cz 1 gadu atpakaļ
vecāks
revīzija
0ce9cd3402

+ 47 - 22
src/views/JXSK/afterSales/edit.vue

@@ -152,12 +152,16 @@ const topConfig = ref([
     prop: "code",
   },
   {
+    label: proxy.t("afterSales.productSN"),
+    prop: "productSn",
+  },
+  {
     label: proxy.t("afterSales.productName"),
     prop: "productName",
   },
   {
-    label: proxy.t("afterSales.productSN"),
-    prop: "productSn",
+    label: "规格型号",
+    prop: "productSpec",
   },
 ]);
 
@@ -175,27 +179,48 @@ const listConfig = ref([
 const onClickLeft = () => history.back();
 const submitData = ref({});
 const getDetails = (id) => {
-  proxy.post("/afterSalesRecord/detail", { id }).then((res) => {
-    formData.data = res.data;
-    const obj = JSON.parse(window.localStorage.getItem("jxstAfterSalesData"));
-    for (let i = 0; i < formData.data.bomDetailList.length; i++) {
-      const e = formData.data.bomDetailList[i];
-      submitData.value[e.productId] = {
-        accessoriesId: e.productId,
-        remark: "",
-        fileList: [],
-      };
-      // if (e.afterSalesRecordDetail) {
-      //   e.productName = e.productName + proxy.t("afterSales.afterSales");
-      // }
-      // for (const key in obj) {
-      //   if (e.productId === key) {
-      //     e.accessoriesId = key;
-      //     e.remark = obj[key].remark;
-      //     e.fileList = obj[key].fileList;
-      //   }
-      // }
+  const status = route.query.status;
+  proxy.post("/afterSalesRecord/detail", { id }).then(async (res) => {
+    if (status == 0) {
+      for (let i = 0; i < res.data.bomDetailList.length; i++) {
+        const e = res.data.bomDetailList[i];
+        submitData.value[e.productId] = {
+          accessoriesId: e.productId,
+          remark: "",
+          fileList: [],
+        };
+      }
+      formData.data = res.data;
+    } else {
+      let arr = res.data.bomDetailList.map((x) => x.afterSalesRecordDetail.id);
+      for (let i = 0; i < res.data.bomDetailList.length; i++) {
+        const e = res.data.bomDetailList[i];
+        submitData.value[e.productId] = {
+          accessoriesId: e.productId,
+          remark: e.afterSalesRecordDetail.remark,
+          fileList: [],
+        };
+      }
+      formData.data = res.data;
+      const fileObj = await proxy.post("/fileInfo/getList", {
+        businessIdList: arr,
+      });
+      for (let i = 0; i < res.data.bomDetailList.length; i++) {
+        const e = res.data.bomDetailList[i];
+        for (const key in fileObj.data) {
+          if (e.afterSalesRecordDetail.id == key) {
+            submitData.value[e.productId].fileList = fileObj.data[key].map(
+              (item) => ({
+                raw: item,
+                name: item.fileName,
+                url: item.fileUrl,
+              })
+            );
+          }
+        }
+      }
     }
+
     if (res.data.bomInfoId) {
       proxy
         .post("/fileInfo/getList", { businessIdList: [res.data.bomInfoId] })

+ 15 - 13
src/views/JXSK/mes/forward/add.vue

@@ -16,9 +16,11 @@
       @otherBtnClick="otherBtnClick"
       ref="formDom"
     >
-      <!-- <template #file>
-        <div>aa</div>
-      </template> -->
+      <template #productRemark>
+        <div style="width: 100%">
+          {{ formData.data.productRemark }}
+        </div>
+      </template>
       <template #fileOne>
         <div
           style="width: 100%"
@@ -283,10 +285,10 @@ const configData = [
       readonly: true,
     },
     {
-      type: "input",
+      type: "slot",
       itemType: "textarea",
       label: "产品备注",
-      prop: "productRemark",
+      slotName: "productRemark",
       readonly: true,
     },
     {
@@ -300,11 +302,11 @@ const configData = [
     {
       type: "slot",
       slotName: "fileOne",
-      label: "上一个工序图纸",
+      label: "前道工序完工拍摄",
     },
     {
       type: "slot",
-      label: "工序附件",
+      label: "生产工序资料",
       slotName: "fileTwo",
     },
     {
@@ -314,7 +316,7 @@ const configData = [
     },
     {
       type: "upload",
-      label: proxy.t("forward.processDrawing"),
+      label: "完工拍摄",
       prop: "fileList",
     },
     {
@@ -364,10 +366,10 @@ const configData = [
       readonly: true,
     },
     {
-      type: "input",
+      type: "slot",
       itemType: "textarea",
       label: "产品备注",
-      prop: "productRemark",
+      slotName: "productRemark",
       readonly: true,
     },
     {
@@ -381,11 +383,11 @@ const configData = [
     {
       type: "slot",
       slotName: "fileOne",
-      label: "上一个工序图纸",
+      label: "前道工序完工拍摄",
     },
     {
       type: "slot",
-      label: "工序附件",
+      label: "生产工序资料",
       slotName: "fileTwo",
     },
     {
@@ -395,7 +397,7 @@ const configData = [
     },
     {
       type: "upload",
-      label: proxy.t("forward.processDrawing"),
+      label: "完工拍摄",
       prop: "fileList",
     },
   ],

+ 15 - 9
src/views/JXSK/mes/receive/add.vue

@@ -16,6 +16,11 @@
       @otherBtnClick="otherBtnClick"
       ref="formDom"
     >
+      <template #productRemark>
+        <div style="width: 100%">
+          {{ formData.data.productRemark }}
+        </div>
+      </template>
       <template #fileTwo>
         <div
           style="width: 100%"
@@ -126,10 +131,10 @@ const formConfig = reactive([
     readonly: true,
   },
   {
-    type: "input",
+    type: "slot",
     itemType: "textarea",
     label: "产品备注",
-    prop: "productRemark",
+    slotName: "productRemark",
     readonly: true,
   },
   {
@@ -139,15 +144,10 @@ const formConfig = reactive([
     prop: "productionProcessesName",
     readonly: true,
   },
-  {
-    type: "upload",
-    label: proxy.t("forward.processDrawing"),
-    prop: "fileList",
-    showUpload: false,
-  },
+
   {
     type: "slot",
-    label: "工序附件",
+    label: "生产工序资料",
     slotName: "fileTwo",
   },
   {
@@ -156,6 +156,12 @@ const formConfig = reactive([
     slotName: "fileThree",
   },
   {
+    type: "upload",
+    label: "完工拍摄",
+    prop: "fileList",
+    showUpload: false,
+  },
+  {
     type: "input",
     itemType: "text",
     label: proxy.t("receive.previousProcess"),

+ 6 - 6
src/views/JXSK/salesContract/add.vue

@@ -38,12 +38,12 @@ const rules = {
       message: proxy.t("salesContract.pleaseSelectTheCustomerName"),
     },
   ],
-  // deliveryDate: [
-  //   {
-  //     required: true,
-  //     message: proxy.t("salesContract.pleaseSelectTheDeliveryDeadline"),
-  //   },
-  // ],
+  deliveryDate: [
+    {
+      required: true,
+      message: proxy.t("salesContract.pleaseSelectTheDeliveryDeadline"),
+    },
+  ],
   payMethod: [
     {
       required: true,