소스 검색

修改承接合同中,修改功能中的关联项目、关联合同

余思翰 9 달 전
부모
커밋
cf797d019c

+ 0
- 1
oa-ui/src/views/flowable/task/finished/index.vue 파일 보기

162
           map[item.procInsId].children.push(item);
162
           map[item.procInsId].children.push(item);
163
         }
163
         }
164
       });
164
       });
165
-      console.log(processed);
166
       return processed;
165
       return processed;
167
     },
166
     },
168
   },
167
   },

+ 0
- 1
oa-ui/src/views/oa/assess/index.vue 파일 보기

213
   },
213
   },
214
   created() {
214
   created() {
215
     this.getList();
215
     this.getList();
216
-    console.log(this.taskForm);
217
   },
216
   },
218
   methods: {
217
   methods: {
219
     /** 查询cmc考核列表 */
218
     /** 查询cmc考核列表 */

+ 39
- 31
oa-ui/src/views/oa/contract/components/edit.vue 파일 보기

245
       connectProjectList: [],
245
       connectProjectList: [],
246
       connectSubContractList: [],
246
       connectSubContractList: [],
247
       deleteSubList: [],
247
       deleteSubList: [],
248
-      projectContractForm: {
249
-        projectIds: [],
250
-      },
251
       taskForm: {
248
       taskForm: {
252
         formId: ''
249
         formId: ''
253
-      }
250
+      },
254
     }
251
     }
255
   },
252
   },
256
   watch: {
253
   watch: {
270
       this.connectProjectList = [];
267
       this.connectProjectList = [];
271
       this.connectSubContractList = [];
268
       this.connectSubContractList = [];
272
       this.deleteSubList = [];
269
       this.deleteSubList = [];
273
-      this.projectloading = true;
274
-      this.subloading = true;
275
       listContractComment({ pageNum: 1, pageSize: 100, contractId: contractId }).then(res => {
270
       listContractComment({ pageNum: 1, pageSize: 100, contractId: contractId }).then(res => {
276
         if (res.rows && res.rows.length != 0) {
271
         if (res.rows && res.rows.length != 0) {
277
           this.commentList = res.rows;
272
           this.commentList = res.rows;
278
         }
273
         }
279
       })
274
       })
275
+      this.getProjectContractList();
276
+      this.getContractSubcontractList();
277
+    },
278
+    // 获取关联项目
279
+    getProjectContractList() {
280
+      this.projectloading = true;
281
+      const contractId = this.form.contractId;
280
       listProjectContract({ contractId: contractId }).then(async res => {
282
       listProjectContract({ contractId: contractId }).then(async res => {
281
         if (res.rows) {
283
         if (res.rows) {
282
           let list = []
284
           let list = []
288
           this.projectloading = false;
290
           this.projectloading = false;
289
         }
291
         }
290
       })
292
       })
293
+    },
294
+    // 获取关联分包合同
295
+    getContractSubcontractList() {
296
+      this.subloading = true;
297
+      const contractId = this.form.contractId;
291
       listContractSubcontract({ contractId: contractId }).then(async res => {
298
       listContractSubcontract({ contractId: contractId }).then(async res => {
299
+        let list = []
292
         for (let r of res.rows) {
300
         for (let r of res.rows) {
293
           let obj = await getSubContract(r.subContractId)
301
           let obj = await getSubContract(r.subContractId)
294
-          this.connectSubContractList.push(obj.data)
302
+          list.push(obj.data)
295
         }
303
         }
304
+        this.connectSubContractList = list
296
         this.subloading = false;
305
         this.subloading = false;
297
       })
306
       })
298
     },
307
     },
306
             }
315
             }
307
             this.updateContractData();
316
             this.updateContractData();
308
             this.updateRelatedProject();
317
             this.updateRelatedProject();
309
-            this.updateRelatedSub();
310
             this.$emit('cancel')
318
             this.$emit('cancel')
311
           }
319
           }
312
         }
320
         }
340
       return chooseTender.partyA.partyAName.includes(TARGET_COMPANY) ? '院内' : '院外';
348
       return chooseTender.partyA.partyAName.includes(TARGET_COMPANY) ? '院内' : '院外';
341
     },
349
     },
342
     confirmProject(val) {
350
     confirmProject(val) {
351
+      let isSame = this.haveSameIds(val, this.connectProjectList, 'projectId');
352
+      if (isSame) {
353
+        this.$message.error('请勿重复添加已有项目')
354
+        return
355
+      }
343
       this.open = false
356
       this.open = false
344
       for (let v of val) {
357
       for (let v of val) {
345
-        this.projectContractForm.projectIds.push(v.projectId);
346
         this.connectProjectList.push(v)
358
         this.connectProjectList.push(v)
347
       }
359
       }
348
     },
360
     },
