Browse Source

物料基本信息-列表调整适配检索框变化以及详情字段间距调整

002390 1 year ago
parent
commit
0b7fd5ba65
2 changed files with 457 additions and 293 deletions
  1. 49 45
      src/views/material/basicFile/details.vue
  2. 408 248
      src/views/material/basicFile/index.vue

+ 49 - 45
src/views/material/basicFile/details.vue

@@ -18,7 +18,7 @@
             <el-col :span="1.5">
               <el-button-group>
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleSave"
                   v-hasPermi="[
                     'system:material:add',
@@ -32,7 +32,7 @@
 
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleCancel">取消</el-button>
+                <el-button :size="size" @click="handleCancel">取消</el-button>
               </el-button-group>
             </el-col>
           </el-row>
@@ -41,30 +41,30 @@
             <!-- 新增、修改、删除、复制 -->
             <el-col :span="1.5">
               <el-button-group>
-                <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
-                <el-button size="small" @click="handleBasicEdit"
+                <!-- <el-button :size="size" @click="handleInster">新增</el-button> -->
+                <el-button :size="size" @click="handleBasicEdit"
                   >修改</el-button
                 >
-                <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
-                <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
+                <!-- <el-button :size="size" @click="handleDel">删除</el-button> -->
+                <!-- <el-button :size="size" @click="handleCopy">复制</el-button> -->
               </el-button-group>
             </el-col>
 
             <!-- 查询、刷新、过滤 -->
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleRefresh">刷新</el-button>
+                <el-button :size="size" @click="handleRefresh">刷新</el-button>
               </el-button-group>
             </el-col>
 
             <!-- 启用 -->
             <el-col :span="1.5">
               <el-button-group>
-                <el-button size="small" @click="handleMaterialType"
+                <el-button :size="size" @click="handleMaterialType"
                   >维护物料类别</el-button
                 >
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleIsInvoke"
                   :key="count"
                   v-hasPermi="['system:material:add']"
@@ -79,7 +79,7 @@
             <el-col :span="1.5">
               <el-button-group>
                 <el-button
-                  size="small"
+                  :size="size"
                   @click="handleNewVersion"
                   v-hasPermi="['system:material:versions']"
                   >维护新版本
@@ -99,18 +99,18 @@
         >
           <el-col :span="1.5">
             <el-button-group>
-              <el-button size="small" @click="handleOtherEdit('table')"
+              <el-button :size="size" @click="handleOtherEdit('table')"
                 >修改</el-button
               >
               <el-button
-                size="small"
+                :size="size"
                 v-show="activeMainTab != 'material_finance'"
                 @click="handleOtherDel"
                 >删除</el-button
               >
             </el-button-group>
             <el-button-group>
-              <el-button size="small" @click="handleOtherListRefresh"
+              <el-button :size="size" @click="handleOtherListRefresh"
                 >刷新</el-button
               >
             </el-button-group>
@@ -122,7 +122,7 @@
           <el-col :span="6">
             <!-- :disabled="headerParam.isEdit" -->
             <el-button
-              size="small"
+              :size="size"
               @click="handleBack"
               :disabled="updateButtonGroup"
               >返回</el-button
@@ -303,6 +303,7 @@
                             v-model="basicData.value[f.prop]"
                             :type="f.attribute || 'text'"
                             :readonly="handleJudge(f)"
+                            :rows="1"
                             :maxlength="judgeMaxLength(f.prop)"
                           ></el-input>
                         </el-form-item>
@@ -488,6 +489,7 @@
                                 size="mini"
                                 v-model="medcineData.value[m.prop]"
                                 :type="m.attribute || 'text'"
