瀏覽代碼

销售合同变更

lxf 1 年之前
父節點
當前提交
76cb2ecd2e
共有 2 個文件被更改,包括 69 次插入68 次删除
  1. 65 68
      src/components/process/ContractAlteration.vue
  2. 4 0
      src/views/salesMange/saleContract/contract/index.vue

+ 65 - 68
src/components/process/ContractAlteration.vue

@@ -127,8 +127,8 @@
                 <div v-else></div>
               </template>
             </el-table-column>
-            <el-table-column prop="code" label="商品编码" width="120" />
-            <el-table-column prop="name" label="商品中文名" width="160" />
+            <el-table-column prop="productCode" label="商品编码" width="120" />
+            <el-table-column prop="productCnName" label="商品中文名" width="160" />
             <el-table-column label="商品英文名" min-width="200">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -147,7 +147,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="unit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.unit, productUnit)" />
+            <el-table-column label="单位" width="100" :formatter="(row) => dictValueLabel(row.productUnit, productUnit)" />
             <el-table-column label="数量" width="150">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -404,8 +404,8 @@
       <template #shipment>
         <div style="width: 100%">
           <el-table :data="formData.data.contractShipmentList" style="width: 100%; margin-top: 16px">
-            <el-table-column prop="code" label="商品编码" width="120" />
-            <el-table-column prop="productName" label="商品名称" />
+            <el-table-column prop="productCode" label="商品编码" width="120" />
+            <el-table-column prop="productCnName" label="商品名称" />
             <el-table-column label="出货日期" width="220">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
@@ -652,7 +652,6 @@ const getDict = () => {
       value: x.dictKey,
     }));
   });
