瀏覽代碼

修改bug

695593266@qq.com 1 周之前
父節點
當前提交
b916b80840
共有 2 個文件被更改,包括 21 次插入14 次删除
  1. 19 12
      src/views/produce/components/prenatalExamination/releaseRulesDialog.vue
  2. 2 2
      vue.config.js

+ 19 - 12
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -764,8 +764,14 @@
       // 仅仅查看
       openView(productionInfo, workOrderInfo) {
         this.type = 'detail';
+        if (productionInfo && productionInfo.recordId == null) {
+          productionInfo.recordId = productionInfo.id;
+        }
         this.open(productionInfo, workOrderInfo);
       },
+      getRecordId() {
+        return this.productionInfo?.recordId || this.addForm.id || null;
+      },
       open(productionInfo, workOrderInfo) {
         console.log(
           'productionInfo, workOrderInfo',
@@ -777,7 +783,7 @@
         this.workOrderInfo = workOrderInfo;
 
         // 存在缓存记录
-        if (this.productionInfo.recordId != null) {
+        if (this.getRecordId() != null) {
           // 查询详情
           this.getCacheInfo();
         } else {
@@ -822,7 +828,9 @@
         console.log('this.productionInfo', this.productionInfo);
         console.log('this.addForm', this.addForm);
         this.$nextTick(() => {
-          this.getListByWorkOrderId();
+          if (this.getRecordId() == null) {
+            this.getListByWorkOrderId();
+          }
           this.getRuleInfo();
         });
       },
@@ -830,7 +838,7 @@
       async getCacheInfo() {
         this.loading = true;
         try {
-          const data = await getById(this.productionInfo.recordId);
+          const data = await getById(this.getRecordId());
           console.log('dat 缓存', data);
           data.details = data.details.map((i) => {
             i.toolNames = i.tools.map((j) => j.toolName).join(',');
@@ -879,22 +887,21 @@
       },
       // 物料信息查询
       async getListByWorkOrderId(type = '') {
+        const recordId = this.getRecordId();
+        const produceTaskId =
+          this.addForm.produceTaskId || this.productionInfo.produceTaskId;
         console.log(
           'type 物料信息',
           type,
-          this.productionInfo.produceTaskId,
+          produceTaskId,
           this.addForm.reportWorkType
         );
-        if (
-          !this.productionInfo.produceTaskId ||
-          this.addForm.reportWorkType != 2
-        )
-          return;
+        if (!produceTaskId || this.addForm.reportWorkType != 2) return;
         // 查询物料信息
         const materialObject = await queryListByWorkOrderId({
           workOrderId: this.addForm.workOrderId,
-          recordId: this.productionInfo.recordId,
-          produceTaskId: this.productionInfo.produceTaskId,
+          recordId,
+          produceTaskId,
           ruleId: this.addForm.ruleId
         });
 
@@ -1004,7 +1011,7 @@
         const data = await getRecordRulesDetail(this.productionInfo.ruleId);
         this.ruleInfo = data;
         console.log('this.ruleInfo', this.ruleInfo);
-        if (this.productionInfo.recordId == null) {
+        if (this.getRecordId() == null) {
           // 赋值表单信息
           this.addForm.recordRulesClassify = this.ruleInfo.classify + '';
           this.addForm.recordTemplateStyle =

+ 2 - 2
vue.config.js

@@ -32,8 +32,8 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116