Kaynağa Gözat

1.导入导出按钮权限
2.财物信息、利润中心信息、采购信息、库存信息、计划信息、成本信息编辑接口

002390 2 yıl önce
ebeveyn
işleme
13a0fb976a

+ 1 - 1
src/api/material/basic.js

@@ -145,7 +145,7 @@ const planList = (data) => {
 }
 
 // 查询计划信息详情 
-const planDetails = () => {
+const planDetails = (id) => {
   return request({
     url: `/system/plan/details/${id}`,
     method: 'get',

+ 85 - 31
src/views/material/basicFile/details.vue

@@ -29,7 +29,7 @@
               </el-dropdown-menu>
             </el-dropdown>
 
-                                                              <el-button size="small" @click="handleQuery">查询</el-button> -->
+                                                                                          <el-button size="small" @click="handleQuery">查询</el-button> -->
             <el-button size="small" @click="handleRefresh">刷新</el-button>
 
           </el-button-group>
@@ -49,7 +49,7 @@
                 <el-dropdown-item :command="isInvoke(true)">启用</el-dropdown-item>
                 <el-dropdown-item :command="isInvoke(false)">停用</el-dropdown-item>
               </el-dropdown-menu>
-                                                                                                             </el-dropdown> -->
+                                                                                                                                         </el-dropdown> -->
           </el-button-group>
         </el-col>
 
@@ -58,7 +58,7 @@
           <el-button-group>
             <el-button size="small" @click="handleQueryForm">申请单查询</el-button>
           </el-button-group>
-                                                      </el-col> -->
+                                                                                  </el-col> -->
 
         <!-- 导入导出 -->
       <!-- <el-col :span="1.5">
@@ -66,7 +66,7 @@
             <el-button size="small" @click="handleImport">批量导入</el-button>
             <el-button size="small" @click="handleExport">批量导出</el-button>
           </el-button-group>
-                                                        </el-col> -->
+                                                                                    </el-col> -->
 
       </el-row>
 
@@ -112,7 +112,7 @@
           <!-- 附件管理 -->
         <!-- <el-button-group>
             <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button>
-                                                      </el-button-group> -->
+                                                                                  </el-button-group> -->
 
           <!-- 切换 -->
         <!-- <el-button-group>
@@ -124,7 +124,7 @@
               @click="handleChangePage('next')" />
             <el-button size="small" icon="el-icon-d-arrow-right" :disabled="!handleBasicEdit"
               @click="handleChangePage('end')" />
-                                                      </el-button-group> -->
+                                                                                  </el-button-group> -->
         </el-col>
       </el-row>
 
@@ -385,7 +385,7 @@
     <el-dialog :title="otherDeatils.title" :visible.sync="otherDeatils.show" show-close width="70%"
       :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
       class="otherDialog">
-      <div>
+      <div v-loading="otherDeatils.loading">
         <!-- 其他标签页操作  修改、删除 -->
         <el-row :gutter="10" class="mb10">
           <el-col :span="1.5" v-if="!otherDeatils.isEdit">
@@ -394,7 +394,7 @@
               <el-button size="small" @click="handleDel">删除</el-button>
             </el-button-group>
             <el-button-group>
-              <el-button size="small" @click="handleRefresh">刷新</el-button>
+              <el-button size="small" @click="handleOtherRefresh">刷新</el-button>
             </el-button-group>
           </el-col>
           <el-col :span="1.5" v-else>
@@ -411,7 +411,7 @@
             <el-form :inline="true" label-position="right" :model="basicData.value">
             <!-- <el-form-item label="所属组织">
                   <el-input v-model="basicData.value.orgName" placeholder="所属组织"></el-input>
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </el-form-item> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       </el-form-item> -->
               <el-form-item label="物料编码">
                 <el-input v-model="basicData.value.code" size="small" readonly placeholder="物料编码"></el-input>
               </el-form-item>
@@ -423,7 +423,7 @@
               </el-form-item>
             <!-- <el-form-item label="版本号">
                 <el-input v-model="basicData.value.version"  placeholder="版本号"></el-input>
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </el-form-item> -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       </el-form-item> -->
 
             </el-form>
           </el-collapse-item>
@@ -439,8 +439,8 @@
                     <template v-if="f.show">
                       <!-- 多选框 -->
                       <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" class="od-msg-checkedbx">
-                        <el-checkbox :label="f.name" name="type" v-model="otherDeatils.value[f.prop]"
-                          :disabled="!(otherDeatils.isEdit && f.edit)">
+                        <el-checkbox :label="f.name" name="type" v-model="otherDeatils.value[f.prop]" true-label="0"
+                          false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
                         </el-checkbox>
                       </el-form-item>
 
@@ -634,6 +634,7 @@ export default {
       },
       // 其他页签操作弹窗
       otherDeatils: {
+        loading: false,
         show: false,
         title: '',
         // 查询关键字-物料id
@@ -720,42 +721,42 @@ export default {
         case 'material_finance':
           this.getTagList('material_finance', (form) => {
             this.mainMsg.form = form;
-            this.getFinanceList('');
+            this.getFinanceList(this.materialId);
           });
           break;
         // 利润中心信息
         case 'profit_center':
           this.getTagList('profit_center', (form) => {
             this.mainMsg.form = form;
-            this.getCenterList('');
+            this.getCenterList(this.materialId);
           });
           break;
         // 采购信息
         case 'material_purchase':
           this.getTagList('material_purchase', (form) => {
             this.mainMsg.form = form;
-            this.getPurchaseList();
+            this.getPurchaseList(this.materialId);
           });
           break;
         // 库存信息
         case 'material_inventory':
           this.getTagList('material_inventory', (form) => {
             this.mainMsg.form = form;
-            this.getInventoryList();
+            this.getInventoryList(this.materialId);
           });
           break;
         // 计划信息
         case 'material_plan':
           this.getTagList('material_plan', (form) => {
             this.mainMsg.form = form;
-            this.getPlanList('');
+            this.getPlanList(this.materialId);
           });
           break;
         // 成本信息
         case 'material_cost':
           this.getTagList('material_cost', (form) => {
             this.mainMsg.form = form;
-            this.getCostList('');
+            this.getCostList(this.materialId);
           });
           break;
         default: break;
@@ -939,8 +940,7 @@ export default {
       materialApi.financeList({ materialId }).then(res => {
         console.log(res, '查询财务信息列表');
         if (res.code == 200) {
-          this.mainMsg.value = res.rows;
-
+          this.mainMsg.value = res.data.tableBody.rows;
         }
       })
     },
@@ -995,7 +995,7 @@ export default {
       console.log(type, id, '查询其他标签页列表详情');
       this.otherDeatils.form = this.mainMsg.form;
       console.log(this.otherDeatils.form, 'this.otherDeatils.form');
-
+      this.otherDeatils.loading = true;
       switch (type) {
         // 财物信息
         case 'material_finance':
@@ -1027,6 +1027,7 @@ export default {
     // 查询财务信息详情
     getFinanceDetails(id) {
       materialApi.financeDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         let _this = this;
         console.log('查询财务信息详情', res);
         if (res.code == 200) {
@@ -1039,6 +1040,7 @@ export default {
     getCenterDetails(id) {
       let _this = this;
       materialApi.centerDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取利润中心详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
@@ -1050,6 +1052,7 @@ export default {
     getPurchaseDetails(id) {
       let _this = this;
       materialApi.purchaseDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取采购详细信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
@@ -1061,6 +1064,7 @@ export default {
     getCostDetails(id) {
       let _this = this;
       materialApi.costDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取成本信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
@@ -1072,6 +1076,7 @@ export default {
     getPlanDetails(id) {
       let _this = this;
       materialApi.planDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取计划信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
@@ -1083,6 +1088,7 @@ export default {
     getInventoryDetails(id) {
       let _this = this;
       materialApi.inventoryDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取库存详细信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
@@ -1227,6 +1233,10 @@ export default {
         });
       }
     },
+    // 其他标签详情弹窗-刷新
+    handleOtherRefresh() {
+      this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
+    },
     // 修改
     handleBasicEdit() {
       console.log('修改基本信息');
@@ -1432,8 +1442,38 @@ export default {
       this.optionDialog.op = '修改';
     },
     // 其他标签页弹窗保存
-    handleOtherSave() {
+    async handleOtherSave() {
       console.log('其他标签页弹窗保存', this.activeMainTab);
+      let data = this.otherDeatils.value;
+      console.log(data, 'params');
+      switch (this.activeMainTab) {
+        // 财物信息
+        case 'material_finance':
+          await this.handleSaveFinance(data);
+          break;
+        // 利润中心信息
+        case 'profit_center':
+          await this.handleSaveCenter(data);
+          break;
+        // 采购信息
+        case 'material_purchase':
+          await this.handleSavePurchase(data);
+          break;
+        // 库存信息
+        case 'material_inventory':
+          await this.handleSaveInventoryEdit(data);
+          break;
+        // 计划信息
+        case 'material_plan':
+          await this.handleSavePlan(data);
+          break;
+        // 成本信息
+        case 'material_cost':
+          await this.handleSaveCost(data);
+          break;
+        default: break;
+      }
+      this.handleOtherRefresh();
     },
     // 其他页签详情弹窗关闭事件
     handleCloseOtherDetails(done) {
@@ -1568,7 +1608,7 @@ export default {
       console.log(data, '保存财务信息——单个数据');
       materialApi.financeEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1577,7 +1617,7 @@ export default {
       console.log(data, '保存利润中心信息');
       materialApi.centerEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1586,7 +1626,7 @@ export default {
       console.log(data, '保存采购信息');
       materialApi.purchaseEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1595,7 +1635,7 @@ export default {
       console.log(data, '保存库存信息');
       materialApi.inventoryEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1604,7 +1644,7 @@ export default {
       console.log(data, '保存计划信息');
       materialApi.planEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1613,7 +1653,7 @@ export default {
       console.log(data, '保存成本信息');
       materialApi.costEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1676,10 +1716,17 @@ export default {
 
       .md-main {
         // height: calc(100vh - 625px);
-        max-height: 160px;
         margin-bottom: 10px;
-        overflow-y: auto;
-        overflow-x: hidden;
+
+        .el-form {
+          max-height: 200px;
+          overflow-y: auto;
+          overflow-x: hidden;
+
+          .el-checkbox {
+            padding: 0 50%;
+          }
+        }
       }
 
       .md-vice-content {
@@ -1704,6 +1751,13 @@ export default {
       padding-bottom: 12px;
     }
 
+    .el-form {
+      .el-checkbox {
+        width: 100%;
+        padding: 0 10%;
+      }
+    }
+
     .el-dialog__body {
       padding: 12px 20px;
       height: 80%;

+ 5 - 4
src/views/material/basicFile/index.vue

@@ -26,7 +26,7 @@
               <el-dropdown-item :command="filterCondition('stop')">显示停用</el-dropdown-item>
               <el-dropdown-item :command="filterCondition('allot')">显示已分配</el-dropdown-item>
             </el-dropdown-menu>
-                    </el-dropdown> -->
+                      </el-dropdown> -->
 
           <!-- <el-button size="small" @click="handleQuery">查询</el-button> -->
           <el-button size="small" @click="handleRefresh">刷新</el-button>
@@ -45,22 +45,23 @@
             </el-dropdown-menu>
           </el-dropdown>
         </el-button-group>
-                </el-col> -->
+                  </el-col> -->
 
       <!-- 申请单查询 -->
     <!-- <el-col :span="1.5">
         <el-button-group>
           <el-button size="small" @click="handleQueryForm">申请单查询</el-button>
         </el-button-group>
-                </el-col> -->
+                  </el-col> -->
 
       <!-- 导入导出 -->
       <el-col :span="1.5">
         <el-button-group>
-          <el-button size="small" @click="handleImport">批量导入</el-button>
+          <el-button size="small" @click="handleImport" v-hasPermi="['system:material:import']">批量导入</el-button>
           <el-button size="small" @click="handleExport" v-hasPermi="['system:material:export']">批量导出</el-button>
         </el-button-group>
       </el-col>
+
       <el-col :span="1.5">
         <!-- 查询框 -->
         <el-form :inline="true" :model="queryForm" class="mb-query">

+ 2 - 2
vue.config.js

@@ -36,8 +36,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://test-sy.derom.com/drp-admin`, //测试
-        // target: `http://172.16.13.47:8000/drp-admin`, //本地
+        // target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://172.16.13.47:8000/drp-admin`, //本地
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''