瀏覽代碼

Merge branch 'develop'

* develop:
  feat:订单打印显示业务员
  feat:线下销售订单规格型号限制不能重复
Moss 1 年之前
父節點
當前提交
8af067d063

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

@@ -870,21 +870,47 @@ export default {
 
     // 选择规格型号
     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) {

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

@@ -1645,7 +1645,7 @@ export default {
 		  <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
 		  	<div>制单人: ${data.createBy || ''}</div>
 		  	<div>审核人: ${data.companyWechatName || ''}</div>
-			<div>业务员: </div>
+			<div>业务员: ${data.saleName || ''}</div>
 			<div>签收人: </div>
 		  </div>
 	      <div style="margin:100px 0 0 0">