cz преди 1 година
родител
ревизия
5bec68c243

+ 12 - 2
src/views/JXSK/production/forward/index.vue

@@ -51,7 +51,7 @@
           size="large"
           :loading="submitLoading"
         >
-          提 交
+          {{ submitText }}
         </el-button>
         <el-button
           type="danger"
@@ -247,6 +247,13 @@ const getList = async (req) => {
 
 const submitForm = (flag) => {
   if (flag) {
+    formData.data.fileList = formData.data.fileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+      };
+    });
     if (submitType.value == "10") {
       const data = {
         id: formData.data.id,
@@ -326,16 +333,19 @@ const submitForm = (flag) => {
   }
 };
 const submitType = ref("");
+const submitText = ref("");
 const getDtl = (row) => {
   if (
     row.nextProductionProcessesId == "" ||
     row.nextProductionProcessesId == "-1"
   ) {
     submitType.value = "20";
+    submitText.value = "提交入库";
   } else {
     submitType.value = "10";
+    submitText.value = "提交";
   }
-  formOption.disabled = true;
+  // formOption.disabled = true;
   formData.data = { ...row, fileList: [] };
   dialogVisible.value = true;
 };

+ 4 - 0
src/views/JXSK/production/receive/index.vue

@@ -354,6 +354,10 @@ const getDtl = (row) => {
 };
 
 getList();
+
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
 </script>
 
 <style lang="scss" scoped>

+ 11 - 5
src/views/JXSK/production/schedule/index.vue

@@ -142,6 +142,13 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "产品SN",
+        prop: "productSn",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
         label: "产品编号",
         prop: "productCode",
         width: 100,
@@ -154,19 +161,18 @@ const config = computed(() => {
         "min-width": 150,
       },
     },
-
     {
       attrs: {
         label: "任务完成期限",
         prop: "dueDate",
-        width: 155,
+        width: 110,
       },
     },
     {
       attrs: {
         label: "工序名称列表",
         prop: "productionProcessesNames",
-        "min-width": 220,
+        "min-width": 250,
       },
     },
     {
@@ -179,7 +185,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "当前工序负责人",
-        prop: "previousProcessesName",
+        prop: "personLiableName",
         width: 130,
       },
     },
@@ -297,7 +303,7 @@ const formConfig = computed(() => {
     },
     {
       type: "date",
-      itemType: "datetime",
+      itemType: "date",
       prop: "getFinishTime",
       label: "任务完成时间",
       itemWidth: 50,

+ 1 - 0
src/views/JXSK/production/task/index.vue

@@ -305,6 +305,7 @@ const formConfigOne = computed(() => {
       style: {
         width: "25%",
       },
+      isShow: modalType.value == "add",
     },
     {
       type: "number",

+ 79 - 27
src/views/JXSK/production/workOrder/index.vue

@@ -48,7 +48,7 @@
             <el-button type="primary" plain @click="openMaterial = true"
               >添加物料/半成品</el-button
             >
-            <el-button type="primary" plain> Excel导入</el-button>
+            <!-- <el-button type="primary" plain> Excel导入</el-button> -->
             <el-form
               ref="tableForm"
               :model="formData.data"
@@ -200,20 +200,21 @@
                           :size="17"
                           style="margin-top: 12px; cursor: pointer"
                         >
-                          <Edit />
+                          <Plus />
                         </el-icon>
                       </el-upload>
-                      <div>
-                        <div>
-                          <el-tag
-                            style="margin-left: 10px"
-                            class="ml-2"
-                            type="info"
-                            v-for="(item, index) in row.fileListCopy"
-                            :key="index"
-                            >{{ item.fileName }}</el-tag
-                          >
-                        </div>
+
+                      <div
+                        v-if="row.fileListCopy && row.fileListCopy.length > 0"
+                      >
+                        <el-tag
+                          style="margin-left: 10px"
+                          class="ml-2"
+                          type="info"
+                          v-for="(item, index) in row.fileListCopy"
+                          :key="index"
+                          >{{ item.fileName }}</el-tag
+                        >
                       </div>
                     </el-form-item>
                   </div>
@@ -235,6 +236,21 @@
             </el-table>
           </div>
         </template>
+        <template #file>
+          <div style="width: 100%">
+            <el-upload
+              v-model:fileList="formData.dataOne.fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              multiple
+              :before-upload="handleBeforeUploadOne"
+              :on-success="handleSuccess"
+              :on-preview="onPreviewFile"
+            >
+              <el-button type="primary" plain>选择</el-button>
+            </el-upload>
+          </div>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisibleOne = false" size="large"
@@ -413,7 +429,7 @@ const config = computed(() => {
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          row.isCustomized == 1
+          row.isCustomized == 1 && (row.bomStatus == 0 || row.bomStatus == null)
             ? {
                 attrs: {
                   label: "调整BOM",
@@ -426,7 +442,8 @@ const config = computed(() => {
                 },
               }
             : {},
-          row.isCustomized == 1
+          row.isCustomized == 1 &&
+          (row.technologyStatus == 0 || row.technologyStatus == null)
             ? {
                 attrs: {
                   label: "调整工艺",
@@ -472,6 +489,11 @@ const formConfigOne = reactive([
     slotName: "slot",
     label: "",
   },
+  {
+    type: "slot",
+    slotName: "file",
+    label: "上传附件",
+  },
 ]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -526,6 +548,15 @@ const submitFormOne = (type) => {
         });
       }
     }
+    formData.dataOne.fileList = formData.dataOne.fileList.map((item) => {
+      return {
+        id: item.raw.id,
+        fileName: item.raw.fileName,
+        fileUrl: item.raw.fileUrl,
+        uploadState: item.raw.uploadState,
+      };
+    });
+
     for (
       let i = 0;
       i < formData.dataOne.workOrderProductionProcessesList.length;
@@ -594,22 +625,27 @@ const getDtlOne = (row) => {
       dialogVisibleOne.value = true;
       res = res.map((x) => ({
         ...x,
-        fileList: [
-          {
-            fileName: x.fileName,
-            id: x.oldId,
-          },
-        ],
-        fileListCopy: [
-          {
-            fileName: x.fileName,
-            id: x.oldId,
-          },
-        ],
+        fileList: x.oldId
+          ? [
+              {
+                fileName: x.fileName,
+                id: x.oldId,
+              },
+            ]
+          : [],
+        fileListCopy: x.oldId
+          ? [
+              {
+                fileName: x.fileName,
+                id: x.oldId,
+              },
+            ]
+          : [],
       }));
       formData.dataOne = {
         workOrderId: row.id,
         workOrderProductionProcessesList: res,
+        fileList: [],
       };
       nextTick(() => {
         initSort();
@@ -679,6 +715,22 @@ const handleBeforeUpload = async (file, index) => {
     },
   ];
 };
+
+const handleBeforeUploadOne = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  file.id = res.id;
+  file.fileName = res.fileName;
+  file.fileUrl = res.fileUrl;
+  file.uploadState = true;
+  return true;
+};
+const handleSuccess = (any, UploadFile) => {
+  UploadFile.raw.uploadState = false;
+};
+const onPreviewFile = (file) => {
+  window.open(file.raw.fileUrl, "_blank");
+};
 </script>
   
 <style lang="scss" scoped>