Browse Source

沟通(编辑未做)

damon227 2 years ago
parent
commit
d74c3d6b51

+ 22 - 8
src/views/modules/cus/communicate-add-or-update.vue

@@ -90,7 +90,7 @@
         </el-col>
       </el-row>
       <el-row class="my-row">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item label="技术资料" prop="attachListTechnical">
             <upload-component
               :display="display"
@@ -101,7 +101,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8" :offset="4">
           <el-form-item label="数模/图纸" prop="attachListDrawing">
             <upload-component
               :display="display"
@@ -114,7 +114,7 @@
         </el-col>
       </el-row>
       <el-row class="my-row">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item label="沟通表原件" prop="attachList">
             <upload-component
               :display="display"
@@ -125,7 +125,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8" :offset="4">
           <el-form-item label="其他附件" prop="attachListOther">
             <upload-component
               :display="display"
@@ -351,7 +351,7 @@
                 <el-button
                   type="text"
                   size="small"
-                  @click="updateProductHandle(scope.row)"
+                  @click="updateWorderHandle(scope.row)"
                   >编辑</el-button
                 >
                 <el-button
@@ -614,8 +614,16 @@ export default {
     },
     //添加工单
     addWorderItem(item) {
-      console.log(item);
-      this.workInfoList.push({ ...item });
+      if (!item.recordId) {
+        item.recordId = Math.round(Math.random() * 1000000);
+      }
+      if (
+        this.workInfoList.findIndex(
+          (item1) => item1.recordId === item.recordId
+        ) === -1
+      ) {
+        this.workInfoList.push({ ...item });
+      }
     },
     uploadSuccessTechnical(fileList) {
       this.attachListTechnical = fileList;
@@ -642,7 +650,13 @@ export default {
     worderAdd() {
       this.worderVisible = true;
       this.$nextTick(() => {
-        this.$refs.worder.init();
+        this.$refs.worder.init(0, null);
+      });
+    },
+    updateWorderHandle(row) {
+      this.worderVisible = true;
+      this.$nextTick(() => {
+        this.$refs.worder.init(1, row);
       });
     },
     attachDetails(attachList) {

+ 7 - 7
src/views/modules/cus/communicate-detail.vue

@@ -160,7 +160,7 @@
               </template>
             </el-table-column>
             <el-table-column
-              prop="attachList"
+              prop="attachListVo"
               header-align="center"
               align="center"
               width="150"
@@ -169,11 +169,11 @@
               <template slot-scope="scope">
                 <el-button
                   :disabled="
-                    !scope.row.attachList || scope.row.attachList.length === 0
+                    !scope.row.attachListVo || scope.row.attachListVo.length === 0
                   "
                   type="text"
                   size="small"
-                  @click="attachDetails(scope.row.attachList)"
+                  @click="attachDetails(scope.row.attachListVo)"
                   >查看</el-button
                 >
               </template>
@@ -192,6 +192,7 @@
     <span slot="footer" class="dialog-footer">
       <el-button @click="onChose">返回</el-button>
     </span>
+    <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
   </div>
   <!-- </el-dialog> -->
 </template>
@@ -201,12 +202,14 @@ import EDesc from "../common/e-desc";
 import EDescItem from "../common/e-desc-item";
 import { getCoDetail } from "@/api/cus";
 import uploadComponent from "../common/upload-component-v2";
+import AttachDetailDialog from "../common/attach-detail-dialog";
 export default {
   name: "communicate-detail",
   components: {
     EDesc,
     EDescItem,
     uploadComponent,
+    AttachDetailDialog
   },
   data() {
     return {
@@ -271,10 +274,7 @@ export default {
       });
     },
     attachDetails(attachList) {
-      attachList.forEach((item) => {
-        item.fileName = item.name;
-      });
-      // this.$refs.attachDetail.init(attachList);
+      this.$refs.attachDetail.init(attachList);
     },
   },
 };

+ 23 - 6
src/views/modules/worder/add-or-update.vue

@@ -113,7 +113,7 @@
         </el-row>
         <el-row class="my-row"> </el-row>
         <el-row class="my-row">
-          <el-col :span="24">
+          <el-col :span="8">
             <el-form-item label="工单附件" prop="attachList">
               <upload-component
                 :display="display"
@@ -150,7 +150,6 @@ export default {
       bizType: 1,
       dataForm: {},
       attachList: [],
-      attachListV2: [],
       userList: [],
       taskTypeOption: [
         { label: "开始", value: "start" },
@@ -198,8 +197,20 @@ export default {
       this.visible = false;
     },
     // 初始化
-    async init(id) {
+    async init(id, item) {
       this.id = id || 0;
+      if (item) {
+        this.isModify = true;
+        item.name = item.fileName;
+        this.dataForm = item;
+      } else {
+        this.isModify = false;
+        this.dataForm = {
+          recordId: Math.round(Math.random() * 1000000),
+        };
+      }
+      this.userList = [];
+      this.attachList = [];
       this.visible = true;
       await getUserList().then(({ data }) => {
         if (data && data.code === "200") {
@@ -212,9 +223,15 @@ export default {
       this.$refs["dataForm"].validate((valid) => {
         if (valid) {
           this.visible = false;
-          this.dataForm.taskTypeName = this.taskTypeOption.find(t => t.value == this.dataForm.taskType).label;
-          this.dataForm.rankTypeName = this.rankTypeOption.find(t => t.value == this.dataForm.ranks).label;
-          this.dataForm.receiverName = this.userList.find(t => t.userId == this.dataForm.receiver).name;
+          this.dataForm.taskTypeName = this.taskTypeOption.find(
+            (t) => t.value == this.dataForm.taskType
+          ).label;
+          this.dataForm.rankTypeName = this.rankTypeOption.find(
+            (t) => t.value == this.dataForm.ranks
+          ).label;
+          this.dataForm.receiverName = this.userList.find(
+            (t) => t.userId == this.dataForm.receiver
+          ).name;
           this.$emit("submit", this.dataForm);
         }
       });