+                                :rows="1"
                                 :readonly="
                                   !(
                                     updateButtonGroup &&
@@ -644,13 +646,13 @@
         <el-col :span="1.5">
           <el-button-group>
             <el-button
-              size="small"
+              :size="size"
               :disabled="!materialType.isEdit"
               @click="handleMaterialTypeRow('add')"
               >增行
             </el-button>
             <el-button
-              size="small"
+              :size="size"
               :disabled="!materialType.isEdit"
               @click="handleMaterialTypeRow('del')"
               >删行
@@ -658,18 +660,18 @@
           </el-button-group>
           <el-button-group>
             <el-button
-              size="small"
+              :size="size"
               @click="handleMaterialTypeRow('edit')"
               v-hasPermi="['system:material:add']"
               >{{ materialType.isEdit ? "保存" : "修改" }}
             </el-button>
             <el-button
-              size="small"
+              :size="size"
               v-if="materialType.isEdit"
               @click="handleMaterialTypeRow('cancal')"
               >取消</el-button
             >
-            <el-button size="small" @click="handleMaterialTypeRow"
+            <el-button :size="size" @click="handleMaterialTypeRow"
               >刷新</el-button
             >
           </el-button-group>
@@ -774,21 +776,21 @@
         <el-row :gutter="10" class="mb10" type="flex" justify="end">
           <el-col :span="1.5" v-if="!otherDeatils.isEdit">
             <el-button-group>
-              <el-button size="small" @click="handleOtherEdit('form')"
+              <el-button :size="size" @click="handleOtherEdit('form')"
                 >修改</el-button
               >
-              <!-- <el-button size="small" @click="handleOtherDel">删除</el-button> -->
+              <!-- <el-button :size="size" @click="handleOtherDel">删除</el-button> -->
             </el-button-group>
             <el-button-group>
-              <el-button size="small" @click="handleOtherRefresh"
+              <el-button :size="size" @click="handleOtherRefresh"
                 >刷新</el-button
               >
             </el-button-group>
           </el-col>
           <el-col :span="1.5" v-else>
             <el-button-group>
-              <el-button size="small" @click="handleOtherSave">保存</el-button>
-              <el-button size="small" @click="handleOtherCancel"
+              <el-button :size="size" @click="handleOtherSave">保存</el-button>
+              <el-button :size="size" @click="handleOtherCancel"
                 >取消</el-button
               >
             </el-button-group>
@@ -805,21 +807,21 @@
               <el-form-item label="物料编码">
                 <el-input
                   v-model="basicData.value.code"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
               <el-form-item label="物料名称">
                 <el-input
                   v-model="basicData.value.name"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
               <el-form-item label="英文名称">
                 <el-input
                   v-model="basicData.value.enName"
-                  size="small"
+                  :size="size"
                   readonly
                 ></el-input>
               </el-form-item>
@@ -915,7 +917,7 @@
                       <!--attribute 文本 数字 文本域 为null -->
                       <el-form-item v-else :label="f.name">
                         <el-input
-                          size="small"
+                          :size="size"
                           v-model="otherDeatils.value[f.prop]"
                           :type="f.attribute || 'text'"
                           :readonly="!(otherDeatils.isEdit && f.edit)"
@@ -939,28 +941,28 @@
                 <el-form-item label="创建人">
                   <el-input
                     v-model="basicData.value.createByName"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="创建时间">
                   <el-input
                     v-model="basicData.value.createTime"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改人">
                   <el-input
                     v-model="basicData.value.updateByName"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
                 <el-form-item label="最后修改时间">
                   <el-input
                     v-model="basicData.value.updateTime"
-                    size="small"
+                    :size="size"
                     readonly
                   ></el-input>
                 </el-form-item>
@@ -1060,12 +1062,12 @@
         <el-row class="more-button">
           <el-button
             round
-            size="small"
+            :size="size"
             type="primary"
             @click="handleConfirmRefer"
             >确认</el-button
           >
-          <el-button round size="small" @click="handleConcalRefer"
+          <el-button round :size="size" @click="handleConcalRefer"
             >取消</el-button
           >
         </el-row>
@@ -2596,13 +2598,15 @@ export default {
       // diCode
       param.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;
-      });
+      materialApi
+        .insertMaterialInfo(param)
+        .then((res) => {
+          console.log(res, "保存物料以及相关页签");
+          if (res.code == 200) cb();
+        })
+        .catch((error) => {
+          this.loading = false;
+        });
     },
     // 保存财务信息——单个数据
     async handleSaveFinance(data) {
@@ -2943,9 +2947,9 @@ export default {
   }
 
   .md-content {
-    margin-top: 12px;
+    // margin-top: 12px;
     // height: calc(100vh - 260px);
-    height: calc(100vh - 228px);
+    // height: calc(100vh - 200px);
     box-sizing: border-box;
 
     .md-basic {
@@ -2960,7 +2964,7 @@ export default {
         }
 
         .el-form {
-          max-height: 350px;
+          max-height: 430px;
           overflow-y: auto;
           overflow-x: hidden;
 
@@ -3085,7 +3089,7 @@ export default {
 <style scoped>
 .md-content >>> .el-form-item,
 .otherDialog >>> .el-form-item {
-  margin-bottom: 10px;
+  margin-bottom: 0px;
 }
 
 .md-content >>> .el-tabs--border-card > .el-tabs__content {

+ 408 - 248
src/views/material/basicFile/index.vue

@@ -2,11 +2,17 @@
 <script src="../../../main.js"></script>
 <template>
   <div class="material-basic" v-loading="failLoad">
-
     <!-- 主体列表 -->
-    <el-card class="material-list" v-loading="loading">
-
-    <div style="margin: 0 0 10px 0;">
+    <el-card
+      class="material-list"
+      v-loading="loading"
+      :body-style="{
+        height: '100%',
+        padding: '10px ',
+        display: 'flex',
+        'flex-direction': 'column',
+      }"
+    >
       <!-- 查询条件 -->
       <el-super-search
         v-model="params"
@@ -16,14 +22,14 @@
         @reset="handleResetQuery"
         @submit="handleQuery"
       ></el-super-search>
-    
-    </div>
-    <!-- 操作栏 -->
-      <el-row 
-        :gutter="10" 
+
+      <!-- 操作栏 -->
+      <el-row
+        :gutter="10"
         class="mb10"
         type="flex"
         justify="end"
+        style="margin: 10px 0"
       >
         <!-- 新增、修改、删除、复制 -->
         <el-col :span="1.5">
@@ -36,10 +42,14 @@
         <!-- 启用 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button :size="size" @click="handleIsInvoke" :disabled="checkedList.length != 1"
-                       v-hasPermi="['system:material:add']">
+            <el-button
+              :size="size"
+              @click="handleIsInvoke"
+              :disabled="checkedList.length != 1"
+              v-hasPermi="['system:material:add']"
+            >
               <!-- 0:启用  2:停用 -->
-              {{ handleJudgeIsUsing() ? '停用' : '启用' }}
+              {{ handleJudgeIsUsing() ? "停用" : "启用" }}
             </el-button>
           </el-button-group>
         </el-col>
@@ -47,144 +57,237 @@
         <!-- 导入导出 -->
         <el-col :span="1.5">
           <el-button-group>
-            <el-button :size="size" @click="handleImport" v-hasPermi="['system:material:import']">批量导入</el-button>
-            <el-button :size="size" @click="handleExport" v-hasPermi="['system:material:export']">批量导出</el-button>
+            <el-button
+              :size="size"
+              @click="handleImport"
+              v-hasPermi="['system:material:import']"
+              >批量导入</el-button
+            >
+            <el-button
+              :size="size"
+              @click="handleExport"
+              v-hasPermi="['system:material:export']"
+              >批量导出</el-button
+            >
           </el-button-group>
         </el-col>
-
-
       </el-row>
 
-      <el-table 
-        v-if="tableHeader.length"
-        border 
-        :data="taskList" 
-        ref="materialTable" 
-        max-height="525"
-        @cell-dblclick="handledbClick" 
-        :row-key="getRowKey"
-        @selection-change="handleSelectionChange" 
-        @select="handleSelect" 
-        @select-all="handleSelectAll"
-        :size="size"
+      <div
+        class="el-super-ux-table"
+        v-resize="resize"
+        style="
+          position: relative;
+          display: flex;
+          flex: 1;
+          flex-direction: column;
+          overflow: auto;
+        "
       >
-        <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true" fixed/>
-        <el-table-column type="index" label="序号" width="55" align="center"/>
-        <el-table-column 
-          width="150" 
-          v-for="h in  tableHeader" v-if="h.show" 
-          :label="h.name" 
-          align="center"
-          show-overflow-tooltip
+        <ux-grid
+          v-if="tableHeader.length"
+          border
+          use-virtual
+          keep-source
+          beautify-table
+          :size="size"
+          :data="taskList"
+          :height="tableHeight"
+          ref="materialTable"
+          @cell-dblclick="handledbClick"
+          @selection-change="handleSelectionChange"
+          @select="handleSelect"
+          @select-all="handleSelectAll"
+          :header-row-style="{
+            color: '#515a6e',
+          }"
+          style="flex: 1"
         >
-          <template slot-scope="scope">
-            <span v-if="h.apiUrl">{{scope.row[`${h.prop}Name`]}}</span>
-            <el-checkbox 
-              v-else-if="h.attribute == 'checkbox'"
-              v-model="scope.row[h.prop]"
-              disabled
-              true-label="0" 
-              false-label="2"
-            ></el-checkbox>
-            <el-dict-tag
-              v-else-if="h.dictId"
-              :value="scope.row[h.prop]"
-              :options="dict.type[h.dictId]"
-            ></el-dict-tag>
-
-            <span v-else>{{ scope.row[h.prop] || '--' }}</span>
-            <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
-            (h.attribute == 'checkbox' ?
-            (scope.row[h.prop] == '0' ? '√' : '')
-            : scope.row[h.prop])
-            }} -->
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <pagination
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="handleQuery"
-        style="height: 32px; padding: 0 !important; "
-      />
-
+          <
+          <!-- 多选 -->
+          <ux-table-column
+            fixed="left"
+            width="60"
+            align="center"
+            type="checkbox"
+            resizable
+            reserve-selection
+            :column-key="rowKey"
+          ></ux-table-column>
+          <!-- 序号 -->
+          <ux-table-column
+            fixed="left"
+            width="50"
+            title="序号"
+            type="index"
+            align="center"
+            class="is-index"
+            resizable
+          ></ux-table-column>
+          <!-- <ux-table-column type="selection" width="45" :reserve-selection="true" fixed/>
+          <ux-table-column type="index" title="序号" width="55" align="center"/> -->
+          <ux-table-column
+            width="150"
+            v-for="h in tableHeader"
+            v-if="h.show"
+            :title="h.name"
+            align="center"
+            resizable
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <span v-if="h.apiUrl">{{ scope.row[`${h.prop}Name`] }}</span>
+              <el-checkbox
+                v-else-if="h.attribute == 'checkbox'"
+                v-model="scope.row[h.prop]"
+                disabled
+                true-label="0"
+                false-label="2"
+              ></el-checkbox>
+              <el-dict-tag
+                v-else-if="h.dictId"
+                :value="scope.row[h.prop]"
+                :options="dict.type[h.dictId]"
+              ></el-dict-tag>
+
+              <span v-else>{{ scope.row[h.prop] || "--" }}</span>
+              <!-- {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+              (h.attribute == 'checkbox' ?
+              (scope.row[h.prop] == '0' ? '√' : '')
+              : scope.row[h.prop])
+              }} -->
+            </template>
+          </ux-table-column>
+        </ux-grid>
+        <div
+          style="
+            height: 50px;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+          :style="{
+            height: '50px',
+          }"
+        >
+          <pagination
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="handleQuery"
+            style="
+              height: 32px;
+              padding: 0 !important;
+              flex: 1;
+              overflow-x: auto;
+            "
+          />
+        </div>
+      </div>
     </el-card>
 
     <!-- 操作提示 -->
