chencc 1 жил өмнө
parent
commit
33f5615a59

+ 13 - 0
src/api/produceOrder/index.js

@@ -48,6 +48,9 @@ export async function cancelCompletion (id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+
 // 领料保存
 export async function batchSave (data) {
   const res = await request.post(`/mes/pickorder/batchSave`, data);
@@ -90,6 +93,16 @@ export async function reportCount (params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+export async function workorderproductsequencePage (params) {
+  // 发送 GET 请求获取数据
+  const res = await request.get(`/mes/workorderproductsequence/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
 // 详情页-tab列表
 export async function reportPage (data) {
   const res = await request.post('/mes/workreport/page', data);

+ 63 - 34
src/api/workOrderList/index.js

@@ -1,50 +1,79 @@
 import request from '@/utils/request';
 
-
 // 列表
 export async function updateStatusPauseRecover(data) {
-    const res = await request.put(`/mes/workorder/updateStatusPauseRecover`, {
-        params: data
-    });
-    console.log(res.data.code == 0)
-    if (res.data.code == 0) {
-        return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+  const res = await request.put(`/mes/workorder/updateStatusPauseRecover`, {
+    params: data
+  });
+  console.log(res.data.code == 0);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }
 export async function updateStatusPause(params) {
-    const res = await request.put(`/mes/workorder/updateStatusPause`, {
-        params: data
-    });
-    console.log(res.data.code == 0)
-    if (res.data.code == 0) {
-        return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
-
+  const res = await request.put(`/mes/workorder/updateStatusPause`, {
+    params: data
+  });
+  console.log(res.data.code == 0);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }
 
 // 工单终止
 export async function updateStatusTerminate(params) {
-    const res = await request.put(`/mes/workorder/updateStatusTerminate`, {
-        params: data
-    });
-    console.log(res.data.code == 0)
-    if (res.data.code == 0) {
-        return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
-
+  const res = await request.put(`/mes/workorder/updateStatusTerminate`, {
+    params: data
+  });
+  console.log(res.data.code == 0);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }
 
 export async function produceDetail(id) {
-    const res = await request.get(`/pda/mes/workorder/produceDetail/${id}`, {
-    });
-    console.log(res.data.code == 0)
-    if (res.data.code == 0) {
-        return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+  const res = await request.get(`/pda/mes/workorder/produceDetail/${id}`, {});
+  console.log(res.data.code == 0);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取资产数量
+ *
+ * @param data 请求参数
+ * @returns 返回资产数据或 undefined
+ */
+export async function workorderList(data) {
+  const res = await request.post('/pda/mes/workorder/list', data);
+
+  console.log(res);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+export async function workorderPage(params) {
+  const res = await request.post('/pda/mes/workorder/page', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//   物料详情
+export async function pickorderList(params) {
+  const res = await request.post('/pda/mes/pickorder/list', params);
+  console.log(res);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }
 
 // export async function updateStatusPauseRecover(params) {

+ 2 - 0
src/views/produce/components/picking/index.vue

@@ -280,6 +280,8 @@
       },
 
       allSelection(id, list) {
+console.log(id,list);
+
         this.workList.forEach((e) => {
           if (e.id == id) {
             e.pickList = list;

+ 3 - 1
src/views/produceOrder/components/unpackDialog.vue

@@ -72,7 +72,7 @@
 
 
           <template v-slot:classeId="scope">
-            <el-form-item v-if="formingNum != 0" :prop="'surplusUnpack.' + scope.$index + '.classeId'" :rules="{
+            <el-form-item v-if="formingNum != 0"  :rules="{
               required: true,
               message: '请选择排班',
               trigger: 'change'
@@ -380,8 +380,10 @@ export default {
 
     },
     confirm() {
+      console.log('111111111111111');
 
       this.$refs.form.validate(async (value) => {
+        
         if (value) {
           if (this.form.unpackList.length == 1 && this.form.unpackList[0].formingNum == this.formData.formingNum) {
             this.$message.info('拆单数要大于1')

+ 135 - 0
src/views/produceOrder/components/xlhView.vue

@@ -0,0 +1,135 @@
+<template>
+    <ele-modal :visible.sync="visible" title="查看序列号" width="1200px" :maxable="true">
+        <el-form ref="form" label-width="100px" class="create-form">
+            <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+
+            <el-row :gutter="15">
+
+
+                <el-col :span="8">
+                    <el-form-item label="生产工单号:" prop="code">
+                        <el-input v-model="row.code" disabled />
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="计划编号:" prop="productionPlanCode">
+                        <el-input v-model="row.productionPlanCode" disabled />
+                    </el-form-item>
+                </el-col>
+
+                <el-col :span="8">
+                    <el-form-item label="编码:" prop="productCode">
+                        <el-input v-model="row.productCode" style="width: 100%" disabled>
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="名称:" prop="productName">
+                        <el-input v-model="row.productName" style="width: 100%" disabled>
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                    <el-form-item label="创建时间:" prop="createTime">
+                        <el-input v-model="row.createTime" style="width: 100%" disabled>
+                        </el-input>
+                    </el-form-item>
+                </el-col>
+
+
+
+            </el-row>
+
+        </el-form>
+
+
+        <ele-pro-table  :columns="columns" :datasource="tableList" cache-key="tgDetails"
+            height="calc(100vh - 350px)" :need-page="false">
+
+
+
+
+            <template v-slot:useStatus="{ row }">
+                {{ row.useStatus==0?'未使用':'已使用' }} 
+            </template>
+
+
+
+
+
+        </ele-pro-table>
+
+
+  
+
+
+    </ele-modal>
+</template>
+
+<script>
+import { workorderproductsequencePage } from '@/api/produceOrder/index.js';
+export default {
+
+
+    computed: {
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        },
+    },
+    data() {
+        return {
+            visible: false,
+            tableList: [],
+            row: {},
+            columns: [
+                {
+                    label: '序号',
+                    type: 'index',
+                    width: 120,
+                    align: 'center'
+                },
+                {
+                    label: '序列码',
+                    prop: 'productSequence'
+                },
+                {
+                    label: '工单编码',
+                    prop: 'workOrderCode'
+                },
+                {
+                    slot: 'useStatus',
+                    label: '是否使用',
+                    prop: 'useStatus'
+                },
+                
+                {
+                    label: '创建时间',
+                    prop: 'createTime'
+                },
+
+
+            ],
+
+        };
+    },
+    created() {
+
+    },
+    methods: {
+         initLoad() {
+            workorderproductsequencePage({workOrderId:this.row.id,pageNum:1,size:-1}).then((res) => {
+                console.log(res);
+                if (res.list.length) {
+                    this.tableList = res.list;
+                }
+            });
+        },
+
+        open(row) {
+            this.row = row;
+            this.initLoad();
+            this.visible = true;
+        }
+    }
+};
+</script>

+ 21 - 3
src/views/produceOrder/index.vue

@@ -116,7 +116,15 @@
             >
               更改工艺路线
           </el-link>
-
+          <template >
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="toView(row)"
+            >
+              查看序列号
+            </el-link></template
+          >
           <template v-if="activeName != 'second'">
             <el-link
               v-if="row.status == 4 && row.isSplit == 0"
@@ -159,6 +167,9 @@
 
     <detailsPop ref="detailsRef"> </detailsPop>
     <EquipmentDialog ref="equipmentRef" @choose="choose"></EquipmentDialog>
+
+    <xlhView ref="xlhRef"></xlhView>
+
   </div>
 </template>
 
@@ -170,7 +181,7 @@
     updatePriority,
     update
   } from '@/api/produceOrder/index.js';
-
+  import xlhView from './components/xlhView.vue';
   import { fieldModel } from '@/api/produceWord/index.js';
   import produceOrderSearch from './components/produceOrder-search.vue';
   import createDialog from './components/createDialog.vue';
@@ -195,7 +206,8 @@
       printSr,
       printTg,
       detailsPop,
-      EquipmentDialog
+      EquipmentDialog,
+      xlhView
     },
     data() {
       return {
@@ -428,6 +440,12 @@
       this.getFieldModel();
     },
     methods: {
+      // 查看序列号
+      toView(row){
+        this.$refs.xlhRef.open(row)
+      },
+
+
       handlePicking() {
         this.$router.push({
           path: '/produceOrder/picking'

+ 80 - 19
src/views/workOrderList/components/btnlist.vue

@@ -2,7 +2,8 @@
     <div class="bottom_box">
 
         <div>
-            <el-button :type="item.type" v-for="(item, i) in btnList[1]" :key="i">{{ item.name }}</el-button>
+            <el-button :type="item.type" v-for="(item, i) in btnList[1]" :key="i" @click="handlerToPage(item)">{{
+                item.name }}</el-button>
         </div>
 
         <div>
@@ -17,13 +18,24 @@
 
         <!-- 交接 -->
         <handover ref="handoverRef"></handover>
+
+        <!-- 领料 -->
+        <picking-dom ref="pickingDomRef"></picking-dom>
+
     </div>
 </template>
 
 <script>
-import{updateStatusPauseRecover,updateStatusPause,updateStatusTerminate} from '@/api/workOrderList'
+import { updateStatusPauseRecover, updateStatusPause, updateStatusTerminate } from '@/api/workOrderList'
 import handover from './handover'
+import pickingDom from './produce/pickingDom'
 export default {
+    props:{
+        workOrderInfo:{
+            type: Object,
+            default:() => ({})
+        }
+    },
     data() {
         return {
             isOperate: false,
@@ -36,20 +48,24 @@ export default {
             btnList: {
                 1: [{
                     name: '领料',
+                    id: '1',
                     type: 'success'
                 },
                 {
                     name: '投料',
+                    id: '2',
                     type: 'success'
                 },
 
                 {
                     name: '更换周转车',
+                    id: '3',
                     type: 'success'
                 },
                 {
                     name: '报工',
                     type: 'success',
+                    id: '4',
                     isOutsource: 0
                 },
                     // {
@@ -66,6 +82,7 @@ export default {
                 },
                 {
                     name: '报工',
+                    id: '4',
                     type: 'sampleJob'
                 },
                 ],
@@ -82,6 +99,7 @@ export default {
 
                 {
                     name: '报工',
+                    id: '4',
                     type: 'inspectionJob'
                 }
 
@@ -91,14 +109,17 @@ export default {
 
                 4: [{
                     name: '领料',
+                    id: '1',
                     type: 'picking'
                 },
                 {
                     name: '投料',
+                    id: '2',
                     type: 'feeding'
                 },
                 {
                     name: '报工',
+                    id: '4',
                     type: 'jobBooking'
                 },
 
@@ -114,6 +135,7 @@ export default {
 
                 6: [{
                     name: '报工',
+                    id: '4',
                     type: 'jobBooking'
                 },
 
@@ -243,7 +265,7 @@ export default {
         }
     },
 
-    components:{handover},
+    components: { handover, pickingDom },
 
     created() {
 
@@ -251,6 +273,46 @@ export default {
 
     methods: {
 
+        //操作按钮处理器
+        handlerToPage(item) {
+            console.log(item, 'handlerToPage');
+            const actions = {
+                '1': () => this.openPickingDomRef(),
+                '2': () => { }
+            };
+
+            const action = actions[item.id];
+
+            if (action) {
+                action()
+            }
+
+
+
+
+        },
+
+
+        // 委外弹窗
+        openPickingDomRef() {
+      
+            let ids = [this.workOrderInfo.id];
+
+            let taskId = this.workOrderInfo?.taskId||''
+            let newTaskObj = {
+                ids, taskId
+            }
+
+            this.$refs.pickingDomRef.open(newTaskObj)
+        },
+
+
+
+
+
+
+
+
         // 委外时间选择
 
         //委外到 类型选择
@@ -341,8 +403,8 @@ export default {
                     updateStatusPauseRecover([this.newTaskObj.workOrderId]).then(res => {
                         // this.$emit('refresh')
                     })
-                }).catch(()=> {
-                    
+                }).catch(() => {
+
                 })
             } else {
 
@@ -354,8 +416,8 @@ export default {
                     updateStatusPause([this.newTaskObj.workOrderId]).then(res => {
                         // this.$emit('refresh')
                     })
-                }).catch(()=> {
-                    
+                }).catch(() => {
+
                 })
 
             }
@@ -369,17 +431,17 @@ export default {
 
         handTerminate() {
             this.$confirm('确定该工单终止?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    updateStatusTerminate([this.newTaskObj.workOrderId]).then(res => {
-                        // this.$emit('refresh')
-                    })
-                }).catch(()=> {
-
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                updateStatusTerminate([this.newTaskObj.workOrderId]).then(res => {
+                    // this.$emit('refresh')
                 })
-            
+            }).catch(() => {
+
+            })
+
         },
         outCancel() {
             this.sceneText = "";//委外场景
@@ -646,5 +708,4 @@ export default {
 //     border: 2px solid #F0F8F2;
 //     background: #F0F8F2;
 //     // color: $theme-color;
-// }
-</style>
+// }</style>

+ 10 - 2
src/views/workOrderList/components/details/index.vue

@@ -15,7 +15,7 @@
       <div class="drawer_content">
         <!-- //详细信息 -->
         <!-- <Info :workOrderInfo="workOrderInfo"></Info> -->
-        <btnlist></btnlist>
+        <btnlist :workOrderInfo="workOrderInfo"></btnlist>
 
 
         <el-steps :active="activeIndex" space="20px" align-center style="margin-top: 18px">
@@ -39,6 +39,11 @@
           <el-tab-pane label="报工详情">
             <jobDetails :routeObj="routeObj" :curTaskObj="curTaskObj" :newId="newId"></jobDetails>
           </el-tab-pane>
+
+          <el-tab-pane label="领料详情">
+            <pickingDetails :routeObj="routeObj" :curTaskObj="curTaskObj" :newId="newId"></pickingDetails>
+          </el-tab-pane>
+
         </el-tabs>
       </div>
     </el-drawer>
@@ -54,7 +59,7 @@ import feedDetails from '@/views/produce/components/feeding/details.vue';
 import jobDetails from '@/views/produce/components/jobBooking/details.vue';
 import basicDetails from '../basicDetails.vue';
 import productionDetails from '../productionDetails.vue';
-
+import pickingDetails from '../pickingDetails.vue';
 
 import btnlist from '../btnlist.vue';
 import { getTaskInstanceList } from '@/api/produce/job';
@@ -66,6 +71,7 @@ export default {
     jobDetails,
     basicDetails,
     btnlist,
+    pickingDetails,
     productionDetails
   },
   data() {
@@ -110,6 +116,8 @@ export default {
 
       this.workOrderInfo = row;
       this.routeObj.id = this.workOrderInfo.id;
+
+
       this.getTaskFn();
       this.drawer = true;
     },

+ 151 - 0
src/views/workOrderList/components/pickingDetails.vue

@@ -0,0 +1,151 @@
+<template>
+
+    <ele-pro-table :columns="columns" :datasource="List" cache-key="tgDetails" height="calc(100vh - 350px)"
+        :need-page="false" :cache-key="`${activeName}produceOrderTable`" :selection.sync="selection">
+
+        <template v-slot:categoryCode="{ row }">
+            {{ row.orderInfoList[0].code }}
+        </template>
+
+        <template v-slot:workCode="{ row }">
+            {{ row.orderInfoList[0].bomDetailDTOS[0].categoryCode }}
+        </template>
+
+        <template v-slot:categoryName="{ row }">
+            {{ row.orderInfoList[0].bomDetailDTOS[0].categoryName }}
+        </template>
+
+        <template v-slot:status="{ row }">
+            {{ ['未领料', '领料中', '已出库', '已驳回'][row.status]}}
+        </template>
+        
+        <template v-slot:demandQuantity="{ row }">
+            {{ row.orderInfoList[0].bomDetailDTOS[0].demandQuantity }}
+        </template>
+        
+
+        <template v-slot:packingCount="{ row }">
+            {{ row.orderInfoList[0].bomDetailDTOS[0].warehouseName  }}(审核人:{{ row.orderInfoList[0].bomDetailDTOS[0].warehouseLeaderName }} )
+        </template>
+
+
+    </ele-pro-table>
+
+</template>
+
+<script>
+
+import { pickorderList } from '@/api/workOrderList'
+
+export default {
+
+
+    computed: {
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        },
+    },
+    data() {
+        return {
+            visible: false,
+            List: [],
+            selection: [],
+            row: {},
+        };
+    },
+    created() {
+        this.workorderList();
+    },
+    computed: {
+
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        },
+        columns() {
+            return [
+
+                {
+                    label: '序号',
+                    type: 'index',
+                    width: 55,
+                    align: 'center'
+                },
+                {
+                    label: '领料单号',
+                    prop: 'code',
+                    width: 150,
+                },
+                {
+                    label: '领料状态',
+                    prop: 'status',
+                    slot: 'status',
+                },
+
+                {
+                    label: '工单编号',
+                    slot: 'workCode',
+                    prop: 'workCode'
+                },
+
+                {
+                    label: '编码',
+                    prop: 'categoryCode',
+                    slot: 'categoryCode',
+                },
+                {
+                    label: '名称',
+                    prop: 'categoryName',
+                    slot: 'categoryName',
+                },
+
+                {
+                    label: '数量',
+                    prop: 'demandQuantity',
+                    slot: 'demandQuantity',
+                },
+
+                {
+                    label: '领料仓库',
+                    prop: 'packingCount',
+                    slot: 'packingCount',
+                    width: 240,
+                },
+
+                {
+                    label: '库存可用量',
+                    prop: 'packingUnit',
+                    show: this.clientEnvironmentId == 21
+                },
+
+            ]
+        },
+
+    },
+    props: {
+        routeObj: {
+            type: Object,
+            default: () => { }
+        },
+        activeName: {
+            type: String,
+            default: ''
+        }
+
+    },
+    methods: {
+
+
+        // 获取领料列表
+
+        workorderList() {
+
+            pickorderList([this.routeObj.id]).then((res) => {
+                console.log(res, '99999');
+                this.List = res.data;
+                console.log(res);
+            });
+        },
+
+    }
+};
+</script>

+ 118 - 0
src/views/workOrderList/components/produce/assetTree.vue

@@ -0,0 +1,118 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      :default-expanded-keys="current && current.id ? [current.id] : []"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { treeByPid } from '@/api/produce/workOrder';
+
+  export default {
+    props: {
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+
+      treeIds: {
+        type: String,
+        default: ''
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+    },
+    data() {
+      return {
+        treeList: [],
+        treeLoading: false,
+        current: {},
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      // 获取树结构数据
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await treeByPid({ ids: this.treeIds });
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+            this.$emit('setRootId', res.data[0]);
+
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.setCurrentKey(this.treeList[0]);
+                this.current = this.treeList[0];
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {
+          console.log(error);
+        }
+        this.treeLoading = false;
+      },
+
+      handleNodeClick(data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 291 - 0
src/views/workOrderList/components/produce/pickingDom.vue

@@ -0,0 +1,291 @@
+<template>
+    <div>
+        <ele-modal :visible.sync="visible" append-to-body title="领料" width="1200px" :maxable="true">
+            <div v-for="(item, i) in List" :key="i">
+                <el-form ref="form" label-width="100px" class="create-form">
+
+                    <el-row :gutter="15">
+
+                        <el-col :span="12">
+                            <el-form-item label="工单编码:" prop="workOrderCode">
+                                <el-input v-model="item.code" disabled />
+                            </el-form-item>
+                        </el-col>
+
+                        <el-col :span="12">
+                            <el-form-item prop="workOrderCode">
+                                <el-button type="primary" @click="openPicking(item)">添加物料</el-button>
+                            </el-form-item>
+                        </el-col>
+
+
+                    </el-row>
+
+                </el-form>
+
+
+                <ele-pro-table :columns="columns" :datasource="item.bomList" cache-key="tgDetails"
+                    height="calc(100vh - 350px)" :need-page="false" :cache-key="`produceOrderTable`"
+                    :selection.sync="selection">
+
+
+                    <template v-slot:demandQuantity="{ row }">
+                        {{ row.demandQuantity }} {{ row.unit }}
+                    </template>
+
+                    
+               
+
+                    
+
+
+                    <template v-slot:packingCount="{ row }">
+                        <el-select v-model="row.packingCount">
+                            <el-option v-for="item of row.warehouseList" :key="item.id" :label="item.name"
+                                :value="item.id"></el-option>
+                        </el-select>
+                    </template>
+
+
+                    <template v-slot:cz="{ row, $index }">
+                        <el-link type="primary" :underline="false" @click="goDetail(item, $index)">
+                            删除
+                        </el-link>
+                    </template>
+
+
+
+                </ele-pro-table>
+
+            </div>
+            <el-button type="primary" @click="save()">提交</el-button>
+
+        </ele-modal>
+
+        <pickingList isType="pick" ref="pickingListRef" @allSelection="allSelection"></pickingList>
+    </div>
+</template>
+
+<script>
+
+import { workorderList } from '@/api/workOrderList'
+import pickingList from './pickingList.vue';
+export default {
+    components: {pickingList},
+
+
+    computed: {
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        },
+    },
+    data() {
+        return {
+            visible: false,
+            List: [],
+            selection: [],
+            row: {},
+        };
+    },
+    created() {
+
+    },
+    computed: {
+
+        clientEnvironmentId() {
+            return this.$store.state.user.info.clientEnvironmentId;
+        },
+        columns() {
+            return [
+                {
+                    width: 45,
+                    type: 'selection',
+                    columnKey: 'selection',
+                    align: 'center',
+                    fixed: 'left'
+                },
+                {
+                    label: '序号',
+                    type: 'index',
+                    width: 55,
+                    align: 'center'
+                },
+
+                {
+                    label: '物料编码',
+                    prop: 'categoryCode'
+                },
+                {
+                    label: '名称',
+                    prop: 'categoryName'
+                },
+
+                {
+                    label: '牌号',
+                    prop: 'brandNum'
+                },
+
+                {
+                    label: '数量',
+                    prop: 'demandQuantity',
+                    slot: 'demandQuantity',
+                },
+
+                {
+                    label: '领料仓库',
+                    prop: 'packingCount',
+                    slot: 'packingCount',
+                },
+
+                {
+                    label: '库存可用量',
+                    prop: 'packingUnit',
+                    show: this.clientEnvironmentId == 21
+                },
+                {
+                    label: '操作',
+                    slot: 'cz',
+                },
+            ]
+        },
+
+    },
+    methods: {
+        // 添加物料
+        openPicking(item) {
+            console.log(item, 'item');
+            this.$refs.pickingListRef.open(item.createUserId, item);
+        },
+
+        // 选择回显
+        allSelection(id, list) {
+            console.log(id, list, '55555555555');
+            this.List.forEach((e) => {
+                if (id == e.createUserId) {
+                    e.bomList.push(list);
+                    this.$forceUpdate();
+                }
+            });
+        },
+
+
+        // 删除列表
+        goDetail(row, index) {
+            this.$confirm('是否删除?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                let index = this.List.findIndex(m => m.id == row.id);
+
+                if (index > -1) {
+                    this.List[index].bomList.splice(index, 1)
+                }
+            })
+        },
+
+        save() {
+
+
+            let _arr = []
+
+            if (this.clientEnvironmentId !== 21) {
+
+                _arr = this.List.map(m => {
+                    console.log(m, 'm');
+                    if (m.bomList.length > 0) {
+                        let bomList = m.bomList.filter(f => f.checked)
+                        m['bomDetailDTOSList'] = [...bomList, ...m.modelList, ...m.palletList]
+                    }
+                    m.instanceList = [...m.instanceList2, ...m.modelList2, ...m.palletList2, ...m.packingList2, ...
+                        m.semiProductList2, ...m.productList2, ...m.junkProductList2
+                    ]
+                    m.isOutsource = this.isOutsource
+                    return {
+                        ...m
+                    }
+                })
+            }
+
+
+            if (this.clientEnvironmentId == 21) {
+
+                findVoucherList({ workOrderId: this.idsList[0] }).then(res => {
+                    this.visible = false;
+                    this.$emit('update:visible', false);
+                    this.$message.success(res.msg);
+                })
+
+            } else {
+                batchSave(_arr).then(res => {
+
+                    this.visible = false;
+
+                })
+            }
+
+
+
+        },
+
+        // 获取领料列表
+
+        workorderList() {
+
+            workorderList(this.row).then((res) => {
+                this.List = res.map(m => {
+                    m.workOrderId = m.id
+                    let modelList = []
+                    let palletList = []
+                    let bomList = []
+
+                    m.bomDetailDTOS.forEach((f, i) => {
+
+                        if (f.rootCategoryLevelId == 5) {
+                            f.automatic = 2
+                            modelList = modelList.concat(f)
+                        }
+
+                        if (f.rootCategoryLevelId == 8) {
+                            f.automatic = 2
+                            palletList = palletList.concat(f)
+                        }
+                        if (f.rootCategoryLevelId != 5 && f.rootCategoryLevelId != 8) {
+                            f.automatic = 2
+                            bomList = bomList.concat(f)
+                        }
+
+                    })
+
+                    m['modelList'] = modelList
+                    m['palletList'] = palletList
+                    m['bomList'] = bomList
+                    m['modelList2'] = []
+                    m['instanceList2'] = []
+                    m['palletList2'] = []
+                    m['packingList2'] = []
+                    m['semiProductList2'] = []
+                    m['productList2'] = []
+                    m['junkProductList2'] = []
+                    delete m.id
+                    return {
+                        ...m
+                    }
+                })
+
+                console.log(this.List,'this.List');
+            });
+        },
+
+
+        open(row) {
+
+            this.row = row;
+
+            this.workorderList();
+
+            this.visible = true;
+        }
+    }
+};
+</script>

+ 652 - 0
src/views/workOrderList/components/produce/pickingList.vue

@@ -0,0 +1,652 @@
+<template>
+  <el-dialog
+    title="领料列表"
+    :visible.sync="visible"
+    v-if="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="75%"
+  >
+    <el-card shadow="never">
+      <pickingListSearch @search="reload" ref="searchRef" />
+
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <AssetTree
+            ref="assetTreeRef"
+            :treeIds="treeIds"
+            @handleNodeClick="handleNodeClick"
+            @setRootId="setRootId"
+          />
+        </div>
+        <!-- 表格 -->
+
+        <template v-slot:content>
+          <ele-pro-table
+            :initLoad="false"
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            row-key="id"
+            height="calc(100vh - 350px)"
+            class="dict-table"
+            :cache-key="tableKey"
+            :row-style="rowStyle"
+            :row-click-checked="true"
+            :row-click-checked-intelligent="false"
+            @update:selection="handleSelectionChange"
+          >
+            <template v-slot:toolbar>
+              <el-alert
+                type="info"
+                :closable="false"
+                class="ele-alert-border"
+                style="width: 300px"
+              >
+                <i class="el-icon-info ele-text-info"></i>
+                <span class="ele-text">
+                  <span>
+                    已选择
+                    <b class="ele-text-info">{{ allSelection.length }}</b>
+                    项数据<em></em>
+                  </span>
+                </span>
+                <el-link type="primary" :underline="false" @click="clearChoose">
+                  清空
+                </el-link>
+              </el-alert>
+            </template>
+
+            <template v-slot:code="{ row }">
+              {{ row.rootCategoryLevelId == 4 ? row.codeNumber : row.code }}
+            </template>
+
+            <template v-slot:runStatus="{ row }">
+              {{ stateList[Number(row.runStatus)] }}
+            </template>
+
+            <template v-slot:vehicleLen="{ row }">
+              {{ row.extInfo.vehicleLen || '-' }}
+              {{ row.extInfo.wilde || '-' }} {{ row.extInfo.hight || '-' }}
+            </template>
+
+            <template v-slot:status="{ row }">
+              <span
+                :style="{ color: row.status == 0 ? '#157A2C' : '#FFA929' }"
+                >{{
+                  row.status == 0 ? '空闲' : row.status == 1 ? '占用' : ''
+                }}</span
+              >
+            </template>
+
+            <template v-slot:packingCountBase="{ row }">
+              {{ row.packingCountBase }} {{ row.minUnit }}
+            </template>
+
+            <template v-slot:availableCountBase="{ row }">
+              {{ row.availableCountBase }} {{ row.measuringUnit }}
+            </template>
+
+            <template v-slot:weight="{ row }">
+              {{ row.weight }} {{ row.weightUnit }}
+            </template>
+
+            <!-- 库存保质期 -->
+            <template v-slot:expirationDate="{ row }">
+              <span v-if="row.expirationDate">
+                {{ row.expirationDate ? row.expirationDate : '-' }}
+                {{
+                  row.expirationDateUnit == 'year'
+                    ? '年'
+                    : row.expirationDateUnit == 'month'
+                    ? '月'
+                    : '日'
+                }}
+              </span>
+            </template>
+            <!-- 质检状态 -->
+            <template v-slot:qualityStatus="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == 1"
+                >已检</span
+              >
+              <span v-else-if="row.qualityStatus == 1">已检</span>
+              <span v-else-if="row.qualityStatus == 0">未检</span>
+              <span v-else>-</span>
+            </template>
+            <!-- 质检结果 -->
+            <template v-slot:qualityResult="{ row }">
+              <span v-if="row.qualityResult == 0 || row.qualityResult == ''"
+                >合格</span
+              >
+              <span v-else-if="row.qualityResult == 1">不合格</span>
+              <span v-else-if="row.qualityResult == 3">让步接收</span>
+              <span v-else>-</span>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from './assetTree.vue';
+  import pickingListSearch from './pickingListSearch.vue';
+  import {
+    pageeLedgerMain,
+    assetPage,
+    listInProduct
+  } from '@/api/produce/workOrder';
+
+  export default {
+    components: { AssetTree, pickingListSearch },
+    props: {
+      isType: {
+        type: String,
+        default: '',
+        required: true
+      }
+    },
+    data() {
+      return {
+        visible: false,
+
+        id: null,
+        treeIds: null,
+        categoryLevelId: null,
+        rootCategoryLevelId: null,
+        isCategory: true,
+
+        stateList: [
+          '启动',
+          '空闲',
+          '运行',
+          '故障',
+          '检修',
+          '停机',
+          '待料',
+          '占用'
+        ],
+
+        selection: [],
+
+        allSelection: [],
+        temporaryList: []
+      };
+    },
+
+    computed: {
+      tableKey() {
+        return `table-${this.rootCategoryLevelId}`;
+      },
+
+      // 表格列配置
+      columns() {
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 50,
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true
+          },
+    
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          {
+            prop: 'manualBatchNo',
+            label: '批次号',
+            align: 'center'
+          },
+          {
+            prop: 'availableCountBase',
+            label: '计量库存数量',
+            sortable: 'custom',
+            slot: 'availableCountBase',
+            showOverflowTooltip: true,
+            width: 130,
+            align: 'center'
+          },
+
+          ...([1, 23, 8].includes(Number(this.rootCategoryLevelId))
+            ? [
+                {
+                  prop: 'packingCountBase',
+                  label: '包装库存',
+                  slot: 'packingCountBase',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          {
+            prop: 'weight',
+            label: '重量',
+            showOverflowTooltip: true,
+            slot: 'weight'
+          },
+
+          {
+            prop: 'expirationDate',
+            slot: 'expirationDate',
+            label: '库存保质期',
+            width: 100
+          },
+          {
+            prop: 'expirationTime',
+            label: '周期倒计时',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityResult',
+            slot: 'qualityResult',
+            label: '质检结果',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'qualityStatus',
+            slot: 'qualityStatus',
+            label: '质检状态',
+            showOverflowTooltip: true,
+            width: 100
+          },
+          {
+            prop: 'pathName',
+            width: 230,
+            label: '仓库',
+            showOverflowTooltip: true
+          },
+
+          ...(this.rootCategoryLevelId == '4'
+            ? [
+                {
+                  prop: 'workstationName',
+                  label: '工位',
+                  showOverflowTooltip: true
+                },
+
+                {
+                  prop: 'runStatus',
+                  label: '状态',
+                  slot: 'runStatus',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          // ...(this.rootCategoryLevelId == '5'
+          //   ? [
+          //       {
+          //         prop: 'dieHoleNum',
+          //         label: '模孔数量',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'mandrelDiameter',
+          //         label: '芯棒直径',
+          //         showOverflowTooltip: true
+          //       },
+          //       {
+          //         prop: 'shrinkEffictive',
+          //         label: '收缩系数',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
+          // ...(this.rootCategoryLevelId == '7'
+          //   ? [
+          //       {
+          //         prop: 'materialQuality',
+          //         label: '材质',
+          //         showOverflowTooltip: true
+          //       },
+
+          //       {
+          //         prop: 'vehicleLen',
+          //         label: '长宽高',
+          //         slot: 'vehicleLen',
+          //         showOverflowTooltip: true
+          //       }
+          //     ]
+          //   : []),
+
+          ...(this.rootCategoryLevelId == '8'
+            ? [
+                {
+                  prop: 'extInfo.slotNum',
+                  label: '槽数',
+                  showOverflowTooltip: true
+                }
+              ]
+            : []),
+
+          ...(this.rootCategoryLevelId == '11'
+            ? [
+                {
+                  prop: 'status',
+                  label: '状态',
+                  slot: 'status',
+                  showOverflowTooltip: true
+                },
+
+                {
+                  prop: 'region',
+                  label: '位置',
+                  showOverflowTooltip: true
+                }
+              ]
+            : [])
+        ];
+      }
+    },
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, where, limit }) {
+        let URL;
+
+        let param = {
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        };
+        if (this.isType == 'pick') {
+          param.dimension = 1;
+
+          URL = pageeLedgerMain;
+        } else if (this.isType == 'feed') {
+          if ([4, 7, 14].includes(Number(this.rootCategoryLevelId))) {
+            URL = assetPage;
+          } else if (this.rootCategoryLevelId == 2) {
+            param.workOrderId = this.id;
+            delete param.taskId;
+            delete param.categoryLevelId;
+            URL = listInProduct;
+          } else if (
+            ![2, 4, 7, 14].includes(Number(this.rootCategoryLevelId))
+          ) {
+            URL = assetPage;
+          }
+        } else if(this.isType == 'job') {
+          URL = assetPage;
+        }
+
+        const res = await URL(param);
+
+        if (this.rootCategoryLevelId == '11') {
+          let _res = res;
+          let _list = [];
+          _res.list.forEach((e) => {
+            if (e.aridRegionList && e.aridRegionList.length != 0) {
+              e.aridRegionList.map((i) => {
+                let obj = {
+                  name: e.name,
+                  region: e.extInfo.region,
+                  rootCategoryLevelId: e.rootCategoryLevelId,
+                  ...i,
+                  instanceId: i.id
+                };
+                _list.push(obj);
+              });
+            }
+          });
+          res.list = _list;
+          return res;
+        } else {
+          let _res = res;
+          let _list = [];
+
+          _list.push(
+            ..._res.list.map((i) => {
+              const warehouseId = i.pathIds && i.pathIds.split(',')[0];
+
+              return {
+                warehouseId,
+                ...i,
+                instanceId: i.id
+              };
+            })
+          );
+
+          res.list = _list;
+          return res;
+        }
+      },
+
+      handleSelectionChange(data) {
+        this.allSelection = data;
+      },
+
+      /* 清空选择 */
+      clearChoose() {
+        this.allSelection = [];
+        this.$refs.table.clearSelection();
+      },
+      rowStyle({ row }) {
+        return this.selection.includes(row) ? { background: '#e6f7ff' } : null;
+      },
+      handleNodeClick(data) {
+        this.isCategory = true;
+        this.categoryLevelId = data.id;
+        this.rootCategoryLevelId = data.rootCategoryLevelId;
+        this.reload();
+      },
+
+      setRootId(data) {
+        this.categoryLevelId = data.id;
+        this.rootCategoryLevelId = data.rootCategoryLevelId;
+        this.reload();
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.isCategory = false;
+          this.$refs.table.reload({ pageNum: 1, where: where });
+        });
+      },
+
+      onDone() {
+        this.$nextTick(() => {
+          this.allSelection.forEach((item) => {
+            this.$refs.table.toggleRowSelection(item, true);
+          });
+        });
+      },
+      open(id, item) {
+        this.id = id;
+
+        if (this.isType == 'pick') {
+          this.temporaryList = item.pickList || [];
+          this.allSelection = item.pickList || [];
+          this.visible = true;
+          this.$nextTick(() => {
+            this.allSelection.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        } else if (this.isType == 'feed') {
+          let feedList = [];
+          feedList = [
+            ...item.modelList,
+            ...item.equipmentList,
+            ...item.instanceList,
+            ...item.aridRegionList,
+            ...item.turnover,
+            ...item.palletList,
+            ...item.revolvingDiskList,
+            ...item.semiProductList
+          ];
+          this.temporaryList = feedList || [];
+          this.allSelection = feedList || [];
+          this.visible = true;
+
+          this.$nextTick(() => {
+            feedList.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        } else if (this.isType == 'job') {
+          let feedList = [];
+          feedList = [
+            ...item.turnover,
+            ...item.equipmentList,
+          ];
+          this.temporaryList = feedList || [];
+          this.allSelection = feedList || [];
+          this.visible = true;
+
+          this.$nextTick(() => {
+            feedList.forEach((item) => {
+              this.$refs.table.toggleRowSelection(item, true);
+            });
+          });
+        }
+      },
+
+      handleClose() {
+        this.clearChoose();
+        this.temporaryList = [];
+        this.allSelection = [];
+        this.visible = false;
+      },
+      selected() {
+        if (this.allSelection.length == 0) {
+          this.$message.warning('请选择物料');
+          return false;
+        }
+
+
+        if (this.temporaryList.length > 0) {
+          // 使用Promise来“模拟”异步操作
+          new Promise((resolve) => {
+            if (this.temporaryList.length > 0) {
+              this.temporaryList.forEach((item) => {
+                this.allSelection.forEach((item2) => {
+                  if (item.id == item2.id && this.isType == 'pick') {
+                  this.$set(item2, 'demandQuantity',  item.demandQuantity || null);
+                  } else if (item.id == item2.id && this.isType == 'feed') {
+                  this.$set(item2, 'feedQuantity',  item.feedQuantity || null);
+                  }
+                });
+              });
+            }
+            this.allSelection.sort(
+              (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
+            );
+
+            resolve();
+          }).then(() => {
+    
+            this.$emit('allSelection', this.id, this.allSelection);
+            this.handleClose();
+          });
+        } else {
+          this.allSelection.sort(
+            (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
+          );
+
+          this.$emit('allSelection', this.id, this.allSelection);
+          this.handleClose();
+        }
+      }
+    },
+
+    created() {
+      if (this.isType == 'pick') {
+        this.treeIds = '1, 5, 7, 8, 10, 13, 14, 23, 26, 9, 28';
+      } else if (this.isType == 'feed') {
+        this.treeIds = '1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 26, 9, 23,28';
+      } else if (this.isType == 'job') {
+        this.treeIds = '4, 7';
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+
+  ::v-deep .is-checked {
+    background: #e6f7ff;
+  }
+</style>

+ 170 - 0
src/views/workOrderList/components/produce/pickingListSearch.vue

@@ -0,0 +1,170 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    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="仓库:" prop="warehouseId">
+          <template>
+            <el-select
+              clearable
+              filterable
+              style="width: 100%"
+              v-model="where.warehouseId"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in warehouseList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="物品编码:" prop="code">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="where.code"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="物品名称:" prop="assetName">
+          <el-input
+            clearable
+            v-model="where.assetName"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="批次号:" prop="batchNo">
+          <el-input
+            clearable
+            v-model="where.batchNo"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="批次号:" prop="manualBatchNo">
+          <el-input
+            clearable
+            v-model="where.manualBatchNo"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="型号:" prop="modelType">
+          <el-input
+            clearable
+            v-model="where.modelType"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="规格:" prop="specification">
+          <el-input
+            clearable
+            v-model="where.specification"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { getWarehouseList } from '@/api/produce/index.js';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        batchNo: '',
+
+        warehouseId: '',
+        manualBatchNo: '',
+
+        modelType: '',
+        specification: '',
+        code: '',
+
+        assetName: ''
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere },
+        warehouseList: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+      this.getArguInfo();
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      //搜索数据源
+      async getArguInfo() {
+        const { data } = await getWarehouseList();
+        this.warehouseList = data;
+      }
+    }
+  };
+</script>
+
+<style>
+  .ele-form-actions {
+    display: inline-block;
+    transform: translate(0);
+    transition: all;
+  }
+</style>

+ 6 - 17
src/views/workOrderList/index.vue

@@ -4,25 +4,12 @@
             <produceOrder-search @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
                 :activeName="activeName">
             </produceOrder-search>
-            <!-- <el-tabs v-model="activeName" type="card">
-                <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
-                <el-tab-pane label="已完成工单" name="second"></el-tab-pane>
-            </el-tabs> -->
+
             <!-- 数据表格 -->
             <ele-pro-table ref="table" :key="activeName" :initLoad="false" :columns="newColumns"
                 :datasource="datasource" row-key="code" :cache-key="`${activeName}produceOrderTable`"
                 :selection.sync="selection" @sort-change="onSortChange" autoAmendPage :parse-data="parseData">
-                <!-- <template v-slot:toolbar>
-                    <el-button type="success">新建</el-button>
-                    <el-button type="success">暂停</el-button>
-                    <el-button type="success">终止</el-button>
-
-                    <el-button type="success" @click="handlePicking">领料</el-button>
-                    <el-button type="success" @click="toEnd()">批量完结</el-button>
-
 
-                    <el-button type="success" @click="allPrinting()">批量打印二维码</el-button>
-                </template> -->
 
                 <template v-slot:code="{ row }">
                     <el-link type="primary" :underline="false" @click="goDetail(row)">
@@ -65,8 +52,7 @@
                 <!-- 操作列 -->
                 <template v-slot:action="{ row }">
                     <template>
-                        <el-link  type="primary" :underline="false"
-                        @click="goDetail(row)">
+                        <el-link type="primary" :underline="false" @click="goDetail(row)">
                             领料/投料/报工
                         </el-link>
                     </template>
@@ -95,6 +81,7 @@ import {
     updatePriority,
     update
 } from '@/api/produceOrder/index.js';
+import { workorderPage } from '@/api/workOrderList'
 
 import { fieldModel } from '@/api/produceWord/index.js';
 import produceOrderSearch from './components/produceOrder-search.vue';
@@ -374,7 +361,7 @@ export default {
 
         /* 表格数据源 */
         async datasource({ page, limit, where, order }) {
-            let res = await getPage({
+            let res = await workorderPage({
                 ...where,
                 ...order,
                 pageNum: page,
@@ -444,6 +431,7 @@ export default {
         },
 
         getFieldModel() {
+
             fieldModel({ fieldModel: 't_main_category' }).then((res) => {
                 const privateColumn = [
                     {
@@ -551,6 +539,7 @@ export default {
 
         // 生产工单跳转
         goDetail(row) {
+
             this.$refs.detailsRef.open(row)
         },
         handleDelete({ id }) {