فهرست منبع

销售订单/采购订单-项目不可修改问题

jingbb 3 ماه پیش
والد
کامیت
05c7c6bd85

+ 33 - 25
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -433,37 +433,45 @@
         formData.id = '';
         formData.billCode = '';
         formData.submit= undefined;
+        formData.sourceCode = '';
+        formData.sourceCode2 = '';
+        formData.project=''
+        formData.projectName=''
         //子表数据
         const PurOrderFormShipFormShipDataList = await queryPurOrderFormShipFormShippTable(id);
         PurOrderFormShipFormShipTable.dataSource = [...PurOrderFormShipFormShipDataList];
+        data.map(item=>{
+          item.sourceId=''
+          item.sourceType =''
+        })
         purOrderFormShipFormProductTable.dataSource = [...data];
-        isSelect();
+        notAllowEdit.value = false;
       }
       // 判断有没有参照的子表
-      function isSelect() {
-        var arrQuo = [],
-          arrCon = [];
-        purOrderFormShipFormProductTable.dataSource.map((item) => {
-          var sign = '';
-          sign = item.sourceId ? item.sourceId.substring(0, 3) : '';
-          if (item.sourceId && sign == 'Quo') {
-            arrQuo.push(item.sourceId);
-          } else if (item.sourceId && sign == 'Con') {
-            arrCon.push(item.sourceId);
-          }
-        });
-        if (arrQuo.length == 0 && arrCon.length == 0) {
-          formData.sourceCode2 = '';
-          formData.sourceCode = '';
-          notAllowEdit.value = false;
-        } else if (arrQuo.length == 0) {
-          formData.sourceCode = '';
-          notAllowEdit.value = true;
-        } else if (arrCon.length == 0) {
-          formData.sourceCode2 = '';
-          notAllowEdit.value = true;
-        }
-      }
+      // function isSelect() {
+      //   var arrQuo = [],
+      //     arrCon = [];
+      //   purOrderFormShipFormProductTable.dataSource.map((item) => {
+      //     var sign = '';
+      //     sign = item.sourceId ? item.sourceId.substring(0, 3) : '';
+      //     if (item.sourceId && sign == 'Quo') {
+      //       arrQuo.push(item.sourceId);
+      //     } else if (item.sourceId && sign == 'Con') {
+      //       arrCon.push(item.sourceId);
+      //     }
+      //   });
+      //   if (arrQuo.length == 0 && arrCon.length == 0) {
+      //     formData.sourceCode2 = '';
+      //     formData.sourceCode = '';
+      //     notAllowEdit.value = false;
+      //   } else if (arrQuo.length == 0) {
+      //     formData.sourceCode = '';
+      //     notAllowEdit.value = true;
+      //   } else if (arrCon.length == 0) {
+      //     formData.sourceCode2 = '';
+      //     notAllowEdit.value = true;
+      //   }
+      // }
       async function edit(row) {
         //主表数据
         await queryMainData(row.id);

+ 9 - 1
src/views/saleCode/salesOrder/components/SlaeOrderFormForm.vue

@@ -579,11 +579,19 @@
         formData.id = '';
         formData.billCode = '';
         formData.submit= undefined;
+        formData.sourceCode=''
+        formData.sourceCode2=''
+        formData.project=''
+        formData.projectName=''
         //子表数据
         const SaleOrderFormShipFormShipDataList = await querySaleOrderFormShipFormShippTable(id);
         SaleOrderFormShipFormShipTable.dataSource = [...SaleOrderFormShipFormShipDataList];
+        data.map(item=>{
+          item.sourceId=''
+          item.sourceType =''
+        })
         SaleOrderFormShipFormProductTable.dataSource = [...data];
-        isSelect();
+        notAllowEdit.value= false
       }
       // 判断有没有参照的子表
       function isSelect() {