Bladeren bron

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 1 jaar geleden
bovenliggende
commit
70d110cd6a
2 gewijzigde bestanden met toevoegingen van 142 en 107 verwijderingen
  1. 129 94
      src/views/material/basicFile/details.vue
  2. 13 13
      src/views/purchase/DemandSummary/index.vue

+ 129 - 94
src/views/material/basicFile/details.vue

@@ -240,8 +240,11 @@
                 </el-form>
 
                 <!-- 其他展示为列表 -->
-                <el-table v-else :data="mainMsg.value" @cell-dblclick="handleMaindbClick"
-                          @selection-change="handleMainChange">
+                <el-table v-else 
+                  :data="mainMsg.value" 
+                  @cell-dblclick="handleMaindbClick"
+                  @selection-change="handleMainChange"
+                  >
                   <el-table-column type="selection" width="55"/>
                   <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center"/>
                   <el-table-column v-for="m in  mainMsg.form" v-if="m.show" :label="m.name" align="center"
@@ -888,6 +891,7 @@
         this.activeMainTab = detailsTabs[e.index].code;
 
         this.collapseActive.splice(1, 1, this.activeMainTab);
+
         console.log(this.collapseActive, 'this.collapseActive');
 
         this.handleOtherListRefresh();
@@ -1024,9 +1028,10 @@
         })
       },
       // 获取物料基本信息详细信息
