cz před 1 rokem
rodič
revize
1eae8bee73

+ 1 - 0
src/components/testForm/index.vue

@@ -337,6 +337,7 @@
                 v-model="formData[i.prop]"
                 :after-read="afterRead"
                 multiple
+                :show-upload="i.showUpload === undefined ? true : i.showUpload"
                 :max-count="9"
                 :max-size="5 * 1024 * 1024"
                 @oversize="onOversize"

+ 9 - 5
src/views/JXSK/mes/forward/add.vue

@@ -80,6 +80,7 @@ const onSubmit = () => {
     const data = {
       id: formData.data.id,
       receivedUserId: formData.data.receivedUserId,
+      fileList: formData.data.fileList,
     };
     proxy.post("/productionTaskDetail/circulation", data).then(
       (res) => {
@@ -94,7 +95,10 @@ const onSubmit = () => {
     );
   } else {
     proxy
-      .post("/productionTaskDetail/productStorage", { id: formData.data.id })
+      .post("/productionTaskDetail/productStorage", {
+        id: formData.data.id,
+        fileList: formData.data.fileList,
+      })
       .then(
         (res) => {
           setTimeout(() => {
@@ -165,9 +169,9 @@ const configData = [
       readonly: true,
     },
     {
-      type: "slot",
+      type: "upload",
       label: proxy.t("forward.processDrawing"),
-      slotName: "file",
+      prop: "fileList",
     },
     {
       type: "title",
@@ -216,9 +220,9 @@ const configData = [
       readonly: true,
     },
     {
-      type: "slot",
+      type: "upload",
       label: proxy.t("forward.processDrawing"),
-      slotName: "file",
+      prop: "fileList",
     },
   ],
 ];

+ 25 - 3
src/views/JXSK/mes/receive/add.vue

@@ -89,6 +89,12 @@ const formConfig = reactive([
     readonly: true,
   },
   {
+    type: "upload",
+    label: proxy.t("forward.processDrawing"),
+    prop: "fileList",
+    showUpload: false,
+  },
+  {
     type: "input",
     itemType: "text",
     label: proxy.t("receive.previousProcess"),
@@ -163,9 +169,24 @@ const otherBtnClick = () => {
   );
 };
 const getDetails = () => {
-  proxy.post("/productionTask/detail", { id: route.query.id }).then(
+  proxy.post("/productionTaskDetail/detail", { id: route.query.id }).then(
     (res) => {
-      console.log(res, "ada");
+      if (res.data && res.data.productionTaskDetailRecordList.length > 0) {
+        let id = res.data.productionTaskDetailRecordList[0].id;
+        proxy
+          .post("/fileInfo/getList", { businessIdList: [id] })
+          .then((res) => {
+            if (res.data && res.data[id].length > 0) {
+              formData.data.fileList = res.data[id].map((item) => {
+                return {
+                  raw: item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            }
+          });
+      }
     },
     (err) => {
       return showFailToast(err.message);
@@ -175,7 +196,8 @@ const getDetails = () => {
 onMounted(() => {
   if (route.query.id) {
     formData.data = { ...route.query };
-    if (!formData.data.productionProcessesName) {
+    getDetails();
+    if (!formData.data.personLiableId) {
       formOption.otherBtn = false;
     }
   }