Sfoglia il codice sorgente

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

黄梓星 2 anni fa
parent
commit
259a0f79b0

+ 2 - 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',
@@ -337,6 +337,7 @@ const fileImport = (data) => {
   })
 }
 
+
 /**
  * 删除接口
  */

+ 101 - 38
src/views/material/basicFile/details.vue

@@ -10,7 +10,7 @@
           <el-button-group>
             <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
             <el-button size="small" @click="handleBasicEdit">修改</el-button>
-            <el-button size="small" @click="handleDel">删除</el-button>
+            <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
             <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
           </el-button-group>
         </el-col>
@@ -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>
 
@@ -92,8 +92,8 @@
     <el-row :gutter="10" class="mb10" v-show="activeMainTab != 'material'">
       <el-col :span="1.5">
         <el-button-group>
-          <el-button size="small" @click="handleEdit">修改</el-button>
-          <el-button size="small" @click="handleDel">删除</el-button>
+          <el-button size="small" @click="handleOtherEdit">修改</el-button>
+          <!-- <el-button size="small" @click="handleOtherDel">删除</el-button> -->
         </el-button-group>
         <el-button-group>
           <el-button size="small" @click="handleRefresh">刷新</el-button>
@@ -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,16 +385,16 @@
     <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">
             <el-button-group>
-              <el-button size="small" @click="handleEdit">修改</el-button>
-              <el-button size="small" @click="handleDel">删除</el-button>
+              <el-button size="small" @click="handleOtherEdit">修改</el-button>
+              <!-- <el-button size="small" @click="handleOtherDel">删除</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;
@@ -1206,7 +1212,7 @@ export default {
       });
     },
     // 除基本信息之后的修改
-    handleEdit() {
+    handleOtherEdit() {
       console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
 
       if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
@@ -1227,6 +1233,14 @@ export default {
         });
       }
     },
+    // 其他标签详情弹窗-刷新
+    handleOtherRefresh() {
+      this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
+    },
+    // 其他标签详情弹窗-删除
+    handleOtherDel() {
+
+    },
     // 修改
     handleBasicEdit() {
       console.log('修改基本信息');
@@ -1242,7 +1256,8 @@ export default {
     },
     // 删除
     handleDel() {
-      console.log('删除');
+      console.log('删除----基本信息');
+
     },
     // 复制
     handleCopy() {
@@ -1432,8 +1447,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 +1613,7 @@ export default {
       console.log(data, '保存财务信息——单个数据');
       materialApi.financeEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1577,7 +1622,7 @@ export default {
       console.log(data, '保存利润中心信息');
       materialApi.centerEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1586,7 +1631,7 @@ export default {
       console.log(data, '保存采购信息');
       materialApi.purchaseEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1595,7 +1640,7 @@ export default {
       console.log(data, '保存库存信息');
       materialApi.inventoryEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1604,7 +1649,7 @@ export default {
       console.log(data, '保存计划信息');
       materialApi.planEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1613,7 +1658,7 @@ export default {
       console.log(data, '保存成本信息');
       materialApi.costEdit(data).then(res => {
         if (res.code == 200) {
-
+          this.otherDeatils.isEdit = false;
         }
       })
     },
@@ -1664,6 +1709,10 @@ export default {
     padding: 12px;
     overflow-y: auto;
     overflow-x: auto;
+
+    .el-select {
+      width: 100%;
+    }
   }
 
   .md-content {
@@ -1676,10 +1725,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 58%;
+          }
+        }
       }
 
       .md-vice-content {
@@ -1704,6 +1760,13 @@ export default {
       padding-bottom: 12px;
     }
 
+    .el-form {
+      .el-checkbox {
+        width: 100%;
+        padding: 0 10%;
+      }
+    }
+
     .el-dialog__body {
       padding: 12px 20px;
       height: 80%;

+ 22 - 11
src/views/material/basicFile/index.vue

@@ -9,7 +9,7 @@
         <el-button-group>
           <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
           <el-button size="small" @click="handleEdit">修改</el-button>
-          <el-button size="small" @click="handleDel">删除</el-button>
+          <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
           <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
         </el-button-group>
       </el-col>
@@ -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,25 +45,26 @@
             </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">
+        <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
           <el-form-item label="物料名称">
             <el-input size="small" v-model="queryForm.name" placeholder="物料名称"></el-input>
           </el-form-item>
@@ -85,9 +86,9 @@
 
     <el-card class="material-list" v-loading="loading">
       <el-table :data="taskList" @cell-dblclick="handledbClick" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55" />
+        <el-table-column type="selection" width="20" />
         <el-table-column type="index" label="序号" width="55" align="center" />
-        <el-table-column v-for="h in  tableHeader" v-if="h.show" :label="h.name" align="center" :prop="h.prop"
+        <el-table-column width="150" v-for="h in  tableHeader" v-if="h.show" :label="h.name" align="center" :prop="h.prop"
           show-overflow-tooltip />
       </el-table>
 
@@ -98,16 +99,17 @@
     </el-card>
 
     <!-- 导入弹窗 -->
-    <el-dialog title="批量导入" :visible.sync="importData.show" width="50%" center @before-close="handlefileDialogColse">
+    <el-dialog title="批量导入" :visible.sync="importData.show" width="30%" center @before-close="handlefileDialogColse">
       <div class="mb-import">
 
+
         <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
           :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
-          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <el-button slot="trigger" type="primary">选取文件</el-button>
           <!-- <el-button style="margin-left: 10px;" size="small" type="success" @click="handleSubmitUpload">上传到服务器</el-button> -->
           <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
         </el-upload>
-
+        <el-button type="success" @click="handleDownTemplate">下载模板</el-button>
       </div>
       <span slot="footer">
         <el-button @click="handleImportData('cancal')">取 消</el-button>
@@ -317,6 +319,11 @@ export default {
       }
       this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`)
     },
+    // 下载模板
+    handleDownTemplate() {
+      console.log('下载模板');
+      this.download('/system/material/download', {}, `物料基本信息模板.xlsx`)
+    },
 
 
     // 操作弹窗显隐
@@ -432,7 +439,11 @@ export default {
 }
 
 .mb-import {
+  padding: 0 20%;
   text-align: center;
+  display: flex;
+  align-items: flex-start;
+  justify-content: space-around;
 }
 </style>
 <style scoped>

+ 1 - 1
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
         // target: `http://172.16.63.202:8000/drp-admin`, // 谁的本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
-        // target: `http://172.16.13.47:8000/drp-admin`, //石本地
+        // target: `http://172.16.13.47:8000/drp-admin`, //石本地
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''