-      getMaterialDetails(id, templateCode) {
+      async getMaterialDetails(id, templateCode) {
+
         let _this = this;
-        materialApi.materialDetails(
+        await materialApi.materialDetails(
           id,
           templateCode,
         ).then(res => {
@@ -1097,58 +1102,87 @@
 
 
       // 查询财务信息列表
-      getFinanceList(materialId) {
-        materialApi.financeList({materialId}).then(res => {
-          console.log(res, '查询财务信息列表');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getFinanceList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.financeList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+          
+        } catch (error) {
+          
+        }finally{
+          this.loading = false;
+        }
       },
       // 查询计划信息列表
-      getPlanList(materialId) {
-        materialApi.planList({materialId}).then(res => {
-          console.log(res, '查询计划信息列表');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getPlanList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.planList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+        } catch (error) {
+          
+        }finally{
+          this.loading = false;
+        }
       },
       // 查询成本信息列表
-      getCostList(materialId) {
-        materialApi.costList({materialId}).then((res) => {
-          console.log(res, '成本信息列表+表头');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getCostList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.costList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+        } catch (error) {
+          
+        }finally{
+          this.loading = false;
+        }
       },
       // 查询利润中心列表
-      getCenterList(materialId) {
-        materialApi.centerList({materialId}).then(res => {
-          console.log(res, '查询利润中心信息');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getCenterList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.centerList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+        } catch (error) {
+          
+        }finally{
+          this.loading = false;
+        }
       },
       // 查询采购中心列表
-      getPurchaseList(materialId) {
-        materialApi.purchaseList({materialId}).then(res => {
-          console.log(res, '查询采购中心');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getPurchaseList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.purchaseList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+        } catch (error) {
+          
+        }finally{
+          this.loading = false;
+        }
       },
       // 获取库存信息列表
-      getInventoryList(materialId) {
-        materialApi.inventoryList({materialId}).then(res => {
-          console.log(res, '获取库存信息列表');
-          if (res.code == 200) {
-            this.mainMsg.value = res.data.tableBody.rows;
+      async getInventoryList(materialId) {
+        try {
+          this.loading = true;
+          let {code,data} = await materialApi.inventoryList({materialId});
+          if (code == 200) {
+            this.mainMsg.value = data.tableBody.rows;
           }
-        })
+        } catch (error) {}finally{
+          this.loading = false;
+        }
       },
 
       // 查询其他标签页列表详情
@@ -1449,61 +1483,62 @@
         }
       },
       // 其他标签页刷新
-      handleOtherListRefresh() {
-        switch (this.activeMainTab) {
+     async handleOtherListRefresh() {
+          switch (this.activeMainTab) {
 
-          // 基本信息
-          case 'material':
-            this.getTagList('material', (form) => {
-              this.basicData.form = [...form];
-              this.getMaterialDetails(this.materialId, 'material');
-            })
-            break;
-          // 财物信息
-          case 'material_finance':
-            this.getTagList('material_finance', (form) => {
-              this.mainMsg.form = [...form];
-              this.getFinanceList(this.materialId);
-            });
-            break;
-          // 利润中心信息
-          case 'profit_center':
-            this.getTagList('profit_center', (form) => {
-              this.mainMsg.form = [...form];
-              this.getCenterList(this.materialId);
-            });
-            break;
-          // 采购信息
-          case 'material_purchase':
-            this.getTagList('material_purchase', (form) => {
-              this.mainMsg.form = [...form];
-              this.getPurchaseList(this.materialId);
-            });
-            break;
-          // 库存信息
-          case 'material_inventory':
-            this.getTagList('material_inventory', (form) => {
-              this.mainMsg.form = [...form];
-              this.getInventoryList(this.materialId);
-            });
-            break;
-          // 计划信息
-          case 'material_plan':
-            this.getTagList('material_plan', (form) => {
-              this.mainMsg.form = [...form];
-              this.getPlanList(this.materialId);
-            });
-            break;
-          // 成本信息
-          case 'material_cost':
-            this.getTagList('material_cost', (form) => {
-              this.mainMsg.form = [...form];
-              this.getCostList(this.materialId);
-            });
-            break;
-          default:
-            break;
-        }
+            // 基本信息
+            case 'material':
+              await this.getTagList('material', async(form) => {
+                this.basicData.form = [...form];
+                await  this.getMaterialDetails(this.materialId, 'material');
+              })
+              break;
+            // 财物信息
+            case 'material_finance':
+              await this.getTagList('material_finance', async(form) => {
+                this.mainMsg.form = [...form];
+                await this.getFinanceList(this.materialId);
+              });
+              break;
+            // 利润中心信息
+            case 'profit_center':
+              await this.getTagList('profit_center', async(form) => {
+                this.mainMsg.form = [...form];
+                await this.getCenterList(this.materialId);
+              });
+              break;
+            // 采购信息
+            case 'material_purchase':
+              await this.getTagList('material_purchase', async(form) => {
+                this.mainMsg.form = [...form];
+                await this.getPurchaseList(this.materialId);
+              });
+              break;
+            // 库存信息
+            case 'material_inventory':
+              await this.getTagList('material_inventory', async(form) => {
+                this.mainMsg.form = [...form];
+                await  this.getInventoryList(this.materialId);
+              });
+              break;
+            // 计划信息
+            case 'material_plan':
+            await this.getTagList('material_plan', async(form) => {
+                this.mainMsg.form = [...form];
+                await this.getPlanList(this.materialId);
+              });
+              break;
+            // 成本信息
+            case 'material_cost':
+              await this.getTagList('material_cost',async(form) => {
+                this.mainMsg.form = [...form];
+                await this.getCostList(this.materialId);
+              });
+              break;
+            default:
+              break;
+          }
+       
       },
       // 修改
       handleBasicEdit() {

+ 13 - 13
src/views/purchase/DemandSummary/index.vue

@@ -275,14 +275,14 @@
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.buyerName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '明细采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <template slot-scope="scope">
                 <el-input readonly :disabled="scope.row.status !== '1' || lineDisable" size="mini" v-model="scope.row.purchaseOrgName">
-                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+                  <el-button size="mini" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '明细默认采购组织')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
@@ -460,11 +460,11 @@ export default {
       allSelection: [],
       // 子表index
       tableIndex: null,
-      referConditionMx: {
-        type: '',
-        isPage: true,
-        title: ''
-      }
+      // referConditionMx: {
+      //   type: '',
+      //   isPage: true,
+      //   title: ''
+      // }
     }
   },
   created() {
@@ -732,12 +732,12 @@ export default {
         this.orgOptions = selection
         this.queryParams.purchaseOrg = selection[0].id
       }
-      if (this.referConditionMx.title == '采购员') {
+      if (this.referCondition.title == '明细采购员') {
         console.log('选择进了吗',this.tableList)
         this.tableList[this.tableIndex].buyer = selection[0].code
         this.tableList[this.tableIndex].buyerName = selection[0].name
       }
-      if (this.referConditionMx.title == '默认采购组织') {
+      if (this.referCondition.title == '明细默认采购组织') {
         console.log('选择进了吗',this.tableList)
         this.tableList[this.tableIndex].purchaseOrg = selection[0].id
         this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
@@ -765,10 +765,10 @@ export default {
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {
       this.tableIndex = index
-      this.referConditionMx.type = type
-      this.referConditionMx.isPage = isPage
-      this.referConditionMx.title = title
-      this.$refs.refer.init(this.referConditionMx)
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
     }
   }
 }