361
+    haveSameIds(arr1, arr2, key) {
362
+      return arr1.some(obj1 => arr2.some(obj2 => obj1[key] === obj2[key]))
363
+    },
349
     confirmTender(val) {
364
     confirmTender(val) {
350
       this.tbOpen = false
365
       this.tbOpen = false
351
       this.form.amount = val.quote
366
       this.form.amount = val.quote
365
         this.$set(this.form, 'partyAId', val[0].partyAId)
380
         this.$set(this.form, 'partyAId', val[0].partyAId)
366
       }
381
       }
367
     },
382
     },
368
-    confirmSubContract(val) {
383
+    async confirmSubContract(val) {
384
+      let isSame = this.haveSameIds(val, this.connectSubContractList, 'subContractId');
385
+      if (isSame) {
386
+        this.$message.error('请勿重复添加已有的分包合同')
387
+        return
388
+      }
369
       this.subOpen = false
389
       this.subOpen = false
370
       for (let v of val) {
390
       for (let v of val) {
371
         this.connectSubContractList.push(v)
391
         this.connectSubContractList.push(v)
392
+        await addContractSubcontract({ contractId: this.form.contractId, subContractId: v.subContractId })
372
       }
393
       }
394
+      this.getContractSubcontractList()
373
     },
395
     },
374
     getContractPath(val) {
396
     getContractPath(val) {
375
       let arr = val.split('/upload')
397
       let arr = val.split('/upload')
398
         })
420
         })
399
       });
421
       });
400
     },
422
     },
401
-    updateRelatedProject() {
402
-      delProjectContract(this.form.contractId).then(() => {
403
-        for (let projectId of this.projectContractForm.projectIds) {
404
-          addProjectContract({ projectId: projectId, contractId: this.form.contractId });
405
-        }
406
-      })
407
-    },
408
-    updateRelatedSub() {
409
-      let subIds = this.deleteSubList.map(item => item.subContractId);
410
-      console.log(subIds);
411
-      delContractSubcontract(subIds).then(() => {
412
-        this.connectSubContractList.forEach(item => {
413
-          item.contractId = this.form.contractId;
414
-          let obj = {
415
-            contractId: this.form.contractId,
416
-            subContractId: item.subContractId
417
-          }
418
-          addContractSubcontract(obj)
419
-        })
420
-      })
423
+    async updateRelatedProject() {
424
+      let projectIds = this.connectProjectList.map(item => item.projectId);
425
+      await delProjectContract(this.form.contractId)
426
+      for (let projectId of projectIds) {
427
+        await addProjectContract({ projectId: projectId, contractId: this.form.contractId });
428
+      }
421
     },
429
     },
422
     clickProjectFn(row) {
430
     clickProjectFn(row) {
423
       this.$router.replace({ query: { ...this.$route.query, projectId: row.projectId } });
431
       this.$router.replace({ query: { ...this.$route.query, projectId: row.projectId } });
425
     },
433
     },
426
     handleDelete(index, row) {
434
     handleDelete(index, row) {
427
       this.connectProjectList.splice(index, 1)
435
       this.connectProjectList.splice(index, 1)
428
-      this.projectContractForm.projectIds.splice(row.contractId)
429
     },
436
     },
430
     clickSubFn(row) {
437
     clickSubFn(row) {
431
       this.taskForm.formId = row.subContractId
438
       this.taskForm.formId = row.subContractId
432
       this.subInfoOpen = true
439
       this.subInfoOpen = true
433
     },
440
     },
434
     handleDeleteSub(index, row) {
441
     handleDeleteSub(index, row) {
442
+      delContractSubcontract(row.subContractId)
435
       this.deleteSubList.push(row)
443
       this.deleteSubList.push(row)
436
       this.connectSubContractList.splice(index, 1)
444
       this.connectSubContractList.splice(index, 1)
437
     },
445
     },

+ 0
- 1
oa-ui/src/views/oa/material/buy.vue 파일 보기

303
     },
303
     },
304
     computeAmount() {
304
     computeAmount() {
305
       let amount = (this.form.totalNum * this.form.price).toFixed(2);
305
       let amount = (this.form.totalNum * this.form.price).toFixed(2);
306
-      console.log(amount);
307
       this.$set(this.form, 'amount', amount);
306
       this.$set(this.form, 'amount', amount);
308
       this.$set(this.form, 'buyer', 17);
307
       this.$set(this.form, 'buyer', 17);
309
     },
308
     },

+ 0
- 1
oa-ui/src/views/oa/staff/index.vue 파일 보기

481
     }
481
     }
482
   },
482
   },
483
   created() {
483
   created() {
484
-    console.log(this.dict.type.sys_post_status);
485
     this.getList();
484
     this.getList();
486
     this.getDeptTree();
485
     this.getDeptTree();
487
     this.getConfigKey("sys.user.initPassword").then(response => {
486
     this.getConfigKey("sys.user.initPassword").then(response => {

Loading…
취소
저장