Преглед на файлове

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

002201 преди 2 години
родител
ревизия
a7609dc4c7

+ 16 - 9
src/components/Refers/refers.vue

@@ -18,14 +18,11 @@
           </el-header>
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
-              @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)" style="width: 100%">
-              <el-table-column type="selection" header-align="center" align="center" width="50">
-              </el-table-column>
-              <el-table-column prop="id" header-align="center" align="center" sortable="custom" min-width="90" label="id">
-              </el-table-column>
-              <el-table-column prop="name" header-align="center" align="center" sortable="custom" min-width="90"
-                label="名称">
-              </el-table-column>
+              @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)">
+              <el-table-column type="selection" header-align="center" align="center" width="50"/>
+              <el-table-column prop="id" header-align="center" align="center" min-width="90" label="id"/>
+              <el-table-column prop="name" header-align="center" align="center" min-width="90" label="名称"/>
+              <el-table-column v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
             </el-table>
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
               :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
@@ -57,6 +54,7 @@ export default {
       idKey: "id", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
       dataList: [],
       total: 0,
+      orgName: false,
       orders: [],
       loading: false,
       visible: false,
@@ -94,6 +92,11 @@ export default {
         console.log('res', res)
         this.dataList = res.rows;
         this.total = res.total
+        if(res.rows[0].orgName) {
+          this.orgName = true
+        } else {
+          this.orgName = false
+        }
         this.loading = false;
         this.$nextTick(() => {
           this.setSelectRow();
@@ -151,7 +154,7 @@ export default {
   },
 };
 </script>
-<style lang="scss">
+<style lang="scss" scoped>
 .userDialog {
   .el-dialog__body {
     padding: 10px 0px 0px 10px;
@@ -168,4 +171,8 @@ export default {
     }
   }
 }
+::v-deep .el-table__header-wrapper .el-checkbox {
+  // display: none;//设置不成功,页面卡顿
+  visibility: hidden;
+}
 </style>

+ 1 - 4
src/components/popover-select/index.vue

@@ -137,10 +137,7 @@ export default {
         if (code === 200) {
           this.data = rows;
           this.page.total = total;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
+        } 
       } catch (err) {
         //
       } finally {

+ 1636 - 1624
src/views/material/basicFile/details.vue

@@ -10,7 +10,7 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button size="small" @click="handleSave"
-              v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
+                       v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
               保存
             </el-button>
           </el-button-group>
@@ -57,7 +57,8 @@
         <!-- 维护新版本 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本</el-button>
+            <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本
+            </el-button>
           </el-button-group>
         </el-col>
 
@@ -128,7 +129,7 @@
 
                 <!-- 基本信息展示表单 -->
                 <el-form v-if="activeMainTab == 'material'" :inline="true" label-position="right"
-                  :hide-required-asterisk="true" :model="basicData.value">
+                         :hide-required-asterisk="true" :model="basicData.value">
 
                   <el-row :gutter="10">
                     <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
@@ -140,14 +141,14 @@
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
                           <el-checkbox :label="f.name" name="type" v-model="basicData.value[f.prop]" true-label="0"
-                            false-label="2" :disabled="handleJudge(f)">
+                                       false-label="2" :disabled="handleJudge(f)">
                           </el-checkbox>
                         </el-form-item>
 
                         <!-- 下拉框   -->
                         <el-form-item v-else-if="f.attribute == 'select'"
-                          :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
-                          :prop="f.apiUrl ? `${f.prop}Name` : f.prop">
+                                      :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
+                                      :prop="f.apiUrl ? `${f.prop}Name` : f.prop">
                           <!-- :rules="[{ required: f.required, message: `请选择${f.name}`, trigger: 'change' }]" -->
 
                           <template slot="label">
@@ -161,16 +162,16 @@
 
                           <!-- 参照 -->
                           <el-select v-if="f.apiUrl" v-model="basicData.value[`${f.prop}Name`]" placeholder="请选择"
-                            :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
-                            @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
+                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)"
+                                     @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
                             <div slot="empty"></div>
                           </el-select>
 
                           <!-- 字典 -->
                           <el-select v-if="f.dictId" v-model="basicData.value[f.prop]" placeholder="请选择"
-                            :key="basicData.value[f.prop]" :disabled="handleJudge(f)">
+                                     :key="basicData.value[f.prop]" :disabled="handleJudge(f)">
                             <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
-                              :value="d.dictValue">
+                                       :value="d.dictValue">
                             </el-option>
 
                           </el-select>
@@ -198,7 +199,7 @@
                           </template>
 
                           <el-input size="small" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
-                            :readonly="handleJudge(f)">
+                                    :readonly="handleJudge(f)">
                           </el-input>
                         </el-form-item>
 
@@ -210,16 +211,16 @@
 
                 <!-- 其他展示为列表 -->
                 <el-table v-else :data="mainMsg.value" @cell-dblclick="handleMaindbClick"
-                  @selection-change="handleMainChange">
-                  <el-table-column type="selection" width="55" />
-                  <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center" />
+                          @selection-change="handleMainChange">
+                  <el-table-column type="selection" width="55"/>
+                  <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center"/>
                   <el-table-column v-for="m in  mainMsg.form" v-if="m.show" :label="m.name" align="center"
-                    :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
+                                   :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop" show-overflow-tooltip>
                     <template slot-scope="scope">
                       {{ m.attribute == 'select' ? scope.row[`${m.prop}Name`] :
-                        (m.attribute == 'checkbox' ?
-                          (scope.row[m.prop] == '0' ? '√' : '')
-                          : scope.row[m.prop])
+                      (m.attribute == 'checkbox' ?
+                      (scope.row[m.prop] == '0' ? '√' : '')
+                      : scope.row[m.prop])
                       }}
                     </template>
                   </el-table-column>
@@ -230,12 +231,13 @@
               <!-- 副信息 -->
               <div class="md-vice">
 
-                <dr-tabs v-if="activeMainTab == 'material'" :tabList="basicMessage" :handleTabClick="handleViceTabClick">
+                <dr-tabs v-if="activeMainTab == 'material'" :tabList="basicMessage"
+                         :handleTabClick="handleViceTabClick">
 
                   <template #tabContent>
 
                     <el-form v-if="activeViceTab == 'material_medcine'" :inline="true" label-position="right"
-                      :hide-required-asterisk="true" :model="medcineData.value" class="md-vice-content">
+                             :hide-required-asterisk="true" :model="medcineData.value" class="md-vice-content">
 
                       <el-row :gutter="10">
                         <el-col :span="8" v-for="m in medcineData.form" style="text-align: right;">
@@ -246,8 +248,8 @@
                             <!-- 多选框 -->
                             <el-form-item v-if="m.attribute == 'checkbox'">
                               <el-checkbox :label="m.name" name="type" v-model="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                true-label="0" false-label="2">
+                                           :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                           true-label="0" false-label="2">
                               </el-checkbox>
                             </el-form-item>
 
@@ -256,9 +258,9 @@
 
                               <!-- 参照弹窗 -->
                               <el-select v-if="m.apiUrl" v-model="medcineData.value[`${m.prop}Name`]" placeholder="请选择"
-                                :key="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
+                                         :key="medcineData.value[m.prop]"
+                                         :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                         @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
                                 <!-- <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue":label="d.dictLabel" :value="d.dictValue"></el-option> -->
 
@@ -267,12 +269,12 @@
 
                               <!-- 下拉选择 -->
                               <el-select v-else v-model="medcineData.value[m.prop]" placeholder="请选择"
-                                :key="medcineData.value[m.prop]"
-                                :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
-                                @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
+                                         :key="medcineData.value[m.prop]"
+                                         :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
+                                         @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
 
                                 <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue"
-                                  :label="d.dictLabel" :value="d.dictValue">
+                                           :label="d.dictLabel" :value="d.dictValue">
                                 </el-option>
 
                               </el-select>
@@ -287,7 +289,7 @@
                             <!-- 文本、数字、textarae -->
                             <el-form-item v-else :label="m.name">
                               <el-input size="small" v-model="medcineData.value[m.prop]" :type="m.attribute || 'text'"
-                                :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
+                                        :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
                               </el-input>
                             </el-form-item>
                           </template>
@@ -301,15 +303,16 @@
 
                     <!-- 辅计量 -->
                     <el-table v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
-                      class="material-table">
-                      <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55" align="center" />
+                              class="material-table">
+                      <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55"
+                                       align="center"/>
                       <el-table-column v-for="v in  unitDetails.form" v-if="v.show" :label="v.name" align="center"
-                        :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
+                                       :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
                           {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
-                            (v.attribute == 'checkbox' ?
-                              (scope.row[v.prop] == '0' ? '√' : '')
-                              : scope.row[v.prop])
+                          (v.attribute == 'checkbox' ?
+                          (scope.row[v.prop] == '0' ? '√' : '')
+                          : scope.row[v.prop])
                           }}
                         </template>
                       </el-table-column>
@@ -317,16 +320,16 @@
 
                     <!-- 辅助属性 -->
                     <el-table v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
-                      class="material-table">
+                              class="material-table">
                       <el-table-column type="index" v-if="propertyDetail.form.length" label="序号" width="55"
-                        align="center" />
+                                       align="center"/>
                       <el-table-column v-for="v in  propertyDetail.form" v-if="v.show" :label="v.name" align="center"
-                        :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
+                                       :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
                         <template slot-scope="scope">
                           {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
-                            (v.attribute == 'checkbox' ?
-                              (scope.row[v.prop] == '0' ? '√' : '')
-                              : scope.row[v.prop])
+                          (v.attribute == 'checkbox' ?
+                          (scope.row[v.prop] == '0' ? '√' : '')
+                          : scope.row[v.prop])
                           }}
                         </template>
                       </el-table-column>
@@ -368,19 +371,22 @@
 
     <!-- 维护物料类别弹窗 -->
     <el-dialog title="物料类别维护" :visible.sync="materialType.show" :before-close="handleCloseTypeDetails"
-      :close-on-press-escape="false" :close-on-click-modal="false" width="80%" center class="materialType">
+               :close-on-press-escape="false" :close-on-click-modal="false" width="80%" center class="materialType">
 
       <!-- 操作按钮 -->
       <el-row :gutter="10" class="mb10">
         <el-col :span="1.5">
           <el-button-group>
-            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行</el-button>
-            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行</el-button>
+            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行
+            </el-button>
+            <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行
+            </el-button>
           </el-button-group>
           <el-button-group>
             <el-button size="small" @click="handleMaterialTypeRow('edit')" v-hasPermi="['system:material:add']">{{
               materialType.isEdit
-              ? '保存' : '修改' }}</el-button>
+              ? '保存' : '修改' }}
+            </el-button>
             <el-button size="small" v-if="materialType.isEdit" @click="handleMaterialTypeRow('cancal')">取消</el-button>
             <el-button size="small" @click="handleMaterialTypeRow">刷新</el-button>
           </el-button-group>
@@ -388,21 +394,22 @@
       </el-row>
       <!-- 表格数据 -->
       <el-table :data="materialType.value" stripe style="width: 100%" max-height="350" v-loading="materialType.loading"
-        :key="refer" @selection-change="handleSelectionType">
-        <el-table-column type="selection" width="30" />
-        <el-table-column type="index" width="50" label="序号" />
+                :key="refer" @selection-change="handleSelectionType">
+        <el-table-column type="selection" width="30"/>
+        <el-table-column type="index" width="50" label="序号"/>
         <el-table-column v-for="mt in materialType.form" v-if="mt.show" :label="mt.name" width="180">
 
           <template slot-scope="scope">
             <!-- :prop="mt.prop" -->
             <!-- 多选框 -->
             <el-checkbox size="small" v-if="mt.attribute == 'checkbox'" :disabled="!(materialType.isEdit && mt.edit)"
-              true-label="0" false-label="2" v-model="scope.row[mt.prop]" />
+                         true-label="0" false-label="2" v-model="scope.row[mt.prop]"/>
 
             <!-- 下拉框 / 参照弹窗---- 药品类别编码 scope.row[`${mt.prop}Name`] -->
             <el-select size="small" v-else-if="mt.attribute == 'select' && mt.apiUrl" placeholder="请选择"
-              :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]"
-              @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
+                       :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]"
+                       :key="scope.row[mt.prop]"
+                       @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
               <div slot="empty"></div>
             </el-select>
 
@@ -412,7 +419,7 @@
                 :value="d.dictValue"></el-option></el-select> -->
 
             <!-- 其他类型 -->
-            <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)" />
+            <el-input v-else size="small" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)"/>
           </template>
 
         </el-table-column>
@@ -432,8 +439,8 @@
 
     <!-- 其他页签的操作 -->
     <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">
+               :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
+               class="otherDialog">
       <div v-loading="otherDeatils.loading">
         <!-- 其他标签页操作  修改、删除 -->
         <el-row :gutter="10" class="mb10">
@@ -476,7 +483,7 @@
 
               <!-- 展示表单 -->
               <el-form :inline="true" label-position="right" :key="refer" :hide-required-asterisk="true"
-                :model="otherDeatils.value">
+                       :model="otherDeatils.value">
 
                 <el-row :gutter="10">
                   <el-col :span="8" v-for="f in otherDeatils.form" style="text-align: right;">
@@ -484,7 +491,7 @@
                       <!-- 多选框 -->
                       <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]" true-label="0"
-                          false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
+                                     false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
                         </el-checkbox>
                       </el-form-item>
 
@@ -492,17 +499,17 @@
                       <el-form-item v-else-if="f.attribute == 'select'" :label="f.name">
 
                         <el-select v-if="f.apiUrl" v-model="otherDeatils.value[`${f.prop}Name`]" placeholder="请选择"
-                          :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
-                          @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
+                                   :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
+                                   @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
 
                           <div slot="empty"></div>
                         </el-select>
 
                         <!-- 字典-下拉 -->
                         <el-select v-if="f.dictId" v-model="otherDeatils.value[f.prop]" placeholder="请选择"
-                          :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
+                                   :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
                           <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
-                            :value="d.dictValue">
+                                     :value="d.dictValue">
                           </el-option>
                         </el-select>
 
@@ -517,7 +524,7 @@
                       <!--attribute 文本 数字 文本域 为null -->
                       <el-form-item v-else :label="f.name">
                         <el-input size="small" v-model="otherDeatils.value[f.prop]" :type="f.attribute || 'text'"
-                          :readonly="!(otherDeatils.isEdit && f.edit)">
+                                  :readonly="!(otherDeatils.isEdit && f.edit)">
                         </el-input>
                       </el-form-item>
                     </template>
@@ -556,30 +563,30 @@
 
     <!-- 参照弹窗 -->
     <el-dialog :title="MoreDataDialog.msg.name" :visible.sync="MoreDataDialog.show" width="70%" class="MoreDataDialog"
-      :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
+               :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
       <div>
         <el-row>
           <el-col :span="1.5">
-            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer" />
+            <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer"/>
           </el-col>
         </el-row>
         <!-- 树形 -->
         <el-tree class="referTree" v-loading="MoreDataDialog.loading" v-if="MoreDataDialog.type == 'tree'"
-          :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
-          :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
+                 :data="MoreDataDialog.list" @node-click="handleNodeClick" :key="refer"
+                 :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps" node-key="id">
         </el-tree>
         <!-- queryMedcineItemDrug -->
         <!-- 列表 -->
         <div v-else>
           <el-table :data="MoreDataDialog.list" v-loading="MoreDataDialog.loading" style="width: 100%"
-            @row-click="handleCurentRow" highlight-current-row>
-            <el-table-column type="index" label="序号" width="55" align="center" />
-            <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name" />
+                    @row-click="handleCurentRow" highlight-current-row>
+            <el-table-column type="index" label="序号" width="55" align="center"/>
+            <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name"/>
           </el-table>
 
           <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-            :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
-            layout="total, sizes, prev, pager, next, jumper" :total="queryParams.total">
+                         :current-page="queryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
+                         layout="total, sizes, prev, pager, next, jumper" :total="queryParams.total">
           </el-pagination>
         </div>
 
@@ -595,1746 +602,1751 @@
 </template>
 
 <script>
