Browse Source

部分bug解决

cz 1 year ago
parent
commit
b6d1150255

+ 12 - 2
src/components/testForm/index.vue

@@ -117,7 +117,7 @@
           <!-- 文件上传 -->
           <van-field name="uploader" v-if="i.type == 'upload'" :label="i.label" :readonly="i.readonly ? true : false">
             <template #input>
-              <van-uploader v-model="formData[i.prop]" :after-read="afterRead" multiple :max-count="9" :max-size="5 * 1024 * 1024"
+              <van-uploader v-model="formData[i.prop]" :after-read="afterRead" multiple :max-count="9" :max-size="10 * 1024 * 1024"
                             @oversize="onOversize" />
             </template>
           </van-field>
@@ -220,8 +220,16 @@
 </template>
 
 <script setup>
-import { showLoadingToast, closeToast, showNotify } from "vant";
+import {
+  showLoadingToast,
+  closeToast,
+  showNotify,
+  showSuccessToast,
+  showToast,
+  showFailToast,
+} from "vant";
 import { formatDate } from "@/utils/auth";
+
 import {
   ref,
   getCurrentInstance,
@@ -715,6 +723,7 @@ const afterRead = (file) => {
         () => {
           file[i].status = "failed";
           file[i].message = "上传失败";
+          showFailToast("上传失败");
         }
       );
     }
@@ -748,6 +757,7 @@ const afterRead = (file) => {
       () => {
         file.status = "failed";
         file.message = "上传失败";
+        showFailToast("上传失败");
       }
     );
   }

+ 63 - 70
src/views/MES/supplementaryOrder/add.vue

@@ -39,6 +39,48 @@ const formOption = reactive({
 });
 const formConfig = reactive([
   {
+    type: "title",
+    title: "基本信息",
+  },
+  // {
+  //   type: "picker",
+  //   label: "生产订单",
+  //   prop: "prodOrderId",
+  //   itemType: "onePicker",
+  //   showPicker: false,
+  //   fieldNames: {
+  //     text: "label",
+  //     value: "value",
+  //   },
+  //   data: [],
+  //   readonly: true,
+  // },
+  {
+    type: "input",
+    itemType: "text",
+    label: "生产订单",
+    prop: "prodOrderCode",
+    readonly: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "产品编码",
+    prop: "productCode",
+    readonly: true,
+  },
+  {
+    type: "input",
+    itemType: "text",
+    label: "产品名称",
+    prop: "productName",
+    readonly: true,
+  },
+  {
+    type: "title",
+    title: "报损信息",
+  },
+  {
     type: "picker",
     label: "类型",
     prop: "type",
@@ -81,8 +123,8 @@ const formConfig = reactive([
   },
   {
     type: "picker",
-    label: "生产订单",
-    prop: "prodOrderId",
+    label: "报损工序",
+    prop: "processId",
     itemType: "onePicker",
     showPicker: false,
     fieldNames: {
@@ -90,41 +132,6 @@ const formConfig = reactive([
       value: "value",
     },
     data: [],
-    readonly: true,
-    // changeFn: (val, data) => {
-    //   proxy.formChange(val, data, formData);
-    //   if (val.selectedValues[0]) {
-    //     let current = data.data.find((x) => x.value == val.selectedValues[0]);
-    //     if (current) {
-    //       proxy
-    //         .post("/contractProductBom/getList", {
-    //           contractId: current.contractId,
-    //         })
-    //         .then((res) => {
-    //           formConfig[4].data = res.data.map((x) => ({
-    //             ...x,
-    //             label: x.productName,
-    //             value: x.materialId,
-    //           }));
-    //         });
-    //     }
-    //   }
-    //   data.showPicker = false;
-    // },
-  },
-  {
-    type: "input",
-    itemType: "text",
-    label: "产品编码",
-    prop: "productCode",
-    readonly: true,
-  },
-  {
-    type: "input",
-    itemType: "text",
-    label: "产品名称",
-    prop: "productName",
-    readonly: true,
   },
   {
     type: "picker",
@@ -164,18 +171,6 @@ const formConfig = reactive([
     readonly: true,
   },
   {
-    type: "picker",
-    label: "报损工序",
-    prop: "processId",
-    itemType: "onePicker",
-    showPicker: false,
-    fieldNames: {
-      text: "label",
-      value: "value",
-    },
-    data: [],
-  },
-  {
     type: "input",
     label: "报损数量",
     prop: "quantity",
@@ -215,7 +210,7 @@ const getDict = () => {
       companyId: getUserInfo().companyId,
     })
     .then((res) => {
-      formConfig[2].data = res.rows.map((item) => {
+      formConfig[7].data = res.rows.map((item) => {
         return {
           text: item.nickName,
           value: item.userId,
@@ -223,19 +218,19 @@ const getDict = () => {
       });
     });
 
-  proxy
-    .post("produceOrder/page", {
-      pageNum: 1,
-      pageSize: 9999,
-      produceStatus: "0,1",
-    })
-    .then((res) => {
-      formConfig[3].data = res.data.rows.map((x) => ({
-        ...x,
-        label: x.code,
-        value: x.id,
-      }));
-    });
+  // proxy
+  //   .post("produceOrder/page", {
+  //     pageNum: 1,
+  //     pageSize: 9999,
+  //     produceStatus: "0,1",
+  //   })
+  //   .then((res) => {
+  //     formConfig[1].data = res.data.rows.map((x) => ({
+  //       ...x,
+  //       label: x.code,
+  //       value: x.id,
+  //     }));
+  //   });
 
   proxy
     .post("/productionProcesses/page", {
@@ -243,12 +238,12 @@ const getDict = () => {
       pageSize: 999,
     })
     .then((res) => {
-      formConfig[9].data = res.data.rows.map((x) => ({
+      formConfig[8].data = res.data.rows.map((x) => ({
         ...x,
         label: x.name,
         value: x.id,
       }));
-      formConfig[9].data.unshift({
+      formConfig[8].data.unshift({
         label: "无",
         value: "",
       });
@@ -265,6 +260,7 @@ const getDetail = () => {
       (res) => {
         formData.data = {
           prodTaskId: res.data.id,
+          prodOrderCode: res.data.orderCode,
           prodOrderId: res.data.produceOrderId,
           productCode: res.data.productCode,
           productName: res.data.productName,
@@ -274,14 +270,11 @@ const getDetail = () => {
           processId: "",
           fileList: [],
         };
-        console.log(formData.data, "saa");
-        formConfig[6].data = res.data.contractProductBomList.map((x) => ({
+        formConfig[9].data = res.data.contractProductAllBomList.map((x) => ({
           ...x,
           label: x.productName + `(${x.productCode})`,
-          value: x.productId,
+          value: x.materialId,
         }));
-
-        console.log(res, "saaas");
         setTimeout(() => {
           formDom.value.formDataShowLabelOne();
         }, 2000);

+ 4 - 0
src/views/MES/supplementaryOrder/index.vue

@@ -38,6 +38,10 @@ const listConfig = ref([
     prop: "repoTime",
   },
   {
+    label: "报损工序",
+    prop: "processName",
+  },
+  {
     label: "责任人",
     prop: "respUserName",
   },