-
   proxy.post("/contractTemplate/page", { pageNum: 1, pageSize: 999 }).then((res) => {
     templateList.value = res.rows.map((item) => {
       return {
@@ -920,12 +919,12 @@ const pushGoods = (goods) => {
         }
         return {
           fileUrl: fileUrl,
-          code: item.code,
+          productCode: item.code,
           productId: item.id,
-          name: item.name,
+          productCnName: item.name,
           productName: name,
           productModel: item.spec,
-          unit: item.unit,
+          productUnit: item.unit,
           quantity: undefined,
           price: undefined,
           amount: "",
@@ -937,9 +936,9 @@ const pushGoods = (goods) => {
     formData.data.contractShipmentList = formData.data.contractShipmentList.concat(
       afterFiltering.map((item) => {
         return {
-          code: item.code,
+          productCode: item.code,
           productId: item.id,
-          productName: item.name,
+          productCnName: item.name,
           shipmentTime: "",
           quantity: undefined,
         };
@@ -1271,11 +1270,11 @@ onMounted(() => {
                 name = standardJson.englishName;
               }
             }
-            formData.data.contractProductList[i].name = resProduct.name;
+            formData.data.contractProductList[i].productCnName = resProduct.name;
             formData.data.contractProductList[i].productName = name;
-            formData.data.contractProductList[i].code = resProduct.code;
-            formData.data.contractProductList[i].unit = resProduct.unit;
-            formData.data.contractShipmentList[i].code = resProduct.code;
+            formData.data.contractProductList[i].productCode = resProduct.code;
+            formData.data.contractProductList[i].productUnit = resProduct.unit;
+            formData.data.contractShipmentList[i].productCode = resProduct.code;
           });
         }
       }
@@ -1296,59 +1295,57 @@ onMounted(() => {
     });
   } else if (props.queryData.contractId) {
     proxy.post("/contract/detail", { id: props.queryData.contractId }).then((res) => {
-        console.log(res);
-    //   res.countryId = res.buyCountryId;
-    //   res.provinceId = res.buyProvinceId;
-    //   res.cityId = res.buyCityId;
-    //   for (var text in res) {
-    //     formData.data[text] = res[text];
-    //   }
-    //   if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
-    //     formData.data.contractProductList = formData.data.contractProductList.map((item) => {
-    //       delete item.id;
-    //       return {
-    //         ...item,
-    //       };
-    //     });
-    //     formData.data.contractShipmentList = proxy.deepClone(
-    //       formData.data.contractProductList.map((item) => {
-    //         return {
-    //           ...item,
-    //           quantity: undefined,
-    //         };
-    //       })
-    //     );
-    //     for (let i = 0; i < formData.data.contractProductList.length; i++) {
-    //       proxy.post("/productInfo/detail", { id: formData.data.contractProductList[i].productId }).then((resProduct) => {
-    //         let name = resProduct.name;
-    //         if (resProduct.standardJson) {
-    //           let standardJson = JSON.parse(resProduct.standardJson);
-    //           if (standardJson && standardJson.englishName) {
-    //             name = standardJson.englishName;
-    //           }
-    //         }
-    //         formData.data.contractProductList[i].name = resProduct.name;
-    //         formData.data.contractProductList[i].productName = name;
-    //         formData.data.contractProductList[i].code = resProduct.code;
-    //         formData.data.contractProductList[i].unit = resProduct.unit;
-    //         formData.data.contractShipmentList[i].code = resProduct.code;
-    //       });
-    //     }
-    //   }
-    //   delete formData.data.id;
-    //   delete formData.data.code;
-    //   getCityData(formData.data.countryId, "20");
-    //   if (formData.data.provinceId) {
-    //     getCityData(formData.data.provinceId, "30");
-    //   }
-    //   if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
-    //     formData.data.contractProjectList = formData.data.contractProjectList.map((item) => {
-    //       delete item.id;
-    //       return {
-    //         ...item,
-    //       };
-    //     });
-    //   }
+      res.countryId = res.buyCountryId;
+      res.provinceId = res.buyProvinceId;
+      res.cityId = res.buyCityId;
+      for (var text in res) {
+        if (text === "contractType") {
+          formData.data[text] = res[text] + "";
+        } else {
+          formData.data[text] = res[text];
+        }
+      }
+      formData.data.oldContractId = formData.data.id;
+      delete formData.data.id;
+      delete formData.data.code;
+      getCityData(formData.data.countryId, "20");
+      if (formData.data.provinceId) {
+        getCityData(formData.data.provinceId, "30");
+      }
+      if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
+        let productIds = formData.data.contractProductList.map((item) => item.productId);
+        proxy.post("/fileInfo/getList", { businessIdList: productIds }).then((resFile) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            if (resFile[formData.data.contractProductList[i].productId] && resFile[formData.data.contractProductList[i].productId].length > 0) {
+              formData.data.contractProductList[i].fileUrl = resFile[formData.data.contractProductList[i].productId][0].fileUrl;
+            }
+          }
+        });
+        let ids = formData.data.contractProductList.map((item) => item.id);
+        proxy.post("/fileInfo/getList", { businessIdList: ids }).then((resFile) => {
+          for (let i = 0; i < formData.data.contractProductList.length; i++) {
+            if (resFile[formData.data.contractProductList[i].id] && resFile[formData.data.contractProductList[i].id].length > 0) {
+              formData.data.contractProductList[i].fileList = resFile[formData.data.contractProductList[i].id];
+            }
+          }
+        });
+      }
+      if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
+        formData.data.contractProjectList = formData.data.contractProjectList.map((item) => {
+          delete item.id;
+          return {
+            ...item,
+          };
+        });
+      }
+      if (formData.data.contractShipmentList && formData.data.contractShipmentList.length > 0) {
+        formData.data.contractShipmentList = formData.data.contractShipmentList.map((item) => {
+          delete item.id;
+          return {
+            ...item,
+          };
+        });
+      }
     });
   }
 });

+ 4 - 0
src/views/salesMange/saleContract/contract/index.vue

@@ -274,6 +274,10 @@ const status = ref([
     value: 30,
   },
   {
+    label: "作废",
+    value: 70,
+  },
+  {
     label: "终止",
     value: 99,
   },