-import drTabs from '../components/dr-tabs.vue';
-import detailsTabs from '../config/detailsTabs';
-import materialApi from '@/api/material/basic';
-import { getDicts as getDicts } from '@/api/system/dict/data'
-import arrayUtils from '../tools/arrayUtils';
-
-export default {
-  name: 'material-details',
-  // dicts: [],
-  components: {
-    drTabs
-  },
-  data() {
-    return {
-      count: 1,
-      refer: 1,
-      loading: false,
-      // 维护新版本
-      maintainNewVersion: false,
-      // 详情固定标签页
-      detailsTabs,
-      defaultProps: {
-        children: 'childrens',
-        label: 'name'
-      },
-      drugProps: {
-        children: 'childrens',
-        label: function (data, node) {
-          return data.code + ' ' + data.name
-        }
-        // 'name'
-      },
-      // 标签页当前激活状态
-      activeMainTab: 'material',
-      activeViceTab: 'material_medcine',
-      materialId: this.$route.params.id,
-      collapseActive: ['basic', '',],
-      // 修改按钮 是否激活
-      updateButtonGroup: false,
-      // 基本信息下的页签
-      basicMessage: [
-        {
-          label: '医药行业',
-          code: 'material_medcine',
-          isShow: true,
+  import drTabs from '../components/dr-tabs.vue';
+  import detailsTabs from '../config/detailsTabs';
+  import materialApi from '@/api/material/basic';
+  import {getDicts as getDicts} from '@/api/system/dict/data'
+  import arrayUtils from '../tools/arrayUtils';
+
+  export default {
+    name: 'material-details',
+    // dicts: [],
+    components: {
+      drTabs
+    },
+    data() {
+      return {
+        count: 1,
+        refer: 1,
+        loading: false,
+        // 维护新版本
+        maintainNewVersion: false,
+        // 详情固定标签页
+        detailsTabs,
+        defaultProps: {
+          children: 'childrens',
+          label: 'name'
         },
-        {
-          label: '辅计量管理',
-          code: 'material_unit',
-          isShow: true,
+        drugProps: {
+          children: 'childrens',
+          label: function (data, node) {
+            return data.code + ' ' + data.name
+          }
+          // 'name'
         },
-        {
-          label: '辅助属性',
-          code: 'material_property',
-          isShow: true,
+        // 标签页当前激活状态
+        activeMainTab: 'material',
+        activeViceTab: 'material_medcine',
+        materialId: this.$route.params.id,
+        collapseActive: ['basic', '',],
+        // 修改按钮 是否激活
+        updateButtonGroup: false,
+        // 基本信息下的页签
+        basicMessage: [
+          {
+            label: '医药行业',
+            code: 'material_medcine',
+            isShow: true,
+          },
+          {
+            label: '辅计量管理',
+            code: 'material_unit',
+            isShow: true,
+          },
+          {
+            label: '辅助属性',
+            code: 'material_property',
+            isShow: true,
+          },
+        ],
+        // 基本信息
+        basicData: {
+          value: {},
+          form: []
+        },
+        // 物料类别
+        materialType: {
+          show: false,
+          value: [],
+          form: [],
+          loading: false,
+          checkedList: [],
+          isEdit: false,
+        },
+        // 医药行业
+        medcineData: {
+          value: {},
+          form: []
+        },
+        // 辅助属性
+        propertyDetail: {
+          value: [],
+          form: []
+        },
+        // 辅计量管理
+        unitDetails: {
+          value: [],
+          form: []
+        },
+        // 主标签信息
+        mainMsg: {
+          form: [],
+          value: [],
+          checkedList: [],
+        },
+        // 副信息
+        viceMsg: {
+          form: [],
+          value: [],
+        },
+        // 操作弹窗
+        optionDialog: {
+          show: false,
+          op: ''
+        },
+        // 其他页签操作弹窗
+        otherDeatils: {
+          loading: false,
+          show: false,
+          title: '',
+          // 查询关键字-物料id
+          queryKey: '',
+          isEdit: false,
+          // 详情表头
+          from: [],
+          // 详情值
+          value: {}
+        },
+        // 编辑-更多数据展示弹窗_ 参照
+        MoreDataDialog: {
+          loading: false,
+          show: false,
+          // 查询关键字
+          key: '',
+          // 需要查看参照的表单头信息
+          msg: '',
+          type: 'table',
+          // 查询出的参照数据
+          list: [],
+          // 查询出的参照表头
+          form: [],
+          // 选中的参照数据
+          value: '',
+          // 参照最后应该赋值的地方
+          target: {
+            name: '',
+            prop: ''
+          }
+        },
+        // 参照分页参数
+        queryParams: {
+          pageNum: 1,
+          total: 0,
+          pageSize: 10,
         },
-      ],
-      // 基本信息
-      basicData: {
-        value: {},
-        form: []
-      },
-      // 物料类别
-      materialType: {
-        show: false,
-        value: [],
-        form: [],
-        loading: false,
-        checkedList: [],
-        isEdit: false,
-      },
-      // 医药行业
-      medcineData: {
-        value: {},
-        form: []
-      },
-      // 辅助属性
-      propertyDetail: {
-        value: [],
-        form: []
-      },
-      // 辅计量管理
-      unitDetails: {
-        value: [],
-        form: []
-      },
-      // 主标签信息
-      mainMsg: {
-        form: [],
-        value: [],
-        checkedList: [],
-      },
-      // 副信息
-      viceMsg: {
-        form: [],
-        value: [],
-      },
-      // 操作弹窗
-      optionDialog: {
-        show: false,
-        op: ''
-      },
-      // 其他页签操作弹窗
-      otherDeatils: {
-        loading: false,
-        show: false,
-        title: '',
-        // 查询关键字-物料id
-        queryKey: '',
-        isEdit: false,
-        // 详情表头
-        from: [],
-        // 详情值
-        value: {}
-      },
-      // 编辑-更多数据展示弹窗_ 参照
-      MoreDataDialog: {
-        loading: false,
-        show: false,
-        // 查询关键字
-        key: '',
-        // 需要查看参照的表单头信息
-        msg: '',
-        type: 'table',
-        // 查询出的参照数据
-        list: [],
-        // 查询出的参照表头
-        form: [],
-        // 选中的参照数据
-        value: '',
-        // 参照最后应该赋值的地方
-        target: {
-          name: '',
-          prop: ''
-        }
-      },
-      // 参照分页参数
-      queryParams: {
-        pageNum: 1,
-        total: 0,
-        pageSize: 10,
-      },
-    }
-  },
-
-  methods: {
-    // 判断效期管理
-    handleJudge(attribute) {
-      // 维护新版本才能修改:批号及库存状态管理(isInventoryStatus)、
-      if (attribute.prop == 'isInventoryStatus') {
-        return !(this.maintainNewVersion && attribute.edit);
-      }
-      // 序列号管理(serialNoManager):维护新版本 && 批号及库存状态管理
-      else if (attribute.prop == 'serialNoManager') {
-
-        if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['serialNoManager'] = '2';
-
-        return !(this.maintainNewVersion && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
-
-      }
-      // 批号及库存状态管理(isInventoryStatus) 控制 效期管理是否展示(expiryDateManagerment)
-      else if (attribute.prop == 'expiryDateManagerment') {
-
-        if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['expiryDateManagerment'] = '2';
-
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
-      }
-      // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
-      // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
-
-      else if (attribute.prop == 'expiryUnitId'
-        || attribute.prop == 'usefulLife'
-        || attribute.prop == 'usefulLifeUnitId'
-        || attribute.prop == 'recentWarningPeriod'
-      ) {
-        if (this.basicData.value['expiryDateManagerment'] == '2') {
-
-          this.basicData.value['expiryUnitId'] = '';
-          this.basicData.value['usefulLife'] = '';
-          this.basicData.value['usefulLifeUnitId'] = '';
-          this.basicData.value['recentWarningPeriod'] = '';
-        }
-
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
-      }
-      // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
-      else if (attribute.prop == 'businessDepartment') {
-        return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
-      }
-      else {
-        // 其他属性是否可编辑
-        return !(this.updateButtonGroup && attribute.edit);
-      }
-
-
-    },
-    // 返回
-    handleBack() {
-      this.$store.dispatch('tagsView/delView', this.$route)
-      this.$router.go(-1)
-      // this.$router.push({
-      //   path: `/basic/material/basicFile`,
-      // });
-
-    },
-    // 附件按钮
-    handleFile() {
-      console.log('附件按钮');
-    },
-    // 改变分页情况
-    handleChangePage(type) {
-      switch (type) {
-        case 'first':
-          console.log('第一页');
-          break;
-        case 'pre':
-          console.log('上一页');
-          break;
-        case 'next':
-          console.log('下一页');
-          break;
-        case 'end':
-          console.log('最后页');
-          break;
       }
     },
-    // 切换主信息标签
-    handleMainTabClick(e) {
 
-      this.activeMainTab = detailsTabs[e.index].code;
+    methods: {
+      // 判断效期管理
+      handleJudge(attribute) {
+        // 维护新版本才能修改:批号及库存状态管理(isInventoryStatus)、
+        if (attribute.prop == 'isInventoryStatus') {
+          return !(this.maintainNewVersion && attribute.edit);
+        }
+        // 序列号管理(serialNoManager):维护新版本 && 批号及库存状态管理
+        else if (attribute.prop == 'serialNoManager') {
 
-      this.collapseActive.splice(1, 1, this.activeMainTab);
-      console.log(this.collapseActive, 'this.collapseActive');
+          if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['serialNoManager'] = '2';
 
-      this.handleOtherListRefresh();
+          return !(this.maintainNewVersion && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
 
-    },
-    // 切换副表信息
-    handleViceTabClick(e) {
-      console.log(this.basicMessage[e.index], '切换标签');
-      this.activeViceTab = this.basicMessage[e.index].code;
+        }
+        // 批号及库存状态管理(isInventoryStatus) 控制 效期管理是否展示(expiryDateManagerment)
+        else if (attribute.prop == 'expiryDateManagerment') {
 
-      switch (this.activeViceTab) {
+          if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['expiryDateManagerment'] = '2';
 
-        // 医药行业
-        case 'material_medcine':
-          this.getTagList('material_medcine', (form) => {
-            this.medcineData.form = form;
-            this.getMedcineDetails(this.materialId, 'material_medcine');
-          })
-          break;
-        // 辅计量管理
-        case 'material_unit':
-          this.getTagList('material_unit', (form) => {
-            console.log(form, 'form');
-            this.unitDetails.form = form;
-            this.getUnitList(this.materialId);
-          });
-          break;
-        // 辅助属性
-        case 'material_property':
-          this.getTagList('material_property', (form) => {
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
+        }
+          // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
+        // expiryUnitId 效期单位  usefulLife 有效期 usefulLifeUnitId 有效期至单位  "recentWarningPeriod" 近效期预警天数
+
+        else if (attribute.prop == 'expiryUnitId'
+          || attribute.prop == 'usefulLife'
+          || attribute.prop == 'usefulLifeUnitId'
+          || attribute.prop == 'recentWarningPeriod'
+        ) {
+          if (this.basicData.value['expiryDateManagerment'] == '2') {
+
+            this.basicData.value['expiryUnitId'] = '';
+            this.basicData.value['usefulLife'] = '';
+            this.basicData.value['usefulLifeUnitId'] = '';
+            this.basicData.value['recentWarningPeriod'] = '';
+          }
 
-            this.propertyDetail.form = form;
-            this.getPropertyList(this.materialId);
-          });
-          break;
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
+        }
+        // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+        else if (attribute.prop == 'businessDepartment') {
+          return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
+        } else {
+          // 其他属性是否可编辑
+          return !(this.updateButtonGroup && attribute.edit);
+        }
 
-        default:
-          break;
-      }
-    },
-    // 主标签页 列表双击
-    handleMaindbClick(e) {
-      console.log(e, '主标签页 列表双击');
-      this.otherDeatils.queryKey = e.id;
-      this.otherDeatils.show = true;
-      let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
-      console.log(activeTab, 'activeTab');
-      this.otherDeatils.title = activeTab.label;
-
-      this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
-    },
-    // 主页签 列表数据选择
-    handleMainChange(e) {
-      console.log(e, '主页签 列表数据选择');
-      this.mainMsg.checkedList = e;
-    },
-    // 上传图片
-    handleUpImage() {
-      console.log('上传图片');
-    },
-    // 编辑状态下,参照弹窗显示查询数据
-    handleQueryMore(msg, val, target) {
-      this.MoreDataDialog.loading = true;
-      let _this = this;
-      console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
 
-      this.MoreDataDialog.show = true;
-      this.MoreDataDialog.msg = msg;
-      this.MoreDataDialog.target = target;
+      },
+      // 返回
+      handleBack() {
+        this.$store.dispatch('tagsView/delView', this.$route)
+        this.$router.go(-1)
+        // this.$router.push({
+        //   path: `/basic/material/basicFile`,
+        // });
 
-      let par = { param: this.MoreDataDialog.key };
+      },
+      // 附件按钮
+      handleFile() {
+        console.log('附件按钮');
+      },
+      // 改变分页情况
+      handleChangePage(type) {
+        switch (type) {
+          case 'first':
+            console.log('第一页');
+            break;
+          case 'pre':
+            console.log('上一页');
+            break;
+          case 'next':
+            console.log('下一页');
+            break;
+          case 'end':
+            console.log('最后页');
+            break;
+        }
+      },
+      // 切换主信息标签
+      handleMainTabClick(e) {
 
-      this[target.name].form.map(t => {
+        this.activeMainTab = detailsTabs[e.index].code;
 
-        if (t.relevance && t.relevance != '') {
+        this.collapseActive.splice(1, 1, this.activeMainTab);
+        console.log(this.collapseActive, 'this.collapseActive');
 
-          let reList = t.relevance.split(',');
-          console.log(reList, 'reList-------------------');
-          reList.forEach(i => {
-            par[i] = this.basicData.value[i]
-          })
-          console.log(par, 'par/////////////////////////');
-        }
-      })
+        this.handleOtherListRefresh();
 
-      this.getExecuteMethods(msg.apiUrl, par, (data) => {
+      },
+      // 切换副表信息
+      handleViceTabClick(e) {
+        console.log(this.basicMessage[e.index], '切换标签');
+        this.activeViceTab = this.basicMessage[e.index].code;
+
+        switch (this.activeViceTab) {
+
+          // 医药行业
+          case 'material_medcine':
+            this.getTagList('material_medcine', (form) => {
+              this.medcineData.form = form;
+              this.getMedcineDetails(this.materialId, 'material_medcine');
+            })
+            break;
+          // 辅计量管理
+          case 'material_unit':
+            this.getTagList('material_unit', (form) => {
+              console.log(form, 'form');
+              this.unitDetails.form = form;
+              this.getUnitList(this.materialId);
+            });
+            break;
+          // 辅助属性
+          case 'material_property':
+            this.getTagList('material_property', (form) => {
 
-        console.log(data, '编辑状态下,弹窗显示查询数据');
-        _this.MoreDataDialog.type = data.type;
-        if (data.type == 'tree') {
+              this.propertyDetail.form = form;
+              this.getPropertyList(this.materialId);
+            });
+            break;
 
-          _this.MoreDataDialog.list = arrayUtils.filterTreeData(data.tableBody);
-        } else {
-          _this.MoreDataDialog.list = data.tableBody;
-          _this.MoreDataDialog.form = data.tableHeader;
+          default:
+            break;
         }
-        this.refer++;
-        // this.count++;s
-        console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
-        console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
-
+      },
+      // 主标签页 列表双击
+      handleMaindbClick(e) {
+        console.log(e, '主标签页 列表双击');
+        this.otherDeatils.queryKey = e.id;
+        this.otherDeatils.show = true;
+        let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+        console.log(activeTab, 'activeTab');
+        this.otherDeatils.title = activeTab.label;
 
-      })
-    },
-    // 参照改变分页大小
-    handleSizeChange(e) {
-      this.queryParams.pageSize = e;
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
-    },
-    // 参照改变当前页
-    handleCurrentChange(e) {
-      this.queryParams.pageNum = e;
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
-    },
-    // 根据apiUrl获取对应参照的值
-    getExecuteMethods(methodName, param, cb) {
+        this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+      },
+      // 主页签 列表数据选择
+      handleMainChange(e) {
+        console.log(e, '主页签 列表数据选择');
+        this.mainMsg.checkedList = e;
+      },
+      // 上传图片
+      handleUpImage() {
+        console.log('上传图片');
+      },
+      // 编辑状态下,参照弹窗显示查询数据
+      handleQueryMore(msg, val, target) {
+        this.MoreDataDialog.loading = true;
+        let _this = this;
+        console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
 
-      let page = {
-        pageSize: this.queryParams.pageSize,
-        pageNum: this.queryParams.pageNum,
-      }
+        this.MoreDataDialog.show = true;
+        this.MoreDataDialog.msg = msg;
+        this.MoreDataDialog.target = target;
 
-      let params = { ...param };
-      // 业务部门需要  依据默认采购组组织查询
-      if (methodName == "queryOperatingDepptTree") {
+        let par = {param: this.MoreDataDialog.key};
 
-        params['puOrgId'] = this.basicData.value['purchasingOrganization']
+        this[target.name].form.map(t => {
 
-      }
+          if (t.relevance && t.relevance != '') {
 
-      materialApi.executeMethods(methodName, params, page).then(res => {
-        this.MoreDataDialog.loading = false;
-        if (res.code == 200) {
-          this.queryParams.total = res.data.total;
-          cb(res.data);
-        }
-      })
-    },
-    // 获取物料基本信息详细信息
-    getMaterialDetails(id, templateCode) {
-      let _this = this;
-      materialApi.materialDetails(
-        id,
-        templateCode,
-      ).then(res => {
-        this.loading = false;
-        console.log(res, '物料基本信息');
-        let { code, data } = res;
-        if (code == 200) {
-
-          _this.basicData.value = data.data;
-
-          for (const key in data.data) {
-            _this.basicData.value[key] = (typeof data.data[key] === 'number') ? String(data.data[key]) : data.data[key];
+            let reList = t.relevance.split(',');
+            console.log(reList, 'reList-------------------');
+            reList.forEach(i => {
+              par[i] = this.basicData.value[i]
+            })
+            console.log(par, 'par/////////////////////////');
           }
+        })
 
-          // _this.handleAddReferLabel('basicData');
-
-        }
-      })
-    },
-    // 添加参照中的label
-    // handleAddReferLabel(dataName) {
-    //   let _this = this;
-    //   this[dataName].form.map(item => {
-    //     // 查参照
-    //     if (item.apiUrl && item.apiUrl != '') {
-
-    //       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/////////////////////////');
-    //       }
-
-    //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
-    //         let { tableBody } = data;
-
-    //         // 维护物料类别  --- 属于列表中获取label
-    //         if (dataName == 'materialType') {
-
-    //           _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;
-    //           }))
-
-    //         } 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 || '';
-    //         }
-
-    //         // this.count++;
-    //         this.loading = false;
-    //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
-    //       })
-    //     }
-    //   })
-    //   this.materialType.loading = false;
-
-    // },
-
-
-    // 查询财务信息列表
-    getFinanceList(materialId) {
-      materialApi.financeList({ materialId }).then(res => {
-        console.log(res, '查询财务信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询计划信息列表
-    getPlanList(materialId) {
-      materialApi.planList({ materialId }).then(res => {
-        console.log(res, '查询计划信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询成本信息列表
-    getCostList(materialId) {
-      materialApi.costList({ materialId }).then((res) => {
-        console.log(res, '成本信息列表+表头');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询利润中心列表
-    getCenterList(materialId) {
-      materialApi.centerList({ materialId }).then(res => {
-        console.log(res, '查询利润中心信息');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 查询采购中心列表
-    getPurchaseList(materialId) {
-      materialApi.purchaseList({ materialId }).then(res => {
-        console.log(res, '查询采购中心');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
-    // 获取库存信息列表
-    getInventoryList(materialId) {
-      materialApi.inventoryList({ materialId }).then(res => {
-        console.log(res, '获取库存信息列表');
-        if (res.code == 200) {
-          this.mainMsg.value = res.data.tableBody.rows;
-        }
-      })
-    },
+        this.getExecuteMethods(msg.apiUrl, par, (data) => {
 
-    // 查询其他标签页列表详情
-    getOtherListDetails(type, id) {
-      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':
-          this.getFinanceDetails(id);
-          break;
-        // 利润中心信息
-        case 'profit_center':
-          this.getCenterDetails(id);
-          break;
-        // 采购信息
-        case 'material_purchase':
-          this.getPurchaseDetails(id);
-          break;
-        // 库存信息
-        case 'material_inventory':
-          this.getInventoryDetails(id);
-          break;
-        // 计划信息
-        case 'material_plan':
-          this.getPlanDetails(id);
-          break;
-        // 成本信息
-        case 'material_cost':
-          this.getCostDetails(id);
-          break;
-        default: break;
-      }
-    },
-    // 查询财务信息详情
-    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');
-        }
-      })
-    },
-    // 获取利润中心详情
-    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;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取采购详细信息详情
-    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;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
-    // 获取成本信息详情
-    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');
-        }
-      })
-    },
-    // 获取计划信息详情
-    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');
-        }
-      })
-    },
-    // 获取库存详细信息详情
-    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;
-          // _this.handleAddReferLabel('otherDeatils');
-        }
-      })
-    },
+          console.log(data, '编辑状态下,弹窗显示查询数据');
+          _this.MoreDataDialog.type = data.type;
+          if (data.type == 'tree') {
 
+            _this.MoreDataDialog.list = arrayUtils.filterTreeData(data.tableBody);
+          } else {
+            _this.MoreDataDialog.list = data.tableBody;
+            _this.MoreDataDialog.form = data.tableHeader;
+          }
+          this.refer++;
+          // this.count++;s
+          console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
+          console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
 
 
+        })
+      },
+      // 参照改变分页大小
+      handleSizeChange(e) {
+        this.queryParams.pageSize = e;
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+      },
+      // 参照改变当前页
+      handleCurrentChange(e) {
+        this.queryParams.pageNum = e;
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+      },
+      // 根据apiUrl获取对应参照的值
+      getExecuteMethods(methodName, param, cb) {
 
-    /* 二级标签页 */
-    // 根据物料id获取医药行业信息详细信息
-    getMedcineDetails(id) {
-      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');
-          console.log(' _this.medcineData', _this.medcineData, res);
-        }
-      })
-    },
-    // 获取物料辅助属性详细信息+表单列段属性
-    getPropertyDetails(id) {
-      materialApi.propertyDetails(id).then(res => {
-        console.log(res, '物料辅助属性详细信息');
-        if (res.code == 200) {
-          this.propertyDetail.value = res.data.data || [];
-        }
-      })
-    },
-    // 查询物料辅助属性列表+表头字段
-    getPropertyList(materialId) {
-      materialApi.propertyList({ materialId }).then(res => {
-        console.log(res, '料辅助属性列表');
-        if (res.code == 200) {
-          this.propertyDetail.value = res.data.data || [];
+        let page = {
+          pageSize: this.queryParams.pageSize,
+          pageNum: this.queryParams.pageNum,
         }
-      })
-    },
-    //获取辅助计量单位基本信息+表单列段属性
-    getUnitDetails(materialId) {
-      materialApi.unitDetails(materialId).then(res => {
-        console.log(res, '辅助计量单位基本信息');
-        if (res.code == 200) {
-          this.unitDetails.value = res.data.tableBody.rows || [];
-        }
-      })
-    },
-    //获取辅计量管理列表信息
-    getUnitList(materialId) {
-      materialApi.unitList({ materialId }).then(res => {
-        console.log(res, '辅计量管理列表信息');
-        if (res.code == 200) {
-          this.unitDetails.value = res.data.tableBody.rows || [];
-        }
-      })
-    },
-    // 获取物料列表表头
-    getTagList(templateCode, cb) {
-      let _this = this
-      materialApi.tagList({ templateCode }).then(res => {
-        console.log(res, `获取${templateCode}表头`);
-        let dictIdList = [];
-        if (res.code == 200) {
-
-          res.data.map(item => {
-
-            // 查字典
-            if (item.dictId && item.dictId != '') {
-              // 通过接口获取有dict的对应的数据
-              getDicts(item.dictId).then(dict => {
-                if (dict.data) {
-                  item['dictValue'] = dict.data;
-                }
-              })
-            }
 
-          })
-
-          // 动态更改dict
-          // res.data.forEach(item => {
-          //   if (item.dictId) {
-          //     // 请求接口
-          //     dictIdList.push(item.dictId);
-          //   }
-          // })
-          // console.log(dictIdList, 'dictIdList');
-          // _this.dict = [..._this.dict, ...dictIdList];
-          // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
+        let params = {...param};
+        // 业务部门需要  依据默认采购组组织查询
+        if (methodName == "queryOperatingDepptTree") {
 
-          // console.log(_this.dict, 'dicts');
+          params['puOrgId'] = this.basicData.value['purchasingOrganization']
 
-          return cb(res.data);
-        }
-      })
-    },
-    // 根据物料id获取物料类别维护列表
-    getMedcineitemList(materialId) {
-      let _this = this;
-      materialApi.medcineitemList({ materialId }).then(res => {
-        this.materialType.loading = false;
-        console.log(res, '根据物料id获取物料类别维护列表');
-        if (res.code == 200) {
-          _this.materialType.value = res.data.tableBody.rows;
-          // _this.handleAddReferLabel('materialType');
         }
-      })
-    },
 
+        materialApi.executeMethods(methodName, params, page).then(res => {
+          this.MoreDataDialog.loading = false;
+          if (res.code == 200) {
+            this.queryParams.total = res.data.total;
+            cb(res.data);
+          }
+        })
+      },
+      // 获取物料基本信息详细信息
+      getMaterialDetails(id, templateCode) {
+        let _this = this;
+        materialApi.materialDetails(
+          id,
+          templateCode,
+        ).then(res => {
+          this.loading = false;
+          console.log(res, '物料基本信息');
+          let {code, data} = res;
+          if (code == 200) {
 
-    // 新增
-    handleInster() {
-      this.$message({
-        message: '物料只能通过申请审批增加,不能在节点直接录入!',
-        type: 'warning'
-      });
-    },
-    // 除基本信息之后的修改
-    handleOtherEdit() {
-      console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
+            _this.basicData.value = data.data;
 
-      if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
-        this.otherDeatils.show = true;
-        this.otherDeatils.isEdit = true;
-        let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
-        this.otherDeatils.title = activeTab.label;
-        this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
-        console.log(this.otherDeatils, 'this.otherDeatils');
-        // 查询其他标签页列表详情
-        this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+            for (const key in data.data) {
+              _this.basicData.value[key] = (typeof data.data[key] === 'number') ? String(data.data[key]) : data.data[key];
+            }
 
+            // _this.handleAddReferLabel('basicData');
 
-      } else {
-        this.$message({
-          message: '修改请选择单个数据!',
-          type: 'warning'
-        });
-      }
-    },
-    // 其他标签详情弹窗-刷新
-    handleOtherRefresh() {
-      this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
-    },
-    // 其他标签详情弹窗-删除
-    handleOtherDel() {
-      let ids = this.mainMsg.checkedList.map(i => i.id);
+          }
+        })
+      },
+      // 添加参照中的label
+      // handleAddReferLabel(dataName) {
+      //   let _this = this;
+      //   this[dataName].form.map(item => {
+      //     // 查参照
+      //     if (item.apiUrl && item.apiUrl != '') {
+
+      //       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/////////////////////////');
+      //       }
+
+      //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
+      //         let { tableBody } = data;
+
+      //         // 维护物料类别  --- 属于列表中获取label
+      //         if (dataName == 'materialType') {
+
+      //           _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;
+      //           }))
+
+      //         } 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 || '';
+      //         }
+
+      //         // this.count++;
+      //         this.loading = false;
+      //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
+      //       })
+      //     }
+      //   })
+      //   this.materialType.loading = false;
+
+      // },
+
+
+      // 查询财务信息列表
+      getFinanceList(materialId) {
+        materialApi.financeList({materialId}).then(res => {
+          console.log(res, '查询财务信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询计划信息列表
+      getPlanList(materialId) {
+        materialApi.planList({materialId}).then(res => {
+          console.log(res, '查询计划信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询成本信息列表
+      getCostList(materialId) {
+        materialApi.costList({materialId}).then((res) => {
+          console.log(res, '成本信息列表+表头');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询利润中心列表
+      getCenterList(materialId) {
+        materialApi.centerList({materialId}).then(res => {
+          console.log(res, '查询利润中心信息');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 查询采购中心列表
+      getPurchaseList(materialId) {
+        materialApi.purchaseList({materialId}).then(res => {
+          console.log(res, '查询采购中心');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
+      // 获取库存信息列表
+      getInventoryList(materialId) {
+        materialApi.inventoryList({materialId}).then(res => {
+          console.log(res, '获取库存信息列表');
+          if (res.code == 200) {
+            this.mainMsg.value = res.data.tableBody.rows;
+          }
+        })
+      },
 
-      console.log(`${this.activeMainTab}其他标签详情弹窗-删除---id合集`, ids);
-      if (ids.length) {
-        switch (this.activeMainTab) {
+      // 查询其他标签页列表详情
+      getOtherListDetails(type, id) {
+        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':
-            this.handleDelFinance(ids);
+            this.getFinanceDetails(id);
             break;
           // 利润中心信息
           case 'profit_center':
-            this.handledDelCenter(ids);
+            this.getCenterDetails(id);
             break;
           // 采购信息
           case 'material_purchase':
-            this.handledelPurchase(ids);
+            this.getPurchaseDetails(id);
             break;
           // 库存信息
           case 'material_inventory':
-            this.handleDelInventory(ids);
+            this.getInventoryDetails(id);
             break;
           // 计划信息
           case 'material_plan':
-            this.handleDelPlan(ids);
+            this.getPlanDetails(id);
             break;
           // 成本信息
           case 'material_cost':
-            this.handleDelCost(ids);
+            this.getCostDetails(id);
+            break;
           default:
             break;
         }
-      } else {
-        this.$message({
-          message: '请选择需要删除的数据!',
-          type: 'warning'
-        });
-      }
-    },
-    // 其他标签页刷新
-    handleOtherListRefresh() {
-      switch (this.activeMainTab) {
-
-        // 基本信息
-        case 'material':
-          this.getTagList('material', (form) => {
-            this.basicData.form = form;
-            this.getMaterialDetails(this.materialId, 'material');
-          })
-          break;
-        // 财物信息
-        case 'material_finance':
-          this.getTagList('material_finance', (form) => {
-            this.mainMsg.form = form;
-            this.getFinanceList(this.materialId);
-          });
-          break;
-        // 利润中心信息
-        case 'profit_center':
-          this.getTagList('profit_center', (form) => {
-            this.mainMsg.form = form;
-            this.getCenterList(this.materialId);
-          });
-          break;
-        // 采购信息
-        case 'material_purchase':
-          this.getTagList('material_purchase', (form) => {
-            this.mainMsg.form = form;
-            this.getPurchaseList(this.materialId);
-          });
-          break;
-        // 库存信息
-        case 'material_inventory':
-          this.getTagList('material_inventory', (form) => {
-            this.mainMsg.form = form;
-            this.getInventoryList(this.materialId);
-          });
-          break;
-        // 计划信息
-        case 'material_plan':
-          this.getTagList('material_plan', (form) => {
-            this.mainMsg.form = form;
-            this.getPlanList(this.materialId);
-          });
-          break;
-        // 成本信息
-        case 'material_cost':
-          this.getTagList('material_cost', (form) => {
-            this.mainMsg.form = form;
-            this.getCostList(this.materialId);
-          });
-          break;
-        default: break;
-      }
-    },
-    // 修改
-    handleBasicEdit() {
-      console.log('修改基本信息');
-      this.updateButtonGroup = true;
-      // this.count++;
-      //需要禁止点击其他标签
-      // this.detailsTabs = this.detailsTabs.map(item => {
-      //   item['disabled'] = true;
-      //   return item
-      // })
-      console.log(this.detailsTabs, 'this.detailsTabs ');
-
-    },
-    // 删除
-    handleDel() {
-      console.log('删除----基本信息');
+      },
+      // 查询财务信息详情
+      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');
+          }
+        })
+      },
+      // 获取利润中心详情
+      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;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取采购详细信息详情
+      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;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
+      // 获取成本信息详情
+      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');
+          }
+        })
+      },
+      // 获取计划信息详情
+      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');
+          }
+        })
+      },
+      // 获取库存详细信息详情
+      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;
+            // _this.handleAddReferLabel('otherDeatils');
+          }
+        })
+      },
 
-    },
-    // 复制
-    handleCopy() {
-      console.log('复制');
-    },
-    //查询
-    handleQuery() {
 
-    },
-    // 刷新
-    handleRefresh() {
-      console.log('刷新');
-      this.handleRest();
-    },
-    // 过滤
-    handleFilter(e) {
-      console.log(e, '过滤');
-    },
-    filterCondition(type) {
-      return {
-        type
-      }
-    },
-    // 维护物料类别 
-    handleMaterialType() {
-      console.log('维护物料类别');
-      this.materialType.show = true;
-
-      this.materialType.loading = true;
-      this.getTagList('material_medcine_item', (form) => {
-        this.materialType.form = form;
-        this.getMedcineitemList(this.materialId);
-      });
-    },
-    // 启用
-    handleIsInvoke(e) {
-      console.log('启用', this.basicData.value.isEnable);
-
-      let param = {
-        isEnable: this.basicData.value.isEnable == '已启用' ? '2' : '0',
-        id: this.basicData.value.id
-      };
-      console.log(param, '启用/停用param');
-      materialApi.updateEnableMaterial(param).then(res => {
-        console.log(res, '启用/停用');
-        if (res.code == 200) this.handleRefresh();
-      })
-    },
-    // 维护新版本
-    handleNewVersion() {
-      let _this = this;
-      let data = {
-        // 物料编码
-        code: this.basicData.value.code
-      }
-      materialApi.versions(data).then(res => {
-        console.log(res, '维护新版本');
-        if (res.code == 200) {
-          _this.maintainNewVersion = res.data.result;
-        }
-      })
-    },
-    // 维护物料保存
-    handleSaveNewVersion(cb) {
-      let data = {
-        // 物料编码
-        materialCode: this.basicData.value.code,
-        //序列号管理; 2= 否,0= 是	
-        serialNoManager: this.basicData.value.serialNoManager,
-        // 批号及库存状态管理;2=否,0=是
-        isInventoryStatus: this.basicData.value.isInventoryStatus,
-      }
-      materialApi.saveVersions(data).then(res => {
-        console.log(res, '维护物料保存');
-
-        if (res.code == 200) {
-          cb();
-        }
-      })
-        .catch((error) => {
+      /* 二级标签页 */
+      // 根据物料id获取医药行业信息详细信息
+      getMedcineDetails(id) {
+        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');
+            console.log(' _this.medcineData', _this.medcineData, res);
+          }
         })
-    },
-    // 取消保存
-    handleCancel() {
-      console.log('取消保存');
-      this.optionDialog.op = '取消';
-      this.optionDialog.show = true;
-    },
-    // 保存修改
-    handleSave() {
-      console.log('保存修改');
-      this.loading = true;
-      // 普通保存修改
-      this.updateButtonGroup && this.handleSaveMaterial(() => {
-        this.updateButtonGroup = false;
-        this.handleRefresh();
-      });
-
-      // 维护新版本保存修改
-      this.maintainNewVersion && this.handleSaveNewVersion(() => {
-        this.maintainNewVersion = false;
-        this.handleRefresh();
-      })
-    },
-    // 物料类别列表选中
-    handleSelectionType(list) {
-      console.log('物料类别列表选中', list);
-      this.materialType.checkedList = list;
-    },
-    // 物料类别增删行
-    handleMaterialTypeRow(op) {
-      let _this = this;
-      switch (op) {
-        // 增行
-        case 'add':
-          let rowObj = {};
+      },
+      // 获取物料辅助属性详细信息+表单列段属性
+      getPropertyDetails(id) {
+        materialApi.propertyDetails(id).then(res => {
+          console.log(res, '物料辅助属性详细信息');
+          if (res.code == 200) {
+            this.propertyDetail.value = res.data.data || [];
+          }
+        })
+      },
+      // 查询物料辅助属性列表+表头字段
+      getPropertyList(materialId) {
+        materialApi.propertyList({materialId}).then(res => {
+          console.log(res, '料辅助属性列表');
+          if (res.code == 200) {
+            this.propertyDetail.value = res.data.data || [];
+          }
+        })
+      },
+      //获取辅助计量单位基本信息+表单列段属性
+      getUnitDetails(materialId) {
+        materialApi.unitDetails(materialId).then(res => {
+          console.log(res, '辅助计量单位基本信息');
+          if (res.code == 200) {
+            this.unitDetails.value = res.data.tableBody.rows || [];
+          }
+        })
+      },
+      //获取辅计量管理列表信息
+      getUnitList(materialId) {
+        materialApi.unitList({materialId}).then(res => {
+          console.log(res, '辅计量管理列表信息');
+          if (res.code == 200) {
+            this.unitDetails.value = res.data.tableBody.rows || [];
+          }
+        })
+      },
+      // 获取物料列表表头
+      getTagList(templateCode, cb) {
+        let _this = this
+        materialApi.tagList({templateCode}).then(res => {
+          console.log(res, `获取${templateCode}表头`);
+          let dictIdList = [];
+          if (res.code == 200) {
+
+            res.data.map(item => {
+
+              // 查字典
+              if (item.dictId && item.dictId != '') {
+                // 通过接口获取有dict的对应的数据
+                getDicts(item.dictId).then(dict => {
+                  if (dict.data) {
+                    item['dictValue'] = dict.data;
+                  }
+                })
+              }
 
-          for (const key in _this.materialType.value[0]) {
-            if (Object.hasOwnProperty.call(_this.materialType.value[0], key)) {
+            })
 
-              rowObj[key] = '';
+            // 动态更改dict
+            // res.data.forEach(item => {
+            //   if (item.dictId) {
+            //     // 请求接口
+            //     dictIdList.push(item.dictId);
+            //   }
+            // })
+            // console.log(dictIdList, 'dictIdList');
+            // _this.dict = [..._this.dict, ...dictIdList];
+            // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
 
-            }
+            // console.log(_this.dict, 'dicts');
+
+            return cb(res.data);
           }
-          rowObj['insertId'] = new Date().getTime();
-          this.materialType.value.push(rowObj);
-          console.log(this.materialType.value, '物料类别增行rowObj后');
-
-          break;
-        // 删行
-        case 'del':
-          console.log('物料类别删行', _this.materialType.checkedList);
-          if (_this.materialType.checkedList.length) {
-            _this.materialType.checkedList.map(c => {
-              _this.materialType.value = _this.materialType.value.filter(m => {
-                if (m.id && m.id != '' && m.id != c.id) {
-                  return m;
-                } else if (m.insertId && m.insertId != '' && m.insertId != c.insertId) {
-                  return m
-                }
-              })
+        })
+      },
+      // 根据物料id获取物料类别维护列表
+      getMedcineitemList(materialId) {
+        let _this = this;
+        materialApi.medcineitemList({materialId}).then(res => {
+          this.materialType.loading = false;
+          console.log(res, '根据物料id获取物料类别维护列表');
+          if (res.code == 200) {
+            _this.materialType.value = res.data.tableBody.rows;
+            // _this.handleAddReferLabel('materialType');
+          }
+        })
+      },
+
+
+      // 新增
+      handleInster() {
+        this.$message({
+          message: '物料只能通过申请审批增加,不能在节点直接录入!',
+          type: 'warning'
+        });
+      },
+      // 除基本信息之后的修改
+      handleOtherEdit() {
+        console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
+
+        if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
+          this.otherDeatils.show = true;
+          this.otherDeatils.isEdit = true;
+          let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+          this.otherDeatils.title = activeTab.label;
+          this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
+          console.log(this.otherDeatils, 'this.otherDeatils');
+          // 查询其他标签页列表详情
+          this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
+
+
+        } else {
+          this.$message({
+            message: '修改请选择单个数据!',
+            type: 'warning'
+          });
+        }
+      },
+      // 其他标签详情弹窗-刷新
+      handleOtherRefresh() {
+        this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
+      },
+      // 其他标签详情弹窗-删除
+      handleOtherDel() {
+        let ids = this.mainMsg.checkedList.map(i => i.id);
+
+        console.log(`${this.activeMainTab}其他标签详情弹窗-删除---id合集`, ids);
+        if (ids.length) {
+          switch (this.activeMainTab) {
+            // 财物信息
+            case 'material_finance':
+              this.handleDelFinance(ids);
+              break;
+            // 利润中心信息
+            case 'profit_center':
+              this.handledDelCenter(ids);
+              break;
+            // 采购信息
+            case 'material_purchase':
+              this.handledelPurchase(ids);
+              break;
+            // 库存信息
+            case 'material_inventory':
+              this.handleDelInventory(ids);
+              break;
+            // 计划信息
+            case 'material_plan':
+              this.handleDelPlan(ids);
+              break;
+            // 成本信息
+            case 'material_cost':
+              this.handleDelCost(ids);
+            default:
+              break;
+          }
+        } else {
+          this.$message({
+            message: '请选择需要删除的数据!',
+            type: 'warning'
+          });
+        }
+      },
+      // 其他标签页刷新
+      handleOtherListRefresh() {
+        switch (this.activeMainTab) {
+
+          // 基本信息
+          case 'material':
+            this.getTagList('material', (form) => {
+              this.basicData.form = form;
+              this.getMaterialDetails(this.materialId, 'material');
             })
-          } else {
-            this.$message({
-              message: '请选择需要删除的信息!',
-              type: 'warning'
+            break;
+          // 财物信息
+          case 'material_finance':
+            this.getTagList('material_finance', (form) => {
+              this.mainMsg.form = form;
+              this.getFinanceList(this.materialId);
+            });
+            break;
+          // 利润中心信息
+          case 'profit_center':
+            this.getTagList('profit_center', (form) => {
+              this.mainMsg.form = form;
+              this.getCenterList(this.materialId);
+            });
+            break;
+          // 采购信息
+          case 'material_purchase':
+            this.getTagList('material_purchase', (form) => {
+              this.mainMsg.form = form;
+              this.getPurchaseList(this.materialId);
+            });
+            break;
+          // 库存信息
+          case 'material_inventory':
+            this.getTagList('material_inventory', (form) => {
+              this.mainMsg.form = form;
+              this.getInventoryList(this.materialId);
             });
+            break;
+          // 计划信息
+          case 'material_plan':
+            this.getTagList('material_plan', (form) => {
+              this.mainMsg.form = form;
+              this.getPlanList(this.materialId);
+            });
+            break;
+          // 成本信息
+          case 'material_cost':
+            this.getTagList('material_cost', (form) => {
+              this.mainMsg.form = form;
+              this.getCostList(this.materialId);
+            });
+            break;
+          default:
+            break;
+        }
+      },
+      // 修改
+      handleBasicEdit() {
+        console.log('修改基本信息');
+        this.updateButtonGroup = true;
+        // this.count++;
+        //需要禁止点击其他标签
+        // this.detailsTabs = this.detailsTabs.map(item => {
+        //   item['disabled'] = true;
+        //   return item
+        // })
+        console.log(this.detailsTabs, 'this.detailsTabs ');
+
+      },
+      // 删除
+      handleDel() {
+        console.log('删除----基本信息');
+
+      },
+      // 复制
+      handleCopy() {
+        console.log('复制');
+      },
+      //查询
+      handleQuery() {
+
+      },
+      // 刷新
+      handleRefresh() {
+        console.log('刷新');
+        this.handleRest();
+      },
+      // 过滤
+      handleFilter(e) {
+        console.log(e, '过滤');
+      },
+      filterCondition(type) {
+        return {
+          type
+        }
+      },
+      // 维护物料类别
+      handleMaterialType() {
+        console.log('维护物料类别');
+        this.materialType.show = true;
+
+        this.materialType.loading = true;
+        this.getTagList('material_medcine_item', (form) => {
+          this.materialType.form = form;
+          this.getMedcineitemList(this.materialId);
+        });
+      },
+      // 启用
+      handleIsInvoke(e) {
+        console.log('启用', this.basicData.value.isEnable);
+
+        let param = {
+          isEnable: this.basicData.value.isEnable == '已启用' ? '2' : '0',
+          id: this.basicData.value.id
+        };
+        console.log(param, '启用/停用param');
+        materialApi.updateEnableMaterial(param).then(res => {
+          console.log(res, '启用/停用');
+          if (res.code == 200) this.handleRefresh();
+        })
+      },
+      // 维护新版本
+      handleNewVersion() {
+        let _this = this;
+        let data = {
+          // 物料编码
+          code: this.basicData.value.code
+        }
+        materialApi.versions(data).then(res => {
+          console.log(res, '维护新版本');
+          if (res.code == 200) {
+            _this.maintainNewVersion = res.data.result;
+            // 维护版本消息展示 by shiy 2023/05/31
+            if (!res.data.result) {
+              this.$message({
+                message: res.data.msg,
+                type: 'warning'
+              });
+            }
+          }
+        })
+      },
+      // 维护物料保存
+      handleSaveNewVersion(cb) {
+        let data = {
+          // 物料编码
+          materialCode: this.basicData.value.code,
+          //序列号管理; 2= 否,0= 是
+          serialNoManager: this.basicData.value.serialNoManager,
+          // 批号及库存状态管理;2=否,0=是
+          isInventoryStatus: this.basicData.value.isInventoryStatus,
+        }
+        materialApi.saveVersions(data).then(res => {
+          console.log(res, '维护物料保存');
+
+          if (res.code == 200) {
+            cb();
           }
-          break;
-        // 取消
-        case 'cancal':
-          this.materialType.isEdit = false;
-          this.handleMaterialTypeRow();
-          break;
-        // 保存、修改
-        case 'edit':
-
-          if (_this.materialType.isEdit) {
-            // 编辑状态
-            let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
-            console.log(nullList, 'nullList');
-            if (!nullList.length && _this.materialType.value.length) {
-              console.log('物料类别保存', _this.materialType.value);
-              let params = {
-                materialId: _this.materialId,
-                medcineItems: _this.materialType.value
+        })
+          .catch((error) => {
+            this.loading = false;
+          })
+      },
+      // 取消保存
+      handleCancel() {
+        console.log('取消保存');
+        this.optionDialog.op = '取消';
+        this.optionDialog.show = true;
+      },
+      // 保存修改
+      handleSave() {
+        console.log('保存修改');
+        this.loading = true;
+        // 普通保存修改
+        this.updateButtonGroup && this.handleSaveMaterial(() => {
+          this.updateButtonGroup = false;
+          this.handleRefresh();
+        });
+
+        // 维护新版本保存修改
+        this.maintainNewVersion && this.handleSaveNewVersion(() => {
+          this.maintainNewVersion = false;
+          this.handleRefresh();
+        })
+      },
+      // 物料类别列表选中
+      handleSelectionType(list) {
+        console.log('物料类别列表选中', list);
+        this.materialType.checkedList = list;
+      },
+      // 物料类别增删行
+      handleMaterialTypeRow(op) {
+        let _this = this;
+        switch (op) {
+          // 增行
+          case 'add':
+            let rowObj = {};
+
+            for (const key in _this.materialType.value[0]) {
+              if (Object.hasOwnProperty.call(_this.materialType.value[0], key)) {
+
+                rowObj[key] = '';
+
               }
-              materialApi.medcineitemBatchSave(params).then(res => {
-                console.log(res, '保存物料类型');
-                if (res.code == 200) {
-                  _this.materialType.isEdit = false;
-                  _this.handleMaterialTypeRow();
-                }
+            }
+            rowObj['insertId'] = new Date().getTime();
+            this.materialType.value.push(rowObj);
+            console.log(this.materialType.value, '物料类别增行rowObj后');
+
+            break;
+          // 删行
+          case 'del':
+            console.log('物料类别删行', _this.materialType.checkedList);
+            if (_this.materialType.checkedList.length) {
+              _this.materialType.checkedList.map(c => {
+                _this.materialType.value = _this.materialType.value.filter(m => {
+                  if (m.id && m.id != '' && m.id != c.id) {
+                    return m;
+                  } else if (m.insertId && m.insertId != '' && m.insertId != c.insertId) {
+                    return m
+                  }
+                })
               })
-              // 保存
             } else {
               this.$message({
-                message: '不能保存空数据或存在数据为空!',
+                message: '请选择需要删除的信息!',
                 type: 'warning'
               });
             }
-          } else {
-            // 非编辑状态
-            console.log('物料类别修改');
-            this.materialType.isEdit = true;
-          }
-          break;
-        // 刷新
-        default:
-          console.log('物料类别刷新');
-          if (this.materialType.isEdit) {
-            this.$message({
-              message: '请先保存数据!',
-              type: 'warning'
-            })
-          } else {
-            this.materialType.loading = true;
-            this.getTagList('material_medcine_item', (form) => {
-              this.materialType.form = form;
-              this.getMedcineitemList(this.materialId);
-            });
-          }
-          break;
-
-      }
-    },
-    // 物料类别弹窗关闭前
-    handleCloseTypeDetails(done) {
+            break;
+          // 取消
+          case 'cancal':
+            this.materialType.isEdit = false;
+            this.handleMaterialTypeRow();
+            break;
+          // 保存、修改
+          case 'edit':
+
+            if (_this.materialType.isEdit) {
+              // 编辑状态
+              let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
+              console.log(nullList, 'nullList');
+              if (!nullList.length && _this.materialType.value.length) {
+                console.log('物料类别保存', _this.materialType.value);
+                let params = {
+                  materialId: _this.materialId,
+                  medcineItems: _this.materialType.value
+                }
+                materialApi.medcineitemBatchSave(params).then(res => {
+                  console.log(res, '保存物料类型');
+                  if (res.code == 200) {
+                    _this.materialType.isEdit = false;
+                    _this.handleMaterialTypeRow();
+                  }
+                })
+                // 保存
+              } else {
+                this.$message({
+                  message: '不能保存空数据或存在数据为空!',
+                  type: 'warning'
+                });
+              }
+            } else {
+              // 非编辑状态
+              console.log('物料类别修改');
+              this.materialType.isEdit = true;
+            }
+            break;
+          // 刷新
+          default:
+            console.log('物料类别刷新');
+            if (this.materialType.isEdit) {
+              this.$message({
+                message: '请先保存数据!',
+                type: 'warning'
+              })
+            } else {
+              this.materialType.loading = true;
+              this.getTagList('material_medcine_item', (form) => {
+                this.materialType.form = form;
+                this.getMedcineitemList(this.materialId);
+              });
+            }
+            break;
 
-      console.log('物料类别弹窗关闭前');
-      this.materialType.isEdit ? this.$message({
-        message: '请先保存数据!',
-        type: 'warning'
-      }) : done();
+        }
+      },
+      // 物料类别弹窗关闭前
+      handleCloseTypeDetails(done) {
 
-    },
-    // 保存修改并新增
-    handleSaveAdd() {
-      console.log('保存修改并新增');
-    },
-    // 其他标签页弹窗取消操作
-    handleOtherCancel() {
-      console.log('其他标签页弹窗取消操作');
-      this.optionDialog.show = true;
-      this.optionDialog.op = '修改';
-    },
-    // 其他标签页弹窗保存
-    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) {
-      console.log('其他页签详情弹窗关闭事件');
-      // 处于编辑状态
-      if (this.otherDeatils.isEdit) {
-        this.$message({
-          message: '请先退出编辑操作',
+        console.log('物料类别弹窗关闭前');
+        this.materialType.isEdit ? this.$message({
+          message: '请先保存数据!',
           type: 'warning'
-        });
-      } else {
-        done();
-      }
-    },
-    // 折叠菜单改变
-    handleCollapseChange(val) {
-      console.log(val, '折叠菜单改变');
-    },
-    // 更新导入
-    handleUpdateImport() {
-      console.log('更新导入');
-    },
-    // 确认弹窗操作
-    handleComfirmOption() {
-      console.log('确认弹窗操作');
+        }) : done();
 
-      this.optionDialog.show = false;
+      },
+      // 保存修改并新增
+      handleSaveAdd() {
+        console.log('保存修改并新增');
+      },
+      // 其他标签页弹窗取消操作
+      handleOtherCancel() {
+        console.log('其他标签页弹窗取消操作');
+        this.optionDialog.show = true;
+        this.optionDialog.op = '修改';
+      },
+      // 其他标签页弹窗保存
+      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) {
+        console.log('其他页签详情弹窗关闭事件');
+        // 处于编辑状态
+        if (this.otherDeatils.isEdit) {
+          this.$message({
+            message: '请先退出编辑操作',
+            type: 'warning'
+          });
+        } else {
+          done();
+        }
+      },
+      // 折叠菜单改变
+      handleCollapseChange(val) {
+        console.log(val, '折叠菜单改变');
+      },
+      // 更新导入
+      handleUpdateImport() {
+        console.log('更新导入');
+      },
+      // 确认弹窗操作
+      handleComfirmOption() {
+        console.log('确认弹窗操作');
 
-      // 取消基本信息修改
-      if (this.updateButtonGroup) {
-        this.updateButtonGroup = false;
-        this.handleRest();
+        this.optionDialog.show = false;
 
-      }
+        // 取消基本信息修改
+        if (this.updateButtonGroup) {
+          this.updateButtonGroup = false;
+          this.handleRest();
 
-      // 取消其他主页签详情弹窗修改
-      if (this.otherDeatils.isEdit) {
-        this.otherDeatils.isEdit = false;
-        this.handleOtherRefresh();
-      }
+        }
 
-      // 取消维护新版本修改
-      if (this.maintainNewVersion) {
-        console.log('取消维护新版本修改');
-        this.maintainNewVersion = false;
-        this.handleRefresh();
-      }
-    },
-    // 参照弹窗过滤
-    handleFilterRefer() {
-      // this.MoreDataDialog.key =
-      console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
+        // 取消其他主页签详情弹窗修改
+        if (this.otherDeatils.isEdit) {
+          this.otherDeatils.isEdit = false;
+          this.handleOtherRefresh();
+        }
 
-      this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
+        // 取消维护新版本修改
+        if (this.maintainNewVersion) {
+          console.log('取消维护新版本修改');
+          this.maintainNewVersion = false;
+          this.handleRefresh();
+        }
+      },
+      // 参照弹窗过滤
+      handleFilterRefer() {
+        // this.MoreDataDialog.key =
+        console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
 
-    },
-    // 操作提示弹窗关闭
-    handleOptionCancal() {
-      this.optionDialog.show = false;
-      this.otherDeatils.isEdit = true;
-    },
-    // 树形节点选择
-    handleNodeClick(e) {
-      console.log(e, '树形节点选择', this.MoreDataDialog.target);
-      // let node = { ...e, name: e.label }
-      this.MoreDataDialog.value = e;
-    },
+        this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
 
-    // 修改-更多数据表格——选择行
-    handleCurentRow(row) {
-      console.log(row, '修改-更多数据表格——选择行');
-      this.MoreDataDialog.value = row;
-    },
-    // 参照弹窗确认
-    handleConfirmRefer() {
+      },
+      // 操作提示弹窗关闭
+      handleOptionCancal() {
+        this.optionDialog.show = false;
+        this.otherDeatils.isEdit = true;
+      },
+      // 树形节点选择
+      handleNodeClick(e) {
+        console.log(e, '树形节点选择', this.MoreDataDialog.target);
+        // let node = { ...e, name: e.label }
+        this.MoreDataDialog.value = e;
+      },
 
-      let _this = this;
-      console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
+      // 修改-更多数据表格——选择行
+      handleCurentRow(row) {
+        console.log(row, '修改-更多数据表格——选择行');
+        this.MoreDataDialog.value = row;
+      },
+      // 参照弹窗确认
+      handleConfirmRefer() {
 
-      let confirm = true;
+        let _this = this;
+        console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
 
-      if (this.MoreDataDialog.target.name == 'basicData') {
-        //  基本信息
-        this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        let confirm = true;
 
-        this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+        if (this.MoreDataDialog.target.name == 'basicData') {
+          //  基本信息
+          this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
+          this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-        console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
-        // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
-        if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
+          console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
-          this.basicData.value['businessDepartment'] = '';
-          this.basicData.value['businessDepartmentName'] = '';
+          console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
+          // 默认采购组织:purchasingOrganization  业务部门:businessDepartment
+          if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
 
-        }
+            this.basicData.value['businessDepartment'] = '';
+            this.basicData.value['businessDepartmentName'] = '';
 
+          }
 
-      } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
-        //  医药信息
-        this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        } else if (this.MoreDataDialog.target.name == 'medcineData') {
 
-        this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+          //  医药信息
+          this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
+          this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-        console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
+          console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
 
-      } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
+          console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
 
-        //  其他页签
-        this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
+        } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
 
-        this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
+          //  其他页签
+          this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
 
-        console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
+          this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
 
-      } else if (this.MoreDataDialog.target.name == 'materialType') {
+          console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
 
-        // 物料类别
-        console.log('确认时选择的数据', this.MoreDataDialog.value);
-
-        this.materialType.value = this.materialType.value.map(m => {
-          if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
-            (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
-          ) {
-            let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
-            console.log(drug, 'drug------------------------------------');
-            if (drug.length) {
-              _this.$message({
-                message: '不能维护相同的物料类别!',
-                type: 'warning'
-              });
-              confirm = false;
-            } else {
-              m.drugId = _this.MoreDataDialog.value['id'];
-              m.drugCode = _this.MoreDataDialog.value['code'];
-              m.drugName = _this.MoreDataDialog.value['name'];
+        } else if (this.MoreDataDialog.target.name == 'materialType') {
+
+          // 物料类别
+          console.log('确认时选择的数据', this.MoreDataDialog.value);
+
+          this.materialType.value = this.materialType.value.map(m => {
+            if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
+              (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
+            ) {
+              let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
+              console.log(drug, 'drug------------------------------------');
+              if (drug.length) {
+                _this.$message({
+                  message: '不能维护相同的物料类别!',
+                  type: 'warning'
+                });
+                confirm = false;
+              } else {
+                m.drugId = _this.MoreDataDialog.value['id'];
+                m.drugCode = _this.MoreDataDialog.value['code'];
+                m.drugName = _this.MoreDataDialog.value['name'];
+              }
             }
-          }
-          return m;
-        })
+            return m;
+          })
 
-        console.log(this.materialType.value, '修改之后-----this.materialType.value');
-      }
+          console.log(this.materialType.value, '修改之后-----this.materialType.value');
+        }
 
-      if (confirm) {
-        // this.count++;
-        this.refer++;
+        if (confirm) {
+          // this.count++;
+          this.refer++;
+          this.MoreDataDialog.show = false;
+          this.MoreDataDialog.key = '';
+          this.MoreDataDialog.value = {};
+        }
+      },
+      // 取消-关闭参照弹窗
+      handleConcalRefer() {
+        console.log('关闭参照弹窗');
         this.MoreDataDialog.show = false;
         this.MoreDataDialog.key = '';
-        this.MoreDataDialog.value = {};
-      }
-    },
-    // 取消-关闭参照弹窗
-    handleConcalRefer() {
-      console.log('关闭参照弹窗');
-      this.MoreDataDialog.show = false;
-      this.MoreDataDialog.key = '';
-    },
-    // 关闭参照弹窗前
-    handleCloseRefer(done) {
-      this.MoreDataDialog.key = '';
-      done();
-    },
+      },
+      // 关闭参照弹窗前
+      handleCloseRefer(done) {
+        this.MoreDataDialog.key = '';
+        done();
+      },
 
 
-    // 删除利润中心信息
-    handledDelCenter(ids) {
-      console.log('删除利润中心信息');
-      materialApi.delCenter(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除库存信息
-    handleDelInventory(ids) {
-      console.log('删除库存信息');
-      materialApi.delInventory(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除成本信息
-    handleDelCost(ids) {
-      console.log('删除成本信息');
-      materialApi.delCost(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除计划信息
-    handleDelPlan(ids) {
-      console.log('删除计划信息');
-      materialApi.delPlan(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
+      // 删除利润中心信息
+      handledDelCenter(ids) {
+        console.log('删除利润中心信息');
+        materialApi.delCenter(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除库存信息
+      handleDelInventory(ids) {
+        console.log('删除库存信息');
+        materialApi.delInventory(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除成本信息
+      handleDelCost(ids) {
+        console.log('删除成本信息');
+        materialApi.delCost(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除计划信息
+      handleDelPlan(ids) {
+        console.log('删除计划信息');
+        materialApi.delPlan(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
 
-      })
-    },
-    // 删除财物信息
-    handleDelFinance(ids) {
-      console.log('删除财物信息');
-      materialApi.delFinance(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      })
-    },
-    // 删除采购信息
-    handledelPurchase(ids) {
-      console.log('删除采购信息');
-      materialApi.delPurchase(ids).then(res => {
-        if (res.code == 200) {
-          this.handleOtherListRefresh();
-        }
-      });
-    },
+        })
+      },
+      // 删除财物信息
+      handleDelFinance(ids) {
+        console.log('删除财物信息');
+        materialApi.delFinance(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        })
+      },
+      // 删除采购信息
+      handledelPurchase(ids) {
+        console.log('删除采购信息');
+        materialApi.delPurchase(ids).then(res => {
+          if (res.code == 200) {
+            this.handleOtherListRefresh();
+          }
+        });
+      },
 
 
-    // 保存物料以及相关页签
-    handleSaveMaterial(cb) {
-      let param = {
-        ...this.basicData.value,
-        materialMedcine: this.medcineData.value,
-        materialMedcineItem: {}
-      };
-      // diCode
-      param.diCode = param.diCode.replace(/ /g, '');
-      console.log(param, '保存物料以及相关页签param');
-      materialApi.insertMaterialInfo(param).then(res => {
-
-        console.log(res, '保存物料以及相关页签');
-        if (res.code == 200) cb();
-      }).catch((error) => {
-        this.loading = false;
-      })
-    },
-    // 保存财务信息——单个数据
-    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;
-        }
-      })
-    },
+      // 保存物料以及相关页签
+      handleSaveMaterial(cb) {
+        let param = {
+          ...this.basicData.value,
+          materialMedcine: this.medcineData.value,
+          materialMedcineItem: {}
+        };
+        // diCode
+        param.diCode = param.diCode.replace(/ /g, '');
+        console.log(param, '保存物料以及相关页签param');
+        materialApi.insertMaterialInfo(param).then(res => {
+
+          console.log(res, '保存物料以及相关页签');
+          if (res.code == 200) cb();
+        }).catch((error) => {
+          this.loading = false;
+        })
+      },
+      // 保存财务信息——单个数据
+      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;
+          }
+        })
+      },
 
 
-    // 重新加载
-    async handleRest() {
-      this.loading = true;
-      // 基本信息
-      await this.getTagList('material', (form) => {
-        this.basicData.form = form;
-        this.getMaterialDetails(this.materialId, 'material');
-      })
-      // 医疗行业
-      await this.getTagList('material_medcine', (form) => {
-        form.forEach((item) => {
-          this.medcineData.value[item.prop] = ''
+      // 重新加载
+      async handleRest() {
+        this.loading = true;
+        // 基本信息
+        await this.getTagList('material', (form) => {
+          this.basicData.form = form;
+          this.getMaterialDetails(this.materialId, 'material');
+        })
+        // 医疗行业
+        await this.getTagList('material_medcine', (form) => {
+          form.forEach((item) => {
+            this.medcineData.value[item.prop] = ''
+          })
+          this.medcineData.form = form;
+          this.getMedcineDetails(this.materialId, 'material_medcine');
         })
-        this.medcineData.form = form;
-        this.getMedcineDetails(this.materialId, 'material_medcine');
-      })
+
+      },
 
     },
 
-  },
+    watch: {
+      // 监听主标签修改标识,控制其他标签是否禁止点击
+      'updateButtonGroup': function (nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        this.detailsTabs = this.detailsTabs.map(item => {
+          item['disabled'] = nVal;
+          return item;
+        })
+      },
+      'maintainNewVersion': function (nVal, oVal) {
+        console.log(nVal, 'nVal', oVal, 'oVal');
+        this.detailsTabs = this.detailsTabs.map(item => {
+          item['disabled'] = nVal;
+          return item;
+        })
+      },
 
-  watch: {
-    // 监听主标签修改标识,控制其他标签是否禁止点击
-    'updateButtonGroup': function (nVal, oVal) {
-      console.log(nVal, 'nVal', oVal, 'oVal');
-      this.detailsTabs = this.detailsTabs.map(item => {
-        item['disabled'] = nVal;
-        return item;
-      })
-    },
-    'maintainNewVersion': function (nVal, oVal) {
-      console.log(nVal, 'nVal', oVal, 'oVal');
-      this.detailsTabs = this.detailsTabs.map(item => {
-        item['disabled'] = nVal;
-        return item;
-      })
     },
 
-  },
-
-  created() {
-    console.log(this, 'created');
-    // 基本信息
-    this.handleRest();
-    if (window.name === '') {
-      console.log('页面首次被加载')
-      this.$route.query.isEdit && this.handleBasicEdit();
-    } else {
-      console.log('页面被刷新')
-    }
+    created() {
+      console.log(this, 'created');
+      // 基本信息
+      this.handleRest();
+      if (window.name === '') {
+        console.log('页面首次被加载')
+        this.$route.query.isEdit && this.handleBasicEdit();
+      } else {
+        console.log('页面被刷新')
+      }
 
+    }
   }
-}
 </script>
 
 <style lang="scss">
-.material-details {
-  padding: 12px;
-  height: calc(100vh - 158px);
-  box-sizing: border-box;
-
-  .el-card__body {
-    height: calc(100vh - 160px);
-    box-sizing: border-box;
+  .material-details {
     padding: 12px;
-    overflow-y: auto;
-    overflow-x: auto;
+    height: calc(100vh - 158px);
+    box-sizing: border-box;
 
-    .el-select {
-      width: 100%;
+    .el-card__body {
+      height: calc(100vh - 160px);
+      box-sizing: border-box;
+      padding: 12px;
+      overflow-y: auto;
+      overflow-x: auto;
+
+      .el-select {
+        width: 100%;
+      }
     }
-  }
 
-  .md-content {
-    margin-top: 12px;
-    // height: calc(100vh - 260px);
-    height: calc(100vh - 228px);
-    box-sizing: border-box;
+    .md-content {
+      margin-top: 12px;
+      // height: calc(100vh - 260px);
+      height: calc(100vh - 228px);
+      box-sizing: border-box;
 
 
+      .md-basic {
+        overflow: auto;
 
-    .md-basic {
-      overflow: auto;
+        .md-main {
+          // height: calc(100vh - 625px);
+          margin-bottom: 10px;
 
-      .md-main {
-        // height: calc(100vh - 625px);
-        margin-bottom: 10px;
+          .el-table__body {
+            // height: calc(100vh - 300px);
+          }
 
-        .el-table__body {
-          // height: calc(100vh - 300px);
+          .el-form {
+            max-height: 200px;
+            overflow-y: auto;
+            overflow-x: hidden;
+
+            .el-checkbox {
+              padding: 0 58%;
+            }
+          }
         }
 
-        .el-form {
-          max-height: 200px;
+        .md-vice-content {
+          height: 140px;
           overflow-y: auto;
           overflow-x: hidden;
-
-          .el-checkbox {
-            padding: 0 58%;
-          }
         }
       }
 
-      .md-vice-content {
-        height: 140px;
-        overflow-y: auto;
-        overflow-x: hidden;
-      }
-    }
-
-    .md-auditInfo {
+      .md-auditInfo {
 
-      .el-divider--horizontal {
-        margin: 20px 0px 15px;
+        .el-divider--horizontal {
+          margin: 20px 0px 15px;
+        }
       }
+
     }
 
-  }
+    // .md-content>.el-tabs {
+    //   height: calc(100vh - 280px);
+    // }
 
-  // .md-content>.el-tabs {
-  //   height: calc(100vh - 280px);
-  // }
+    .otherDialog {
 
-  .otherDialog {
+      .el-collapse-item__content {
+        padding-bottom: 12px;
+      }
 
-    .el-collapse-item__content {
-      padding-bottom: 12px;
-    }
+      .el-form {
+        .el-checkbox {
+          width: 100%;
+          padding: 0 10%;
+        }
+      }
 
-    .el-form {
-      .el-checkbox {
-        width: 100%;
-        padding: 0 10%;
+      .el-dialog__body {
+        padding: 12px 20px;
+        height: 80%;
+        overflow: auto;
+      }
+
+      .od-msg {
+        max-height: 220px;
+        box-sizing: border-box;
+        overflow-y: auto;
+        overflow-x: hidden;
       }
-    }
 
-    .el-dialog__body {
-      padding: 12px 20px;
-      height: 80%;
-      overflow: auto;
+      // .el-dialog__header {
+      //   background-color: rgb(244, 244, 244);
+      // }
     }
 
-    .od-msg {
-      max-height: 220px;
-      box-sizing: border-box;
-      overflow-y: auto;
-      overflow-x: hidden;
+    .el-dialog__header {
+      background-color: rgb(244, 244, 244);
     }
 
-    // .el-dialog__header {
-    //   background-color: rgb(244, 244, 244);
-    // }
-  }
+    .MoreDataDialog {
 
-  .el-dialog__header {
-    background-color: rgb(244, 244, 244);
-  }
+      .el-dialog__body {
+        height: 500px;
+        padding: 20px 15px;
 
-  .MoreDataDialog {
+        .el-table {
+          margin-top: 10px;
 
-    .el-dialog__body {
-      height: 500px;
-      padding: 20px 15px;
+          .el-table__body-wrapper {
+            height: 300px;
+            overflow-y: auto;
+            overflow-x: hidden;
+          }
+        }
 
-      .el-table {
-        margin-top: 10px;
+        .el-pagination {
+          text-align: right;
+          margin-top: 5px;
+        }
 
-        .el-table__body-wrapper {
-          height: 300px;
-          overflow-y: auto;
+        .referTree {
+          height: 390px;
           overflow-x: hidden;
+          overflow-y: auto;
         }
       }
 
-      .el-pagination {
-        text-align: right;
-        margin-top: 5px;
-      }
 
-      .referTree {
-        height: 390px;
-        overflow-x: hidden;
-        overflow-y: auto;
+      .more-button {
+        margin-top: 10px;
+        text-align: right;
       }
     }
 
 
-
-    .more-button {
-      margin-top: 10px;
-      text-align: right;
-    }
   }
 
+  // 修改下拉框样式
+  #selected {
+    /*很关键:将默认的select选择框样式清除*/
+    //   appearance: none;
+    //   -moz-appearance: none;
+    //   -webkit-appearance: none;
+    //   /*为下拉小箭头留出一点位置,避免被文字覆盖*/
+    //   padding-right: 14px;
+    //   /*自定义图片*/
+    //   background: url("../images/search@2x.png") no-repeat scroll right center transparent;
+    //   /*自定义图片的大小*/
+    //   background-size: 16px 16px;
+
+    //   /*将小箭头的样式去去掉*/
+    //   .el-icon-arrow-up:before {
+    //     content: '';
+    //   }
+    // }
 
-}
-
-// 修改下拉框样式
-#selected {
-  /*很关键:将默认的select选择框样式清除*/
-  //   appearance: none;
-  //   -moz-appearance: none;
-  //   -webkit-appearance: none;
-  //   /*为下拉小箭头留出一点位置,避免被文字覆盖*/
-  //   padding-right: 14px;
-  //   /*自定义图片*/
-  //   background: url("../images/search@2x.png") no-repeat scroll right center transparent;
-  //   /*自定义图片的大小*/
-  //   background-size: 16px 16px;
-
-  //   /*将小箭头的样式去去掉*/
-  //   .el-icon-arrow-up:before {
-  //     content: '';
-  //   }
-  // }
-
-}
+  }
 </style>
 
 <style scoped>
-.md-content>>>.el-form-item,
-.otherDialog>>>.el-form-item {
-  margin-bottom: 10px;
-}
-
-.md-content>>>.el-tabs--border-card>.el-tabs__content {
-  padding-bottom: 8px;
-}
-
-.md-content .md-auditInfo>>>.el-form-item {
-  margin-bottom: 0px;
-}
-
-.md-main>>>.el-form-item,
-.md-vice>>>.el-form-item,
-.od-msg>>>.el-form-item {
-  width: 100%;
-  box-sizing: border-box;
-}
-
-.md-main>>>.el-form-item__label,
-.md-vice>>>.el-form-item__label,
-.od-msg>>>.el-form-item__label {
-  width: 40%;
-}
-
-.od-msg>>>.el-checkbox__input {
-  width: 15%;
-}
-
-.md-main>>>.el-form-item__content,
-.md-vice>>>.el-form-item__content,
-.od-msg>>>.el-form-item__content {
-  width: 60%;
-  box-sizing: border-box;
-  height: 36px;
-}
-
-.od-msg>>>.el-checkbox__label {
-  width: 85%;
-  box-sizing: border-box;
-}
-
-
-.od-msg-checkedbx>>>.el-form-item__content {
-  width: 80%;
-  box-sizing: border-box;
-}
-
-.od-msg-checkedbx>>>.el-checkbox {
-  width: 75%;
-  box-sizing: border-box;
-}
-
-.md-content>>>.el-form-item__label,
-.otherDialog>>>.el-form-item__label,
-.od-msg>>>.el-form-item__label,
-.od-msg>>>.el-checkbox__label {
-  font-weight: normal;
-  /* text-align: left;
-  width: 28%; */
-  white-space: nowrap;
-  /* IE6 需要定义宽度 */
-  overflow: hidden;
-
-  -o-text-overflow: ellipsis;
-  /* Opera */
-  text-overflow: ellipsis;
-  /* IE, Safari (WebKit) */
-  /* -moz-binding: url('ellipsis.xml#ellipsis'); */
-  /* Firefox */
-}
-
-.otherDialog>>>.el-form-item__label {
-  font-size: 12px;
-}
-
-.md-main>>>.material-table {
-  height: 100%;
-}
-
-.md-vice>>>.material-table {
-  height: 140px;
-  overflow-y: auto;
-  overflow-x: auto;
-}
-
->>>.referTree {
-  margin-top: 10px;
-}
-
-/* .md-main>>>.el-table .el-table__body {
-  height: calc(100vh - 300px);
-} */
-
-/* .otherDialog>>>.el-collapse-item__content {
-  padding-bottom: 12px;
-}
-
-.otherDialog>>>.el-dialog__body {
-  padding: 12px 20px;
-} */
+  .md-content >>> .el-form-item,
+  .otherDialog >>> .el-form-item {
+    margin-bottom: 10px;
+  }
+
+  .md-content >>> .el-tabs--border-card > .el-tabs__content {
+    padding-bottom: 8px;
+  }
+
+  .md-content .md-auditInfo >>> .el-form-item {
+    margin-bottom: 0px;
+  }
+
+  .md-main >>> .el-form-item,
+  .md-vice >>> .el-form-item,
+  .od-msg >>> .el-form-item {
+    width: 100%;
+    box-sizing: border-box;
+  }
+
+  .md-main >>> .el-form-item__label,
+  .md-vice >>> .el-form-item__label,
+  .od-msg >>> .el-form-item__label {
+    width: 40%;
+  }
+
+  .od-msg >>> .el-checkbox__input {
+    width: 15%;
+  }
+
+  .md-main >>> .el-form-item__content,
+  .md-vice >>> .el-form-item__content,
+  .od-msg >>> .el-form-item__content {
+    width: 60%;
+    box-sizing: border-box;
+    height: 36px;
+  }
+
+  .od-msg >>> .el-checkbox__label {
+    width: 85%;
+    box-sizing: border-box;
+  }
+
+
+  .od-msg-checkedbx >>> .el-form-item__content {
+    width: 80%;
+    box-sizing: border-box;
+  }
+
+  .od-msg-checkedbx >>> .el-checkbox {
+    width: 75%;
+    box-sizing: border-box;
+  }
+
+  .md-content >>> .el-form-item__label,
+  .otherDialog >>> .el-form-item__label,
+  .od-msg >>> .el-form-item__label,
+  .od-msg >>> .el-checkbox__label {
+    font-weight: normal;
+    /* text-align: left;
+    width: 28%; */
+    white-space: nowrap;
+    /* IE6 需要定义宽度 */
+    overflow: hidden;
+
+    -o-text-overflow: ellipsis;
+    /* Opera */
+    text-overflow: ellipsis;
+    /* IE, Safari (WebKit) */
+    /* -moz-binding: url('ellipsis.xml#ellipsis'); */
+    /* Firefox */
+  }
+
+  .otherDialog >>> .el-form-item__label {
+    font-size: 12px;
+  }
+
+  .md-main >>> .material-table {
+    height: 100%;
+  }
+
+  .md-vice >>> .material-table {
+    height: 140px;
+    overflow-y: auto;
+    overflow-x: auto;
+  }
+
+  >>> .referTree {
+    margin-top: 10px;
+  }
+
+  /* .md-main>>>.el-table .el-table__body {
+    height: calc(100vh - 300px);
+  } */
+
+  /* .otherDialog>>>.el-collapse-item__content {
+    padding-bottom: 12px;
+  }
+
+  .otherDialog>>>.el-dialog__body {
+    padding: 12px 20px;
+  } */
 </style>

+ 76 - 26
src/views/material/changeApply/add.vue

@@ -31,8 +31,8 @@
             <el-col :span="8">
               <el-form-item label="医药物料" prop="medicineMaterial">
                 <el-select v-model="basicForm.medicineMaterial" placeholder="医药物料" clearable :disabled="disable"
-                  @change="controlMedic">
-                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+                           @change="controlMedic">
+                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -59,8 +59,8 @@
             <el-col :span="8">
               <el-form-item label="生产厂家/代理人" prop="factory">
                 <el-select ref="factoryOrman" v-model="basicForm.factory" placeholder="生产厂家/代理人" clearable
-                  :disabled="disable" @focus="chooseFactory">
-                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id" />
+                           :disabled="disable" @focus="chooseFactory">
+                  <el-option v-for="item in factoryOptions" :key="item.id" :label="item.name" :value="item.id"/>
                 </el-select>
                 <!-- <el-input :disabled="disable" v-model="basicForm.factory">
                   <el-button :disabled="disable" slot="append" icon="el-icon-more" @click="test02"></el-button>
@@ -78,7 +78,7 @@
               <el-form-item label="存储条件" prop="storageConditions">
                 <el-select v-model="basicForm.storageConditions" placeholder="存储条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_storage_condition" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -86,7 +86,7 @@
               <el-form-item label="运输条件" prop="transportCondition">
                 <el-select v-model="basicForm.transportCondition" placeholder="运输条件" clearable :disabled="disable">
                   <el-option v-for="dict in dict.type.sys_conditions_carriage" :key="dict.value" :label="dict.label"
-                    :value="dict.value" />
+                             :value="dict.value"/>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -98,8 +98,12 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="业务线" prop="remark">
-                <el-input :disabled="disable" v-model="basicForm.businessLine"></el-input>
+              <el-form-item label="业务线" prop="businessLine"
+                            :rules="{ required: isOneClass, message: '骨科、介入、检验、普耗、设备类物料产线必须输入对应的业务线', trigger: 'blur' }">
+                <el-select ref="lines" v-model="basicForm.businessLine" placeholder="请选择" clearable :disabled="disable"
+                           @focus="chooseLine">
+                  <el-option v-for="item in lineOptions" :key="item.id" :label="item.name" :value="item.id"/>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -148,7 +152,8 @@
         <el-form :model="basicForm2" ref="basic2" label-width="160px">
           <el-row :gutter="20">
             <el-col :span="8">
-              <el-form-item label="药品" prop="drug">
+              <el-form-item label="药品" prop="drug"
+                            :rules="{ required: !isControl, message: '请选择是否药品', trigger: 'change' }">
                 <el-select v-model="basicForm2.drug" placeholder="请选择" clearable :disabled="disable || isControl">
                   <el-option v-for="dict in dict.type.sys_medicine" :key="dict.value" :label="dict.label"
                              :value="dict.value"/>
@@ -317,6 +322,7 @@
     <fourClass ref="fourClass" @doSubmit="acceptFourClass" :selectData="selectData3" :single="true"/>
 
     <dose ref="dose" @doSubmit="acceptDose" :selectData="selectData9" :single="true"/>
+    <serviceline ref="line" @doSubmit="acceptLine" :selectData="selectData8" :single="true" />
   </div>
 </template>
 
@@ -324,12 +330,13 @@
   import popDialog from '@/components/PopDialog/index.vue'
   import factory from '@/components/PopDialog/productFactory.vue'
   import {addChangeList, getMaterialDetails, getChangeDetails, editChangeList} from '@/api/changeApply/basic'
-  import {getDose} from '@/api/requisition/basic'
+  import {getDose, getLine} from '@/api/requisition/basic'
   // 生产厂商/代理人调用用于回显
   import {getProductFactory} from '@/api/changeApply/basic'
   // 四级分类
   import fourClass from '@/components/PopDialog/fourClass.vue'
   import dose from '@/components/PopDialog/dose.vue'
+  import serviceline from '@/components/PopDialog/serviceline.vue'
   // 调用物料分类详情接口用于数据回显
   import {getDetail} from '@/api/classify/basic';
 
@@ -340,6 +347,7 @@
       popDialog,
       factory,
       dose,
+      serviceline,
       fourClass
     },
     props: ['pageStu', 'row', 'disable'],
@@ -353,8 +361,12 @@
         // 剂型
         doseOptions: [],
         selectData9: [],
+        selectData8: [],
         tabValue: 'first',
         isControl: true,
+        // 业务线
+        lineOptions: [],
+        isOneClass: false,
         basicForm: {
           code: '',
           orgId: '德荣集团',
@@ -427,8 +439,8 @@
           registrationNo: '',
           medicalDevices: '',
           maintenanceType: '',
-        // 剂型
-        dosageFrom: ''
+          // 剂型
+          dosageFrom: ''
           // 医药属性子表
           // medicineTypeChanges:[
           // ],
@@ -562,6 +574,10 @@
             if (res.data.medicineChange && res.data.medicineChange.dosageFrom) {
               this.getDoseDetails(res.data.medicineChange.dosageFrom)
             }
+            // 业务线回显
+            if (res.data.businessLine) {
+              this.getLineDetails(res.data.businessLine)
+            }
           }
         })
       },
@@ -572,13 +588,17 @@
         console.log('保存参数', sparams)
         this.$refs['basic'].validate((valid) => {
           if (valid) {
-            addChangeList(sparams).then(res => {
-              if (res.code === 200) {
-                this.$message({
-                  message: res.msg,
-                  type: 'success'
-                });
-                this.back()
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                addChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
               }
             })
           }
@@ -591,13 +611,17 @@
         console.log('提交参数', sparams)
         this.$refs['basic'].validate((valid) => {
           if (valid) {
-            editChangeList(sparams).then(res => {
-              if (res.code === 200) {
-                this.$message({
-                  message: res.msg,
-                  type: 'success'
-                });
-                this.back()
+            this.$refs['basic2'].validate(valid => {
+              if (valid) {
+                editChangeList(sparams).then(res => {
+                  if (res.code === 200) {
+                    this.$message({
+                      message: res.msg,
+                      type: 'success'
+                    });
+                    this.back()
+                  }
+                })
               }
             })
           }
@@ -733,6 +757,32 @@
             this.basicForm.twoClass = res.data.twoClass
             this.basicForm.threeClass = res.data.threeClass
             this.basicForm.fourClass = res.data.fourClass
+            const classjudge = res.data.oneClass
+            if (classjudge == '介入耗材5' || classjudge == '骨科耗材2' || classjudge == '普通耗材3' || classjudge == '医用设备1' || classjudge == '体外诊断4') {
+              this.isOneClass = true
+            } else {
+              this.isOneClass = false
+            }
+          }
+        })
+      },
+      // 选择业务线
+      acceptLine(selections) {
+        this.lineOptions = selections
+        this.basicForm.businessLine = selections[0].id
+        this.getLineDetails(selections[0].id)
+      },
+      // 业务线显示列表
+      chooseLine() {
+        this.$refs.lines.blur()
+        this.$refs.line.init()
+      },
+      // 业务线回显
+      getLineDetails(id) {
+        getLine({id: id}).then(res => {
+          console.log('业务线', res)
+          if (res.code === 200) {
+            this.lineOptions = res.data.tableBody
           }
         })
       },

+ 27 - 1
src/views/purchase/DemandSummary/index.vue

@@ -263,11 +263,12 @@
           :data="tableList" 
           fit
           show-summary
+          :summary-method="getSummaries"
           max-height="480"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
-          <el-table-column type="selection" width="55" />
+          <el-table-column type="selection" width="60" />
           <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
           <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
           <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
@@ -499,6 +500,31 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 指定列合计
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (column.property === 'demandNum' || column.property === 'netDemandNum' || column.property === 'artificialAdjust' || column.property === 'suggestBuyQty' || column.property === 'finalBuyQty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          sums[index];
+
+        }
+      });
+      return sums
+    },
     // 搜索
     search() {
       this.getList(this.queryParams)

+ 44 - 18
src/views/purchase/PurchaseDemandList/add.vue

@@ -219,7 +219,7 @@
           <el-table-column label="预留数量" align="center"  prop="reservedQty" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedQty"/>
+                <el-input readonly size="small" v-model="scope.row.reservedQty"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -228,7 +228,7 @@
           <el-table-column label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
@@ -332,7 +332,7 @@
           <el-table-column label="收货仓库" align="center"  prop="deliveryWarehouseName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable size="small" v-model="scope.row.deliveryWarehouseName" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></el-button>
                 </el-input>
               </el-form-item>
@@ -341,7 +341,7 @@
           <el-table-column label="收货货位" align="center"  prop="deliveryAllocationName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.deliveryAllocationName">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
@@ -364,12 +364,12 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>
+          <el-table-column label="默认采购组织" align="center"  prop="purOrgName" width="200px"/>yu
           <el-table-column label="默认采购组织编码" align="center"  prop="puOrg" width="200px"/>
           <!-- <el-table-column label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
-          <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/>
+          <!-- <el-table-column label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
           <el-table-column label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/>
-          <el-table-column label="可用量" align="center"  prop="availableQty"/>
+          <!-- <el-table-column label="可用量" align="center"  prop="availableQty"/> -->
           <el-table-column label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -387,8 +387,8 @@
           <el-table-column label="补单供应商编码" align="center"  prop="additionalSupplier" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplier">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
+                <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
+                  <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -396,7 +396,7 @@
           <el-table-column label="补单供应商名称" align="center"  prop="additionalSupplierName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable readonly size="small" v-model="scope.row.additionalSupplierName"/>
+                <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -416,7 +416,7 @@
           <el-table-column label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable size="small" v-model="scope.row.deliveryAddressName" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
                 </el-input>
               </el-form-item>
@@ -500,6 +500,8 @@ export default {
       // 不能直接改变props传来的值
       sonPageStu: this.pageStu,
       sonDisable: this.disable,
+      // BDZT是补单供应商是否可以编辑条件
+      BDZT: true,
       dialog: {
         config: false
       },
@@ -560,9 +562,15 @@ export default {
     // 更改业务类型调整明细行内补单或紧急标识
     changeBillType() {
       if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
+        this.BDZT = false
         this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
       } else {
-        this.basicForm.puDemandItemList.forEach(item => { item.isReplenishment = 'N' })
+        this.BDZT = true
+        this.basicForm.puDemandItemList.forEach(item => { 
+          item.isReplenishment = 'N' 
+          item.additionalSupplier = null
+          item.additionalSupplierName = null
+        })
       }
       if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
         this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
@@ -650,8 +658,6 @@ export default {
         status: null,
         businessDept: null,
         businessDeptName: null,
-        customer: this.basicForm.customer,
-        customerName: this.basicForm.customerName,
         materialCategory: null,
         buyer: null,
         buyerName: null,
@@ -717,8 +723,8 @@ export default {
         additionalSupplier: null,
         additionalSupplierName: null,
         periodUnit: null,
-        demandCustomer: null,
-        demandCustomerName: null,
+        demandCustomer: this.basicForm.customer,
+        demandCustomerName: this.basicForm.customerName,
         lastStockOrg: null,
         lastStockOrgName: null,
         superiorStockOrg: null,
@@ -855,7 +861,7 @@ export default {
         this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
       }
       if(this.referConditionMx.title == '选择补单供应商') {
-        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].id
+        this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
         this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
       }
       if(this.referConditionMx.title == '选择收货地址') {
@@ -958,7 +964,27 @@ export default {
       } else {
         this.$modal.msgWarning("请先选择收货仓库");
       }
-    }
+    },
+    // 明细行清空收货仓库,货位,收货地址档案等
+    clearHang(index, title) {
+      if (title == '选择收货仓库') {
+        this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
+        this.basicForm.puDemandItemList[index].deliveryWarehouse = null
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货货位') {
+        this.basicForm.puDemandItemList[index].deliveryAllocationName = null
+        this.basicForm.puDemandItemList[index].deliveryAllocation = null
+      }
+      if (title == '选择收货地址') {
+        this.basicForm.puDemandItemList[index].deliveryAddressName = null
+        this.basicForm.puDemandItemList[index].deliveryAddress = null
+        this.basicForm.puDemandItemList[index].contacts = null
+        this.basicForm.puDemandItemList[index].contactsPhone = null
+        this.basicForm.puDemandItemList[index].address = null
+      }
+    },
   }
 }
 </script>

+ 199 - 57
src/views/purchase/purchase-order/add/column.js

@@ -11,21 +11,30 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type", // 字典名
+    isShow:true,
+  },
+  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input",  isShow:true,},
+  {
+    key: "code",
+    title: "订单编号",
+    inputType: "Input",
+    readonly: true,
+    disabled: true,
+    isShow:true,
   },
-  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input", },
-  { key: "code", title: "订单编号", inputType: "Input", },
   {
     key: "billDate",
     title: "订单日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
-    width: 200,
+    width: 200, isShow:true,
   },
   {
     key: "supplierName",
@@ -39,6 +48,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "paymentAgreementName",
@@ -51,7 +61,7 @@ export const Columns = [
       paymentAgreementName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "finalTypeName",
@@ -64,6 +74,7 @@ export const Columns = [
       finalTypeName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "currencyName",
@@ -76,7 +87,7 @@ export const Columns = [
       currencyName: 'name'
     },
     queryParams: () => ({}),
-
+    isShow:true,
   },
   {
     key: "buyerName",
@@ -90,6 +101,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "puDeptName",
@@ -103,6 +115,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     require: true,
+    isShow:true,
   },
   {
     key: "customerName",
@@ -117,33 +130,37 @@ export const Columns = [
       customerName: 'name'
     },
     queryParams: () => ({}),
+    isShow:true,
   },
   {
     key: "qty",
     title: "总数量",
     inputType: "InputNumber",
     controlsPosition: "right",
+    isShow:true,
   },
   {
     key: "originalQty",
     title: "原始总数量",
     inputType: "InputNumber",
     controlsPosition: "right",
+    isShow:true,
   },
-  { key: "money", title: "价税合计", inputType: "Input", },
-  { key: "originalMoney", title: "原始总金额", inputType: "Input", },
-  { key: "notaxMoney", title: "无税金额", inputType: "Input", },
+  { key: "money", title: "价税合计", inputType: "Input", isShow:true, },
+  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true,},
+  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true,},
   {
     key: "status",
     title: "单据状态",
     inputType: "Select",
     referName: "sys_status", // 字典名
     disabled: true,
+    isShow:true,
   },
-  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", },
-  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox", },
-  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox", },
-  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox", },
+  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
+  { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
+  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
   {
     key: "warehouseName",
     title: "WMS入库仓库", // 收货仓库
@@ -155,7 +172,10 @@ export const Columns = [
       warehouse: 'id',
       warehouseName: 'name'
     },
-    queryParams: () => ({}),
+    queryParams: (params) => ({
+      pkOrg: params.puOrg,
+    }),
+    isShow:true,
   },
   {
     key: "goodsAllocationName",
@@ -168,18 +188,19 @@ export const Columns = [
       goodsAllocation: 'id',
       goodsAllocationName: 'name'
     },
+     isShow:true,
     queryParams: (params) => ({
-      pkOrg: params.puOrg,
+      stordocId: params.warehouse,
     }),
     width: 200,
   },
-  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox", },
-  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", },
-  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input", },
-  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input", },
-  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input", },
-  { key: "address", title: "收货地址", inputType: "Input", },
-  { key: "contacts", title: "收货联系人", inputType: "Input", },
+  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
+  { key: "isInvoice", title: "发票标识", inputType: "Checkbox", isShow:true,},
+  { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
+  { key: "rebateMoney", title: "订单使用返利金额", inputType: "Input",isShow:true, },
+  { key: "deductionMoney", title: "订单抵扣余款金额", inputType: "Input",isShow:true, },
+  { key: "address", title: "收货地址", inputType: "Input",isShow:true, },
+  { key: "contacts", title: "收货联系人", inputType: "Input",isShow:true, },
   {
     key: "customerDeptName",
     title: "客户部门",
@@ -191,6 +212,7 @@ export const Columns = [
       customerDept: 'id',
       customerDeptName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
@@ -205,11 +227,12 @@ export const Columns = [
       supplierContacts: 'id',
       supplierContactsName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     width: 200,
   },
-  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox", },
-  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox", },
+  { key: "isUrgency", title: "紧急程度", inputType: "Checkbox",isShow:true, },
+  { key: "isSendWms", title: "已同步WMS", inputType: "Checkbox",isShow:true, },
   // { key: "agent", title: "代理人", inputType: "Input", }, // 建议删除
   {
     key: "agentName",
@@ -221,19 +244,21 @@ export const Columns = [
       agent: 'id',
       agentName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     width: 200,
   },
-  { key: "isClose", title: "最终关闭", inputType: "Checkbox", },
+  { key: "isClose", title: "最终关闭", inputType: "Checkbox", isShow:true, },
   {
     key: "closeTime",
     title: "最终关闭日期",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:true,
   },
-  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", },
-  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", },
-  { key: "invoiceMoney", title: "发票金额", inputType: "Input", },
+  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", isShow:true,},
+  { key: "paymentMoney", title: "累计付款金额", inputType: "Input", isShow:true,},
+  { key: "invoiceMoney", title: "发票金额", inputType: "Input",isShow:true, },
   {
     key: "supplierPersonalName",
     title: "供应商业务员",
@@ -244,10 +269,11 @@ export const Columns = [
       supplierPersonal: 'id',
       supplierPersonalName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
     require: true,
   },
-  { key: "isDeliver", title: "是否发货", inputType: "Checkbox", },
+  { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
   {
     key: "retReasonName",
     title: "退换原因",
@@ -259,6 +285,7 @@ export const Columns = [
       retReason: 'id',
       retReasonName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -272,9 +299,10 @@ export const Columns = [
       processType: 'id',
       processTypeName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
-  { key: "isEnd", title: "整单关闭标识", inputType: "Input", },
+  { key: "isEnd", title: "整单关闭标识", inputType: "Input", isShow:true, },
   {
     key: "projectNowName",
     title: "在建工程项目",
@@ -286,6 +314,7 @@ export const Columns = [
       projectNow: 'id',
       projectNowName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
   },
   {
@@ -299,35 +328,39 @@ export const Columns = [
       operatingItems: 'id',
       operatingItemsName: 'name'
     },
+     isShow:true,
     queryParams: () => ({}),
 
   },
-  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", },
-  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", },
-  { key: "marketingCode", title: "销售订单号", inputType: "Input", },
-  { key: "isArrival", title: "到货超期", inputType: "Checkbox", },
-  { key: "createByName", title: "创建人名称", inputType: "Input", },
-  { key: "updateByName", title: "更新人名称", inputType: "Input", },
-  { key: "flowId", title: "OA流程ID", inputType: "Input", },
-  { key: "approver", title: "审批人", inputType: "Input", },
+  { key: "isArrivalReson", title: "到货超期原因", inputType: "Input", isShow:true, },
+  { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
+  { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
+  { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
+  { key: "createByName", title: "创建人名称", inputType: "Input", isShow:false, },
+  { key: "updateByName", title: "更新人名称", inputType: "Input", isShow:false, },
+  { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
+  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
   {
     key: "approverFinishTime",
     title: "审批时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
   },
   {
     key: "approveTime",
     title: "提交时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
+    isShow:false,
   },
   {
     key: "sysFileRecordList",
     title: "附件",
     inputType: "Upload",
     // fileType: ["pdf",""],
-    span: 24
+    span: 24,
+    isShow:true,
   },
 
 ];
@@ -353,6 +386,20 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
+          materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicineValue',
+          manufacturer:'manufacturerIdName',
+          unit:'unitIdName',
+          tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'threeClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass',
         },
         queryParams: () => ({}),
       },
@@ -362,14 +409,52 @@ export const TabColumns = [
         inputType: "Input",
         width: 180,
       },
-      { key: "materialClassify", title: "物料分类", inputType: "Input", width: 180 },
-      { key: "materialManufacturersCode", title: "厂家物料编码", inputType: "Input", width: 180 },
-      { key: "specification", title: "规格", inputType: "Input", width: 180 },
-      { key: "model", title: "型号", inputType: "Input", },
-      { key: "isMedcine", title: "医药物料", inputType: "Input", width: 180 },
-      { key: "manufacturer", title: "生产厂家代理人", inputType: "Input", width: 180 },
-      { key: "isDrug", title: "物料药品属性", inputType: "Input", width: 180 },
-      { key: "unit", title: "单位", inputType: "Input", },
+      { //classifyIdName   classifyId
+        key: "materialClassify",
+        title: "物料分类", 
+        inputType: "Input",
+        width: 180 
+      },
+      { // manufacturersMaterialCode  manufacturersMaterialName
+        key: "materialManufacturersCode",
+         title: "厂家物料编码", 
+         inputType: "Input",
+          width: 180
+         },
+      { //specification
+        key: "specification",
+         title: "规格", 
+         inputType: "Input",
+          width: 180 
+        },
+      { //model
+        key: "model",
+         title: "型号", 
+         inputType: "Input",
+         },
+      { //isMedicine  isMedicineValue
+        key: "isMedcine",
+         title: "医药物料", 
+         inputType: "Input", 
+         width: 180 
+        },
+      { // manufacturerId  manufacturerIdName
+        key: "manufacturer",
+        title: "生产厂家代理人",
+        inputType: "Input",
+        width: 180 
+      },
+      { 
+        key: "isDrug",
+         title: "物料药品属性", 
+         inputType: "Input", 
+         width: 180 
+        },
+      { //unitId  unitIdName
+        key: "unit", 
+        title: "单位", 
+        inputType: "Input",
+       },
       {
         key: "qty",
         title: "数量",
@@ -379,7 +464,11 @@ export const TabColumns = [
       },
       { key: "taxPrice", title: "含税单价", inputType: "Input", },
       { key: "money", title: "价税合计", inputType: "Input", },
-      { key: "tax", title: "税率", inputType: "Input", },
+      { //materialRate  materialRateName
+        key: "tax", 
+        title: "税率",
+         inputType: "Input",
+         },
       { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input", },
       { key: "arrivalQty", title: "已到货数量", inputType: "Input", },
       { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
@@ -407,18 +496,33 @@ export const TabColumns = [
       { key: "address", title: "收货地址", inputType: "Input", width: 180 },
       { key: "productBatch", title: "产品批号", inputType: "Input", width: 180 },
       { key: "manufactureDate", title: "生产日期", inputType: "Input", width: 180 },
-      { key: "efficacyLoseDate", title: "有效期至/失效日期", inputType: "Input", width: 180 },
-      { key: "approvalNumber", title: "批准文号", inputType: "Input", width: 180 },
-      { key: "registration", title: "注册证号", inputType: "Input", width: 180 },
+      { 
+        key: "efficacyLoseDate", 
+        title: "有效期至/失效日期", 
+        inputType: "Input",
+         width: 180
+         },
+      { 
+        key: "approvalNumber",
+         title: "批准文号",
+          inputType: "Input", 
+          width: 180
+         },
+      { 
+        key: "registration",
+         title: "注册证号", 
+         inputType: "Input", 
+         width: 180 
+        },
 
-      {
+      { //storageCondition storageConditionName
         key: "storageCondition",
         title: "存储条件",
         inputType: "Select",
         referName: "sys_storage_condition", // 字典名
         width: 180
       },
-      {
+      { // transportationCondition  transportationConditionName
         key: "carriageCondition",
         title: "运输条件",
         inputType: "Select",
@@ -451,11 +555,35 @@ export const TabColumns = [
       { key: "isDistributionPrice", title: "配送价", inputType: "Input", },
       { key: "createByName", title: "创建人名称", inputType: "Input", },
       { key: "updateByName", title: "更新人名称", inputType: "Input", },
-      { key: "materialClassifyOneName", title: "物料一级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyTwoName", title: "物料二级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyThreeName", title: "物料三级分类名称", inputType: "Input", width: 180 },
-      { key: "materialClassifyFourName", title: "物料四级分类名称", inputType: "Input", width: 180 },
-      { key: "price", title: "无税单价", inputType: "Input", }
+      { //threeClass
+        key: "materialClassifyOneName", 
+        title: "物料一级分类名称", 
+        inputType: "Input",
+         width: 180 
+        },
+      { //twoClass
+        key: "materialClassifyTwoName",
+         title: "物料二级分类名称", 
+         inputType: "Input",
+          width: 180
+         },
+      { //threeClass
+        key: "materialClassifyThreeName", 
+        title: "物料三级分类名称", 
+        inputType: "Input", 
+        width: 180 
+      },
+      { //fourClass
+        key: "materialClassifyFourName", 
+        title: "物料四级分类名称",
+         inputType: "Input", 
+         width: 180 
+        },
+      { 
+        key: "price",
+        title: "无税单价",
+        inputType: "Input",
+      }
     ]
   },
   {
@@ -474,6 +602,20 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
+          materialClassify:'classifyIdName',
+          materialManufacturersCode:'manufacturersMaterialCode',
+          specification:'specification',
+          model:'model',
+          isMedcine:'isMedicineValue',
+          manufacturer:'manufacturerIdName',
+          unit:'unitIdName',
+          tax:'materialRateName',
+          storageCondition:'storageCondition',
+          carriageCondition:'transportationCondition',
+          materialClassifyOneName:'threeClass',
+          materialClassifyTwoName:'twoClass',
+          materialClassifyThreeName:'threeClass',
+          materialClassifyFourName:'fourClass'
         },
         queryParams: () => ({}),
         width: 180

+ 182 - 84
src/views/purchase/purchase-order/add/index.vue

@@ -21,6 +21,7 @@ export default {
   dicts: initDicts(SelectColumns),
   components: {
     FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+    popDialog: () => import('@/components/PopDialog/index.vue'),
   },
 
   data() {
@@ -44,22 +45,20 @@ export default {
   watch: {
     "params.puOrderItemList": {
       handler(nVal, oVal) {
-        console.log(nVal, 'nVal', oVal, 'oVal');
-        this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
+        this.visible && this.handleSynchronousMaterial("puOrderItemList", "puOrderExecuteList");
       },
       deep: true,
     },
     "params.puOrderExecuteList": {
       handler(nVal, oVal) {
-        this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
+        this.visible && this.handleSynchronousMaterial("puOrderExecuteList", "puOrderItemList");
       },
       deep: true,
     },
     "params": {
       handler(nVal, oVal) {
-
         // 组织变化
-        if (nVal.puOrg != oVal.puOrg) {
+        if (this.visible && (nVal.puOrg != oVal.puOrg)) {
           console.log(nVal.puOrg, 'nVal.puOrg', oVal.puOrg, 'oVal.puOrg');
           for (const key in this.params) {
             if (Array.isArray(this.params[key])) {
@@ -89,7 +88,6 @@ export default {
       this.params.puDept = deptId;
       this.params.puDeptName = deptName;
       // this.params.status = '0';
-
     },
     setVisible(prop) {
       this.visible = prop;
@@ -191,23 +189,24 @@ export default {
     // 取消
     handleCancel() {
       this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
+      this.params = {
+        ...initParams(this.columns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      }
+
     },
     // 保存
     async handleSava() {
       // orderAddForm
       console.log(this.params.sysFileRecordList, "params");
 
-      this.params.sysFileRecordList.forEach(item => {
-
-        item['']
-      })
       // this.$refs['orderAddForm'].validate(async (valid) => {
       //   if (valid) {
       try {
         const { code, msg } = await orderApi.create(this.params);
         if (code === 200) {
-          this.setVisible(false);
+          this.handleCancel();
         }
       } catch (err) {
         //
@@ -295,9 +294,22 @@ export default {
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form size="mini" label-position="right" ref="orderAddForm" label-width="140px" :model="params" :rules="rules">
+  <el-drawer 
+    direction="btt" 
+    size="100%" 
+    :with-header="false" 
+    :visible.sync="visible"
+    @open="beforeOpen"
+    @close="$emit('close')"
+    >
+    <el-form 
+      size="mini" 
+      label-position="right" 
+      ref="orderAddForm" 
+      label-width="140px" 
+      :model="params" 
+      :rules="rules"
+      >
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -319,51 +331,101 @@ export default {
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-
-              <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+            <el-form-item :prop="column.key" :label="column.title" v-if="column.isShow">
+
+              <el-input v-if="column.inputType === 'Input'" 
+                v-model="params[column.key]" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                >
               </el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]"
-                :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
-                :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :query-params="column.queryParams(params)">
-              </dr-popover-select>
-
-              <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-              </el-input>
-
-              <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input-number>
-              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
-                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
-                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" 
+                v-model="params[column.key]"
+                :value-key="column.valueKey" 
+                :source.sync="params" 
+                :title="column.title" 
+                :type="column.referName"
+                :multiple="column.multiple" 
+                :placeholder="column.placeholder" 
+                :data-mapping="column.dataMapping"
+                :query-params="column.queryParams(params)"
+                ></dr-popover-select>
+
+              <el-input v-if="column.inputType === 'Textarea'" 
+                v-model="params[column.key]" 
+                type="textarea"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                ></el-input>
+
+              <el-input-number v-if="column.inputType === 'InputNumber'" 
+                v-model="params[column.key]"
+                :controls-position="column.controlsPosition" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                > </el-input-number>
+              <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%"
+                >
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable
-                collapse-tags :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select v-if="column.inputType === 'TagSelect'" 
+                v-model="params[column.key]" 
+                multiple 
+                clearable
+                collapse-tags 
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                >
                 <template #prefix>
-                  <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+                  <el-icon 
+                    class="el-icon-view" 
+                    style="cursor: pointer" 
+                    @click.stop="$message.info(234)">
+                  </el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
+                <el-option 
+                  v-for="item in options" 
+                  :key="item.value" 
+                  :label="item.label" 
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N">
-              </el-checkbox>
-              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
-                :file-type="column.fileType">
-              </file-upload-center>
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]" 
+                :type="column.type"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions" 
+                style="width: 100%"
+                ></el-date-picker>
+              <el-checkbox v-if="column.inputType === 'Checkbox'" 
+                v-model="params[column.key]" 
+                true-label="Y"
+                false-label="N"
+                ></el-checkbox>
+              <file-upload-center v-if="column.inputType === 'Upload'" 
+                v-model="params[column.key]"
+                :file-type="column.fileType"
+                ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
@@ -376,45 +438,81 @@ export default {
         position: 'relative',
       }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane 
+            v-for="(column, index) in tabColumns" 
+            :key="index" 
+            :label="column.title" 
+            :name="column.key"
+            >
             <el-table :data="params[column.key]" style="width: 100%">
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width || 80">
+              <el-table-column 
+                v-for="(cColumn, cIndex) in column.tableColumns" 
+                :key="cIndex" 
+                :prop="cColumn.key"
+                :label="cColumn.title" 
+                :width="cColumn.width || 80"
+                >
                 <template slot-scope="scope">
                   <el-tag v-if="cColumn.key === 'index'">
                     {{ scope.$index + 1 }}
                   </el-tag>
-                  <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%">
-                  </el-input>
+                  <el-input v-if="cColumn.inputType === 'Input'" 
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" 
+                    :clearable="cColumn.clearable" 
+                    :disabled="cColumn.disabled"
+                    size="mini" 
+                    style="width: 100%"
+                    ></el-input>
 
                   <!--  -->
-                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
-                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :type="cColumn.referName" :multiple="cColumn.multiple" :placeholder="cColumn.placeholder"
-                    :data-mapping="cColumn.dataMapping" :query-params="cColumn.queryParams(scope.row)"
-                    @change="handleReferChange" size="mini">
-                  </dr-popover-select>
-
-                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
-                    :controls-position="cColumn.controlsPosition" :placeholder="cColumn.placeholder"
-                    @change="handleInputChange(scope.row, cColumn.key)" :clearable="cColumn.clearable"
-                    :disabled="cColumn.disabled" size="mini" style="width: 100%">
-                  </el-input-number>
-
-                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
-                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
-                    style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
-                      :value="item.value">
-                    </el-option>
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" 
+                    v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" 
+                    :title="cColumn.title" 
+                    :value-key="cColumn.valueKey"
+                    :type="cColumn.referName" 
+                    :multiple="cColumn.multiple" 
+                    :placeholder="cColumn.placeholder"
+                    :data-mapping="cColumn.dataMapping" 
+                    :query-params="cColumn.queryParams(scope.row)"
+                    @change="handleReferChange" 
+                    size="mini"
+                    > </dr-popover-select>
+
+                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
+                    v-model="scope.row[cColumn.key]"
+                    :controls-position="cColumn.controlsPosition" 
+                    :placeholder="cColumn.placeholder"
+                    @change="handleInputChange(scope.row, cColumn.key)" 
+                    :clearable="cColumn.clearable"
+                    :disabled="cColumn.disabled" 
+                    size="mini" 
+                    style="width: 100%"
+                    ></el-input-number>
+
+                  <el-select v-if="cColumn.inputType === 'Select'" 
+                    v-model="scope.row[cColumn.key]" 
+                    size="mini"
+                    :disabled="cColumn.disabled" 
+                    :clearable="cColumn.clearable" 
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                    >
+                    <el-option 
+                      v-for="item in dict.type[cColumn.referName]" 
+                      :key="item.value" 
+                      :label="item.label"
+                      :value="item.value"
+                      ></el-option>
                   </el-select>
 
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]" true-label="Y"
-                    false-label="N">
-                  </el-checkbox>
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" 
+                    v-model="scope.row[cColumn.key]" 
+                    true-label="Y"
+                    false-label="N"
+                    ></el-checkbox>
 
                 </template>
               </el-table-column>

+ 14 - 7
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="upload-file">
-    <el-upload multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit"
-      :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false"
-      class="upload-file-uploader" ref="fileUpload">
+    <el-upload multiple :action="uploadFileUrl" :disabled="disabled" :before-upload="handleBeforeUpload"
+      :file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
+      :on-success="handleUploadSuccess" :show-file-list="false" class="upload-file-uploader" ref="fileUpload">
       <!-- 上传按钮 -->
-      <el-button size="mini" type="primary">选取文件</el-button>
+      <el-button size="mini" type="primary" :disabled="disabled">选取文件</el-button>
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
@@ -21,13 +21,15 @@
     <!-- 文件列表 -->
     <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
 
-      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
+      <li :key="file.fileUrl" class="el-upload-list__item ele-upload-list__item-content"
+        v-for="(file, index) in fileList">
+        <!-- <el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank"> -->
         <el-link :href="`${baseUrl}${file.fileUrl}`" :underline="false" target="_blank">
           <!-- <span class="el-icon-document"> {{ getFileName(file.name) }} </span> -->
           <span class="el-icon-document"> {{ file.fileName }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" :disabled="disabled" type="danger">删除</el-link>
         </div>
       </li>
     </transition-group>
@@ -55,13 +57,18 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "jpg"],
     },
     // 是否显示提示
     isShowTip: {
       type: Boolean,
       default: true,
     },
+    // 是否禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+    }
   },
   data() {
     console.log(process.env, 'process.env');

+ 203 - 84
src/views/purchase/purchase-order/edit/index.vue

@@ -52,14 +52,16 @@ export default {
     },
     'params.puOrderItemList': {
       handler(nVal, oVal) {
-        this.params.source == 3 && this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
+        this.params.source == 3 &&
+         this.handleSynchronousMaterial('puOrderItemList', 'puOrderExecuteList');
       },
       deep: true,
       immediate: true
     },
     'params.puOrderExecuteList': {
       handler(nVal, oVal) {
-        this.params.source == 3 && this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
+        this.params.source == 3 && 
+        this.handleSynchronousMaterial('puOrderExecuteList', 'puOrderItemList');
       },
       deep: true,
       immediate: true
@@ -82,9 +84,9 @@ export default {
     // 判断属性是否禁用
     handleIsForbidden(status) {
       console.log(status);
-      let { editColumns, editTabColumns } = forbidden(status != '2');
-      this.columns = editColumns;
-      this.tabColumns = editTabColumns;
+      let { editColumns: updateColumns, editTabColumns: updateTabColumns } = forbidden(status != '2');
+      this.columns = updateColumns;
+      this.tabColumns = updateTabColumns;
     },
     // 查询详细
     async fetchItem(prop) {
@@ -93,7 +95,6 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          console.log(this.params, 'this.params----------123');
           this.handleIsForbidden(this.params.status);
         }
       } catch (err) {
@@ -110,13 +111,21 @@ export default {
         if (Array.isArray(this.params[key])) {
 
           const arr = this.tabColumns.find(
+
             (element) => element.key === key
+
           ).tableColumns;
 
+
           let rowData = initParams(arr, "key", "value");
 
-          'rowno' in rowData && (rowData['rowno'] = this.params[key].length + 1);
-          'rowNo' in rowData && (rowData['rowNo'] = this.params[key].length + 1);
+          "rowno" in rowData &&
+            (rowData["rowno"] = this.params[key].length + 1);
+          "rowNo" in rowData &&
+            (rowData["rowNo"] = this.params[key].length + 1);
+
+          // 是否完成询价,新增明细行需默认明细为false
+          rowData['whetherCompleteInquiry'] = false;
 
           this.params[key].push(rowData);
         }
@@ -140,7 +149,11 @@ export default {
     // 取消
     handleCancel() {
       this.setVisible(false);
-      this.params = initParams(this.columns, "key", "value");
+      this.params = {
+        ...initParams(this.columns),
+        puOrderItemList: [],
+        puOrderExecuteList: [],
+      }
     },
     // 保存
     async handleSava() {
@@ -153,7 +166,7 @@ export default {
           : orderApi.edit(this.params)
         )
         if (code === 200) {
-          this.setVisible(false);
+          this.handleCancel();
         }
       } catch (err) {
         //
@@ -219,10 +232,23 @@ export default {
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
-    @close="$emit('close')">
-    <el-form v-loading="loading" :size="size" ref="orderEditForm" label-position="right" label-width="140px"
-      :model="params" :rules="rules">
+  <el-drawer 
+    direction="btt" 
+    size="100%" 
+    :with-header="false" 
+    :visible.sync="visible" 
+    @open="beforeOpen"
+    @close="$emit('close')"
+    >
+    <el-form 
+      v-loading="loading" 
+      :size="size" 
+      ref="orderEditForm" 
+      label-position="right" 
+      label-width="140px"
+      :model="params" 
+      :rules="rules"
+      >
       <el-card :body-style="{
         padding: '20px',
         display: 'flex',
@@ -240,50 +266,104 @@ export default {
           </div>
         </div>
         <el-row style="display:flex; flex-wrap: wrap;">
-          <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
-            <el-form-item :prop="column.key" :label="column.title">
-              <el-input v-if="column.inputType === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input>
-              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" v-model="params[column.key]" size="mini"
-                :value-key="column.valueKey" :source.sync="params" :title="column.title" :type="column.referName"
-                :multiple="column.multiple" :placeholder="column.placeholder" :data-mapping="column.dataMapping"
-                :disabled="column.disabled" :query-params="column.queryParams(params)">
-              </dr-popover-select>
-              <el-input v-if="column.inputType === 'Textarea'" v-model="params[column.key]" type="textarea"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
-              </el-input>
-              <el-input-number v-if="column.inputType === 'InputNumber'" v-model="params[column.key]"
-                :max="handleIsRevise(params.status) ? params[column.key] : 'Infinity'"
-                :controls-position="column.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
-              </el-input-number>
-              <el-select v-if="column.inputType === 'Select'" v-model="params[column.key]" :disabled="column.disabled"
-                :clearable="column.clearable" :placeholder="column.placeholder" style="width: 100%">
-                <el-option v-for="item in dict.type[column.referName]" :key="item.value" :label="item.label"
-                  :value="item.value">
-                </el-option>
+          <el-col 
+            v-for="(column, index) in columns" 
+            :key="index" 
+            :span="column.span || 6"
+            >
+            <el-form-item :prop="column.key" :label="column.title" v-if="column.isShow">
+
+              <el-input v-if="column.inputType === 'Input'" 
+                v-model="params[column.key]" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                ></el-input>
+              <dr-popover-select v-if="column.inputType === 'PopoverSelect'" 
+                v-model="params[column.key]" 
+                size="mini"
+                :value-key="column.valueKey" 
+                :source.sync="params" 
+                :title="column.title" 
+                :type="column.referName"
+                :multiple="column.multiple" 
+                :placeholder="column.placeholder" 
+                :data-mapping="column.dataMapping"
+                :disabled="column.disabled" 
+                :query-params="column.queryParams(params)"
+                ></dr-popover-select>
+              <el-input v-if="column.inputType === 'Textarea'" 
+                v-model="params[column.key]" 
+                type="textarea"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                ></el-input>
+              <el-input-number v-if="column.inputType === 'InputNumber'" 
+                v-model="params[column.key]"
+                :max="handleIsRevise(params.status) ? params[column.key] : Infinity"
+                :controls-position="column.controlsPosition" 
+                :placeholder="column.placeholder"
+                :clearable="column.clearable" 
+                :disabled="column.disabled" 
+                style="width: 100%"
+                ></el-input-number>
+              <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%"
+                >
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-select v-if="column.inputType === 'TagSelect'" v-model="params[column.key]" multiple clearable
-                collapse-tags :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%">
+              <el-select v-if="column.inputType === 'TagSelect'" 
+                v-model="params[column.key]" 
+                multiple 
+                clearable
+                collapse-tags 
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                style="width: 100%"
+                >
                 <template #prefix>
                   <el-icon class="el-icon-view" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
                 </template>
-                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                </el-option>
+                <el-option 
+                  v-for="item in options" 
+                  :key="item.value" 
+                  :label="item.label" 
+                  :value="item.value"
+                  ></el-option>
               </el-select>
-              <el-date-picker v-if="column.inputType === 'DatePicker'" v-model="params[column.key]" :type="column.type"
-                :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :picker-options="column.pickerOptions" style="width: 100%">
-              </el-date-picker>
-              <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
-                true-label="Y" false-label="N">
-              </el-checkbox>
-              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
-                :file-type="column.fileType">
-              </file-upload-center>
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]" 
+                :type="column.type"
+                :placeholder="column.placeholder" 
+                :clearable="column.clearable" 
+                :disabled="column.disabled"
+                :picker-options="column.pickerOptions" 
+                style="width: 100%"
+                ></el-date-picker>
+              <el-checkbox v-if="column.inputType === 'Checkbox'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                true-label="Y"
+                false-label="N"
+                > </el-checkbox>
+              <file-upload-center v-if="column.inputType === 'Upload'" 
+                v-model="params[column.key]"
+                :file-type="column.fileType" 
+                :disabled="handleIsRevise(params.status)"
+                ></file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>
@@ -295,50 +375,87 @@ export default {
         position: 'relative',
       }" style="margin: 10px">
         <el-tabs v-model="tabName" style="width: 100%">
-          <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
+          <el-tab-pane 
+            v-for="(column, index) in tabColumns" 
+            :key="index" 
+            :label="column.title" 
+            :name="column.key"
+            >
             <el-table :data="params[column.key]" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
                 </template>
               </el-table-column>
-              <el-table-column v-for="(cColumn, cIndex) in column.tableColumns" :key="cIndex" :prop="cColumn.key"
-                :label="cColumn.title" :width="cColumn.width">
+              <el-table-column 
+                v-for="(cColumn, cIndex) in column.tableColumns" 
+                :key="cIndex" 
+                :prop="cColumn.key"
+                :label="cColumn.title" 
+                :width="cColumn.width"
+                >
                 <template slot-scope="scope">
 
                   <span v-if="!cColumn.inputType">
                     {{ scope.row[cColumn.key] }}
                   </span>
 
-                  <el-input v-if="cColumn.inputType === 'Input'" v-model="scope.row[cColumn.key]"
-                    :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%">
-                  </el-input>
+                  <el-input v-if="cColumn.inputType === 'Input'" 
+                    v-model="scope.row[cColumn.key]"
+                    :placeholder="cColumn.placeholder" 
+                    :clearable="cColumn.clearable" 
+                    :disabled="cColumn.disabled"
+                    :size="size" 
+                    style="width: 100%"
+                    ></el-input>
 
-                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" v-model="scope.row[cColumn.key]"
-                    :source.sync="scope.row" :title="cColumn.title" :value-key="cColumn.valueKey"
-                    :disabled="cColumn.disabled" :type="cColumn.referName" :multiple="cColumn.multiple"
-                    :placeholder="cColumn.placeholder" :data-mapping="cColumn.dataMapping"
-                    :query-params="cColumn.queryParams(scope.row)" size="mini" @change="handleReferChange">
-                  </dr-popover-select>
+                  <dr-popover-select v-if="cColumn.inputType === 'PopoverSelect'" 
+                    v-model="scope.row[cColumn.key]"
+                    :source.sync="scope.row" 
+                    :title="cColumn.title" 
+                    :value-key="cColumn.valueKey"
+                    :disabled="cColumn.disabled" 
+                    :type="cColumn.referName" 
+                    :multiple="cColumn.multiple"
+                    :placeholder="cColumn.placeholder" 
+                    :data-mapping="cColumn.dataMapping"
+                    :query-params="cColumn.queryParams(scope.row)" 
+                    size="mini" 
+                    @change="handleReferChange"
+                  ></dr-popover-select>
 
-                  <el-select v-if="cColumn.inputType === 'Select'" v-model="scope.row[cColumn.key]" size="mini"
-                    :disabled="cColumn.disabled" :clearable="cColumn.clearable" :placeholder="cColumn.placeholder"
-                    style="width: 100%">
-                    <el-option v-for="item in dict.type[cColumn.referName]" :key="item.value" :label="item.label"
-                      :value="item.value">
-                    </el-option>
+                  <el-select v-if="cColumn.inputType === 'Select'" 
+                    v-model="scope.row[cColumn.key]" size="mini"
+                    :disabled="cColumn.disabled" 
+                    :clearable="cColumn.clearable" 
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  >
+                    <el-option 
+                      v-for="item in dict.type[cColumn.referName]" 
+                      :key="item.value" 
+                      :label="item.label"
+                      :value="item.value"
+                    ></el-option>
                   </el-select>
 
-                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" v-model="scope.row[cColumn.key]"
-                    :disabled="cColumn.disabled" true-label="Y" false-label="N">
-                  </el-checkbox>
-                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" v-model="scope.row[cColumn.key]"
+                  <el-checkbox v-if="cColumn.inputType === 'Checkbox'" 
+                    v-model="scope.row[cColumn.key]"
+                    :disabled="cColumn.disabled" 
+                    true-label="Y" 
+                    false-label="N"
+                  ></el-checkbox>
+                  <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
+                    v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.controlsPosition"
-                    :max="handleIsRevise(params.status) ? scope.row[cColumn.key] : 'Infinity'"
-                    @change="handleInputChange(scope.row, cColumn.key)" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
-                  </el-input-number>
+                    :max="handleIsRevise(params.status) ? scope.row[cColumn.key] : Infinity"
+                    @change="handleInputChange(scope.row, cColumn.key)" 
+                    :placeholder="cColumn.placeholder"
+                    :clearable="cColumn.clearable" 
+                    :disabled="cColumn.disabled" 
+                    :size="size" 
+                    style="width: 100%"
+                  ></el-input-number>
                 </template>
               </el-table-column>
 
@@ -347,10 +464,12 @@ export default {
               编辑:自制:可删可增 -->
               <el-table-column fixed="right" label="操作" width="120">
                 <template slot-scope="scope">
-                  <el-button v-if="params.source == '3' && !handleIsRevise(params.status)" @click.native.prevent="
-                    delTableRow(params[tabName], scope.$index)
-                    " type="text" size="small">
-                    删行
+                  <el-button 
+                    v-if="params.source == '3' && !handleIsRevise(params.status)" 
+                    @click.native.prevent="delTableRow(params[tabName], scope.$index)" 
+                    type="text" 
+                    size="small"
+                    > 删行
                   </el-button>
                 </template>
               </el-table-column>

+ 17 - 4
src/views/purchase/purchase-order/edit/initColumn.js

@@ -27,15 +27,28 @@ export const forbidden = (isEdit) => {
     console.log('编辑');
     // 编辑
     editColumns.forEach(item => {
-      item.disabled = false;
-      item.readonly = false;
+
+      if(item.key == 'code' || item.key == 'status'){
+
+        item.disabled = true;
+        item.readonly = true;
+      }else{
+        item.disabled = false;
+        item.readonly = false;
+      }
     })
 
     editTabColumns.forEach(item => {
 
       item.tableColumns.forEach(t => {
-        t.disabled = false;
-        t.readonly = false;
+
+        if(t.key == 'rowno' ||t.key == 'rowNo'){
+          t.disabled = true;
+          t.readonly = true;
+        }else{
+          t.disabled = false;
+          t.readonly = false;
+        }
       })
     })
   } else {

+ 10 - 5
src/views/purchase/purchase-order/index.vue

@@ -171,18 +171,17 @@ export default {
     async handleSubmit(row) {
       try {
 
-        this.loading = true;
-
         let { code } = await orderApi.submit({ puOrderId: row.id });
 
-        if (code === 200) {
+        if (code == 200) {
+
           this.fetchList(this.params, this.page);
+
         }
 
       } catch (error) {
 
       } finally {
-        this.loading = false;
       }
     },
     // 判断“退回”按钮
@@ -276,7 +275,13 @@ export default {
     <AddDrawer ref="addDrawerFef" @close="handleRefreshList"></AddDrawer>
     <EditDrawer ref="editDrawerFef" @close="handleRefreshList"></EditDrawer>
 
-    <el-form size="mini" label-position="right" label-width="100px" :model="params" style="padding: 20px 0 0 0">
+    <el-form 
+      size="mini" 
+      label-position="right" 
+      label-width="100px" 
+      :model="params" 
+      style="padding: 20px 0 0 0"
+    >
       <el-row :gutter="24" style="display:flex; flex-wrap: wrap;">
         <el-col :span="20">
           <el-row :gutter="20">

+ 11 - 12
src/views/purchase/purchase-order/see/index.vue

@@ -24,6 +24,9 @@ NewTabColumns.forEach(column => {
 export default {
   name: "SeePurchaseOrderDrawer",
   dicts: initDicts(SelectColumns),
+  components: {
+    FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
+  },
   data() {
     return {
       visible: false,
@@ -53,7 +56,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = data;
-        } 
+        }
       } catch (err) {
         //
       } finally {
@@ -73,7 +76,10 @@ export default {
 };
 </script>
 <template>
-  <el-drawer direction="btt" size="100%" :with-header="false" :visible.sync="visible" @open="beforeOpen"
+  <el-drawer 
+    direction="btt" 
+    size="100%" 
+    :with-header="false" :visible.sync="visible" @open="beforeOpen"
     @close="$emit('close')">
     <el-form size="mini" label-position="right" label-width="140px" :model="params" :rules="rules">
       <el-card :body-style="{
@@ -134,16 +140,9 @@ export default {
               <el-checkbox v-if="column.inputType === 'Checkbox'" v-model="params[column.key]" disabled true-label="Y"
                 false-label="N">
               </el-checkbox>
-              <el-upload v-if="column.inputType === 'Upload'" :file-list="params[column.key]" disabled drag
-                action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                <i class="el-icon-upload"></i>
-                <div class="el-upload__text">
-                  将文件拖到此处,或<em>点击上传</em>
-                </div>
-                <div class="el-upload__tip" slot="tip">
-                  只能上传jpg/png文件,且不超过500kb
-                </div>
-              </el-upload>
+              <file-upload-center v-if="column.inputType === 'Upload'" v-model="params[column.key]"
+                :file-type="column.fileType" :disabled="true">
+              </file-upload-center>
             </el-form-item>
           </el-col>
         </el-row>

+ 60 - 4
src/views/purchase/transferOrder/add.vue

@@ -158,7 +158,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventory, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -235,7 +235,7 @@
           <el-table-column label="物料编码" align="center" prop="material" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input readonly size="small" v-model="scope.row.material">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.material" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
@@ -267,7 +267,24 @@
             </template>
           </el-table-column>
           <el-table-column label="税率" align="center" prop="rate"/>
-          <!-- <el-table-column label="调入仓库" align="center" prop="storageWarehouseName"/> -->
+          <el-table-column label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column label="调入货位" align="center" prop="storageAllocationName" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
+                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="批次号" align="center" prop="patchNo" width="150px"/>
           <el-table-column label="产品批号" align="center" prop="producBatch" width="230px">
             <template slot-scope="scope">
@@ -292,6 +309,19 @@
             </template>
           </el-table-column>
           <el-table-column label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
+          <el-table-column label="调拨日期" align="center" prop="allotDate" width="230px">
+            <template slot-scope="scope">
+              <el-form-item class="hang">
+                <el-date-picker
+                  v-model="scope.row.allotDate"
+                  :readonly="sonDisable"
+                  type="date"
+                  size="small"
+                  value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </el-form-item>
+            </template>
+          </el-table-column>
           <el-table-column label="批准文号" align="center" prop="ratifyCode" width="200px"/>
           <el-table-column label="注册证号" align="center" prop="registration" width="200px"/>
           <el-table-column label="商品名" align="center" prop="productCode" width="150px"/>
@@ -589,6 +619,7 @@ export default {
         deliveryCode: '',
         storageCode: '',
         storageInventoryOrg: '',
+        storageInventory: '',
         storageInventoryOrgName: '',
         businessPersonal: '',
         businessPersonalName: '',
@@ -622,6 +653,8 @@ export default {
         type: '',
         isPage: true,
         title: '',
+        // 仓库编码
+        stordocId: ''
       },
       referConditionMx: {
         orgCode: '',
@@ -703,7 +736,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -778,10 +811,15 @@ export default {
         mainQty: null,
         rate: '0.00',
         storageWarehouseName: null,
+        deliveryAllocationName: null,
+        deliveryAllocation: null,
+        storageAllocationName: null,
+        storageAllocation: null,
         patchNo: null,
         producBatch: null,
         manufactureDate: null,
         periodEndDate: null,
+        allotDate: null,
         ratifyCode: null,
         registration: null,
         productCode: null,
@@ -819,6 +857,7 @@ export default {
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
         this.basicForm.storageInventoryOrg = selection[0].id
+        this.basicForm.storageInventory = selection[0].code
         this.basicForm.storageInventoryOrgName = selection[0].name
         this.basicForm.onRouteAffilliation = selection[0].name
         // 选择调入库存组织时判断调拨方式
@@ -853,6 +892,14 @@ export default {
         this.basicForm.deliveryWarehouse = selection[0].id
         this.basicForm.deliveryWarehouseName = selection[0].name
       }
+      if (this.referCondition.title == '调出货位') {
+        this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name
+        this.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '调入货位') {
+        this.materialInfo[this.tableIndex].storageAllocationName = selection[0].name
+        this.materialInfo[this.tableIndex].storageAllocation = selection[0].id
+      }
     },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type
@@ -899,6 +946,15 @@ export default {
     selectBatch(selection) {
       console.log('选中的批次号', selection)
     },
+    // 明细行选择货位
+    chooseMxHW(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
   }
 }
 </script>

+ 5 - 1
src/views/purchase/transferOrder/index.vue

@@ -94,7 +94,11 @@
           <el-table-column label="订单类型" align="center" prop="billType" width="150px"/>
           <el-table-column label="单据号" align="center" prop="code" width="150px"/>
           <el-table-column label="单据日期" align="center" prop="billDate" width="150px"/>
-          <el-table-column label="调拨方式" align="center" prop="allotType" width="150px"/>
+          <el-table-column label="调拨方式" align="center" prop="allotType" width="150px">
+            <template slot-scope="scope">
+              <span>{{ scope.row.allotType == '2' ? '财务组织间调拨' : '财务组织内库存组织内调拨' }}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
           <el-table-column label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
           <el-table-column label="调拨入库组织" align="center" prop="storageInventoryOrgName" width="150px"/>

+ 8 - 6
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        // target: `http://test-sy.derom.com/drp-admin`, //测试
+        target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
@@ -46,6 +46,7 @@ module.exports = {
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
         // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
+        // target: `http://127.0.0.1:8000/drp-admin`, //
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",
@@ -57,7 +58,8 @@ module.exports = {
         pathRewrite: { [`^/drp-file`]: "" },
       },
       "/file": {
-        target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        // target: process.env.NODE_ENV == "development" ? `https://test-sy.derom.com` : `https://sy.derom.com`,
+        target: `https://sy.derom.com`,
         changeOrigin: true,
         pathRewrite: { [`^/file`]: "" },
       },
@@ -142,10 +144,10 @@ module.exports = {
         },
       });
       config.optimization.runtimeChunk("single"),
-        {
-          from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
-          to: "./", //到根目录下
-        };
+      {
+        from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
+        to: "./", //到根目录下
+      };
     });
   },
 };