695593266@qq.com преди 1 година
родител
ревизия
bdf63cd90c

+ 52 - 25
src/api/produceOrder/index.js

@@ -3,7 +3,7 @@ import request from '@/utils/request';
 /**
  * 分页
  */
-export async function getPage (params) {
+export async function getPage(params) {
   const res = await request.post('/mes/workorder/page', params);
   if (res.data.code == 0) {
     return res.data.data;
@@ -13,7 +13,7 @@ export async function getPage (params) {
 /**
  * 新增
  */
-export async function save (data) {
+export async function save(data) {
   const res = await request.post('/mes/workorder/save', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -23,7 +23,7 @@ export async function save (data) {
 /**
  * 修改
  */
-export async function update (data) {
+export async function update(data) {
   const res = await request.put('/mes/workorder/update', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -32,7 +32,7 @@ export async function update (data) {
 }
 
 // 批量完结
-export async function batchCompletion (params) {
+export async function batchCompletion(params) {
   const res = await request.post('/mes/workorder/batchCompletion', params);
   if (res.data.code == 0) {
     return res.data.data;
@@ -41,7 +41,7 @@ export async function batchCompletion (params) {
 }
 
 // 取消完结
-export async function cancelCompletion (id) {
+export async function cancelCompletion(id) {
   const res = await request.get(`/mes/workorder/cancelCompletion/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -49,10 +49,8 @@ export async function cancelCompletion (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
-
 // 领料保存
-export async function batchSave (data) {
+export async function batchSave(data) {
   const res = await request.post(`/mes/pickorder/batchSave`, data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -60,7 +58,7 @@ export async function batchSave (data) {
   return Promise.reject(new Error(res.data.message));
 }
 // 工单详情
-export async function getById (id) {
+export async function getById(id) {
   const res = await request.get(`/mes/workorder/getById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -69,7 +67,7 @@ export async function getById (id) {
 }
 
 // 拆分
-export async function splitWork (params) {
+export async function splitWork(params) {
   const res = await request.post(`/mes/workorder/splitBatch`, params);
   if (res.data.code == 0) {
     return res.data.data;
@@ -77,7 +75,7 @@ export async function splitWork (params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 报工
-export async function report (params) {
+export async function report(params) {
   const res = await request.post(`/mes/workreport/report`, params);
   if (res.data.code == 0) {
     return res.data.data;
@@ -85,7 +83,7 @@ export async function report (params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 报工 统计数据
-export async function reportCount (params) {
+export async function reportCount(params) {
   const res = await request.get(`/mes/workreport/count`, { params });
   if (res.data.code == 0) {
     return res.data.data;
@@ -93,18 +91,19 @@ export async function reportCount (params) {
   return Promise.reject(new Error(res.data.message));
 }
 
-export async function workorderproductsequencePage (params) {
+export async function workorderproductsequencePage(params) {
   // 发送 GET 请求获取数据
-  const res = await request.get(`/mes/workorderproductsequence/page`, { params });
+  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) {
+export async function reportPage(data) {
   const res = await request.post('/mes/workreport/page', data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -112,7 +111,7 @@ export async function reportPage (data) {
   return Promise.reject(new Error(res.data.message));
 }
 // 打印详情页-tab列表
-export async function printWorkOrderInfo (workOrderId) {
+export async function printWorkOrderInfo(workOrderId) {
   const res = await request.get(
     `/mes/workreport/printWorkOrderInfo/${workOrderId}`
   );
@@ -123,7 +122,7 @@ export async function printWorkOrderInfo (workOrderId) {
 }
 
 // 获取详情页数据
-export async function getInfoById (id) {
+export async function getInfoById(id) {
   const res = await request.get(`/mes/workreport/getById/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -132,7 +131,7 @@ export async function getInfoById (id) {
 }
 
 // 冲销接口
-export async function writeOffWork (data) {
+export async function writeOffWork(data) {
   const res = await request.post(`/mes/workreport/writeOff`, data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -140,7 +139,7 @@ export async function writeOffWork (data) {
   return Promise.reject(new Error(res.data.message));
 }
 //包装要求
-export async function getPackageList (code) {
+export async function getPackageList(code) {
   const res = await request.get(`/aps/workorder/getPackageList/${code}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -148,7 +147,7 @@ export async function getPackageList (code) {
   return Promise.reject(new Error(res.data.message));
 }
 //根据工序ID查询设备信息
-export async function getDeviceByTaskId (params) {
+export async function getDeviceByTaskId(params) {
   const res = await request.get(
     `/main/producetask/getDeviceByTaskId/${params.taskId}/${params.rootCategoryLevelId}`
   );
@@ -159,7 +158,7 @@ export async function getDeviceByTaskId (params) {
 }
 
 // 获取槽数
-export async function getSoltNum (id) {
+export async function getSoltNum(id) {
   const res = await request.get(`/main/categorypallet/getByCategoryId/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -168,7 +167,7 @@ export async function getSoltNum (id) {
 }
 
 // 打印前查询
-export async function queryPrint (data) {
+export async function queryPrint(data) {
   const res = await request.post(`/mes/workorder/queryPrint`, data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -177,7 +176,7 @@ export async function queryPrint (data) {
 }
 // 修改优先级
 export async function updatePriority(data) {
-  const res = await request.post(`/mes/workorder/updatePriority`,  data);
+  const res = await request.post(`/mes/workorder/updatePriority`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -186,7 +185,35 @@ export async function updatePriority(data) {
 
 // 根据任务实例id查询工序id
 export async function getTaskIdByInstanceId(taskInstanceId) {
-  const res = await request.get(`/main/producetask/getTaskIdByInstanceId/${taskInstanceId}`);
+  const res = await request.get(
+    `/main/producetask/getTaskIdByInstanceId/${taskInstanceId}`
+  );
+  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,
+    true
+  );
+  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,
+    true
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 15 - 0
src/views/batchRecord/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>批记录</div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    name: 'batchRecord',
+
+    mixins: [dictMixins]
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 0 - 4
src/views/produce/components/feeding/details.vue

@@ -12,10 +12,6 @@
             <div class="time">报工人 {{ item.executorName }}</div>
           </div>
 
-<<<<<<< HEAD
-=======
-
->>>>>>> 4a501bd67c3a30d7d30bdd22c33159816a09d7a9
           <div class="item_box rx-bc">
             <div class="time">工序名称: {{ item.taskName }}</div>
           </div>

+ 20 - 0
src/views/produce/components/footBtn.vue

@@ -62,6 +62,11 @@
             name: '任务',
             type: 'task',
             bjColor: '#67c23a'
+          },
+          {
+            name: '异常',
+            type: 'error',
+            bjColor: '#cc0000'
           }
         ],
         btnList2: [
@@ -100,6 +105,11 @@
             name: '任务',
             type: 'task',
             bjColor: '#67c23a'
+          },
+          {
+            name: '异常',
+            type: 'error',
+            bjColor: '#cc0000'
           }
         ],
         btnList3: [
@@ -117,6 +127,11 @@
             name: '工艺文件',
             type: 'work',
             bjColor: '#2B56C2'
+          },
+          {
+            name: '异常',
+            type: 'error',
+            bjColor: '#cc0000'
           }
         ],
         btnList4: [
@@ -155,6 +170,11 @@
             name: '任务',
             type: 'task',
             bjColor: '#67c23a'
+          },
+          {
+            name: '异常',
+            type: 'error',
+            bjColor: '#cc0000'
           }
         ],
         btnList: []

+ 0 - 3
src/views/produce/components/warehousing/index.vue

@@ -615,9 +615,6 @@
             item.warehouseId = this.warehouseId;
           });
 
-          this.List.forEach((item) => {
-            item.warehouseId = this.warehouseId;
-          });
           jobSave(this.List).then((res) => {
             console.log(res);
             this.$message.success('入库成功');

+ 825 - 733
src/views/produceOrder/index.vue

@@ -1,16 +1,12 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-
       <seek-page :seekList="seekList" @search="search"></seek-page>
 
-
       <!-- <produceOrder-search @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
         :activeName="activeName">
       </produceOrder-search> -->
 
-
-
       <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
         <!-- <el-tab-pane label="未完成工单" name="first"></el-tab-pane>
         <el-tab-pane label="已完成工单" name="second"></el-tab-pane> -->
@@ -20,21 +16,34 @@
         <el-tab-pane label="已延期" name="7"></el-tab-pane>
       </el-tabs>
       <!-- 数据表格 -->
-      <ele-pro-table ref="table" :key="activeName" :initLoad="false" :columns="newColumns" :datasource="datasource"
-        row-key="code" :cache-key="cacheKeyUrl" :selection.sync="selection"
-        @sort-change="onSortChange" autoAmendPage :parse-data="parseData" @columns-change="handleColumnChange">
+      <ele-pro-table
+        ref="table"
+        :key="activeName"
+        :initLoad="false"
+        :columns="newColumns"
+        :datasource="datasource"
+        row-key="code"
+        :cache-key="cacheKeyUrl"
+        :selection.sync="selection"
+        @sort-change="onSortChange"
+        autoAmendPage
+        :parse-data="parseData"
+        @columns-change="handleColumnChange"
+      >
         <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">新建</el-button> -->
+          <el-button type="success" @click="toPause()">暂停</el-button>
+          <el-button type="success" @click="toTermination()">终止</el-button>
 
           <!-- <el-button type="primary">工单刷新</el-button> -->
-          <el-button type="success" @click="handlePicking">领料</el-button>
+          <!-- <el-button type="success" @click="handlePicking">领料</el-button> -->
           <el-button type="success" @click="toEnd()">批量完结</el-button>
           <!-- <el-button type="success" @click="handleCreate">创建工单</el-button> -->
           <!-- <el-button type="success">工单操作控制</el-button> -->
 
-          <el-button type="success" @click="allPrinting()">批量打印二维码</el-button>
+          <el-button type="success" @click="allPrinting()"
+            >批量打印二维码</el-button
+          >
         </template>
 
         <template v-slot:code="{ row }">
@@ -44,7 +53,8 @@
         </template>
 
         <template v-slot:QRcode="{ row }">
-          <el-link type="primary" :underline="false" @click="handleQRcode(row)">生成二维码
+          <el-link type="primary" :underline="false" @click="handleQRcode(row)"
+            >生成二维码
           </el-link>
         </template>
 
@@ -54,9 +64,21 @@
 
         <template v-slot:priority="{ row }">
           <div style="display: flex">
-            <el-input v-model="row.priority" type="number" size="mini" :min="0" :max="10" @change="priorityChange(row)"
-              style="width: 80px"></el-input>
-            <el-popover placement="right" width="200" trigger="hover" content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)">
+            <el-input
+              v-model="row.priority"
+              type="number"
+              size="mini"
+              :min="0"
+              :max="10"
+              @change="priorityChange(row)"
+              style="width: 80px"
+            ></el-input>
+            <el-popover
+              placement="right"
+              width="200"
+              trigger="hover"
+              content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+            >
               <div class="sort-wrap" slot="reference">
                 <i class="el-icon-caret-top" @click="sortTop(row)"></i>
                 <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
@@ -81,31 +103,62 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <template v-if="activeName == 'second'">
-            <el-link type="primary" :underline="false" icon="el-icon-truck" v-if="row.status == 6"
-              @click="toCancel(row)">
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-truck"
+              v-if="row.status == 6"
+              @click="toCancel(row)"
+            >
               取消完结
-            </el-link></template>
-
-          <el-link v-if="row.clientEnvironmentId == 21" type="primary" :underline="false" @click="routing(row)">
+            </el-link></template
+          >
+
+          <el-link
+            v-if="row.clientEnvironmentId == 21"
+            type="primary"
+            :underline="false"
+            @click="routing(row)"
+          >
             更改工艺路线
           </el-link>
           <template>
             <el-link type="primary" :underline="false" @click="toView(row)">
               序列号
-            </el-link></template>
+            </el-link></template
+          >
           <template v-if="activeName != 'second'">
-            <el-link v-if="row.status == 4 && row.isSplit == 0" type="primary" :underline="false" icon="el-icon-truck"
-              @click="handleOrderPublish(1, row)">
+            <el-link
+              v-if="row.status == 4 && row.isSplit == 0"
+              type="primary"
+              :underline="false"
+              icon="el-icon-truck"
+              @click="handleOrderPublish(1, row)"
+            >
               报工
             </el-link>
-            <el-link v-if="row.status == 4 && row.isSplit == 0" type="primary" :underline="false"
-              @click="toUnpack(row)">
+            <el-link
+              v-if="row.status == 4 && row.isSplit == 0"
+              type="primary"
+              :underline="false"
+              @click="toUnpack(row)"
+            >
               拆分
             </el-link>
-            <el-link v-if="row.status == 4 && row.isSplit == 0" type="primary" :underline="false" @click="toEnd(row)">
+            <el-link
+              v-if="row.status == 4 && row.isSplit == 0"
+              type="primary"
+              :underline="false"
+              @click="toEnd(row)"
+            >
               完结
             </el-link>
-            <el-link v-if="dispatchBtn(row)"  type="primary" :underline="false"  @click="toReleaseOpen(row)">
+            <el-link
+              v-if="dispatchBtn(row)"
+              type="primary"
+              :underline="false"
+              @click="toReleaseOpen(row)"
+            >
               派单
             </el-link>
           </template>
@@ -136,799 +189,838 @@
 </template>
 
 <script>
-import releaseDialog from './components/releaseDialog'
-import {
-  getPage,
-  batchCompletion,
-  cancelCompletion,
-  updatePriority,
-  update,
-  getTaskIdByInstanceId
-} 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';
-import unpackDialog from './components/unpackDialog.vue';
-import pickingDialog from './components/pickingDialog.vue';
-import print from './components/print.vue';
-import printSr from './components/printSr';
-import printTg from './components/printTg';
-import EquipmentDialog from './components/EquipmentDialog.vue'
-import detailsPop from './components/details/index.vue'
-
-import { debounce } from 'lodash';
-import tableColumnsMixin from '@/mixins/tableColumnsMixin';
-
-
-export default {
-  mixins: [tableColumnsMixin],
-  components: {
-    releaseDialog,
-    produceOrderSearch,
-    pickingDialog,
-    createDialog,
-    unpackDialog,
-    print,
-    printSr,
-    printTg,
-    detailsPop,
-    EquipmentDialog,
-    xlhView
-  },
-
-  data() {
-
-    return {
-      activeName: 'first',
-      tabValue:'5',
-      id: '',
-      where:{},
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false,
-      statusOpt: {
-        first: [
-          { label: '所有状态', value: '5,4' },
-          { label: '待生产', value: '4' },
-          { label: '生产中', value: '5' }
-          // { label: '已延期', value: '7' }
-        ],
-        second: [{ label: '已完成', value: '6' }]
-      },
-      planType: [
-        { label: '所有计划类型', value: null },
-        { label: '内销计划', value: '1' },
-        { label: '外销计划', value: '2' },
-        { label: '预制计划', value: '3' }
-      ],
-      selection: [],
-      newColumns: [],
-      cacheKeyUrl:'7cc8e5d2-mes-produceOrder',
-      columnsVersion:0,
-      dispatchVisible:false,
-      dispatchRow:{}
-    };
-  },
-  computed: {
-    // 表格列配置
-    seekList() {
-      return [
-        {
-          label: "关键字:",
-          value: "keyWord",
-          type: "input",
-          placeholder: '',
+  import releaseDialog from './components/releaseDialog';
+  import {
+    getPage,
+    batchCompletion,
+    cancelCompletion,
+    updatePriority,
+    update,
+    getTaskIdByInstanceId,
+    updateStatusPause,
+    updateStatusTerminate
+  } 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';
+  import unpackDialog from './components/unpackDialog.vue';
+  import pickingDialog from './components/pickingDialog.vue';
+  import print from './components/print.vue';
+  import printSr from './components/printSr';
+  import printTg from './components/printTg';
+  import EquipmentDialog from './components/EquipmentDialog.vue';
+  import detailsPop from './components/details/index.vue';
+
+  import { debounce } from 'lodash';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+
+  export default {
+    mixins: [tableColumnsMixin],
+    components: {
+      releaseDialog,
+      produceOrderSearch,
+      pickingDialog,
+      createDialog,
+      unpackDialog,
+      print,
+      printSr,
+      printTg,
+      detailsPop,
+      EquipmentDialog,
+      xlhView
+    },
 
+    data() {
+      return {
+        activeName: 'first',
+        tabValue: '5',
+        id: '',
+        where: {},
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false,
+        statusOpt: {
+          first: [
+            { label: '所有状态', value: '5,4' },
+            { label: '待生产', value: '4' },
+            { label: '生产中', value: '5' }
+            // { label: '已延期', value: '7' }
+          ],
+          second: [{ label: '已完成', value: '6' }]
         },
-        {
-          label: "生产工单号:",
-          value: 'code',
-          type: "input",
-          placeholder: '',
-          labelWidth: 100,
-        },
-        {
-          label: "生产订单号:",
-          value: 'apsWorkOrderCode',
-          type: "input",
-          labelWidth: 100,
-        },
-        {
-          label: "计划编码:",
-          value: 'productionPlanCode',
-          type: "input",
-
-          placeholder: '',
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
+        ],
+        selection: [],
+        newColumns: [],
+        cacheKeyUrl: '7cc8e5d2-mes-produceOrder',
+        columnsVersion: 0,
+        dispatchVisible: false,
+        dispatchRow: {}
+      };
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '关键字:',
+            value: 'keyWord',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '生产工单号:',
+            value: 'code',
+            type: 'input',
+            placeholder: '',
+            labelWidth: 100
+          },
+          {
+            label: '生产订单号:',
+            value: 'apsWorkOrderCode',
+            type: 'input',
+            labelWidth: 100
+          },
+          {
+            label: '计划编码:',
+            value: 'productionPlanCode',
+            type: 'input',
 
-        },
-        {
-          label: "计划类型:",
-          value: 'planType',
-          type: "select",
-
-          placeholder: '',
-          width: 240,
-          // 加载状态
-          planList: this.planType
-        },
-        {
-          label: "工艺路线",
-          value: "produceRoutingName",
-          type: "input",
+            placeholder: ''
+          },
+          {
+            label: '计划类型:',
+            value: 'planType',
+            type: 'select',
+
+            placeholder: '',
+            width: 240,
+            // 加载状态
+            planList: this.planType
+          },
+          {
+            label: '工艺路线',
+            value: 'produceRoutingName',
+            type: 'input',
 
-          placeholder: '',
-          width: 240,
-        },
-        {
-          label: "产品编码",
-          value: "productCode",
-          type: "input",
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '产品编码',
+            value: 'productCode',
+            type: 'input',
 
-          placeholder: '',
-          width: 240,
-        },
-        {
-          label: "产品名称:",
-          value: "productName",
-          type: "input",
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '产品名称:',
+            value: 'productName',
+            type: 'input',
 
-          placeholder: '',
-          width: 240,
-        },
-        {
-          label: "牌号",
-          value: "brandNo",
-          type: "input",
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '牌号',
+            value: 'brandNo',
+            type: 'input',
 
-          placeholder: '',
-          width: 240,
-        },
-        {
-          label: "型号",
-          value: "model",
-          type: "input",
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '型号',
+            value: 'model',
+            type: 'input',
 
-          placeholder: '',
-          width: 240,
-        },
-        // {
-        //   label: "状态:",
-        //   value: 'status',
-        //   type: "select",
-
-        //   placeholder: '',
-        //   width: 240,
-        //   // 加载状态
-        //   planList: this.statusOpt.first
-        // },
-        {
-          label: "班组:",
-          value: 'teamId',
-          type: "select",
-          multiple:false, // 是否多选
-          filterable: true, // 是否可搜索
-          placeholder: '',
-          width: 240,
-          // 加载状态
-          planList: this.statusOpt.first
-        },
-        {
-          label: "创建时间:",
-          value: 'createTime',
-          type: "date",
-          dateType: 'daterange',
-          placeholder: '',
-          width: 240,
-          // 加载状态
-          planList: this.statusOpt.first
-        },
+            placeholder: '',
+            width: 240
+          },
+          // {
+          //   label: "状态:",
+          //   value: 'status',
+          //   type: "select",
+
+          //   placeholder: '',
+          //   width: 240,
+          //   // 加载状态
+          //   planList: this.statusOpt.first
+          // },
+          {
+            label: '班组:',
+            value: 'teamId',
+            type: 'select',
+            multiple: false, // 是否多选
+            filterable: true, // 是否可搜索
+            placeholder: '',
+            width: 240,
+            // 加载状态
+            planList: this.statusOpt.first
+          },
+          {
+            label: '创建时间:',
+            value: 'createTime',
+            type: 'date',
+            dateType: 'daterange',
+            placeholder: '',
+            width: 240,
+            // 加载状态
+            planList: this.statusOpt.first
+          }
+        ];
+      },
+      columns() {
+        const num = this.columnsVersion;
+        const opt = {
+          first: [
+            // {
+            //   prop: 'deliveryTime',
+            //   label: '预测交货日期',
+            //   align: 'center',
+            //   showOverflowTooltip: true,
+            //   minWidth: 110
+            // }
+          ],
+          second: [
+            {
+              prop: 'completeTime',
+              label: '完成时间',
+              align: 'center'
+            },
+            {
+              prop: 'cycle',
+              label: '生产周期',
+              align: 'center'
+            }
+          ]
+        };
+
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            fixed: 'left'
+          },
 
-      ];
-    },
-    columns() {
+          // {
+          //   prop: 'batchNo',
+          //   label: '批次号',
+          //   align: 'center',
+          //   minWidth: 130
+          // },
 
-      const num = this.columnsVersion
-      const opt = {
-        first: [
+          {
+            slot: 'code',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110
+          },
           // {
-          //   prop: 'deliveryTime',
-          //   label: '预测交货日期',
+          //   prop: 'originalCode',
+          //   label: '原始工单号',
           //   align: 'center',
-          //   showOverflowTooltip: true,
           //   minWidth: 110
-          // }
-        ],
-        second: [
+          // },
+
+          {
+            slot: 'QRcode',
+            label: '二维码',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            label: '生产订单号',
+            slot: 'apsWorkOrderCode',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 110
+          },
           {
-            prop: 'completeTime',
-            label: '完成时间',
+            prop: 'planType',
+            label: '计划类型',
+            align: 'center',
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
             align: 'center'
           },
           {
-            prop: 'cycle',
-            label: '生产周期',
+            prop: 'productCode',
+            label: '编码',
             align: 'center'
-          }
-        ]
-      };
-
-      return [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          fixed: 'left'
-        },
-
-        // {
-        //   prop: 'batchNo',
-        //   label: '批次号',
-        //   align: 'center',
-        //   minWidth: 130
-        // },
-
-        {
-          slot: 'code',
-          label: '生产工单号',
-          align: 'center',
-          minWidth: 110
-        },
-        // {
-        //   prop: 'originalCode',
-        //   label: '原始工单号',
-        //   align: 'center',
-        //   minWidth: 110
-        // },
-
-        {
-          slot: 'QRcode',
-          label: '二维码',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          label: "生产订单号",
-          slot: 'apsWorkOrderCode',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'productionPlanCode',
-          label: '计划编号',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'planType',
-          label: '计划类型',
-          align: 'center',
-          formatter: (row) => {
-            const obj = this.planType.find((i) => i.value == row.planType);
-            return obj && obj.label;
-          }
-        },
-        {
-          prop: 'produceRoutingName',
-          label: '工艺路线',
-          align: 'center'
-        },
-        {
-          prop: 'productCode',
-          label: '编码',
-          align: 'center'
-        },
-        {
-          prop: 'productName',
-          label: '名称',
-          align: 'center'
-        },
-        {
-          prop: 'model',
-          label: '型号',
-          align: 'center'
-        },
-        {
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center'
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center'
+          },
+          {
             prop: 'productionCodes',
             label: '生产编号',
             align: 'center',
             minWidth: 150,
             showOverflowTooltip: true
-        },
-        {
-          prop: 'brandNo',
-          label: '牌号',
-          align: 'center'
-        },
-        {
-          prop: 'priority',
-          label: '优先级',
-          align: 'center',
-          minWidth: 120,
-          slot: 'priority',
-          sortable: 'custom'
-        },
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'priority',
+            label: '优先级',
+            align: 'center',
+            minWidth: 120,
+            slot: 'priority',
+            sortable: 'custom'
+          },
 
-        {
-          prop: 'formingNum',
-          label: '要求生产数量',
-          align: 'center',
-          slot: 'formingNum',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formingWeight',
-          label: '要求生产重量',
-          slot: 'formingWeight',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formedNum',
-          label: '已生产数量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'formedWeight',
-          label: '已生产重量',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planStartTime',
-          label: '计划开始时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 150,
-           sortable: 'custom'
-        },
-        {
-          prop: 'planCompleteTime',
-          label: '计划结束时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 150,
-           sortable: 'custom'
-        },
-        {
-          prop: 'startTime',
-          label: '实际开始时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 150,
-           sortable: 'custom'
-        },
-        ...opt[this.activeName],
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 150,
-           sortable: 'custom'
-        },
-        // {
-        //   prop: 'status',
-        //   slot: 'status',
-        //   label: '状态',
-        //   align: 'center',
-        //   formatter: (row) => {
-        //     const obj = this.statusOpt[this.activeName].find(
-        //       (i) => i.value == row.status
-        //     );
-        //     return obj && obj.label;
-        //   }
-        // },
-        {
-          prop: 'deviceName',
-          slot: 'deviceName',
-          label: '设备名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'crewNames',
-          slot: 'crewNames',
-          label: '报工人员',
-          align: 'center',
-          showOverflowTooltip: true
-        },
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            slot: 'formingNum',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formingWeight',
+            label: '要求生产重量',
+            slot: 'formingWeight',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formedNum',
+            label: '已生产数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'formedWeight',
+            label: '已生产重量',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            sortable: 'custom'
+          },
+          {
+            prop: 'planCompleteTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            sortable: 'custom'
+          },
+          {
+            prop: 'startTime',
+            label: '实际开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            sortable: 'custom'
+          },
+          ...opt[this.activeName],
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            sortable: 'custom'
+          },
+          // {
+          //   prop: 'status',
+          //   slot: 'status',
+          //   label: '状态',
+          //   align: 'center',
+          //   formatter: (row) => {
+          //     const obj = this.statusOpt[this.activeName].find(
+          //       (i) => i.value == row.status
+          //     );
+          //     return obj && obj.label;
+          //   }
+          // },
+          {
+            prop: 'deviceName',
+            slot: 'deviceName',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'crewNames',
+            slot: 'crewNames',
+            label: '报工人员',
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: 'teamName',
-          label: '班组',
-          align: 'center',
-          showOverflowTooltip: true
-        }
-      ];
-    },
-    dispatchBtn(){
-      return (row)=>{
-        return !!row.taskId
-      }
-    },
-    clientEnvironmentId() {
-      return this.$store.state.user.info.clientEnvironmentId;
-    }
-  },
-  watch: {
-    activeName: {
-      handler() {
-        if (this.activeName) {
-          this.where.status = this.statusOpt[this.activeName][0].value;
-          this.reload();
-        }
+          {
+            prop: 'teamName',
+            label: '班组',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+      dispatchBtn() {
+        return (row) => {
+          return !!row.taskId;
+        };
       },
-      immediate: true
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
     },
-    tabValue: {
-      handler(newVal) {
-        if (newVal === '6') {
-          this.newColumns.splice(3,1)
-        }else {
-          if (this.newColumns[3].label !== '生产订单号') {
-            this.newColumns.splice(3,0,{
-              label: "生产订单号",
-              slot: 'apsWorkOrderCode',
-              align: 'center',
-              minWidth: 110
-            })
+    watch: {
+      activeName: {
+        handler() {
+          if (this.activeName) {
+            this.where.status = this.statusOpt[this.activeName][0].value;
+            this.reload();
           }
-        }
+        },
+        immediate: true
       },
-      immediate: true
-    }
-  },
-  created() {
-    this.getFieldModel();
-  },
-  mounted() {
-
-    this.reload()
-  },
-
-  methods: {
-    //派单
-    toReleaseOpen(row) {
-      getTaskIdByInstanceId(row.taskId).then((res)=>{
-        if (res){
-          this.dispatchRow = {...row};
-          this.dispatchRow.initialWeight = row.formingWeight ? row.formingWeight + row.weightUnit : '';
-          this.dispatchRow.taskInstanceId = res
-          this.dispatchVisible = true;
-        }
-      }).catch((err)=>{
-        this.$message.error(err.message);
-      })
-
-
+      tabValue: {
+        handler(newVal) {
+          if (newVal === '6') {
+            this.newColumns.splice(3, 1);
+          } else {
+            if (this.newColumns[3].label !== '生产订单号') {
+              this.newColumns.splice(3, 0, {
+                label: '生产订单号',
+                slot: 'apsWorkOrderCode',
+                align: 'center',
+                minWidth: 110
+              });
+            }
+          }
+        },
+        immediate: true
+      }
     },
-    search(e){
-      if(Array.isArray(e.createTime)&&e.createTime.length){
-        e.createTimeStart=e.createTime[0];
-        e.createTimeEnd = e.createTime[1];
-      };
-      this.reload(e)
+    created() {
+      this.getFieldModel();
     },
-
-
-    // 查看序列号
-    toView(row) {
-      this.$refs.xlhRef.open(row)
+    mounted() {
+      this.reload();
     },
 
+    methods: {
+      //派单
+      toReleaseOpen(row) {
+        getTaskIdByInstanceId(row.taskId)
+          .then((res) => {
+            if (res) {
+              this.dispatchRow = { ...row };
+              this.dispatchRow.initialWeight = row.formingWeight
+                ? row.formingWeight + row.weightUnit
+                : '';
+              this.dispatchRow.taskInstanceId = res;
+              this.dispatchVisible = true;
+            }
+          })
+          .catch((err) => {
+            this.$message.error(err.message);
+          });
+      },
+      search(e) {
+        if (Array.isArray(e.createTime) && e.createTime.length) {
+          e.createTimeStart = e.createTime[0];
+          e.createTimeEnd = e.createTime[1];
+        }
+        this.reload(e);
+      },
 
-    handlePicking() {
-      this.$router.push({
-        path: '/produceOrder/picking'
-      });
-    },
-    statusFormatter(status) {
-      const obj = this.statusOpt[this.activeName].find(
-        (i) => i.value == status
-      );
+      // 查看序列号
+      toView(row) {
+        this.$refs.xlhRef.open(row);
+      },
 
-      return obj && obj.label;
-    },
+      handlePicking() {
+        this.$router.push({
+          path: '/produceOrder/picking'
+        });
+      },
+      statusFormatter(status) {
+        const obj = this.statusOpt[this.activeName].find(
+          (i) => i.value == status
+        );
 
-    routing(row) {
-      this.id = row.id
+        return obj && obj.label;
+      },
 
-      this.$refs.equipmentRef.open()
-    },
-    handleTabClick(){
-      if(this.tabValue=='6'){
-        this.activeName="second"
-      }else{
-        this.activeName="first"
-      }
-       this.reload()
-    },
+      routing(row) {
+        this.id = row.id;
 
-    /* 表格数据源 */
-    async datasource({ page, limit, where, order }) {
-      // console.log('1123',where)
-      where.statusList=[this.tabValue]
-      let res = await getPage({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit,
-        ...this.sort
-      });
-      // res['list'] = this.flattenArray(res.list)
-      return res;
-    },
-
-    onSortChange(e) {
-      let sort = {
-        orderBy: e.order,
-        sortName: e.prop
-      };
-      this.sort = sort;
-      this.reload();
-    },
-    flattenArray(arr) {
-      var result = []; // 存放结果的数组
-      for (let i = 0; i < arr.length; i++) {
-        if (Array.isArray(arr[i].subWorkOrder)) {
-          let _arr = [];
-          _arr = _arr.concat(arr[i].subWorkOrder);
-          delete arr[i].subWorkOrder;
-          result.push(arr[i]);
-          result.push(..._arr);
+        this.$refs.equipmentRef.open();
+      },
+      handleTabClick() {
+        if (this.tabValue == '6') {
+          this.activeName = 'second';
         } else {
-          result.push(arr[i]);
+          this.activeName = 'first';
         }
-      }
+        this.reload();
+      },
 
-      return result;
-    },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        // console.log('1123',where)
+        where.statusList = [this.tabValue];
+        let res = await getPage({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          ...this.sort
+        });
+        // res['list'] = this.flattenArray(res.list)
+        return res;
+      },
 
-    /* 数据转为树形结构 */
-    parseData(data) {
+      onSortChange(e) {
+        let sort = {
+          orderBy: e.order,
+          sortName: e.prop
+        };
+        this.sort = sort;
+        this.reload();
+      },
+      flattenArray(arr) {
+        var result = []; // 存放结果的数组
+        for (let i = 0; i < arr.length; i++) {
+          if (Array.isArray(arr[i].subWorkOrder)) {
+            let _arr = [];
+            _arr = _arr.concat(arr[i].subWorkOrder);
+            delete arr[i].subWorkOrder;
+            result.push(arr[i]);
+            result.push(..._arr);
+          } else {
+            result.push(arr[i]);
+          }
+        }
 
-      return {
-        ...data,
-        list: this.$util.toTreeData({
-          data: data.list,
-          count: data.total,
+        return result;
+      },
 
-          idField: 'code',
-          parentIdField: 'originalCode'
-        })
-      };
-    },
+      /* 数据转为树形结构 */
+      parseData(data) {
+        return {
+          ...data,
+          list: this.$util.toTreeData({
+            data: data.list,
+            count: data.total,
 
-    /* 数据转为树形结构 */
+            idField: 'code',
+            parentIdField: 'originalCode'
+          })
+        };
+      },
 
-    createSuccess() {
-      this.reload();
-    },
-    handleCreate() {
-      this.$refs.createRef.open(0);
-    },
-    // 发布工单
-    handleOrderPublish(type, row) {
-      // this.$router.push({
-      //   path: '/produce',
-      //   query: {
-      //     workOrderId: row.id
-      //   }
-      // });
-      this.$router.push({
-        path: '/produceOrder/workReport',
-        query: {
-          workOrderId: row.id
-        }
-      });
-    },
+      /* 数据转为树形结构 */
 
-    getFieldModel() {
-      fieldModel({ fieldModel: 't_main_category' }).then((res) => {
-        const privateColumn = [
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 250,
-            align: 'center',
-            resizable: false,
-            fixed: 'right',
-            slot: 'action',
-            showOverflowTooltip: true
+      createSuccess() {
+        this.reload();
+      },
+      handleCreate() {
+        this.$refs.createRef.open(0);
+      },
+      // 发布工单
+      handleOrderPublish(type, row) {
+        // this.$router.push({
+        //   path: '/produce',
+        //   query: {
+        //     workOrderId: row.id
+        //   }
+        // });
+        this.$router.push({
+          path: '/produceOrder/workReport',
+          query: {
+            workOrderId: row.id
           }
-        ];
+        });
+      },
 
-        let newRes = res.map((m) => {
-          return {
-            prop: 'extField.' + m.prop,
-            label: m.label,
-            align: 'center',
-            showOverflowTooltip: true
-          };
+      getFieldModel() {
+        fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          const privateColumn = [
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 250,
+              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.getTabColumns();
+          this.$forceUpdate();
         });
+      },
 
-        this.newColumns = [...this.columns, ...newRes, ...privateColumn];
-        this.getTabColumns();
-        this.$forceUpdate();
-      });
-    },
+      toPause() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条工单!');
+        }
 
-    // 完结与批量完结
-    toEnd(row) {
-      if (row) {
-        this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
+        let ids = [];
+
+        this.selection.forEach((item) => {
+          ids.push(item.id);
+        });
+        this.$confirm(`是否要暂停工单?`, '提醒', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
-            batchCompletion([row.id]).then((res) => {
+            updateStatusPause(ids).then((res) => {
               this.$message.success('成功');
               this.reload();
             });
           })
-          .catch(() => { });
-      } else {
+          .catch(() => {});
+      },
+
+      toTermination() {
         if (!this.selection.length) {
           return this.$message.warning('请至少选择一条工单!');
         }
-        const ids = [];
-        this.selection.map((item) => {
+
+        let ids = [];
+
+        this.selection.forEach((item) => {
           ids.push(item.id);
         });
-        const h = this.$createElement;
-        this.$msgbox({
-          title: '提醒',
-          message: h('p', null, [
-            h('span', null, '是否要完结 '),
-            h(
-              'span',
-              { style: 'color: #70B603' },
-              `${this.selection.length}`
-            ),
-            h('span', null, ' 条工单?')
-          ]),
-          showCancelButton: true,
+        this.$confirm(`是否要终止工单?`, '提醒', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
-            batchCompletion(ids).then((res) => {
+            updateStatusTerminate(ids).then((res) => {
               this.$message.success('成功');
               this.reload();
             });
           })
-          .catch(() => { });
-      }
-    },
-
-    // 取消完结
-    toCancel(row) {
-      cancelCompletion([row.id]).then((res) => {
-        this.$message.success('成功');
-        this.reload();
-      });
-    },
-
-    // 拆分
-    toUnpack(row) {
-      this.$refs.unpackRef.open(row);
-    },
-    handleTabChange() {
-      this.$refs.searchRef.reset();
-    },
+          .catch(() => {});
+      },
 
-    /* 刷新表格 */
-    reload(where = {}) {
-      this.$nextTick(() => {
-        where.statusList = (
-          where.status || this.statusOpt[this.activeName][0].value
-        ).split(',');
-        this.$refs.table.reload({ page: 1, where });
-      });
-    },
+      // 完结与批量完结
+      toEnd(row) {
+        if (row) {
+          this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
+            confirmButtonText: '确认',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              batchCompletion([row.id]).then((res) => {
+                this.$message.success('成功');
+                this.reload();
+              });
+            })
+            .catch(() => {});
+        } else {
+          if (!this.selection.length) {
+            return this.$message.warning('请至少选择一条工单!');
+          }
+          const ids = [];
+          this.selection.map((item) => {
+            ids.push(item.id);
+          });
+          const h = this.$createElement;
+          this.$msgbox({
+            title: '提醒',
+            message: h('p', null, [
+              h('span', null, '是否要完结 '),
+              h(
+                'span',
+                { style: 'color: #70B603' },
+                `${this.selection.length}`
+              ),
+              h('span', null, ' 条工单?')
+            ]),
+            showCancelButton: true,
+            confirmButtonText: '确认',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              batchCompletion(ids).then((res) => {
+                this.$message.success('成功');
+                this.reload();
+              });
+            })
+            .catch(() => {});
+        }
+      },
 
-    // 生产工单跳转
-    goDetail(row) {
-      this.$refs.detailsRef.open(row)
-    },
-    handleDelete({ id }) {
-      this.$confirm('确定删除当前数据?', '提示').then(async () => {
-        await del(id);
-        this.$message.success('删除成功!');
-        this.reload();
-      });
-    },
+      // 取消完结
+      toCancel(row) {
+        cancelCompletion([row.id]).then((res) => {
+          this.$message.success('成功');
+          this.reload();
+        });
+      },
 
-    handleQRcode(row) {
-      if (this.clientEnvironmentId == 2) {
-        this.$refs.printSrRef.open([row.id]);
-      } else if (this.clientEnvironmentId == 3) {
-        this.$refs.printTgRef.open([row.id]);
-      } else {
-        this.$refs.printRef.open([row.id]);
-      }
-    },
+      // 拆分
+      toUnpack(row) {
+        this.$refs.unpackRef.open(row);
+      },
+      handleTabChange() {
+        this.$refs.searchRef.reset();
+      },
 
-    allPrinting() {
-      let ids = this.findAllIds(this.selection);
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$nextTick(() => {
+          where.statusList = (
+            where.status || this.statusOpt[this.activeName][0].value
+          ).split(',');
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
 
-      if (this.clientEnvironmentId == 2) {
-        this.$refs.printSrRef.open(ids);
-      } else if (this.clientEnvironmentId == 3) {
-        this.$refs.printTgRef.open(ids);
-      } else {
-        this.$refs.printRef.open(ids);
-      }
-    },
+      // 生产工单跳转
+      goDetail(row) {
+        this.$refs.detailsRef.open(row);
+      },
+      handleDelete({ id }) {
+        this.$confirm('确定删除当前数据?', '提示').then(async () => {
+          await del(id);
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
 
-    findAllIds(nodes) {
-      let ids = [];
-      nodes.forEach((node) => {
-        ids.push(node.id); // 添加当前节点的id
-        if (node.children && node.children.length > 0) {
-          // 递归调用自身来处理子节点
-          ids = ids.concat(this.findAllIds(node.children));
+      handleQRcode(row) {
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open([row.id]);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open([row.id]);
+        } else {
+          this.$refs.printRef.open([row.id]);
         }
-      });
-      return ids;
-    },
+      },
 
-    choose(row) {
-      this.updateFn(row);
-    },
+      allPrinting() {
+        let ids = this.findAllIds(this.selection);
 
-    async updateFn(row) {
-      let req = {
-        id: this.id,	//工艺路线id		false
-        produceRoutingId: row[0].id,	//工艺路线id		false
-        produceRoutingName: row[0].name,
+        if (this.clientEnvironmentId == 2) {
+          this.$refs.printSrRef.open(ids);
+        } else if (this.clientEnvironmentId == 3) {
+          this.$refs.printTgRef.open(ids);
+        } else {
+          this.$refs.printRef.open(ids);
+        }
+      },
 
-      };
-      const res = await update(req);
-      this.reload();
-    },
+      findAllIds(nodes) {
+        let ids = [];
+        nodes.forEach((node) => {
+          ids.push(node.id); // 添加当前节点的id
+          if (node.children && node.children.length > 0) {
+            // 递归调用自身来处理子节点
+            ids = ids.concat(this.findAllIds(node.children));
+          }
+        });
+        return ids;
+      },
 
-    sortTop(row) {
-      row.priority = Number(row.priority) + 1;
-      this.priorityChange(row);
-    },
-    sortBottom(row) {
-      if (row.priority <= 1) {
-        return;
-      }
-      row.priority = Number(row.priority) - 1;
-      this.priorityChange(row);
-    },
+      choose(row) {
+        this.updateFn(row);
+      },
 
-    priorityChange(row) {
-      if (row.priority > 10) {
-        row.priority = 10; // 如果大于 10,则设置为 10
-      } else if (row.priority < 0) {
-        row.priority = 0; // 如果小于 0,则设置为 0
-      }
+      async updateFn(row) {
+        let req = {
+          id: this.id, //工艺路线id		false
+          produceRoutingId: row[0].id, //工艺路线id		false
+          produceRoutingName: row[0].name
+        };
+        const res = await update(req);
+        this.reload();
+      },
 
-      this.priorityFn(row);
-    },
-    priorityFn: debounce(function (row) {
-      let params = {
-        id: row.id,
-        priority: row.priority
-      };
-      updatePriority(params).then((res) => { });
-    }, 800)
-  }
+      sortTop(row) {
+        row.priority = Number(row.priority) + 1;
+        this.priorityChange(row);
+      },
+      sortBottom(row) {
+        if (row.priority <= 1) {
+          return;
+        }
+        row.priority = Number(row.priority) - 1;
+        this.priorityChange(row);
+      },
 
-};
+      priorityChange(row) {
+        if (row.priority > 10) {
+          row.priority = 10; // 如果大于 10,则设置为 10
+        } else if (row.priority < 0) {
+          row.priority = 0; // 如果小于 0,则设置为 0
+        }
 
+        this.priorityFn(row);
+      },
+      priorityFn: debounce(function (row) {
+        let params = {
+          id: row.id,
+          priority: row.priority
+        };
+        updatePriority(params).then((res) => {});
+      }, 800)
+    }
+  };
 </script>