Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

001295 2 éve
szülő
commit
aa3f01c12a

+ 71 - 2
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',
@@ -268,6 +268,66 @@ const medcineitemBatchSave = (data) => {
   })
 }
 
+// 修改财务信息 /dev-api/drp-admin/system/finance/edit 
+const financeEdit = (data) => {
+  return request({
+    url: `/system/finance/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+// 修改利润中心信息 /dev-api/drp-admin/system/center/edit
+const centerEdit = (data) => {
+  return request({
+    url: `/system/center/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+// 修改采购信息 /dev-api/drp-admin/system/purchase/edit
+const purchaseEdit = (data) => {
+  return request({
+    url: `/system/purchase/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+// 修改库存信息 /dev-api/drp-admin/system/inventory/edit
+const inventoryEdit = (data) => {
+  return request({
+    url: `/system/inventory/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+// 修改计划信息 /dev-api/drp-admin/system/plan/edit
+const planEdit = (data) => {
+  return request({
+    url: `/system/plan/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+// 修改成本信息 /dev-api/drp-admin/system/cost/edit
+const costEdit = (data) => {
+  return request({
+    url: `/system/cost/edit `,
+    method: 'post',
+    data,
+  })
+}
+
+
+
+/*
+*导入导出
+*/
+
 // 导入文件  /dev-api/drp-admin/system/material/import
 const fileImport = (data) => {
   return request({
@@ -277,11 +337,12 @@ const fileImport = (data) => {
   })
 }
 
+
 /**
  * 删除接口
  */
 // 删除物料基本信息-列表   /dev-api/drp-admin/system/material/delete/{id}
-const delMaterial = (data)=>{
+const delMaterial = (data) => {
   return request({
     url: '/system/material/delete',
     method: 'post',
@@ -321,6 +382,14 @@ export default {
   saveMaterial,
   insertMaterialInfo,
   medcineitemBatchSave,
+  financeEdit,
+  centerEdit,
+  purchaseEdit,
+  inventoryEdit,
+  planEdit,
+  costEdit,
+
+  // 导入
   fileImport,
 
   // 删除

+ 10 - 1
src/api/requisition/basic.js

@@ -37,4 +37,13 @@ export function delReq(id) {
     url: `/system/apply/material/${id}`,
     method: 'delete',
   })
-}
+}
+
+// 参照-四级分类
+// export function getMaterialClass(data) {
+//   return request({
+//     url: `/system/archival/queryMaterialClassify`,
+//     method: 'post',
+//     data: data
+//   })
+// }

+ 140 - 0
src/components/PopDialog/fourClass.vue

@@ -0,0 +1,140 @@
+<template>
+  <div>
+    <el-dialog
+      title="物料分类选择"
+      width="1000px"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      v-dialogDrag
+      class="userDialog"
+      :visible.sync="visible"
+    >
+      <el-container style="height: 500px">
+        <el-container>
+          <el-main>
+            <el-row :gutter="10" class="content">
+              <el-col :span="12">
+                <el-input
+                  placeholder="输入关键字进行过滤"
+                  size="small"
+                  v-model="filterText">
+                </el-input>
+
+                <el-tree
+                  class="filter-tree"
+                  :data="threedata"
+                  :props="defaultProps"
+                  node-key="id"
+                  highlight-current
+                  @node-click="clickTree"
+                  :filter-node-method="filterNode"
+                  ref="tree">
+                </el-tree>
+              </el-col>
+            </el-row>
+          </el-main>
+        </el-container>
+      </el-container>
+      <span slot="footer" class="dialog-footer">
+        <el-button
+          size="small"
+          @click="visible = false"
+          icon="el-icon-circle-close"
+          >关闭</el-button
+        >
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-circle-check"
+          @click="doSubmit()"
+          >确定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getTree } from '@/api/classify/basic';
+export default {
+  data() {
+    return {
+      loading: false,
+      visible: false,
+      filterText: '',
+      threedata: [],
+      defaultProps: {
+        children: 'childrens',
+        label: 'materialType'
+      },
+      // 判断是否为最末级节点
+      isLast: false,
+      // 选中的节点
+      choosePoint: {}
+    };
+  },
+  props: {},
+  methods: {
+    init() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.refreshList()
+      });
+    },
+    // 获取数据列表
+    refreshList(data) {
+      this.loading = true;
+      getTree(data).then(res => {
+        console.log('res',res)
+        if(res.code === 200) {
+          this.threedata = res.rows
+        }
+        this.loading = false;
+      });
+    },
+    clickTree(data) {
+      console.log('树形节点信息:',data)
+      if (data.childrens.length == 0) {
+        this.isLast = true
+      } else {
+        this.isLast = false
+      }
+      this.choosePoint = data
+    },
+    filterNode(value, data) {
+      console.log('value', value)
+      console.log('data', data)
+        if (!value) return true;
+        return data.label.indexOf(value) !== -1;
+    },
+    doSubmit() {
+      if(this.isLast == false) {
+        this.$message({
+          message: '请选择最末级节点',
+          type: 'warning'
+        });
+      } else {
+        console.log('子组件选择的数据',this.choosePoint)
+        this.$emit("doSubmit", this.choosePoint);
+        this.visible = false;
+      }
+    },
+  },
+};
+</script>
+<style lang="scss">
+.userDialog {
+  .el-dialog__body {
+    padding: 10px 0px 0px 10px;
+    color: #606266;
+    font-size: 14px;
+    word-break: break-all;
+  }
+  .el-main {
+    padding: 20px 20px 5px 20px;
+    .el-pagination {
+      margin-top: 5px;
+    }
+  }
+}
+</style>

+ 262 - 125
src/views/material/basicFile/details.vue

@@ -8,10 +8,10 @@
         <!-- 新增、修改、删除、复制 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleInster">新增</el-button>
+            <!-- <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="handleCopy">复制</el-button>
+            <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
+            <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
           </el-button-group>
         </el-col>
 
@@ -19,7 +19,7 @@
         <el-col :span="1.5">
           <el-button-group>
 
-            <el-dropdown size="small" @command="handleFilter">
+          <!-- <el-dropdown size="small" @command="handleFilter">
               <el-button size="small">
                 过滤<i class="el-icon-arrow-down el-icon--right"></i>
               </el-button>
@@ -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,24 +49,24 @@
                 <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>
 
         <!-- 申请单查询 -->
-        <el-col :span="1.5">
+      <!-- <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-col :span="1.5">
           <el-button-group>
             <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>
 
@@ -75,8 +75,8 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleSave">保存</el-button>
-            <el-button size="small" @click="handleSaveAdd" :disabled="true">保存新增</el-button>
-            <el-button size="small" @click="handleUpdateImport">更新导入</el-button>
+            <!-- <el-button size="small" @click="handleSaveAdd" :disabled="true">保存新增</el-button> -->
+            <!-- <el-button size="small" @click="handleUpdateImport">更新导入</el-button> -->
           </el-button-group>
         </el-col>
 
@@ -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>
@@ -110,12 +110,12 @@
         </el-col>
         <el-col :span="6" style="text-align: right;">
           <!-- 附件管理 -->
-          <el-button-group>
+        <!-- <el-button-group>
             <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button>
-          </el-button-group>
+                                                                                                                          </el-button-group> -->
 
           <!-- 切换 -->
-          <el-button-group>
+        <!-- <el-button-group>
             <el-button size="small" icon="el-icon-d-arrow-left" :disabled="!handleBasicEdit"
               @click="handleChangePage('first')" />
             <el-button size="small" icon="el-icon-arrow-left" :disabled="!handleBasicEdit"
@@ -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>
 
@@ -162,7 +162,7 @@
                         <!-- 多选框 -->
                         <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;">
                           <el-checkbox :label="f.name" name="type" v-model="basicData.value[f.prop]"
-                            :disabled="!updateButtonGroup">
+                            :disabled="!(updateButtonGroup && f.edit)">
                           </el-checkbox>
                         </el-form-item>
 
@@ -170,11 +170,11 @@
                         <el-form-item v-else-if="f.attribute == 'select'" :label="f.name"
                           :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''">
 
-                          <el-select v-model="basicData.value[`${f.prop}Label`]" :placeholder="f.name"
-                            :key="basicData.value[f.prop]" :disabled="!updateButtonGroup"
+                          <el-select v-model="basicData.value[`${f.prop}Name`]" :placeholder="f.name"
+                            :key="basicData.value[f.prop]" :disabled="!(updateButtonGroup && f.edit)"
                             @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
-                            <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
-                              :value="d.dictValue">
+                            <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictCode" :label="d.dictLabel"
+                              :value="d.dictCode">
                             </el-option>
 
                             <div slot="empty"></div>
@@ -191,7 +191,7 @@
                         <!--attribute 文本 数字 文本域 为null -->
                         <el-form-item v-else :label="f.name">
                           <el-input size="small" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
-                            :readonly="!updateButtonGroup" :placeholder="f.name">
+                            :readonly="!(updateButtonGroup && f.edit)" :placeholder="f.name">
                           </el-input>
                         </el-form-item>
                       </template>
@@ -236,7 +236,7 @@
                             <!-- 下拉框 -->
                             <el-form-item v-else-if="m.attribute == 'select'" :label="m.name">
 
-                              <el-select v-model="medcineData.value[`${m.prop}Label`]" :placeholder="m.name"
+                              <el-select v-model="medcineData.value[`${m.prop}Name`]" :placeholder="m.name"
                                 :key="medcineData.value[m.prop]" :disabled="!updateButtonGroup"
                                 @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
@@ -295,13 +295,13 @@
                 <el-divider content-position="left">审计信息</el-divider>
                 <el-form :inline="true" label-position="right" :model="basicData.value">
                   <el-form-item label="创建人">
-                    <el-input v-model="basicData.value.createBy" size="small" readonly placeholder="创建人"></el-input>
+                    <el-input v-model="basicData.value.createByName" size="small" readonly placeholder="创建人"></el-input>
                   </el-form-item>
                   <el-form-item label="创建时间">
                     <el-input v-model="basicData.value.createTime" size="small" readonly placeholder="创建时间"></el-input>
                   </el-form-item>
                   <el-form-item label="最后修改人">
-                    <el-input v-model="basicData.value.updateBy" size="small" readonly placeholder="最后修改人"></el-input>
+                    <el-input v-model="basicData.value.updateByName" size="small" readonly placeholder="最后修改人"></el-input>
                   </el-form-item>
                   <el-form-item label="最后修改时间">
                     <el-input v-model="basicData.value.updateTime" size="small" readonly placeholder="最后修改时间"></el-input>
@@ -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,15 +439,15 @@
                     <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>
 
                       <!-- 下拉框 -->
                       <el-form-item v-else-if="f.attribute == 'select'" :label="f.name">
 
-                        <el-select v-model="otherDeatils.value[`${f.prop}Label`]" :placeholder="f.name"
+                        <el-select v-model="otherDeatils.value[`${f.prop}Name`]" :placeholder="f.name"
                           :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
                           @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
 
@@ -485,13 +485,13 @@
             <div class="md-auditInfo">
               <el-form :inline="true" label-position="right" :model="basicData.value">
                 <el-form-item label="创建人">
-                  <el-input v-model="basicData.value.createBy" size="small" readonly placeholder="创建人"></el-input>
+                  <el-input v-model="basicData.value.createByName" size="small" readonly placeholder="创建人"></el-input>
                 </el-form-item>
                 <el-form-item label="创建时间">
                   <el-input v-model="basicData.value.createTime" size="small" readonly placeholder="创建时间"></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改人">
-                  <el-input v-model="basicData.value.updateBy" size="small" readonly placeholder="最后修改人"></el-input>
+                  <el-input v-model="basicData.value.updateByName" size="small" readonly placeholder="最后修改人"></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改时间">
                   <el-input v-model="basicData.value.updateTime" size="small" readonly placeholder="最后修改时间"></el-input>
@@ -625,7 +625,7 @@ export default {
       // 副信息
       viceMsg: {
         form: [],
-        value: []
+        value: [],
       },
       // 操作弹窗
       optionDialog: {
@@ -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;
@@ -789,7 +790,7 @@ export default {
           this.getTagList('material_property', (form) => {
 
             this.propertyDetail.form = form;
-            this.getPropertyList('');
+            this.getPropertyList(this.materialId);
           });
           break;
 
@@ -872,6 +873,7 @@ export default {
         id,
         templateCode,
       ).then(res => {
+        this.loading = false;
         console.log(res, '物料基本信息');
         let { code, data } = res;
         if (code == 200) {
@@ -879,59 +881,59 @@ export default {
           _this.basicData.value = data.data;
           // this.basicData.form = data.form;
 
-          _this.handleAddReferLabel('basicData');
+          // _this.handleAddReferLabel('basicData');
 
         }
       })
     },
     // 添加参照中的label
-    handleAddReferLabel(dataName) {
-      let _this = this;
-      this[dataName].form.map(item => {
-        // 查参照
-        if (item.apiUrl && item.apiUrl != '') {
+    // handleAddReferLabel(dataName) {
+    //   let _this = this;
+    //   this[dataName].form.map(item => {
+    //     // 查参照
+    //     if (item.apiUrl && item.apiUrl != '') {
 
-          let param = {};
+    //       let param = {};
 
-          if (item.relevance && item.relevance != '') {
-            let reList = item.relevance.split(',');
-            console.log(reList, 'reList-------------------');
-            reList.forEach(i => {
-              param[i] = this.basicData.value[i]
-            })
-            console.log(param, 'param/////////////////////////');
-          }
+    //       if (item.relevance && item.relevance != '') {
+    //         let reList = item.relevance.split(',');
+    //         console.log(reList, 'reList-------------------');
+    //         reList.forEach(i => {
+    //           param[i] = this.basicData.value[i]
+    //         })
+    //         console.log(param, 'param/////////////////////////');
+    //       }
 
-          _this.getExecuteMethods(item.apiUrl, param, (data) => {
-            let { tableBody } = data;
+    //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
+    //         let { tableBody } = data;
 
-            // 维护物料类别  --- 属于列表中获取label
-            if (dataName == 'materialType') {
+    //         // 维护物料类别  --- 属于列表中获取label
+    //         if (dataName == 'materialType') {
 
-              _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
+    //           _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
 
-                let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
-                console.log(Blabel, 'Blabel``````````````````````````');
-                d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-                return d;
-              }))
+    //             let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
+    //             console.log(Blabel, 'Blabel``````````````````````````');
+    //             d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
+    //             return d;
+    //           }))
 
-            } else {
+    //         } else {
 
-              let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
-              console.log(Blabel, 'Blabel``````````````````````````');
-              _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-            }
+    //           let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
+    //           console.log(Blabel, 'Blabel``````````````````````````');
+    //           _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
+    //         }
 
-            this.count++;
-            this.loading = false;
-            console.log(_this[dataName].value, `${dataName}//////////////////////`);
-          })
-        }
-      })
-      this.materialType.loading = false;
+    //         // this.count++;
+    //         this.loading = false;
+    //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
+    //       })
+    //     }
+    //   })
+    //   this.materialType.loading = false;
 
-    },
+    // },
 
 
     // 查询财务信息列表
@@ -939,8 +941,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 +996,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,33 +1028,36 @@ export default {
     // 查询财务信息详情
     getFinanceDetails(id) {
       materialApi.financeDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         let _this = this;
         console.log('查询财务信息详情', res);
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
     // 获取利润中心详情
-    getCenterDetails(materialId) {
+    getCenterDetails(id) {
       let _this = this;
-      materialApi.centerDetails(materialId).then(res => {
+      materialApi.centerDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取利润中心详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
     // 获取采购详细信息详情
-    getPurchaseDetails(materialId) {
+    getPurchaseDetails(id) {
       let _this = this;
-      materialApi.purchaseDetails(materialId).then(res => {
+      materialApi.purchaseDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取采购详细信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
@@ -1061,10 +1065,11 @@ 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;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
@@ -1072,21 +1077,23 @@ 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;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
     // 获取库存详细信息详情
-    getInventoryDetails(materialId) {
+    getInventoryDetails(id) {
       let _this = this;
-      materialApi.inventoryDetails(materialId).then(res => {
+      materialApi.inventoryDetails(id).then(res => {
+        this.otherDeatils.loading = false;
         console.log(res, '获取库存详细信息详情');
         if (res.code == 200) {
           this.otherDeatils.value = res.data.data;
-          _this.handleAddReferLabel('otherDeatils');
+          // _this.handleAddReferLabel('otherDeatils');
         }
       })
     },
@@ -1100,13 +1107,14 @@ export default {
       let _this = this;
       console.log(id);
       materialApi.medcineDetailsInfo(id).then((res) => {
-
+        this.loading = false;
         console.log(res, '医药行业');
         let { code, data } = res;
         if (code == 200) {
           _this.medcineData.value = data.data || {};
           // this.medcineData.form = data.form;
-          _this.handleAddReferLabel('medcineData');
+          // _this.handleAddReferLabel('medcineData');
+          console.log(' _this.medcineData', _this.medcineData, res);
         }
       })
     },
@@ -1120,8 +1128,8 @@ export default {
       })
     },
     // 查询物料辅助属性列表+表头字段
-    getPropertyList() {
-      materialApi.propertyList().then(res => {
+    getPropertyList(materialId) {
+      materialApi.propertyList({ materialId }).then(res => {
         console.log(res, '料辅助属性列表');
         if (res.code == 200) {
           this.propertyDetail.value = res.data.data || [];
@@ -1191,14 +1199,12 @@ export default {
         console.log(res, '根据物料id获取物料类别维护列表');
         if (res.code == 200) {
           _this.materialType.value = res.data.tableBody.rows;
-          _this.handleAddReferLabel('materialType');
+          // _this.handleAddReferLabel('materialType');
         }
       })
     },
 
 
-
-
     // 新增
     handleInster() {
       this.$message({
@@ -1207,7 +1213,7 @@ export default {
       });
     },
     // 除基本信息之后的修改
-    handleEdit() {
+    handleOtherEdit() {
       console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
 
       if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
@@ -1228,6 +1234,14 @@ export default {
         });
       }
     },
+    // 其他标签详情弹窗-刷新
+    handleOtherRefresh() {
+      this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
+    },
+    // 其他标签详情弹窗-删除
+    handleOtherDel() {
+
+    },
     // 修改
     handleBasicEdit() {
       console.log('修改基本信息');
@@ -1243,7 +1257,8 @@ export default {
     },
     // 删除
     handleDel() {
-      console.log('删除');
+      console.log('删除----基本信息');
+
     },
     // 复制
     handleCopy() {
@@ -1315,7 +1330,8 @@ export default {
     handleSave() {
       console.log('保存修改');
       this.handleSaveMaterial(() => {
-        this.$router.go(0)
+        this.updateButtonGroup = false;
+        this.handleRefresh();
       });
     },
     // 物料类别列表选中
@@ -1433,8 +1449,38 @@ export default {
       this.optionDialog.op = '修改';
     },
     // 其他标签页弹窗保存
-    handleOtherSave() {
-      console.log('其他标签页弹窗保存');
+    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) {
@@ -1477,9 +1523,9 @@ export default {
     // 参照弹窗过滤
     handleFilterRefer() {
       // this.MoreDataDialog.key =
-      console.log(this.MoreDataDialog.key, '查询关键字');
+      console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
 
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key);
+      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
 
     },
     // 操作提示弹窗关闭
@@ -1507,28 +1553,42 @@ export default {
         //  基本信息
         this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        this.basicData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
-        console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}Label`], '//////////基本信息///////////');
+        // this.basicData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
+        this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-      } else if (this.MoreDataDialog.target.name == 'medcineData') {
+        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
+
+        console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
 
+      } else if (this.MoreDataDialog.target.name == 'medcineData') {
+        // console.log('this.MoreDataDialog.value', this.MoreDataDialog.value, this.MoreDataDialog.target.prop, this.medcineData);
+        // if (this.MoreDataDialog.target.prop === 'dosageFrom')
+        //   this.medcineData.form = this.medcineData.form.map((item) => {
+        //     if (item.prop === "dosageFrom") item.dictValue = [{ dictLabel: this.MoreDataDialog.value.name, dictValue: this.MoreDataDialog.value.id }]
+        //     return item
+        //   })
         //  医药信息
         this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
+        // this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
+        this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+
+        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
-        console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`], '//////医药信息//////////');
+        console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
 
       } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
 
         //  其他页签
         this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
+        // this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
+        this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-        console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`], '/////////其他页签///////');
+        console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
 
       }
+      this.count++;
       this.MoreDataDialog.show = false;
     },
     // 取消-关闭参照弹窗
@@ -1559,6 +1619,60 @@ export default {
         if (res.code == 200) cb();
       })
     },
+    // 保存财务信息——单个数据
+    handleSaveFinance(data) {
+      console.log(data, '保存财务信息——单个数据');
+      materialApi.financeEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
+    // 保存利润中心信息
+    handleSaveCenter(data) {
+      console.log(data, '保存利润中心信息');
+      materialApi.centerEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
+    // 保存采购信息
+    handleSavePurchase(data) {
+      console.log(data, '保存采购信息');
+      materialApi.purchaseEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
+    // 保存库存信息
+    handleSaveInventoryEdit(data) {
+      console.log(data, '保存库存信息');
+      materialApi.inventoryEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
+    // 保存计划信息
+    handleSavePlan(data) {
+      console.log(data, '保存计划信息');
+      materialApi.planEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
+    // 保存成本信息
+    handleSaveCost(data) {
+      console.log(data, '保存成本信息');
+      materialApi.costEdit(data).then(res => {
+        if (res.code == 200) {
+          this.otherDeatils.isEdit = false;
+        }
+      })
+    },
 
 
     // 重新加载
@@ -1571,9 +1685,13 @@ export default {
       })
       // 医疗行业
       await this.getTagList('material_medcine', (form) => {
+        form.forEach((item) => {
+          this.medcineData.value[item.prop] = ''
+        })
         this.medcineData.form = form;
         this.getMedcineDetails(this.materialId, 'material_medcine');
       })
+
     },
   },
   created() {
@@ -1588,7 +1706,6 @@ export default {
     }
 
   },
-
 }
 </script>
 
@@ -1602,6 +1719,12 @@ export default {
     height: calc(100vh - 160px);
     box-sizing: border-box;
     padding: 12px;
+    overflow-y: auto;
+    overflow-x: auto;
+
+    .el-select {
+      width: 100%;
+    }
   }
 
   .md-content {
@@ -1613,11 +1736,18 @@ export default {
       overflow: auto;
 
       .md-main {
-        height: calc(100vh - 625px);
-        // max-height: 290px;
+        // height: calc(100vh - 625px);
         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 {
@@ -1642,6 +1772,13 @@ export default {
       padding-bottom: 12px;
     }
 
+    .el-form {
+      .el-checkbox {
+        width: 100%;
+        padding: 0 10%;
+      }
+    }
+
     .el-dialog__body {
       padding: 12px 20px;
       height: 80%;

+ 46 - 32
src/views/material/basicFile/index.vue

@@ -7,10 +7,10 @@
       <!-- 新增、修改、删除、复制 -->
       <el-col :span="1.5">
         <el-button-group>
-          <el-button size="small" @click="handleInster">新增</el-button>
+          <!-- <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="handleCopy">复制</el-button>
+          <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
+          <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
         </el-button-group>
       </el-col>
 
@@ -18,7 +18,7 @@
       <el-col :span="1.5">
         <el-button-group>
 
-          <el-dropdown size="small" @command="handleFilter">
+        <!-- <el-dropdown size="small" @command="handleFilter">
             <el-button size="small">
               过滤<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
@@ -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>
@@ -35,7 +35,7 @@
       </el-col>
 
       <!-- 启用 -->
-      <el-col :span="1.5">
+    <!-- <el-col :span="1.5">
         <el-button-group>
           <el-dropdown split-button size="small" @click="handleIsInvoke(true)" @command="handleIsInvoke">
             启用
@@ -45,35 +45,36 @@
             </el-dropdown-menu>
           </el-dropdown>
         </el-button-group>
-      </el-col>
+                                          </el-col> -->
 
       <!-- 申请单查询 -->
-      <el-col :span="1.5">
+    <!-- <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-row>
-
-    <!-- 查询框 -->
-    <el-form :inline="true" :model="queryForm" class="mb-query">
-      <el-form-item label="物料名称">
-        <el-input size="small" v-model="queryForm.name" placeholder="物料名称"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button size="small" type="primary" @click="handleQuery">查询</el-button>
-      </el-form-item>
-    </el-form>
+      <el-col :span="1.5">
+        <!-- 查询框 -->
+        <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>
+          <el-form-item>
+            <el-button size="small" type="primary" @click="handleQuery">查询</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
 
+    </el-row>
 
     <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
       <span>是否确认{{ optionDialog.op }}?</span>
@@ -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>
@@ -206,7 +208,7 @@ export default {
       // delMaterial
       if (this.checkedList.length) {
         let ids = this.checkedList.map(i => i.id);
-        materialApi.delMaterial(ids ).then(res => {
+        materialApi.delMaterial(ids).then(res => {
           if (res.code == 200) this.handleRefresh();
         })
       } else {
@@ -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`)
+    },
 
 
     // 操作弹窗显隐
@@ -401,7 +408,8 @@ export default {
 
 <style lang="scss">
 .material-list {
-  height: calc(100% - 100px);
+  // height: calc(100% - 100px);
+  height: calc(100% - 70px);
 
 
   .el-card__body {
@@ -410,11 +418,13 @@ export default {
 
     .el-table {
       height: calc(100% - 35px);
+      overflow: auto;
 
       .el-table__body-wrapper {
+        // height: calc(100% - 150px);
         height: calc(100% - 150px);
-        overflow-y: auto;
-        overflow-x: auto;
+        overflow-y: auto !important;
+        overflow-x: auto !important;
         // .el-table__body {
         //   height: 100%;
         // }
@@ -429,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>
@@ -442,7 +456,7 @@ export default {
   font-size: 12px;
 }
 
-.mb-query>>>.el-tabs__content {
-  padding-bottom: 8px;
+.mb-query>>>.el-form-item {
+  margin-bottom: 8px;
 }
 </style>

+ 4 - 2
src/views/material/changeApply/add.vue

@@ -469,7 +469,9 @@ export default {
       getChangeDetails(row.id).then(res => {
         if(res.code === 200) {
           this.basicForm = res.data
-          this.basicForm2 = res.data.medicineChange
+          if (res.data.medicineChange) {
+            this.basicForm2 = res.data.medicineChange
+          }
         }
       })
     },
@@ -570,7 +572,7 @@ export default {
           this.basicForm.registrant = data.registrant
           this.basicForm.storageConditions = data.storageCondition
           this.basicForm.transportCondition = data.transportationCondition
-          this.basicForm.remark = data.deliveryPeriod
+          this.basicForm.leadTime = data.deliveryPeriod
           if(data.medcines.length !== 0) {
             this.basicForm2.drug = data.medcines[0].isDrug
             this.basicForm2.registrationNo = data.medcines[0].registrationNo

+ 2 - 2
src/views/material/changeApply/index.vue

@@ -48,12 +48,12 @@
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导出</el-button>
-      </el-col>
+      </el-col> -->
       <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>批量提交</el-button>
       </el-col>

+ 2 - 2
src/views/material/classify/index.vue

@@ -10,12 +10,12 @@
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="deleteClassify">删除</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>启用</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain>停用</el-button>
-      </el-col>
+      </el-col> -->
     </el-row>
 
     <el-card>

+ 99 - 100
src/views/material/requisition/add.vue

@@ -17,9 +17,23 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="四级分类" prop="classifyId">
-                <el-input :disabled="disable" v-model="basicForm.classifyId">
-                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test01"></el-button>
-                </el-input>
+                <el-select
+                    ref="fourTag"
+                    v-model="basicForm.classifyId"
+                    placeholder="四级分类"
+                    :disabled="disable"
+                    @focus="chooseFourClass"
+                  >
+                    <el-option
+                      v-for="item in testOptions"
+                      :key="item.id"
+                      :label="item.materialType"
+                      :value="item.id"
+                    />
+                </el-select>
+                <!-- <el-input :disabled="disable" v-model="basicForm.classifyId">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="chooseFourClass"></el-button>
+                </el-input> -->
               </el-form-item>
             </el-col>
           </el-row>
@@ -38,7 +52,7 @@
                       :label="item.label"
                       :value="item.value"
                     />
-                  </el-select>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -98,7 +112,9 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="产地" prop="originPlace">
-                <el-input :disabled="disable" v-model="basicForm.originPlace"></el-input>
+                <el-input :disabled="disable" v-model="basicForm.originPlace">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -250,72 +266,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="近效期预警天数" prop="recentWarningPeriod">
-                <el-select
-                    v-model="basicForm.recentWarningPeriod"
-                    placeholder="近效期预警天数"
-                    clearable
-                    :disabled="disable"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="有效期单位" prop="expiryUnitId">
-                <el-select
-                    v-model="basicForm.expiryUnitId"
-                    placeholder="有效期单位"
-                    clearable
-                    :disabled="disable"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="有效期至单位" prop="usefulLifeUnitId">
-                <el-select
-                    v-model="basicForm.usefulLifeUnitId"
-                    placeholder="有效期至单位"
-                    clearable
-                    :disabled="disable"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="近效期预警天数" prop="recentWarningPeriod">
-                <el-select
-                    v-model="basicForm.recentWarningPeriod"
-                    placeholder="近效期预警天数"
-                    clearable
-                    :disabled="disable"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
-                </el-select>
+                <el-input :disabled="disable" v-model="basicForm.recentWarningPeriod"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -329,7 +280,7 @@
                     :disabled="disable"
                   >
                     <el-option
-                      v-for="item in options"
+                      v-for="item in dict.type.sys_storage_condition"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
@@ -346,7 +297,7 @@
                     :disabled="disable"
                   >
                     <el-option
-                      v-for="item in options"
+                      v-for="item in dict.type.sys_conditions_carriage"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
@@ -356,26 +307,16 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="物料税类" prop="materialRate">
-                <el-input :disabled="disable" v-model="basicForm.materialRate"></el-input>
+                <el-input :disabled="disable" v-model="basicForm.materialRate">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                </el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="交货周期" prop="deliveryPeriod">
-                <el-select
-                    v-model="basicForm.deliveryPeriod"
-                    placeholder="交货周期"
-                    clearable
-                    :disabled="disable"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    />
-                </el-select>
+                <el-input :disabled="disable" v-model="basicForm.deliveryPeriod"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -392,7 +333,9 @@
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="采购员" prop="puPersonnelId">
-                <el-input :disabled="disable" v-model="basicForm.puPersonnelId"></el-input>
+                <el-input :disabled="disable" v-model="basicForm.puPersonnelId">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                </el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -436,7 +379,9 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="业务线" prop="businessLine">
-                <el-input :disabled="disable" v-model="basicForm.businessLine"></el-input>
+                <el-input :disabled="disable" v-model="basicForm.businessLine">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                </el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -477,24 +422,24 @@
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="一级分类" prop="oneClass">
-                <el-input :disabled="disable" v-model="basicForm.oneClass"></el-input>
+                <el-input disabled v-model="basicForm.oneClass"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="二级分类" prop="twoClass">
-                <el-input :disabled="disable" v-model="basicForm.twoClass"></el-input>
+                <el-input disabled v-model="basicForm.twoClass"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
               <el-form-item label="三级分类" prop="threeClass">
-                <el-input :disabled="disable" v-model="basicForm.threeClass"></el-input>
+                <el-input disabled v-model="basicForm.threeClass"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row :gutter="20">
             <el-col :span="8">
               <el-form-item label="启用状态" prop="isEnable">
-                <el-input :disabled="disable" v-model="basicForm.isEnable"></el-input>
+                <el-input disabled v-model="basicForm.isEnable"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -563,7 +508,9 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="剂型" prop="dosageFrom">
-                <el-input :disabled="disable" v-model="basicForm2.dosageFrom"></el-input>
+                <el-input :disabled="disable" v-model="basicForm2.dosageFrom">
+                  <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
+                </el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -575,7 +522,19 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="养护类型" prop="curingType">
-                <el-input :disabled="disable" v-model="basicForm2.curingType"></el-input>
+                <el-select
+                    v-model="basicForm2.curingType"
+                    placeholder="养护类型"
+                    clearable
+                    :disabled="disable"
+                  >
+                    <el-option
+                      v-for="dict in dict.type.curing_type"
+                      :key="dict.value"
+                      :label="dict.label"
+                      :value="dict.value"
+                    />
+                  </el-select>
               </el-form-item>
             </el-col>
           </el-row>
@@ -709,19 +668,32 @@
       :selectData="selectData2"
       :single="true"
     />
+
+    <fourClass
+      ref="fourClass"
+      @doSubmit="acceptFourClass"
+      :selectData="selectData3"
+      :single="true"
+    />
+
+
   </div>
 </template>
 
 <script>
 import popDialog from '@/components/PopDialog/index.vue'
 import factory from '@/components/PopDialog/productFactory.vue'
+import fourClass from '@/components/PopDialog/fourClass.vue'
 import { addReq, getReqDetail, editReq } from '@/api/requisition/basic'
+// 调用物料分类详情接口用于数据回显
+import { getDetail } from '@/api/classify/basic';
 export default {
   name: 'requisition_add',
   dicts: ['sys_storage_condition', 'sys_conditions_carriage', 'sys_medicine', 'medical_instruments', 'curing_type'],
   components: {
     popDialog,
-    factory
+    factory,
+    fourClass
   },
   props: ['pageStu', 'row', 'disable'],
   model: {
@@ -730,6 +702,7 @@ export default {
   },
   data() {
     return{
+      testOptions: [],
       tabValue: 'first',
       basicForm: {
         billCode: '',
@@ -827,7 +800,8 @@ export default {
       // 弹窗
       name: '',
       selectData: [],
-      selectData2: []
+      selectData2: [],
+      selectData3: [],
     }
   },
   // watch: {
@@ -863,11 +837,15 @@ export default {
         console.log('页面状态',this.pageStu)
         console.log('数据', this.row)
         this.getDetails(this.row)
+        // 获取树形详情
+        this.getTreeDetails(this.row.classifyId)
       } else if (this.pageStu == 'edit') {
         // alert('修改页面')
         console.log('页面状态',this.pageStu)
         console.log('数据', this.row)
         this.getDetails(this.row)
+        // 获取树形详情
+        this.getTreeDetails(this.row.classifyId)
       } else if(this.pageStu == 'add') {
         // alert('新增页面')
         console.log('页面状态',this.pageStu)
@@ -879,6 +857,17 @@ export default {
       console.log(tab, event);
       console.log('页面状态',this.pageStu)
     },
+    // 用于回显四级分类树形选择
+    getTreeDetails(id) {
+      getDetail(id).then(res => {
+        if (res.code === 200) {
+          this.testOptions.push(res.data)
+          this.basicForm.oneClass = res.data.oneClass
+          this.basicForm.twoClass = res.data.twoClass
+          this.basicForm.threeClass = res.data.threeClass
+        }
+      })
+    },
     // 如果是详情进入,则调用详情接口
     getDetails(row) {
       getReqDetail(row.id).then(res => {
@@ -893,7 +882,6 @@ export default {
     },
     save() {
       if(this.pageStu == 'edit') {
-        alert(111)
         let sparams = {...this.basicForm, ...{status: 0}}
         sparams.sysMaterialMedcineApply = this.basicForm2
         console.log('提交参数', sparams)
@@ -907,7 +895,6 @@ export default {
           }
         })
       } else {
-        alert(222)
         // alert('保存传status:0')
         let sparams = {...this.basicForm, ...{status: 0}}
         sparams.sysMaterialMedcineApply = this.basicForm2
@@ -1017,7 +1004,19 @@ export default {
     },
     selectionsToInput2 (selections) {
       console.log('选择的数据',selections)
-      this.basicForm.factory = selections[0].manufactureName
+      this.basicForm.manufacturerId = selections[0].code
+    },
+    acceptFourClass (selections) {
+      console.log('父组件收到的数据',selections)
+      this.testOptions.push(selections)
+      console.log('收到的数据转成数组', this.testOptions)
+      this.basicForm.classifyId = selections.id
+      this.getTreeDetails(selections.id)
+    },
+    chooseFourClass() {
+      console.log('1111')
+      this.$refs.fourTag.blur()
+      this.$refs.fourClass.init()
     },
     // 显示列表
     test01() {

+ 2 - 2
src/views/material/requisition/index.vue

@@ -48,12 +48,12 @@
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导入</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导出</el-button>
-      </el-col>
+      </el-col> -->
       <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>批量提交</el-button>
       </el-col>

+ 6 - 2
vue.config.js

@@ -37,8 +37,12 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/ruoyi-admin`, //生产
-        // target: `http://172.16.63.202:8000/drp-admin`, //测试
-        target: `http://172.16.13.47:8000/drp-admin`, //本地
+        // target: `http://172.16.100.107:8080/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
+        // 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`, //石杨本地
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''