yusheng 6 days ago
parent
commit
7dea2c7bd9

+ 4 - 4
src/components/contact/parentList.vue

@@ -81,15 +81,14 @@
         type: Number | String,
         default: 1
       },
-      type: '',
-      code: ''
+      type: ''
     },
     data() {
       return {
         visible: false,
         treeList: [],
         treeLoading: false,
-
+        code: '',
         defaultProps: {
           children: 'children',
           label: 'name'
@@ -196,7 +195,8 @@
 
     watch: {},
     methods: {
-      open(item) {
+      open(code) {
+        this.code = code;
         this.visible = true;
         this.getTreeData();
       },

+ 2 - 1
src/views/recordComponents/workOrder.vue

@@ -352,7 +352,8 @@
           ...order,
           pageNum: page,
           size: limit,
-          planType: this.planTypeList[this.pageName]
+          planType: this.planTypeList[this.pageName],
+         currentLoginUserId: this.$store.state.user.info.userId
         };
         return producetaskrulerecordQueryRecordWorkOrderPage(body);
       },

+ 22 - 5
src/views/recordComponents/workOrderReport.vue

@@ -180,7 +180,7 @@
             <el-input
               clearable
               v-model="addForm.supplierName"
-              @click.native="handParent"
+              @click.native="handParent()"
               placeholder="请选择"
               readonly
             />
@@ -332,13 +332,14 @@
             </el-input>
           </div></template
         > -->
-        <template v-slot:num="{ row }">
+        <template v-slot:num="{ row, $index }">
           <div>
             <el-input
               type="text"
               placeholder="请输入"
               v-model="row.num"
               @input="setValue"
+              @click.native="addContactName(row, $index)"
             >
               <template v-if="row.unitName" slot="append">
                 <div>{{ row.unitName }}</div>
@@ -368,7 +369,6 @@
           ? '17'
           : '19'
       "
-      :code="getCode()"
       ref="parentListRef"
       @changeParent="changeParent"
     >
@@ -690,10 +690,21 @@
         await this.getOrderDetials(data.id);
         this.visible = true;
       },
-      handParent() {
-        this.$refs.parentListRef.open();
+      handParent(code) {
+        if (code != '09') {
+          this.currentIndex = '';
+        }
+        this.$refs.parentListRef.open(code || this.getCode());
       },
       changeParent(data) {
+        if (this.currentIndex || this.currentIndex === 0) {
+          this.$set(
+            this.addForm.detailList[this.currentIndex],
+            'num',
+            data.name
+          );
+          return;
+        }
         this.addForm.contactName = data.name;
         this.addForm.contactId = data.id;
         this.addForm.supplierName = data.name;
@@ -732,6 +743,12 @@
           return '';
         }
       },
+      addContactName(row, index) {
+        if (row.paramValue == '运输单位') {
+          this.currentIndex = index;
+          this.handParent('09');
+        }
+      },
       // 获取工单详情
       async getOrderDetials(id) {
         try {