浏览代码

新建需求发货单增加只能选择一条数据限制

jingshuyong 11 月之前
父节点
当前提交
f9b9c0c4fc

+ 3 - 0
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -359,6 +359,9 @@
         if (!this.selection.length) {
           return this.$message.warning('请至少选择一条数据');
         }
+        if (this.selection.length > 1) {
+          return this.$message.warning('只能选择一条物品明细数据');
+        }
         this.$emit('changeParent', {
           orderCode: this.rowClickData.docNo,
           orderId: this.rowClickData.id,

+ 10 - 10
src/views/salesServiceManagement/components/saleorderDialog.vue

@@ -351,17 +351,17 @@
         this.rowClickData = {};
       },
       submitAdd() {
-        // if (!this.selection.length) {
-        //   return this.$message.warning('请至少选择一条数据');
-        // }
-        if (!this.rowClickData.id){
-             return this.$message.warning('请至少选择一条销售订单数据');
+        if (!this.rowClickData.id) {
+          return this.$message.warning('请至少选择一条销售订单数据');
         }
-          this.$emit('changeParent', {
-            orderCode: this.rowClickData.orderNo,
-            orderId: this.rowClickData.id,
-            tableList: this.selection
-          });
+        if (this.selection.length > 1) {
+          return this.$message.warning('只能选择一条物品明细数据');
+        }
+        this.$emit('changeParent', {
+          orderCode: this.rowClickData.orderNo,
+          orderId: this.rowClickData.id,
+          tableList: this.selection
+        });
         this.handleClose();
       },