-    <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
+    <el-dialog
+      title="操作提示"
+      :visible.sync="optionDialog.show"
+      width="30%"
+      center
+    >
       <span>是否确认{{ optionDialog.op }}?</span>
       <span slot="footer">
         <el-button @click="handleOptionShow('option', false)">取 消</el-button>
-        <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
+        <el-button type="primary" @click="handleComfirmOption('cancal')"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
 
     <!-- 导入弹窗 -->
-    <el-dialog title="批量导入" :visible.sync="importData.show" width="35%" center :before-close="handlefileDialogColse">
+    <el-dialog
+      title="批量导入"
+      :visible.sync="importData.show"
+      width="35%"
+      center
+      :before-close="handlefileDialogColse"
+    >
       <div class="mb-import">
-        <el-upload class="upload-demo" accept=".xls, .xlsx" ref="upload" action="#" :on-remove="handleFileRemove"
-                   :file-list="importData.list" :auto-upload="false" :on-change="handleChangeFile" :limit="1">
-          <el-button slot="trigger" :size="size" type="primary">选取文件</el-button>
-          <el-button style="margin-left: 10px;" :size="size" type="success" @click="handleDownTemplate">下载模板</el-button>
+        <el-upload
+          class="upload-demo"
+          accept=".xls, .xlsx"
+          ref="upload"
+          action="#"
+          :on-remove="handleFileRemove"
+          :file-list="importData.list"
+          :auto-upload="false"
+          :on-change="handleChangeFile"
+          :limit="1"
+        >
+          <el-button slot="trigger" :size="size" type="primary"
+            >选取文件</el-button
+          >
+          <el-button
+            style="margin-left: 10px"
+            :size="size"
+            type="success"
+            @click="handleDownTemplate"
+            >下载模板</el-button
+          >
           <div slot="tip" class="el-upload__tip">只能上传Excel文件</div>
         </el-upload>
