From 7946d4995d200873c1d5b0fe8fb59f4d64e52134 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Thu, 13 Mar 2025 17:40:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(materialEdit):=20=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E7=B4=A0=E6=9D=90=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91=E7=9A=84?= =?UTF-8?q?=E5=89=A7=E6=9C=AC=E5=92=8C=E9=A9=B3=E5=9B=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/module/orderApi.js | 11 ++++++++ pages/fun/materialEdit.vue | 50 +++++++++++------------------------ 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/common/api/module/orderApi.js b/common/api/module/orderApi.js index 322502e..e6ef2c2 100644 --- a/common/api/module/orderApi.js +++ b/common/api/module/orderApi.js @@ -100,6 +100,17 @@ export default { }) }) }, + // 编辑订单素材(流程) + EditOrderMaterial(data){ + return new Promise((resolve, reject) => { + request.put('/mall/orderMaterial',data) + .then((res) =>{ + resolve(res); + }).catch(err =>{ + reject(err); + }) + }) + }, // 修改素材(批量) mallMaterialUpdateBatch(data){ return new Promise((resolve, reject) => { diff --git a/pages/fun/materialEdit.vue b/pages/fun/materialEdit.vue index ddaa2ac..a0833c2 100644 --- a/pages/fun/materialEdit.vue +++ b/pages/fun/materialEdit.vue @@ -9,15 +9,6 @@ - - 修改意见 - - - 剧本 视频的剧本 @@ -101,7 +92,6 @@ orderItemId: "", // 素材提交状态 commitState:'add', - comment:'', materialfrom:{ id: undefined, dictId: undefined, @@ -169,17 +159,26 @@ }); }, async getProductDetail(){ + // let res = await this.$api.orderApi.getMallclientOrderProductList({ orderId: this.orderId, productId: this.productId }) let res = await this.$api.orderApi.getOrderMaterialList({ orderItemId: this.orderItemId }) + console.log("res",res) + // this.materialfrom.productSn = res.rows[0].productSn; + // this.commitState = res.rows[0].commitState; + // if (this.commitState === 0) { + // this.getMaterialDictList(); + // } else { + // this.getMaterialList(); + // } if(res.rows.length!=0){ this.materialfrom.flowId = res.rows[0].id; this.commitState = res.rows[0].status; - this.comment = res.rows[0].comment || ''; - this.scriptContent = res.rows[0].script || ''; this.materialTemplateList = res.rows[0].materialItems || []; res.rows[0].materialItems.forEach(async (item,index)=>{ if(item.attrType !== 0 && item.attrValue !== ''){ let {fileUrl,fileName} = await this.getFileDetail(item.attrValue); console.log("fileUrl,fileName",fileUrl,fileName) + // this.materialTemplateList[index].fileUrl = fileUrl; + // this.materialTemplateList[index].fileName = fileName; this.$nextTick(()=>{ this.$set(this.materialTemplateList[index],'fileUrl',fileUrl) this.$set(this.materialTemplateList[index],'fileName',fileName) @@ -441,21 +440,13 @@ orderId: this.orderId, productId: this.productId, orderItemId: this.orderItemId, - materialItems: this.materialTemplateList, - script: this.scriptContent + materialItems: this.materialTemplateList }); this.buttonLoading = false; this.materialfrom.flowId = res.data.id; this.getProductDetail(); }else{ - res = await this.$api.orderApi.EditOrderMaterial({ - orderId: this.orderId, - productId: this.productId, - orderItemId: this.orderItemId, - materialItems: this.materialTemplateList, - script: this.scriptContent, - id: this.materialfrom.flowId - }); + res = await this.$api.orderApi.mallMaterialUpdateBatch(this.materialTemplateList); this.buttonLoading = false; } @@ -523,15 +514,6 @@ align-items: center; } } - .comment-box{ - background-color: rgb(254,242,242); - border: 1px solid rgb(254,226,226); - border-radius: 0.5rem; - padding: 1rem; - width: 100%; - color: red; - font-size: 36rpx; - } .form-item { margin-bottom: 20rpx; @@ -545,9 +527,9 @@ margin-bottom: 10rpx; font-weight: bold; .form-hint{ - font-size: 20rpx; - color: #999; - margin-left: 6rpx; + font-size: 22rpx; + color: #666; + margin-left: 10rpx; } }