ysy 1 год назад
Родитель
Сommit
977e1e7f86

+ 1 - 1
src/views/saleOrder/index.vue

@@ -353,7 +353,7 @@
           })
 
           this.newColumns = [...this.columns, ...newRes, ...privateColumn];
-          console.log(this.newColumns, 55);
+   
           this.$forceUpdate();
         });
       },

+ 8 - 1
src/views/workOrder/components/order-search.vue

@@ -2,6 +2,12 @@
 <template>
   <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
     <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="关键字:">
+          <el-input clearable v-model="where.keyWord" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="生产工单号:">
           <el-input clearable v-model="where.code" placeholder="请输入" />
@@ -45,7 +51,7 @@
           <el-input clearable v-model="where.model" placeholder="请输入" />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 9 }">
+      <el-col v-bind="styleResponsive ?  { lg: 6, md: 6 } : { span: 6 }">
         <el-form-item label="创建时间:">
           <el-date-picker class="w100" v-model="where.createTime" type="daterange" range-separator="至"
             start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"
@@ -77,6 +83,7 @@ export default {
   data() {
     // 默认表单数据
     const defaultWhere = {
+      keyWord: '',
       code: '',
       productionPlanCode: '',
       produceRoutingName: '',

+ 60 - 31
src/views/workOrder/index.vue

@@ -9,10 +9,11 @@
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
-        :columns="columns"
+        :columns="newColumns"
         :datasource="datasource"
         cache-key="workOrderTable"
         @sort-change="onSortChange"
+        height="calc(100vh - 380px)"
       >
         <template v-slot:code="{ row }">
           {{ row.code }}
@@ -56,8 +57,12 @@
             :underline="false"
             icon="el-icon-truck"
             @click="toRelease(row)"
-            v-if="(clientEnvironmentId!='4'&&row.status == 8 )|| (clientEnvironmentId=='4'&&!row.productName.includes('板材')&&row.status == 8)"
-
+            v-if="
+              (clientEnvironmentId != '4' && row.status == 8) ||
+              (clientEnvironmentId == '4' &&
+                !row.productName.includes('板材') &&
+                row.status == 8)
+            "
           >
             下达
           </el-link>
@@ -91,6 +96,9 @@
   } from '@/api/workOrder/index.js';
   import { teamPage } from '@/api/mainData/index.js';
   import OrderSearch from './components/order-search.vue';
+
+  import { fieldModel } from '@/api/saleOrder';
+
   import { debounce } from 'lodash';
   export default {
     components: {
@@ -112,13 +120,15 @@
           { label: '待下达', value: 8 }
         ],
 
+        newColumns: [],
+
         current: null
       };
     },
     computed: {
       clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    },
+        return this.$store.state.user.info.clientEnvironmentId;
+      },
       // 表格列配置
       columns() {
         return [
@@ -175,7 +185,6 @@
             label: '型号',
             align: 'center'
           },
- 
 
           {
             prop: 'priority',
@@ -187,17 +196,16 @@
           },
 
           {
-          prop: 'produceRoutingName',
-          label: '工艺路线',
-          align: 'center',
-          minWidth: 120,
-          sortable: 'custom'
-        },
-
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            minWidth: 120,
+            sortable: 'custom'
+          },
 
           {
             prop: 'formingNum',
-            label: '要求生产数量'+this.clientEnvironmentId==4?'(方)':'',
+            label: '要求生产数量' + this.clientEnvironmentId == 4 ? '(方)' : '',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
@@ -255,22 +263,13 @@
             label: '客户简称',
             align: 'center',
             showOverflowTooltip: true
-          },
-
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 90,
-            align: 'center',
-            resizable: false,
-            fixed: 'right',
-            slot: 'action',
-            showOverflowTooltip: true
           }
         ];
       }
     },
-    created() {},
+    created() {
+      this.getFieldModel();
+    },
     methods: {
       statusFormatter(status) {
         const obj = this.statusOpt.find((i) => i.value == status);
@@ -298,6 +297,37 @@
 
         this.teamList = res.list;
       },
+
+      getFieldModel() {
+        fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          const privateColumn = [
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 90,
+              align: 'center',
+              resizable: false,
+              fixed: 'right',
+              slot: 'action',
+              showOverflowTooltip: true
+            }
+          ];
+
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+
+          this.newColumns = [...this.columns, ...newRes, ...privateColumn];
+
+          this.$forceUpdate();
+        });
+      },
+
       // 下达
       toRelease(row) {
         this.current = row;
@@ -336,11 +366,10 @@
       onSortChange(e) {
         let sort = {
           orderBy: e.order,
-          sortName:  e.prop,
-        }
-        this.sort = sort
-        this.reload()
-       
+          sortName: e.prop
+        };
+        this.sort = sort;
+        this.reload();
       },
 
       sortTop(row) {