-
       </div>
       <span slot="footer">
         <el-button @click="handleImportData('cancal')">取 消</el-button>
-        <el-button type="primary" @click="handleImportData('confirm')">确 定</el-button>
+        <el-button type="primary" @click="handleImportData('confirm')"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
-
   </div>
 </template>
 
 <script>
-import './style/index.scss';
-import materialApi from '@/api/material/basic';
-import { SearchColumns,OtherDictColumns } from './columns';
+import "./style/index.scss";
+import materialApi from "@/api/material/basic";
+import { SearchColumns, OtherDictColumns } from "./columns";
 import { initDicts } from "@/utils/init.js";
 
 export default {
   name: "material-basic",
-  dicts:[...initDicts([...SearchColumns,...OtherDictColumns])],
+  dicts: [...initDicts([...SearchColumns, ...OtherDictColumns])],
   components: {
     ElSuperSearch: () => import("@/components/super-search/index.vue"),
     ElDictTag: () => import("@/components/DictTag/index.vue"),
-    
   },
   data() {
     const params = this.$init.params(SearchColumns);
-  
+
     return {
       failLoad: false,
-      params:params,
-      SearchColumns:SearchColumns,
-      size:'mini',
+      params: params,
+      SearchColumns: SearchColumns,
+      rowKey: "id",
+      size: "mini",
       // 物料基本信息数据
       taskList: [],
       // 查询表单字段
       queryForm: {
-        name: '',
-        code: '',
-        isEnable: '',
+        name: "",
+        code: "",
+        isEnable: "",
       },
       // 总条数
       total: 1,
       loading: false,
       importData: {
         show: false,
-        list: []
+        list: [],
       },
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 50,
         code: null,
-        name: null
+        name: null,
       },
       // 表头
       tableHeader: [],
@@ -195,23 +298,61 @@ export default {
       // 操作弹窗
       optionDialog: {
         show: false,
-        op: ''
+        op: "",
       },
-    }
+      resizeHeight: 0,
+    };
+  },
+  computed: {
+    tableHeight: {
+      get() {
+        return this.resizeHeight;
+      },
+      set() {},
+    },
+  },
+  directives: {
+    // 使用局部注册指令的方式
+    resize: {
+      // 指令的名称
+      bind(el, binding) {
+        // el为绑定的元素,binding为绑定给指令的对象
+        let width = "",
+          height = "";
+        function isReize() {
+          const style = document.defaultView.getComputedStyle(el);
+          if (width !== style.width || height !== style.height) {
+            binding.value(); // 关键
+          }
+          width = style.width;
+          height = style.height;
+        }
+        el.__vueSetInterval__ = setInterval(isReize, 300);
+      },
+      unbind(el) {
+        clearInterval(el.__vueSetInterval__);
+      },
+    },
   },
