Эх сурвалжийг харах

1.【采购订单生成】需求来源查询字段修改成采购需求单号
2.【物料基础档案】的信息修改,保存之后去除表单校验
3.增加物料基础档案搜索条件

002390 1 жил өмнө
parent
commit
d45e7e14a1

+ 129 - 0
src/views/material/basicFile/columns.js

@@ -0,0 +1,129 @@
+export const SearchColumns = [
+
+  {
+    item:{
+      key: "code",
+      title: "物料编码",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "code",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "name",
+      title: "物料名称",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MATERIAL_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "isEnable",
+      title: "启用状态",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "material_enable",
+    },
+  },
+  {
+    item:{
+      key: "isSync",
+      title: "是否同步NC",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key: "registrant",
+      title: "生产厂家/代理人",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-popover-select-v2",
+      valueKey: "name",
+      referName: "MANUFACTURER_PARAM",
+    },
+  },
+  {
+    item:{
+      key: "storageCondition",
+      title: "存储条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_storage_condition",
+    },
+  },
+  {
+    item:{
+      key: "transportationCondition",
+      title: "运输条件",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_conditions_carriage",
+    },
+  },
+  {
+    item:{
+      key: "isMedicine",
+      title: "是否医药物料",  
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "sys_number_yes_no",
+    },
+  },
+  {
+    item:{
+      key:'classifyAbc',
+      title:'ABC分类',
+    },
+    attr:{
+      clearable:true,
+      is: "el-select",
+      dictName: "abc_type",
+    }
+  },
+];
+
+export const OtherDictColumns = [
+  {
+    item:{
+      key:"expiryUnitId",
+      title:'效期管理',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "period_unit",
+    }
+  },
+  {
+    item:{
+      key:'usefulLifeUnitId',
+      title:'有效期至单位',
+    },
+    attr:{
+      is: "el-select",
+      dictName: "expiry_date",
+    }
+  },
+  
+]

+ 1 - 1
src/views/material/basicFile/details.vue

@@ -114,7 +114,7 @@
 
     </div>
     
-      <div class="md-content">
+      <div class="md-content" :key="basicData.value.id">
         <el-form :inline="true" label-position="right" :model="basicData.value">
           <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">

+ 79 - 17
src/views/material/basicFile/index.vue

@@ -6,10 +6,18 @@
     <!-- 主体列表 -->
     <el-card class="material-list" v-loading="loading">
 
-      <!-- 操作栏 -->
+      
     <div style="margin: 0 0 10px 0;">
       <!-- 查询条件 -->
-      <el-row :gutter="10">
+      <el-super-search
+        v-model="params"
+        :size="size"
+        :dict="dict"
+        :columns="SearchColumns"
+        @reset="handleResetQuery"
+        @submit="handleQuery"
+      ></el-super-search>
+      <!-- <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form :inline="true" :model="queryForm" class="mb-query" @submit.native.prevent>
             <el-form-item label="物料编码">
@@ -19,14 +27,12 @@
               <el-input size="small" v-model="queryForm.name" placeholder="物料名称" clearable></el-input>
             </el-form-item>
             <el-form-item label="启用状态">
-              <!-- 0=已启用,2=已停用 -->
               <el-select size="small" v-model="queryForm.isEnable" placeholder="请选择" clearable>
                 <el-option key="0" label="已启用" value="0"></el-option>
                 <el-option key="2" label="已停用" value="2"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="是否同步NC">
-              <!-- 是否同步;2=否,0=是 -->
               <el-select size="small" v-model="queryForm.isSync" placeholder="请选择" clearable>
                 <el-option key="0" label="是" value="0"></el-option>
                 <el-option key="2" label="否" value="2"></el-option>
@@ -40,8 +46,9 @@
           </el-form>
         </el-col>
 
-      </el-row>
+      </el-row> -->
     </div>
+    <!-- 操作栏 -->
       <el-row 
         :gutter="10" 
         class="mb10"
@@ -104,6 +111,7 @@
         border 
         :data="taskList" 
         ref="materialTable" 
+        max-height="550"
         @cell-dblclick="handledbClick" 
         :row-key="getRowKey"
         @selection-change="handleSelectionChange" 
@@ -111,7 +119,7 @@
         @select-all="handleSelectAll"
       >
         <!--  -->
-        <el-table-column type="selection" width="45" :reserve-selection="true"/>
+        <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" 
@@ -120,13 +128,27 @@
           align="center"
           show-overflow-tooltip
         >
-          <!-- :prop="h.attribute == 'select' ? `${h.prop}Name` : h.prop" -->
           <template slot-scope="scope">
-            {{ h.attribute == 'select' ? scope.row[`${h.prop}Name`] :
+            <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>
@@ -174,12 +196,24 @@
 <script>
   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:[],
+    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',
         // 物料基本信息数据
         taskList: [],
         // 查询表单字段
@@ -289,17 +323,25 @@
       },
       // 重置查询条件
       handleResetQuery() {
-        for (const key in this.queryForm) {
+        // for (const key in this.queryForm) {
 
-          this.queryForm[key] = '';
-        }
+        //   this.queryForm[key] = '';
+        // }
+
+        this.queryParams.pageNum = 1;
+      
+        this.queryParams.pageSize = 10;
+
+        this.params = this.$init.params(SearchColumns);
+
+        this.handleQuery();
       },
       // 刷新
       handleRefresh() {
         this.getMaterialList('material');
-        for (const key in this.queryForm) {
-          this.queryForm[key] = '';
-        }
+        // for (const key in this.queryForm) {
+        //   this.queryForm[key] = '';
+        // }
       },
       // 过滤
       handleFilter(e) {
@@ -495,6 +537,7 @@
       },
       // 获取物料列表信息
       getMaterialList(templateCode, query) {
+        // (params, page)
         let _this = this;
         this.loading = true;
         let page = {
@@ -504,7 +547,8 @@
 
         let param = {
           templateCode,
-          ...this.queryForm
+          ...this.params
+          // ...this.queryForm
         }
         // console.log(param, 'param');
         materialApi.materialList(param, page).then((res) => {
@@ -523,6 +567,24 @@
         materialApi.tagList({templateCode}).then(res => {
           console.log(res, '获取物料列表表头');
           if (res.code == 200) {
+
+            // let dictList = []
+            // res.data.forEach(item =>{
+            //   if(item.dictId){
+            //     // 字典
+            //     dictList.push({
+            //       item:{...item},
+            //       attr:{
+            //         dictName:item.dictId
+            //       }
+            //     });
+                
+            //   }
+            // })
+            // console.log(dictList,'dictList');
+            // console.log(this,'this');
+            // this.dict =[...initDicts([...SearchColumns,...dictList])]
+
             this.tableHeader = res.data;
           }
         })
@@ -565,7 +627,7 @@
 
 <style lang="scss">
   .material-list {
-    height: calc(100vh - 70px);
+    // height: calc(100vh - 70px);
 
 
     .el-card__body {

+ 1 - 1
src/views/purchase/task/columns.js

@@ -198,7 +198,7 @@ export default function useColumns() {
     {
       item: {
         key: "documentsCodes",
-        title: "需求来源",
+        title: "采购需求单号",
         span: 12,
       },
       attr: {