浏览代码

Merge branch 'master' of https://gogs.zfire.top/zfire-front/zfire-newmall-admin

linwenxin 1 年之前
父节点
当前提交
95b315d8fe

+ 41 - 15
src/views/mallManagement/order/offline_order_list/index.vue

@@ -870,21 +870,47 @@ export default {
 
 
     // 选择规格型号
     // 选择规格型号
     changeSpec(index, row) {
     changeSpec(index, row) {
-      let item = this.goodsSpecList.find(o => o.id == row.goodsMaterialId);
-      this.goodsList[index].goodsMaterialId = item.id;
-      this.goodsList[index].brandId = item.brandId;
-      this.goodsList[index].brandName = item.brandName;
-      this.goodsList[index].mainId = item.mainId;
-      this.goodsList[index].mainName = item.mainName;
-      this.goodsList[index].smallId = item.smallId;
-      this.goodsList[index].smallName = item.smallName;
-      this.goodsList[index].goodsName = item.goodsName;
-      this.goodsList[index].specsName = item.specsName;
-      this.goodsList[index].unit = item.unit;
-      this.goodsList[index].insideNum = item.insideQty;
-      this.goodsList[index].outNum = item.outQty;
-      this.goodsList[index].partsNum = item.partsQty;
-      this.goodsList[index].stockQty = item.stockQty;
+      // 判断对象数组中是否存在该对象
+      let ids = this.goodsList.map(o => {
+        return o.goodsMaterialId
+      });
+      let fIdx = ids.indexOf(row.goodsMaterialId);
+      let lIdx = ids.lastIndexOf(row.goodsMaterialId);
+      if(fIdx !== lIdx) {
+        this.goodsList[index].goodsMaterialId = '';
+        this.goodsList[index].brandId = '';
+        this.goodsList[index].brandName = '';
+        this.goodsList[index].mainId = '';
+        this.goodsList[index].mainName = '';
+        this.goodsList[index].smallId = '';
+        this.goodsList[index].smallName = '';
+        this.goodsList[index].goodsName = '';
+        this.goodsList[index].specsName = '';
+        this.goodsList[index].unit = '';
+        this.goodsList[index].insideNum = '';
+        this.goodsList[index].outNum = '';
+        this.goodsList[index].partsNum = '';
+        this.goodsList[index].stockQty = '';
+        this.$message.error('该规格型号已存在');
+        return 
+      }
+      else {
+        let item = this.goodsSpecList.find(o => o.id == row.goodsMaterialId);
+        this.goodsList[index].goodsMaterialId = item.id;
+        this.goodsList[index].brandId = item.brandId;
+        this.goodsList[index].brandName = item.brandName;
+        this.goodsList[index].mainId = item.mainId;
+        this.goodsList[index].mainName = item.mainName;
+        this.goodsList[index].smallId = item.smallId;
+        this.goodsList[index].smallName = item.smallName;
+        this.goodsList[index].goodsName = item.goodsName;
+        this.goodsList[index].specsName = item.specsName;
+        this.goodsList[index].unit = item.unit;
+        this.goodsList[index].insideNum = item.insideQty;
+        this.goodsList[index].outNum = item.outQty;
+        this.goodsList[index].partsNum = item.partsQty;
+        this.goodsList[index].stockQty = item.stockQty;
+      }
     },
     },
 
 
     creatCode(data, orderId) {
     creatCode(data, orderId) {

+ 2 - 2
src/views/mallManagement/order/order_detail/index.vue

@@ -376,7 +376,7 @@
 									<el-table-column label="规格型号" align="center">
 									<el-table-column label="规格型号" align="center">
 										<template slot-scope="scope">
 										<template slot-scope="scope">
 											<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
 											<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
-												<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="goodsMaterialSpecsName" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
+												<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="orderDetailId" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
 												    <el-option
 												    <el-option
 												      v-for="(item,ind) in formData1.list"
 												      v-for="(item,ind) in formData1.list"
 												      :key="ind"
 												      :key="ind"
@@ -919,7 +919,7 @@ export default {
 	async getCodeDetail(){
 	async getCodeDetail(){
 		getCodeDetail({orderId: this.orderId}).then(async res => {
 		getCodeDetail({orderId: this.orderId}).then(async res => {
 			for(var item of res.data){
 			for(var item of res.data){
-				item.specs = {goodsMaterialSpecsName: item.specsName}
+				item.specs = {goodsMaterialSpecsName: item.specsName,orderDetailId: item.orderDetailId}
 				item.material = {name: item.materialName}
 				item.material = {name: item.materialName}
 				item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 				item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 			}
 			}

+ 3 - 3
src/views/mallManagement/order/order_list/index.vue

@@ -459,7 +459,7 @@
 											<el-table-column label="规格型号" align="center">
 											<el-table-column label="规格型号" align="center">
 												<template slot-scope="scope">
 												<template slot-scope="scope">
 													<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
 													<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
-														<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="goodsMaterialSpecsName" :disabled="isEdit2 != scope.$index || formType == 2 || logisticsType == 'detail'" placeholder="请选择" style="width: 100%;">
+														<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="orderDetailId" :disabled="isEdit2 != scope.$index || formType == 2 || logisticsType == 'detail'" placeholder="请选择" style="width: 100%;">
 														    <el-option
 														    <el-option
 														      v-for="(item,ind) in formData1.list"
 														      v-for="(item,ind) in formData1.list"
 														      :key="ind"
 														      :key="ind"
@@ -864,7 +864,7 @@ export default {
 	async getCodeDetail(){
 	async getCodeDetail(){
 		getCodeDetail({orderId: this.editOrderId}).then(async res => {
 		getCodeDetail({orderId: this.editOrderId}).then(async res => {
 			for(var item of res.data){
 			for(var item of res.data){
-				item.specs = {goodsMaterialSpecsName: item.specsName}
+				item.specs = {goodsMaterialSpecsName: item.specsName,orderDetailId: item.orderDetailId}
 				item.material = {name: item.materialName}
 				item.material = {name: item.materialName}
 				item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 				item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 			}
 			}
@@ -1645,7 +1645,7 @@ export default {
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>制单人: ${data.createBy || ''}</div>
 		  	<div>制单人: ${data.createBy || ''}</div>
 		  	<div>审核人: ${data.companyWechatName || ''}</div>
 		  	<div>审核人: ${data.companyWechatName || ''}</div>
-			<div>业务员: </div>
+			<div>业务员: ${data.saleName || ''}</div>
 			<div>签收人: </div>
 			<div>签收人: </div>
 		  </div>
 		  </div>
 	      <div style="margin:100px 0 0 0">
 	      <div style="margin:100px 0 0 0">

+ 2 - 2
src/views/mallManagement/order/order_refund/index.vue

@@ -362,7 +362,7 @@
                           <el-form-item :prop=" 'list.' + scope.$index + '.specs' "
                           <el-form-item :prop=" 'list.' + scope.$index + '.specs' "
                             :rules=" [{ required: true, message: `请选择规格型号`, trigger: 'blur' }] ">
                             :rules=" [{ required: true, message: `请选择规格型号`, trigger: 'blur' }] ">
                             <el-select v-model=" scope.row.specs " @change=" (e) => { changeSpecs(e, scope.row) } "
                             <el-select v-model=" scope.row.specs " @change=" (e) => { changeSpecs(e, scope.row) } "
-                              value-key="goodsMaterialSpecsName"
+                              value-key="orderDetailId"
                               :disabled=" isEdit2 != scope.$index || formType == 2 || activeKey == 'REFUND_GOODS_DETAIL' "
                               :disabled=" isEdit2 != scope.$index || formType == 2 || activeKey == 'REFUND_GOODS_DETAIL' "
                               placeholder="请选择" style="width: 100%;">
                               placeholder="请选择" style="width: 100%;">
                               <el-option v-for="(      item, ind      ) in       formData1.list      " :key=" ind "
                               <el-option v-for="(      item, ind      ) in       formData1.list      " :key=" ind "
@@ -589,7 +589,7 @@ export default {
     getCodeDetail2(orderRefundId) {
     getCodeDetail2(orderRefundId) {
       getCodeDetail2({ orderId: orderRefundId || this.editOrderId || this?.order_cp?.orderRefundId || "" }).then(async res => {
       getCodeDetail2({ orderId: orderRefundId || this.editOrderId || this?.order_cp?.orderRefundId || "" }).then(async res => {
         for (var item of res.data) {
         for (var item of res.data) {
-          item.specs = { goodsMaterialSpecsName: item.specsName }
+          item.specs = { goodsMaterialSpecsName: item.specsName,orderDetailId: item.orderDetailId }
           item.material = { name: item.materialName }
           item.material = { name: item.materialName }
           item.materialList = await this.getMaterialList(item.specsName, item.goodsMaterialItemType)
           item.materialList = await this.getMaterialList(item.specsName, item.goodsMaterialItemType)
         }
         }

+ 2 - 2
src/views/mallManagement/order/order_refund_detail/index.vue

@@ -265,7 +265,7 @@
 									<el-table-column label="规格型号" align="center">
 									<el-table-column label="规格型号" align="center">
 										<template slot-scope="scope">
 										<template slot-scope="scope">
 											<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
 											<el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
-												<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="goodsMaterialSpecsName" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
+												<el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="orderDetailId" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
 												    <el-option
 												    <el-option
 												      v-for="(item,ind) in formData1.list"
 												      v-for="(item,ind) in formData1.list"
 												      :key="ind"
 												      :key="ind"
@@ -482,7 +482,7 @@ export default {
 		async getCodeDetail2(){
 		async getCodeDetail2(){
 			getCodeDetail2({orderId: this.orderRefundId}).then(async res => {
 			getCodeDetail2({orderId: this.orderRefundId}).then(async res => {
 				for(var item of res.data){
 				for(var item of res.data){
-					item.specs = {goodsMaterialSpecsName: item.specsName}
+					item.specs = {goodsMaterialSpecsName: item.specsName,orderDetailId: item.orderDetailId}
 					item.material = {name: item.materialName}
 					item.material = {name: item.materialName}
 					item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 					item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
 				}
 				}