LAPTOP-16IUEB3P\Lenovo 3 лет назад
Родитель
Сommit
9375ced0dd

+ 3 - 16
src/views/material/manage/components/dict-data-search.vue

@@ -2,13 +2,13 @@
 <template>
   <el-form
     size="small"
-    label-width="77px"
+    label-width="60px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
   >
     <el-row :gutter="10">
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <el-form-item label="编码">
           <el-input
             clearable
@@ -18,7 +18,7 @@
           />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <el-form-item label="名称">
           <el-input
             clearable
@@ -28,19 +28,6 @@
           />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 4 } : { span: 4 }">
-        <el-form-item label="应用类型">
-          <el-select v-model="where.appType" placeholder="请选择">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
       <el-col v-bind="styleResponsive ? { md: 12 } : { span: 4 }">
         <el-form-item>
           <el-button

+ 41 - 41
src/views/material/manage/components/dict-data.vue

@@ -14,8 +14,7 @@
       cache-key="systemDictDataTable"
     >
       <!-- 表头工具栏 -->
-      <!-- <template v-slot:toolbar>
-        <dict-data-search @search="reload">
+      <template v-slot:toolbar>
           <el-button
             size="small"
             type="primary"
@@ -25,17 +24,7 @@
           >
             添加
           </el-button>
-          <el-button
-            size="small"
-            type="danger"
-            icon="el-icon-delete"
-            class="ele-btn-icon"
-            @click="removeBatch"
-          >
-            删除
-          </el-button>
-        </dict-data-search>
-      </template> -->
+      </template>
       <!-- 操作列 -->
       <template v-slot:appType="{ row }">
         {{ types[row.appType] }}
@@ -84,60 +73,69 @@
       return {
         // 表格列配置
         columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center'
-          },
           {
             columnKey: 'index',
             type: 'index',
             width: 45,
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            label:'序号'
           },
           {
             prop: 'code',
-            label: '字典编码',
+            label: '编码',
             align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'name',
-            label: '字典名称',
+            label: '名称',
             align: 'center',
             showOverflowTooltip: true
           },
-          // {
-          //   prop: 'appType',
-          //   label: '字典类型',
-
-          //   showOverflowTooltip: true,
-          //   minWidth: 110
-          // },
           {
-            prop: 'appType',
+            prop: 'group',
+            label: '物料组',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brand',
             align: 'center',
-            label: '应用类型',
+            label: '牌号',
             showOverflowTooltip: true,
             slot: 'appType'
           },
           {
-            prop: 'remark',
-            label: '描述',
+            prop: 'model',
+            label: '型号',
             align: 'center',
             showOverflowTooltip: true
           },
           {
-            prop: 'updateTime',
-            label: '上次更新时间',
+            prop: 'specifications',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measurement',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'unit',
             align: 'center',
+            label: '包装单位',
             showOverflowTooltip: true,
-            minWidth: 110,
-            formatter: (_row, _column, cellValue) => {
-              return this.$util.toDateString(cellValue);
-            }
+            slot: 'appType'
+          },
+          {
+            prop: 'category',
+            label: '分类',
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             columnKey: 'action',
@@ -174,8 +172,10 @@
       },
       /* 显示编辑 */
       openEdit(row) {
-        this.id = row.id;
-        this.current = row;
+        if(row){
+          this.id = row.id;
+          this.current = row;
+        }
         this.showEdit = true;
       },
       /* 删除 */

+ 8 - 63
src/views/material/manage/index.vue

@@ -2,7 +2,7 @@
   <div class="ele-body">
     <el-card shadow="never">
       <DictDataSearch @search="reload" />
-      <div style="margin: 5px 0; padding-left: 262px">
+<!--      <div style="margin: 5px 0; padding-left: 262px">
         <el-button
           size="small"
           type="primary"
@@ -12,27 +12,7 @@
         >
           添加
         </el-button>
-        <!-- <el-button
-          size="small"
-          type="warning"
-          icon="el-icon-edit"
-          class="ele-btn-icon"
-          :disabled="!current"
-          @click="openEdit(current)"
-        >
-          修改
-        </el-button> -->
-        <el-button
-          size="small"
-          type="danger"
-          icon="el-icon-delete"
-          class="ele-btn-icon"
-          :disabled="!current"
-          @click="remove"
-        >
-          删除
-        </el-button>
-      </div>
+      </div> -->
       <ele-split-layout
         width="244px"
         allow-collapse
@@ -57,13 +37,13 @@
         </ele-pro-table>
 
         <template v-slot:content>
-          <!-- 数据字典项列表 -->
+          <!-- 物料列表 -->
           <dict-data ref="dictData" v-if="current" :dict-id="current.id" />
         </template>
       </ele-split-layout>
     </el-card>
-    <!-- 编辑弹窗 -->
-    <dict-edit :visible.sync="showEdit" @done="reload" />
+<!--    编辑弹窗
+    <dict-edit :visible.sync="showEdit" @done="reload" /> -->
   </div>
 </template>
 
@@ -72,7 +52,7 @@
   import DictEdit from './components/dict-edit.vue';
   import DictDataSearch from './components/dict-data-search.vue';
   import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
-
+  import { getSubPage } from '@/api/classifyManage';
   export default {
     name: 'SystemDictionary',
     components: { DictData, DictEdit, DictDataSearch },
@@ -89,7 +69,7 @@
           },
           {
             prop: 'name',
-            label: '字典名称',
+            label: '物料组名称',
             showOverflowTooltip: true
           }
         ],
@@ -105,8 +85,7 @@
     methods: {
       /* 表格数据源 */
       datasource() {
-        // return;
-        return listDictionaries();
+        return getSubPage({pageNum:1,size:-1,parentId: 0});
       },
       /* 表格渲染完成回调 */
       done(res) {
@@ -118,40 +97,6 @@
       reload(where) {
         this.$refs.table.reload();
         this.$refs.dictData.reload(where);
-      },
-      /* 显示编辑 */
-      openEdit(row) {
-        this.editData = row;
-        this.showEdit = true;
-      },
-      /* 删除 */
-      remove() {
-        this.$confirm('确定要删除选中的字典吗?', '提示', {
-          type: 'warning'
-        })
-          .then(() => {
-            if (this.$refs.dictData.selection.length == 0) {
-              this.$message({
-                message: '当前未选择数据',
-                type: 'error'
-              });
-              return;
-            }
-            let ids = this.$refs.dictData.selection.map((item) => item.id);
-            const loading = this.$loading({ lock: true });
-
-            removeDictionary(ids, true)
-              .then((msg) => {
-                loading.close();
-                this.$message.success(msg);
-                this.reload();
-              })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
       }
     }
   };