-
   methods: {
+    resize() {
+      this.resizeHeight =
+        document.getElementsByClassName("el-super-ux-table")[0].offsetHeight -
+        55;
+    },
     // 判读是否启用
     handleJudgeIsUsing() {
-      return this.checkedList.length == 1 && this.checkedList[0].isEnable == '已启用';
+      return (
+        this.checkedList.length == 1 && this.checkedList[0].isEnable == "已启用"
+      );
     },
-    
+
     // 新增
     handleInster() {
       this.$notify({
-        title: '警告',
-        message: '物料只能通过申请审批增加,不能在节点直接录入!',
-        type: 'warning'
+        title: "警告",
+        message: "物料只能通过申请审批增加,不能在节点直接录入!",
+        type: "warning",
       });
     },
     // 修改
@@ -220,43 +361,46 @@ export default {
         this.$router.push({
           path: `/material/basicFile/detail/${this.checkedList[0].id}`,
           query: {
-            isEdit: true
-          }
+            isEdit: true,
+          },
         });
       } else {
         this.$notify({
-          title: '警告',
-          message: `${this.checkedList.length > 1 ? '修改只能选择单个数据!' : '请选择需要修改的信息!'}`,
-          type: 'warning'
+          title: "警告",
+          message: `${
+            this.checkedList.length > 1
+              ? "修改只能选择单个数据!"
+              : "请选择需要修改的信息!"
+          }`,
+          type: "warning",
         });
       }
     },
     // 删除
     handleDel() {
-      console.log('删除', this.checkedList);
+      console.log("删除", this.checkedList);
       // delMaterial
       if (this.checkedList.length) {
-        let ids = this.checkedList.map(i => i.id);
-        materialApi.delMaterial(ids).then(res => {
+        let ids = this.checkedList.map((i) => i.id);
+        materialApi.delMaterial(ids).then((res) => {
           if (res.code == 200) {
             this.handleRefresh();
             // 清空选中数据
             this.checkedList = [];
             this.$refs.materialTable.clearSelection();
           }
-        })
+        });
       } else {
         this.$notify({
-          title: '警告',
+          title: "警告",
           message: `请选择需要删除的数据!`,
-          type: 'warning'
+          type: "warning",
         });
       }
-
     },
     // 复制
     handleCopy() {
-      console.log('复制');
+      console.log("复制");
     },
     //查询
     handleQuery() {
@@ -273,7 +417,7 @@ export default {
       // }
 
       this.queryParams.pageNum = 1;
-    
+
       this.queryParams.pageSize = 100;
 
       this.params = this.$init.params(SearchColumns);
@@ -287,35 +431,34 @@ export default {
       //   this.queryForm[key] = '';
       // }
     },
-  
+
     // 启用/停用
     handleIsInvoke() {
       // true   当前状态为启用,需要改为停用
       // 0:启用  2:停用
       let param = {
-        isEnable: this.handleJudgeIsUsing() ? '2' : '0',
-        id: this.checkedList[0].id
+        isEnable: this.handleJudgeIsUsing() ? "2" : "0",
+        id: this.checkedList[0].id,
       };
-      materialApi.updateEnableMaterial(param).then(res => {
+      materialApi.updateEnableMaterial(param).then((res) => {
         if (res.code == 200) {
           this.handleRefresh();
           // 清空选中数据
           this.checkedList = [];
           this.$refs.materialTable.clearSelection();
         }
-      })
-
+      });
     },
     isInvoke(val) {
       return val;
     },
     // 申请单查询
     handleQueryForm() {
-      console.log('申请单查询');
+      console.log("申请单查询");
     },
     // 批量导入
     handleImport() {
-      this.importData.show = true
+      this.importData.show = true;
     },
     // 导入弹窗关闭前
     handlefileDialogColse(done) {
@@ -326,59 +469,58 @@ export default {
     handleImportData(type) {
       switch (type) {
         // 取消
-        case 'cancal':
+        case "cancal":
           this.importData.list = [];
           this.importData.show = false;
           break;
         // 确认
-        case 'confirm':
+        case "confirm":
           if (this.importData.list.length) {
-
             let formData = new FormData();
 
-            formData.append('file', this.importData.list[0].raw);
-            materialApi.fileImport(formData).then(res => {
+            formData.append("file", this.importData.list[0].raw);
+            materialApi.fileImport(formData).then((res) => {
               if (res.code == 200) {
                 this.importData.show = false;
                 this.importData.list = [];
                 if (res.data.flag) {
                   this.failLoad = true;
-                  console.log(res.data.datas)
-                  let param = {failDatas: res.data.datas}
+                  console.log(res.data.datas);
+                  let param = { failDatas: res.data.datas };
                   if (null != param) {
-                    materialApi.exportMartial(param).then(res => {
+                    materialApi.exportMartial(param).then((res) => {
                       const blob = new Blob([res], {
                         type: "application/vnd.ms-excel;charset=UTF-8",
-                      });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+                      }); // 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
                       const downloadElement = document.createElement("a"); //创建a标签
                       const href = window.URL.createObjectURL(blob); // 创建下载的链接
-                      downloadElement.href = href;  //下载地址
-                      downloadElement.download = '导入失败的物料基础档案数据.xlsx'; // 下载后文件名
+                      downloadElement.href = href; //下载地址
+                      downloadElement.download =
+                        "导入失败的物料基础档案数据.xlsx"; // 下载后文件名
                       document.body.appendChild(downloadElement);
                       downloadElement.click(); // 点击下载
                       document.body.removeChild(downloadElement); // 下载完成移除元素
                       window.URL.revokeObjectURL(href); // 释放blob对象
                       this.failLoad = false;
-                    })
+                    });
                   }
                 }
                 this.$notify({
                   message: res.data.msg,
-                  type: res.data.flag ? 'warning' : 'success'
+                  type: res.data.flag ? "warning" : "success",
                 });
-                
               } else {
                 this.$notify({
                   message: res.msg,
-                  type: res.code == 200 ? 'success' : 'warning'
+                  type: res.code == 200 ? "success" : "warning",
                 });
               }
-            })
+            });
           } else {
             this.$notify({
-              title:'警告',
-              message: '请上传文件之后在确认!',
-              type: 'warning',
+              title: "警告",
+              message: "请上传文件之后在确认!",
+              type: "warning",
             });
           }
           break;
@@ -397,39 +539,53 @@ export default {
 
     // 批量导出
     handleExport() {
-
-      let ids = this.checkedList.length ? this.checkedList.map(i => i.id) : [];
+      let ids = this.checkedList.length
+        ? this.checkedList.map((i) => i.id)
+        : [];
 
       if (ids.length) {
-
         let params = {
           // orgId: '1',
           ids,
-        }
-        this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
+        };
+        this.download(
+          "/system/material/export",
+          params,
+          `物料基本信息${new Date().getTime()}.xlsx`
+        );
       } else {
         let params = {
-          templateCode:'material',
+          templateCode: "material",
           ...this.params,
-          createTimeBegin: (this.params.createTimeQueue && this.params.createTimeQueue[0]) || '',
-          createTimeEnd:(this.params.createTimeQueue && this.params.createTimeQueue[1]) || '',
-          updateTimeBegin:(this.params.updateTimeQueue && this.params.updateTimeQueue[0]) || '',
-          updateTimeEnd:(this.params.updateTimeQueue && this.params.updateTimeQueue[1]) || ''
-        }
-        this.download('/system/material/export', params, `物料基本信息${new Date().getTime()}.xlsx`);
+          createTimeBegin:
+            (this.params.createTimeQueue && this.params.createTimeQueue[0]) ||
+            "",
+          createTimeEnd:
+            (this.params.createTimeQueue && this.params.createTimeQueue[1]) ||
+            "",
+          updateTimeBegin:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[0]) ||
+            "",
+          updateTimeEnd:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[1]) ||
+            "",
+        };
+        this.download(
+          "/system/material/export",
+          params,
+          `物料基本信息${new Date().getTime()}.xlsx`
+        );
       }
-
     },
     // 下载模板
     handleDownTemplate() {
-      this.download('/system/material/download', {}, `物料基本信息模板.xlsx`)
+      this.download("/system/material/download", {}, `物料基本信息模板.xlsx`);
     },
 
-
     // 操作弹窗显隐
     handleOptionShow(type, val) {
       switch (type) {
-        case 'option':
+        case "option":
           this.optionDialog.show = val;
           break;
       }
@@ -437,13 +593,12 @@ export default {
     // 操作弹窗确认按钮
     handleComfirmOption(op) {
       switch (op) {
-        case 'cancal':
-          this.handleOptionShow('option', false);
+        case "cancal":
+          this.handleOptionShow("option", false);
           break;
       }
     },
 
-
     // 双击行
     handledbClick(e) {
       this.$router.push({
@@ -458,7 +613,7 @@ export default {
     handleUnique(arr, key) {
       // arr  需要去重的数组   type:作为去重依据的key
       const res = new Map();
-      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1))
+      return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1));
     },
     // 选中数据改变
     handleSelectionChange(list) {
@@ -470,7 +625,6 @@ export default {
       this.checkedList = selection;
       // // true就是选中,0或者false是取消选中
       // let selected = selection.length && selection.indexOf(row) !== -1
-
     },
     //手动勾选全选
     handleSelectAll(selection) {
@@ -478,38 +632,43 @@ export default {
     },
     // 获取物料列表信息
     async getMaterialList() {
-
       try {
         this.loading = true;
         let page = {
           pageNum: this.queryParams.pageNum,
           pageSize: this.queryParams.pageSize,
-        }
+        };
 
         let param = {
-          templateCode:'material',
+          templateCode: "material",
           ...this.params,
-          createTimeBegin: (this.params.createTimeQueue && this.params.createTimeQueue[0]) || '',
-          createTimeEnd:(this.params.createTimeQueue && this.params.createTimeQueue[1]) || '',
-          updateTimeBegin:(this.params.updateTimeQueue && this.params.updateTimeQueue[0]) || '',
-          updateTimeEnd:(this.params.updateTimeQueue && this.params.updateTimeQueue[1]) || ''
-        }
+          createTimeBegin:
+            (this.params.createTimeQueue && this.params.createTimeQueue[0]) ||
+            "",
+          createTimeEnd:
+            (this.params.createTimeQueue && this.params.createTimeQueue[1]) ||
+            "",
+          updateTimeBegin:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[0]) ||
+            "",
+          updateTimeEnd:
+            (this.params.updateTimeQueue && this.params.updateTimeQueue[1]) ||
+            "",
+        };
+
+        console.log(param, "param--------------");
+
+        let { code, data } = await materialApi.materialList(param, page);
 
-        console.log(param,'param--------------');
-
-        let {code,data} = await  materialApi.materialList(param, page);
-        
         if (code == 200) {
           this.taskList = data.tableBody.rows;
           this.total = data.tableBody.total;
-
         }
       } catch (error) {
-        
-      }finally{
+      } finally {
         this.loading = false;
       }
-    
+
       // materialApi.materialList(param, page).then((res) => {
       //   _this.loading = false;
       //   console.log(res, '获取物料列表信息以及表头字段');
@@ -523,10 +682,9 @@ export default {
     },
     // 获取物料列表表头
     getTagList(templateCode) {
-      materialApi.tagList({templateCode}).then(res => {
-        console.log(res, '获取物料列表表头');
+      materialApi.tagList({ templateCode }).then((res) => {
+        console.log(res, "获取物料列表表头");
         if (res.code == 200) {
-
           // let dictList = []
           // res.data.forEach(item =>{
           //   if(item.dictId){
@@ -537,7 +695,7 @@ export default {
           //         dictName:item.dictId
           //       }
           //     });
-              
+
           //   }
           // })
           // console.log(dictList,'dictList');
@@ -546,96 +704,98 @@ export default {
 
           this.tableHeader = res.data;
         }
-      })
+      });
     },
-
-
-  },
-  created() {
   },
+  created() {},
   beforeRouteEnter(to, from, next) {
-
     next((vm) => {
-      if (from.name == 'materialDetail') {
+      if (from.name == "materialDetail") {
         // this.$store.getQuery(this.queryForm);
-        console.log(vm, 'queryValue', vm.$store);
+        console.log(vm, "queryValue", vm.$store);
         vm.queryForm = vm.$store.state.query.queryVlue;
         // 清空选中数据
         vm.checkedList = [];
-        vm.$refs.materialTable &&vm.$refs.materialTable.clearSelection();
+        vm.$refs.materialTable && vm.$refs.materialTable.clearSelection();
       }
-      vm.getTagList('material_list');
+      vm.getTagList("material_list");
       vm.getMaterialList();
     });
   },
   // 进入详情,保留查询条件
   beforeRouteLeave(to, from, next) {
-    if (to.name == 'materialDetail') {
-      this.$store.commit('SET_QUERY', this.queryForm);
+    if (to.name == "materialDetail") {
+      this.$store.commit("SET_QUERY", this.queryForm);
     } else {
-      this.$store.commit('SET_QUERY', {name: '', code: ''});
+      this.$store.commit("SET_QUERY", { name: "", code: "" });
     }
     next();
-  }
-
+  },
 };
 </script>
 
-
 <style lang="scss">
-  .material-list {
-    // height: calc(100vh - 70px);
-
-
-    .el-card__body {
-      height: 100%;
-      box-sizing: border-box;
-      padding: 10px;
-
-      .el-table {
-        // overflow: auto;
-
-        .el-table__body-wrapper {
-          overflow-y: auto !important;
-          overflow-x: auto !important;
-        }
+.material-basic {
+  height: calc(100vh);
+}
+.material-list {
+  // height: calc(100vh - 70px);
+  height: 100%;
+
+  .el-card__body {
+    height: 100%;
+    box-sizing: border-box;
+    padding: 10px;
+
+    .el-table {
+      // overflow: auto;
+
+      .el-table__body-wrapper {
+        overflow-y: auto !important;
+        overflow-x: auto !important;
       }
     }
-
-    .el-pagination {
-      margin-top: 8px;
-      text-align: right;
-    }
   }
 
-  .mb-import {
-    padding: 0 20%;
-    text-align: center;
-    display: flex;
-    align-items: flex-start;
-    justify-content: space-around;
+  .el-pagination {
+    // margin-top: 8px;
+    text-align: right;
   }
+}
+
+.mb-import {
+  padding: 0 20%;
+  text-align: center;
+  display: flex;
+  align-items: flex-start;
+  justify-content: space-around;
+}
 </style>
 <style scoped>
-  .el-dialog__header {
-    background-color: rgb(244, 244, 244);
-  }
-
-  .mb-query >>> .el-form-item__label {
-    font-weight: normal;
-    font-size: 12px;
-  }
-
-  .mb-query >>> .el-form-item {
-    margin-bottom: 8px;
-  }
-
-  .mb-query >>> .el-select {
-    width: 90px;
-  }
-
-  .mb-query >>> .el-scrollbar__wrap {
-    margin-bottom: -18px;
-
-  }
+.el-dialog__header {
+  background-color: rgb(244, 244, 244);
+}
+
+.mb-query >>> .el-form-item__label {
+  font-weight: normal;
+  font-size: 12px;
+}
+
+.mb-query >>> .el-form-item {
+  margin-bottom: 8px;
+}
+
+.mb-query >>> .el-select {
+  width: 90px;
+}
+
+.mb-query >>> .el-scrollbar__wrap {
+  margin-bottom: -18px;
+}
+::v-deep.uxbeautifyTableClass
+  .elx-header--column
+  .elx-resizable.is--line:before {
+  height: 100%;
+  background-color: #dfe6ec;
+}
 </style>