Commit e7bfd675 authored by 黄奎's avatar 黄奎

页面修改

parent 14ae48eb
...@@ -664,7 +664,6 @@ ...@@ -664,7 +664,6 @@
}, res => { }, res => {
this.dataInfo = res.data.data; this.dataInfo = res.data.data;
let data = res.data.data; let data = res.data.data;
console.log("data:",data)
// 未付款 // 未付款
if (data.PaymentTime == '' && data.DeliveryTime == '') { if (data.PaymentTime == '' && data.DeliveryTime == '') {
this.activeStep = 1; this.activeStep = 1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="serviceProduct"> <div class="serviceProduct">
<div class="head-title"> <div class="head-title">
商品列表 商品列表
<el-button @click="Export" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">商品导出 <el-button @click="Export" style="float:right;margin-top: -5px;margin-left:20px;display:none;" size="small" type="primary">商品导出
</el-button> </el-button>
<el-button @click="CommonJump('serviceProductEdit',{hpState:hpState,FxState:FxState})" <el-button @click="CommonJump('serviceProductEdit',{hpState:hpState,FxState:FxState})"
style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">添加商品</el-button> style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">添加商品</el-button>
......
...@@ -56,12 +56,8 @@ export default { ...@@ -56,12 +56,8 @@ export default {
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = '';
let javaUrl = 'http://192.168.2.65:8018'; let javaUrl = 'http://192.168.2.65:8018';
// domainUrl = "http://192.168.1.27:8200";
//domainUrl = "http://192.168.1.13:8088";
domainUrl = "http://192.168.1.27:8200"; domainUrl = "http://192.168.1.27:8200";
domainUrl = "https://localhost:5001";
let vtUploadUrl = "http://192.168.1.214:8120"; let vtUploadUrl = "http://192.168.1.214:8120";
let vtViewUrl = "http://192.168.1.214:8130"; let vtViewUrl = "http://192.168.1.214:8130";
...@@ -152,10 +148,9 @@ export default { ...@@ -152,10 +148,9 @@ export default {
Vue.prototype.UploadSelfFile = function (path, file, callback) { Vue.prototype.UploadSelfFile = function (path, file, callback) {
var that = this; var that = this;
that.Info('上传中...') that.Info('上传中...')
var newPath = '/Upload/' + path + "/"; var newPath = '/Upload/' + path + "/";
var formData = new FormData(); var formData = new FormData();
var uploadUrl = that.domainManager().VTUploadUrl + "/Upload?filePath=" + newPath+"&isCreateCover=1"; var uploadUrl = that.domainManager().VTUploadUrl + "/Upload?filePath=" + newPath + "&isCreateCover=1";
formData.append("myfile", file); formData.append("myfile", file);
that.$http.post(uploadUrl, formData, {}) that.$http.post(uploadUrl, formData, {})
.then(res => { .then(res => {
...@@ -164,7 +159,7 @@ export default { ...@@ -164,7 +159,7 @@ export default {
resultCode: 1, resultCode: 1,
FileName: file.name, FileName: file.name,
FileUrl: that.domainManager().VTViewUrl + res.data.FilePath, FileUrl: that.domainManager().VTViewUrl + res.data.FilePath,
VideoCoverImg:that.domainManager().VTViewUrl + res.data.VideoCoverImg VideoCoverImg: that.domainManager().VTViewUrl + res.data.VideoCoverImg
} }
if (callback) { if (callback) {
callback(uploadResult); callback(uploadResult);
...@@ -201,39 +196,39 @@ export default { ...@@ -201,39 +196,39 @@ export default {
var newFile = new File([u8arr], fileObj.name, { var newFile = new File([u8arr], fileObj.name, {
type: mime type: mime
}); });
if(upInfo&&upInfo.IsDefault==1){ if (upInfo && upInfo.IsDefault == 1) {
if(upInfo.StoreType==1){ if (upInfo.StoreType == 1) {
that.uploadStart(path, newFile, callback) that.uploadStart(path, newFile, callback)
} }
if(upInfo.StoreType==2){ if (upInfo.StoreType == 2) {
that.uploadToAli(path, newFile, callback) that.uploadToAli(path, newFile, callback)
} }
}else{ } else {
that.Error('请先配置上传'); that.Error('请先配置上传');
} }
}).catch(function (error) { }).catch(function (error) {
if(upInfo&&upInfo.IsDefault==1){ if (upInfo && upInfo.IsDefault == 1) {
if(upInfo.StoreType==1){ if (upInfo.StoreType == 1) {
that.uploadStart(path, fileObj, callback) that.uploadStart(path, fileObj, callback)
} }
if(upInfo.StoreType==2){ if (upInfo.StoreType == 2) {
that.uploadToAli(path, fileObj, callback) that.uploadToAli(path, fileObj, callback)
} }
}else{ } else {
that.Error('请先配置上传'); that.Error('请先配置上传');
} }
}).always(function () { }).always(function () {
//不管成功或失败,都会执行 //不管成功或失败,都会执行
}) })
}else{ } else {
if(upInfo&&upInfo.IsDefault==1){ if (upInfo && upInfo.IsDefault == 1) {
if(upInfo.StoreType==1){ if (upInfo.StoreType == 1) {
this.uploadStart(path, fileObj, callback) this.uploadStart(path, fileObj, callback)
} }
if(upInfo.StoreType==2){ if (upInfo.StoreType == 2) {
this.uploadToAli(path, fileObj, callback) this.uploadToAli(path, fileObj, callback)
} }
}else{ } else {
this.Error('请先配置上传'); this.Error('请先配置上传');
} }
} }
...@@ -250,13 +245,6 @@ export default { ...@@ -250,13 +245,6 @@ export default {
str = "/Test" str = "/Test"
} }
var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix; var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix;
// var uploadMsg = {
// Bucket: "viitto-1301420277",
// Region: "ap-chengdu",
// /* 存储桶所在地域,必须字段 */
// SecretId: "AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd",
// SecretKey: "PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob",
// };
var uploadMsg = { var uploadMsg = {
Bucket: upInfo.Bucket, Bucket: upInfo.Bucket,
Region: upInfo.Region, Region: upInfo.Region,
...@@ -268,7 +256,6 @@ export default { ...@@ -268,7 +256,6 @@ export default {
SecretId: uploadMsg.SecretId, SecretId: uploadMsg.SecretId,
SecretKey: uploadMsg.SecretKey, SecretKey: uploadMsg.SecretKey,
}); });
cos.putObject({ cos.putObject({
Bucket: uploadMsg.Bucket, Bucket: uploadMsg.Bucket,
Region: uploadMsg.Region, //存储桶所在地域,必须字段 Region: uploadMsg.Region, //存储桶所在地域,必须字段
...@@ -294,43 +281,34 @@ export default { ...@@ -294,43 +281,34 @@ export default {
}, },
//上传至阿里云 //上传至阿里云
Vue.prototype.uploadToAli = function (path, fileObj, successCall) { Vue.prototype.uploadToAli = function (path, fileObj, successCall) {
var upInfo = JSON.parse(localStorage.uploadInfo); var upInfo = JSON.parse(localStorage.uploadInfo);
var OSS = require('ali-oss'); var OSS = require('ali-oss');
var oss = new OSS({ var oss = new OSS({
region: upInfo.Region, region: upInfo.Region,
accessKeyId: upInfo.SecretId, accessKeyId: upInfo.SecretId,
accessKeySecret: upInfo.SecretKey, accessKeySecret: upInfo.SecretKey,
bucket: upInfo.Bucket bucket: upInfo.Bucket
// region: 'oss-cn-chengdu', })
// accessKeyId: 'LTAIwE7l9dImZSa3', //获取文件扩展名
// accessKeySecret: 'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI', var filename = fileObj.name;
// bucket: 'vt-im-bucket' var index = filename.lastIndexOf(".");
}) var suffix = filename.substr(index);
let that = this; var timestamp1 = Date.parse(new Date()) + "_" + (Math.ceil(Math.random() * 1000));
let checkpoint = null; let str = '';
let percentage = 0; if (this.isOnline()) {
str = "/Test"
//获取文件扩展名 }
var filename = fileObj.name; var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix;
var index = filename.lastIndexOf("."); var result = oss.multipartUpload(newFileName, fileObj, {
var suffix = filename.substr(index); progress: function* (p) {}
var timestamp1 = Date.parse(new Date()) + "_" + (Math.ceil(Math.random() * 1000)); }).then(res => {
let str = ''; var uploadResult = {
if (this.isOnline()) { resultCode: 1,
str = "/Test" FileName: fileObj.name,
FileUrl: res.res.requestUrls[0].replace('http', 'https')
} }
var newFileName = str + '/Upload/' + path + "/" + timestamp1 + "" + suffix; successCall(uploadResult);
// fileName = "/New" + '/' +path+ '/' + fileName + "." + files.name.split('.').pop() })
var result = oss.multipartUpload(newFileName, fileObj, {
progress: function* (p) {}
}).then(res=>{
var uploadResult = {
resultCode: 1,
FileName: fileObj.name,
FileUrl: res.res.requestUrls[0].replace('http','https')
}
successCall(uploadResult);
})
}, },
//公用跳转 //公用跳转
Vue.prototype.CommonJump = function (path, obj) { Vue.prototype.CommonJump = function (path, obj) {
...@@ -514,9 +492,6 @@ export default { ...@@ -514,9 +492,6 @@ export default {
ERPGroupId: ERPGroupId, ERPGroupId: ERPGroupId,
ERPEmpId: ERPEmpId, ERPEmpId: ERPEmpId,
ERPBranchId: ERPBranchId, ERPBranchId: ERPBranchId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
} }
return postData return postData
}, },
...@@ -593,4 +568,4 @@ export default { ...@@ -593,4 +568,4 @@ export default {
}, faildCall) }, faildCall)
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment