Просмотр исходного кода

feat: 新增盘点工单功能及相关页面组件

liujt 6 месяцев назад
Родитель
Сommit
3f58fc8763

+ 288 - 0
src/api/mes/produceOrder/index.js

@@ -0,0 +1,288 @@
+import request from '@/utils/request';
+
+/**
+ * 分页
+ */
+export async function getPage(params) {
+  const res = await request.post('/mes/workorder/page', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 新增
+ */
+export async function save(data) {
+  const res = await request.post('/mes/workorder/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 修改
+ */
+export async function update(data) {
+  const res = await request.put('/mes/workorder/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 批量完结
+export async function batchCompletion(params) {
+  const res = await request.post('/mes/workorder/batchCompletion', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 取消完结
+export async function cancelCompletion(id) {
+  const res = await request.get(`/mes/workorder/cancelCompletion/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 领料保存
+export async function batchSave(data) {
+  const res = await request.post(`/mes/pickorder/batchSave`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 工单详情
+export async function getById(id) {
+  const res = await request.get(`/mes/workorder/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 拆分
+export async function splitWork(params) {
+  const res = await request.post(`/mes/workorder/splitBatch`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 报工
+export async function report(params) {
+  const res = await request.post(`/mes/workreport/report`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 报工 统计数据
+export async function reportCount(params) {
+  const res = await request.get(`/mes/workreport/count`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  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);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 打印详情页-tab列表
+export async function printWorkOrderInfo(workOrderId) {
+  const res = await request.get(
+    `/mes/workreport/printWorkOrderInfo/${workOrderId}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取详情页数据
+export async function getInfoById(id) {
+  const res = await request.get(`/mes/workreport/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 冲销接口
+export async function writeOffWork(data) {
+  const res = await request.post(`/mes/workreport/writeOff`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//包装要求
+export async function getPackageList(code) {
+  const res = await request.get(`/aps/workorder/getPackageList/${code}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//根据工序ID查询设备信息
+export async function getDeviceByTaskId(params) {
+  const res = await request.get(
+    `/main/producetask/getDeviceByTaskId/${params.taskId}/${params.rootCategoryLevelId}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取槽数
+export async function getSoltNum(id) {
+  const res = await request.get(`/main/categorypallet/getByCategoryId/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 打印前查询
+export async function queryPrint(data) {
+  const res = await request.post(`/mes/workorder/queryPrint`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 修改优先级
+export async function updatePriority(data) {
+  const res = await request.post(`/mes/workorder/updatePriority`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据任务实例id查询工序id
+export async function 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;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//获取单个工单报工信息
+export async function workorderInfo(id) {
+  let timeStamp = new Date().getTime();
+  const res = await request.get(
+    `/pda/mes/workorder/getById/${id}?timeStamp=${timeStamp}`
+  );
+  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}`);
+  if (res.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(data.message);
+}
+
+export async function fieldModel(params) {
+  const res = await request.get(`/main/fieldmodel/list`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 工艺卡打印信息
+export async function queryPrintV2(data) {
+  const res = await request.post(`/mes/workorder/queryPrintV2`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//获取用户的工厂,所属工作中中心,班组等信息
+export async function getUserInfo(id) {
+  const res = await request.get(`/main/user/getUserWindow/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 我的工单
+ */
+export async function getMyPage(params) {
+  const res = await request.post('/mes/workorder/my-page', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据工单id获取工序列表
+export async function getTaskInstanceList(id) {
+  const res = await request.get(`/pda/mes/workorder/getTaskInstanceById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 258 - 0
src/api/qms/inspectionWork/index.js

@@ -0,0 +1,258 @@
+import request from '@/utils/request';
+
+// 列表
+export async function getList(data) {
+  const res = data.parentId
+    ? await request.post(`/qms/line_point/page`)
+    : await request.post('/qms/quality_work_order/page', data);
+  console.log(res);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 新增
+export async function save(data) {
+  const res = await request.post(`/qms/quality_work_order/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 编辑
+export async function update(data) {
+  const res = await request.post(`/qms/quality_work_order/update`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getById(id) {
+  const res = await request.get(`/qms/quality_work_order/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 查询工单详情
+export async function getDetailById(id) {
+  const res = await request.get(`/qms/quality_work_order/getDetailById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 新增合格证
+export async function qualificationSave(data) {
+  const res = await request.post(`/qms/qualityWorkOrderCertificate/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 删除
+export async function removeItem(data) {
+  const res = await request.delete('/qms/quality_work_order/delete', {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//列表
+export async function parameterList(params) {
+  const res = await request.get('/main/produceparam/page', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+// 报工
+export async function exeReportWork(data) {
+  const res = await request.post(`/qms/quality_work_order/exeReportWork`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据质检工单id获取清单列表
+export async function queryQualityInventory(data) {
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_inventory',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+// 根据质检工单id获取质检样品列表
+export async function queryQualitySamplContent(data) {
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_sampl_content',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+// 根据质检工单id获取方案内容
+export async function queryQualityTempleContent(data) {
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_temple_content',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+// 仓库定义列表
+export async function warehouseList(data) {
+  const res = await request.post('/wms/warehouse/select/warehouseList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+//更新合格证号
+export async function updateCertificateNumber(data) {
+  const res = await request.post(
+    '/qms/quality_work_order/updateCertificateNumber',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+// 查询合格证
+export async function qualityWorkOrderCertificate(params) {
+  const res = await request.get('/qms/qualityWorkOrderCertificate/page', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+// 关闭
+export async function closeWork(data) {
+  const res = await request.post(`/qms/quality_work_order/close`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//批量关闭
+export async function closeWorkList(data) {
+  const res = await request.post(`/qms/quality_work_order/batchClose`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 关闭
+export async function verificationQualityInspector(id) {
+  const res = await request.post(
+    `/qms/quality_work_order/verificationQualityInspector/${id}`
+  );
+  return res.data.code;
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function checkByQualityWorkOrderId(qualityWorkOrderId) {
+  const res = await request.get(
+    `/qms/samplingrecord/checkByQualityWorkOrderId/` + qualityWorkOrderId
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//转派
+export async function transferQualityWork(data) {
+  const res = await request.post('/qms/quality_work_order/transfer', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}
+
+//出库单详情
+
+export async function getOutboundDetail(params) {
+  const res = await request.get(`/mes/pickorder/outStorageDetail`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// /main/qmsreporttemplate/page 报表模板分页查询 get
+export async function getQmsReportTemplatePageList(params) {
+  const res = await request.get(`/main/qmsreporttemplate/page`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function newFilePageAPI(data) {
+  const res = await request.post('/fm/file/queryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//获取工艺文件
+
+export async function fileReleaseAPI(data) {
+  const res = await request.post('/fm/file/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// export async function craftFiles(data) {
+//   const res = await request.post('/mes/workorder/craftFiles', data);
+
+//   if (res.data.code == 0) {
+//     return res.data.data;
+//   }
+//   return Promise.reject(new Error(res.data.message));
+// }
+//收样
+
+export async function sampleCollection(data) {
+  const res = await request.put(
+    `/qms/quality_work_order/sampleCollection`,
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 工艺文件
+export async function craftFiles(qualityWorkOrderId) {
+  const res = await request.get(
+    `/qms/quality_work_order/craftFiles/${qualityWorkOrderId}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 155 - 0
src/api/warehouseManagement/inventory/index.js

@@ -0,0 +1,155 @@
+import request from '@/utils/request';
+
+// 查询临时盘点数据列表
+export async function getInventoryPlanList(params) {
+  const res = await request.get('/wms/plan/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 新增临时盘点计划
+export async function saveInventoryPlan(params) {
+  const res = await request.post('/wms/plan/save', params);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取临时盘点计划详情
+export async function getInventoryPlanDetailById(id) {
+  const res = await request.get('/wms/plan/getById/' + id);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 修改临时盘点计划
+export async function updateInventoryPlan(params) {
+  const res = await request.post('/wms/plan/update', params);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 临时盘点计划删除
+export async function deleteInventoryPlan(data) {
+  const res = await request.delete(`/wms/plan/delete`, { data });
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点计划派单
+export async function sendOrders(params) {
+  const res = await request.post('/wms/planOrder/sendOrders', params);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点工单列表
+export async function getPlanOrderList(params) {
+  const res = await request.get('/wms/planOrder/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点工单详情
+export async function getOrderInfoByPlanId(params) {
+  const res = await request.get('/wms/plan/getOrderInfoByPlanId', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点计划撤回
+export async function revocationInventoryPlan(params) {
+  const res = await request.post('/wms/plan/revocation', params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点工单物品详情
+export async function getPlanDetailList(params) {
+  const res = await request.get('/wms/plandetail/page', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 盘点报工
+export async function reportWork(data, params) {
+  console.log(data);
+  const urlParams = new URLSearchParams(params);
+  const res = await request.post('/wms/planOrder/reportWork?' + urlParams, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 报损报溢列表
+export async function getReportsList(params) {
+  const res = await request.get('/wms/planProfitLoss/page', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取临时盘点计划详情
+export async function getReportPlanDetailById(id) {
+  const res = await request.get('/wms/planProfitLoss/getById/' + id);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 报损报溢保存
+export async function saveReportsList(data) {
+  const res = await request.post('/wms/planProfitLoss/save', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 报损报溢修改
+export async function updateReportsList(data) {
+  const res = await request.post('/wms/planProfitLoss/update', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 报损报溢列表
+export async function getReportList(params) {
+  const res = await request.get('/wms/plandetail/list', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 5 - 0
src/enum/dict.js

@@ -475,3 +475,8 @@ export const payAndReceiveEnum = [
     value: 99
   },
 ];
+
+export const recordingMethodList = [
+  { label: '按质检项检', value: 1 },
+  { label: '按样品检', value: 2 }
+];

+ 14 - 3
src/views/bpm/tickets/index.vue

@@ -33,13 +33,17 @@
   import delivery from './delivery';
   import repair from './repair';
   import inspectionWork from './inspectionWork';
+  import productions from './productions';
+  import work from './work';
   export default {
     components: {
       patrolInspection,
       maintenance,
       delivery,
       repair,
-      inspectionWork
+      inspectionWork,
+      productions,
+      work
     },
     data() {
       return {
@@ -49,9 +53,10 @@
           { key: 'maintenance', name: '保养工单' },
           // { key: 'delivery', name: '量具送检工单' },
           { key: 'repair', name: '维修工单' },
-          // { key: 'inspectionWork', name: '质检工单' }
+          { key: 'productions', name: '生产工单' },
+          { key: 'inspectionWork', name: '质检工单' },
           // { key: 'repair', name: '计划性维修工单' },
-          // { key: 'malfunction', name: '盘点工单' }
+          { key: 'work', name: '盘点工单' }
         ]
       };
     },
@@ -74,6 +79,12 @@
         case '质检工单':
           this.activeComp = 'inspectionWork';
           break;
+        case '盘点工单':
+          this.activeComp = 'work';
+          break;
+        case '生产工单':
+          this.activeComp = 'productions';
+          break;
         default:
           break;
       }

+ 754 - 54
src/views/bpm/tickets/inspectionWork/index.vue

@@ -1,74 +1,774 @@
 <template>
   <div>
-    <div class="iframe_box"  ref="iframeBox">
-      <!--   src="http://aiot.zoomwin.com.cn:51001/page-main-data/product/oneProduct?isWt=true&businessId=1895440590572208130" -->
-      <!-- {{ location + '/page-main-data/product/oneProduct?isWt=true&businessId=' + businessId }} -->
-   
-     <!-- <iframe
-     :src="'http://localhost:8087/qms/inspectionWork?isWt=true&isBtn=false&businessId=' + businessId" 
-      width="100%"
-      height="600"
-      frameborder="0"
-      allowfullscreen
-    ></iframe>  -->
-    </div>
+    <seek-page
+      :seekList="seekList"
+      @search="search"
+      ref="search"
+      :keyValue="'qms-inspectionWork-index-search'"
+    ></seek-page>
 
-   
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      :pageSize="20"
+      :pageSizes="[20, 30, 40, 50, 100]"
+      full-height="calc(100vh - 140px)"
+      height="calc(100vh - 380px)"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+      row-key="id"
+      @selection-change="selectionChangeHandle"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <!-- <el-button
+          v-if="$hasPermission('qms:quality_work_order:close')"
+          size="small"
+          type="primary"
+          class="ele-btn-icon"
+          @click="batchClose"
+          :disabled="selection.length === 0"
+        >
+          批量关闭
+        </el-button> -->
+      </template>
+
+      <template v-slot:code="{ row }">
+        <el-link type="primary" :underline="false" @click="openDetails(row)">{{
+          row.code
+        }}</el-link>
+      </template>
+
+      <template v-slot:sourceCode="{ row }">
+        <div>
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="openWorkDetails(row)"
+          >
+            {{
+              row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
+            }}</el-link
+          >
+        </div>
+      </template>
+
+      <template v-slot:files="scope">
+        <el-link
+          v-for="link in scope.row.files"
+          :key="link.id"
+          type="primary"
+          :underline="false"
+          @click="downloadFile(link)"
+          >{{ link.name }}</el-link
+        >
+      </template>
+
+      <template v-slot:qualityType="{ row }">{{
+        getDictValue('质检计划类型', row.qualityType)
+      }}</template>
+      <template v-slot:qualityMode="{ row }">{{
+        getDictValue('取样类型', row.qualityMode)
+      }}</template>
+      <template v-slot:accessory="scope">
+        <el-link
+          v-for="link in scope.row.accessory"
+          :key="link.id"
+          type="primary"
+          :underline="false"
+          @click="downloadFile(link)"
+          >{{ link.name }}</el-link
+        >
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="handelRouterTo(row)"
+          >详情</el-link
+        >
+      </template>
+      <template v-slot:templateList="{ row }">
+        <div style="width: 250px; max-height: 60px; overflow: auto">
+          <el-tag
+            v-for="(item, index) in row.templateList"
+            :key="item.inspectionName + index"
+            :type="
+              inspectionProjectStatus.find(
+                (ProjectStatus) => ProjectStatus.value == item.status
+              )?.type
+            "
+            effect="dark"
+            style="margin-top: 4px"
+          >
+            <span
+              :title="
+                inspectionProjectStatus.find(
+                  (ProjectStatus) => ProjectStatus.value == item.status
+                )?.label
+              "
+            >
+              {{ item.inspectionName }}
+            </span>
+          </el-tag>
+        </div>
+      </template>
+    </ele-pro-table>
   </div>
 </template>
-
 <script>
+  import {
+    getList,
+    removeItem,
+    getDetailById,
+    closeWorkList,
+    verificationQualityInspector,
+    closeWork,
+    sampleCollection,
+    checkByQualityWorkOrderId,
+    getQmsReportTemplatePageList
+  } from '@/api/qms/inspectionWork/index.js';
+  // import { queryTodo } from '@/api/bpm/task';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getFile } from '@/api/system/file';
+  import { parameterGetByCode } from '@/api/main/index.js';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { getCategoryByCode } from '@/api/main/index';
+  import { inspectionProjectStatus } from '@/enum/dict.js';
+  import { recordingMethodList } from '@/enum/dict.js';
 
   export default {
+    name: 'InspectionWorkList',
+    mixins: [dictMixins, tabMixins],
     components: {
-
+      
     },
     props: {
-      businessId: {
-        default: ''
+      // 是否只显示我的工单
+      myWork: {
+        type: Boolean,
+        default: false
       }
     },
-    mixins: [],
-
     data() {
       return {
-        visible: false,
-        title: '',
-
-        location: window.location.origin,
-  
+        inspectionProjectStatus,
+        cacheKeyUrl: 'qsm-c2e9664a-inspectionWork',
+        targetComponent: null,
+        isView: false,
+        targetVisible: false,
+        currentRow: {},
+        currentItem: {},
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+          {
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号',
+            width: 55,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '质检工单编码',
+            // slot: 'code',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '质检工单名称',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '来源单号',
+            prop: 'sourceCode',
+            // slot: 'sourceCode',
+            align: 'center',
+            width: 160,
+            showOverflowTooltip: true
+          },
+          {
+            label: '类型',
+            prop: 'qualityType',
+            slot: 'qualityType',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '质检方式',
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualityName',
+            label: '接收人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.qualityName) {
+                return row.qualityName;
+              }
+              return row.qualityNames || '';
+            }
+          },
+          {
+            prop: 'executeUserName',
+            label: '执行人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.executeUserName || '';
+            }
+          },
+          {
+            prop: 'qualityTime',
+            label: '质检时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'inspectionTeamName',
+            label: '送检班组',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createUserName',
+            label: '送检人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'produceTaskName',
+            label: '工序',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'total',
+            label: '总数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualifiedNumber',
+            label: '合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualificationRate',
+            label: '合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualifiedNumber',
+            label: '不合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualificationRate',
+            label: '不合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'hours',
+            label: '工时',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '附件',
+            prop: 'accessory',
+            align: 'center',
+            slot: 'accessory',
+            showOverflowTooltip: true
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            align: 'center',
+            width: 160
+          },
+          {
+            prop: 'recordingMethod',
+            label: '记录方法',
+            align: 'center',
+            formatter: (row) => {
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
+            },
+            width: 130,
+            showOverflowTooltip: true
+          },
+          {
+            label: '进度',
+            prop: 'templateList',
+            slot: 'templateList',
+            align: 'center',
+            width: 250
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 80,
+            formatter: (row, column, cellValue) => {
+              switch (cellValue) {
+                case 0:
+                  return '未报工';
+                case 1:
+                  return '已报工';
+                case 2:
+                  return '已关闭';
+                case 3:
+                  return '待请样';
+                default:
+                  return '';
+              }
+            },
+            fixed: 'right'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            align: 'center',
+            width: 200,
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        formData: {
+          certificateNumber: ''
+        },
+        processSubmitDialogFlag: false,
+        rowData: {},
+        statusList: [
+          {
+            value: 0,
+            label: '未报工'
+          },
+          {
+            value: 1,
+            label: '已报工'
+          },
+          {
+            value: 2,
+            label: '已关闭'
+          },
+          {
+            value: 3,
+            label: '待请样'
+          }
+        ],
+        addOpen: false,
+        transferVisible: false,
+        transferId: '',
+        isReportApproval: 0,
+        selection: [],
+        reportTemplateList: [],
+        templateArr: ['inspection_report1', 'ABBCCC']
       };
     },
-    created() {},
-    mounted() {
-    // 在组件挂载后显示加载提示
-    this.loading = this.$loading({
-      lock: true,
-      text: 'Loading',
-      spinner: 'el-icon-loading',
-      background: '#fff',
-      target: this.$refs.iframeBox // 将加载提示绑定到iframeBox上
-    });
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('不良品处理类型');
+      this.requestDict('取样类型');
+      this.getCode();
+      this.getReportTemplateList();
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '工单编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工单名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '来源单号:',
+            value: 'sourceCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '类型:',
+            value: 'qualityType',
+            type: 'DictSelection',
+            dictName: '质检计划类型',
+            placeholder: ''
+          },
+          {
+            label: '质检方式:',
+            value: 'qualityMode',
+            type: 'DictSelection',
+            dictName: '取样类型',
+            placeholder: ''
+          },
+          {
+            label: '编码:',
+            value: 'productCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '名称:',
+            value: 'productName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '质检人:',
+            value: 'qualityName',
+            type: 'input',
+            placeholder: ''
+          },
+          // {
+          //   label: '状态:',
+          //   value: 'status',
+          //   type: 'select',
+          //   placeholder: '',
+          //   planList: this.statusList
+          // },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
+          }
+        ];
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    methods: {
+      handelRouterTo(row) {
+        window.history.pushState(null, '', '/page-qms/inspectionWork?businessId=' + row.id);
+        // this.$router.push(path);
+      },
+      getReportTemplateList() {
+        getQmsReportTemplatePageList({
+          pageNum: 1,
+          pageSize: 999,
+          isEnabled: 1,
+          type: 0
+        })
+          .then((res) => {
+            this.reportTemplateList = res.list;
+            console.log('reportTemplateList', this.reportTemplateList);
+          })
+          .catch((err) => {
+            console.error('获取报表模板列表失败:', err);
+          });
+      },
+      generateReportApproval(row, item) {
+        this.targetComponent = item.code;
+        this.isView = false;
+        this.currentRow = row;
+        this.currentItem = item;
+        this.$nextTick(() => {
+          this.targetVisible = true;
+          console.log('targetVisible~~~~', this.targetVisible);
+        });
+      },
+      async openReport(row) {
+        const data = await getDetailById(row.id);
+        this.targetComponent = row.reportTemplateCode;
+        this.isView = true;
+        this.currentRow = row;
+        this.currentRow.reportApprovalTaskVos =
+          data.data.reportApprovalTaskVos || {};
+        this.$nextTick(() => {
+          this.targetVisible = true;
+        });
+      },
+      selectionChangeHandle(val) {
+        this.selection = val;
+      },
+      async addSampleOpen(row) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
+        const is = await checkByQualityWorkOrderId(row.id);
+        if (is) {
+          this.$message.warning('此工单存在未处理完的请样记录,请检查!');
+          return;
+        }
+        this.$refs.addSampleRef.open('add', row);
+      },
+      async sampleCollection(row) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
 
-    // 模拟异步数据加载
-    setTimeout(() => {
-      // 数据加载完成后关闭加载提示
-      this.loading.close();
-    }, 4000); // 假设数据加载需要3秒
-  },
-    methods: {}
-  };
-</script>
+        sampleCollection({ id: row.id }).then((res) => {
+          this.$message.success('收样成功');
+          this.search();
+        });
+      },
+      batchClose() {
+        const validRows = this.selection.filter(
+          (row) => row.status === 0 && row.qualityType === 2
+        );
+        if (validRows.length === 0) {
+          this.$message.warning('所选工单中没有可关闭的工单');
+          return;
+        }
+
+        this.$confirm(`确定关闭选中的 ${validRows.length} 个工单吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async () => {
+          try {
+            await closeWorkList(validRows.map((row) => row.id));
+            this.$refs.table.clearSelection();
+            this.search();
+          } catch (err) {
+            this.$message.error('批量关闭失败:' + (err.message || '操作异常'));
+          }
+        });
+      },
+
+      reportApprovalSubmit(res) {
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(async () => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'qms_report_approval',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: res.name,
+              businessType: '质检报告单'
+            }
+          };
+          if (this.clientEnvironmentId == 5) {
+            const data = await getCategoryByCode(res.productCode);
+            if (data && data.categoryLevelCodePath?.includes('W3-209')) {
+              params.businessKey = 'qms_report_approval1';
+            } else {
+              params.businessKey = 'qms_report_approval';
+            }
+          }
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      getCode() {
+        parameterGetByCode({
+          code: 'qms_report_approval'
+        }).then((res) => {
+          this.isReportApproval = res.value;
+        });
+      },
+      async qualityInspectionSend(row, type) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
+        this.$refs.inspectionProjectTaskSendRef.open(row, type);
+      },
+      async datasource({ page, where, limit }) {
+        // try {
+        //   await queryTodo({});
+        // } catch (err) {
+        //   console.error('调用queryTodo失败:', err);
+        // }
 
-<style lang="scss" scoped>
-  :deep(.el-table__expanded-cell) {
-    padding-bottom: 30px !important;
-    border-bottom: 12px solid #ccffcc !important;
-  }
+        // if (this.myWork) {
+          where.currentLoginUserId = this.$store.state.user.info.userId;
+          where.status = 0;
+        // }
 
-  .iframe_box{
-    height: 600px;
-    width: 100%;
-   
-  }
-</style>
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where
+        });
+      },
+      isEmptyObject(obj) {
+        return Object.keys(obj).length === 0;
+      },
+      async openEdit(type, row) {
+        // const menusList = this.$store.state.user.menus;
+        if (type == 'edit') {
+          const code = await verificationQualityInspector(row.id);
+          if (code == '-1') {
+            return;
+          }
+        }
+        const id = type !== 'add' ? row.id : '';
+        const qualityType = type !== 'add' ? row.qualityType : null;
+        const qualityTimeStart = row.qualityTimeStart || '';
+        this.$router.push({
+          path: '/inspectionWork/edit',
+          query: {
+            type,
+            id,
+            qualityType,
+            qualityTimeStart
+          }
+        });
+        // for (const item of menusList) {
+        //   if (item.children) {
+        //     for (const item2 of item.children) {
+        //       if (item2.path === '/inspectionWork/edit') {
+        //         found = true;
+
+        //         return;
+        //       }
+        //     }
+        //   }
+        // }
+
+        // if (!found) {
+        //   this.$message.error('请到角色管理配置菜单权限!');
+        // }
+      },
+      openDetails(row) {
+        let id = row.id;
+        this.$router.push({
+          path: '/inspectionWork/details',
+          query: { id, path: '/inspectionWork', name: '工单' }
+        });
+      },
+      openWorkDetails(row) {
+        if (row.qualityPlanCode) {
+        } else {
+          this.$refs.mesWorkOrderRef.open(row);
+        }
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {});
+      },
+      done() {
+        this.$refs.search.search();
+      },
+      openNumber(row) {
+        this.formData.certificateNumber = row.certificateNumber;
+        this.rowData = row;
+        this.addOpen = true;
+      },
+      closeModel() {
+        this.addOpen = false;
+      },
+      async close(row) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
+        await closeWork(row);
+        this.done();
+      },
+      async openTransfer(id) {
+        const code = await verificationQualityInspector(id);
+        if (code == '-1') {
+          return;
+        }
+        this.transferVisible = true;
+        this.transferId = id;
+      },
+      transferConfirm(id) {
+        this.transferVisible = false;
+        this.$message.success('转派成功');
+        this.done();
+      }
+    }
+  };
+</script>

+ 1386 - 0
src/views/bpm/tickets/productions/index.vue

@@ -0,0 +1,1386 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <seek-page :seekList="seekList" @search="search"></seek-page>
+      <!-- <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> -->
+        <!-- <el-tab-pane label="我的工单" name="1"></el-tab-pane>
+        <el-tab-pane label="生产中" name="5"></el-tab-pane>
+        <el-tab-pane label="待生产" name="4"></el-tab-pane>
+        <el-tab-pane label="已完成" name="6"></el-tab-pane>
+        <el-tab-pane label="已延期" name="7"></el-tab-pane>
+        <el-tab-pane label="已终止" name="10"></el-tab-pane>
+      </el-tabs> -->
+      <!-- 数据表格 -->
+      <!--   :cache-key="cacheKeyUrl" -->
+      <ele-pro-table
+        ref="table"
+        :key="activeName"
+        :initLoad="false"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="code"
+        :selection.sync="selection"
+        @sort-change="onSortChange"
+        autoAmendPage
+        :parse-data="parseData"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+        :pageSize="20"
+        :height="tableHeight"
+        @fullscreen-change="fullscreenChange"
+      >
+        <template v-slot:toolbar>
+          <!-- <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="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="cardPrinting()"
+            >工艺卡打印</el-button
+          > -->
+
+          <!-- <el-button type="success" @click="originCode()">朔源码</el-button> -->
+
+          <!-- <el-button v-if="tabValue == '6'" type="success" @click="batchRelease"
+            >批量放行</el-button
+          > -->
+        </template>
+
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="goDetail(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+
+        <template v-slot:QRcode="{ row }">
+          <el-link type="primary" :underline="false" @click="handleQRcode(row)"
+            >生成二维码
+          </el-link>
+        </template>
+
+        <template v-slot:apsWorkOrderCode="{ row }">
+          <label>{{ row.apsWorkOrderCode || '' }}</label>
+        </template>
+
+        <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紧急)"
+            >
+              <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>
+              </div>
+            </el-popover>
+          </div>
+        </template>
+
+        <template v-slot:formingNum="{ row }">
+          <span> {{ row.formingNum }} </span>
+        </template>
+
+        <template v-slot:formingWeight="{ row }">
+          <span> {{ row.formingWeight }} {{ row.weightUnit }} </span>
+        </template>
+
+        <template v-slot:singleReport="{ row }">
+          <span v-if="row.singleReport == 0">批量报工</span>
+          <span v-if="row.singleReport == 1">单个报工</span>
+        </template>
+
+        <template v-slot:sourceType="{ row }">
+          <span v-if="row.sourceType == 1">生产计划</span>
+          <span v-if="row.sourceType == 2">临时生产计划</span>
+          <span v-if="row.sourceType == 3">受托转订单</span>
+        </template>
+
+        <template v-slot:workOrderType="{ row }">
+          <span v-if="row.workOrderType == 1">普通订单</span>
+          <span v-if="row.workOrderType == 2">临时订单</span>
+          <span v-if="row.workOrderType == 3">受托订单</span>
+        </template>
+
+        <template v-slot:entrustStatus="{ row }">
+          <div v-if="row.entrustStatus">
+            <span v-if="row.entrustStatus == 1">未请托</span>
+            <span v-if="row.entrustStatus == 2">请托中</span>
+            <span v-if="row.entrustStatus == 3">请托完成</span>
+          </div>
+          <span v-else>未请托</span>
+        </template>
+
+        <template v-slot:outsourceStatus="{ row }">
+          <div v-if="row.outsourceStatus">
+            <span v-if="row.outsourceStatus == 1">未委外</span>
+            <span v-if="row.outsourceStatus == 2">委外中</span>
+            <span v-if="row.outsourceStatus == 3">完成委外</span>
+          </div>
+        </template>
+
+        <template #taskName="{ row }">
+          <div v-if="taskNameMap[row.id]?.length" class="task-flow">
+            <template v-for="(item, index) in taskNameMap[row.id]">
+              <el-tag
+                :key="item.taskId"
+                size="mini"
+                effect="dark"
+                :type="getTaskTagTypeByStatus(item.flag)"
+              >
+                {{ item.taskTypeName }}
+              </el-tag>
+
+              <!-- 箭头 -->
+              <span
+                v-if="index < taskNameMap[row.id].length - 1"
+                class="task-arrow"
+              >
+                →
+              </span>
+            </template>
+          </div>
+          <span v-else>—</span>
+        </template>
+
+        <template v-slot:status="{ row }">
+          <span :class="{ 'ele-text-danger': row.status == 3 }">
+            {{ statusFormatter(row.status) }}
+          </span>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+            <el-link
+            type="primary"
+            :underline="false"
+            @click="handelRouterTo(row)"
+          >
+            详情
+          </el-link>
+          <!-- <template v-if="activeName == 'second'">
+            <el-link
+              type="primary"
+              :underline="false"
+              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 type="primary" :underline="false" @click="toView(row)">
+              序列号
+            </el-link></template
+          > -->
+          <!-- <template v-if="activeName != 'second'"> -->
+            <!-- <el-link
+              v-if="
+                (row.status == 4 || row.status == 5 || row.status == 7) &&
+                row.isSplit == 0
+              "
+              type="primary"
+              :underline="false"
+              @click="handleOrderPublish(row)"
+            >
+              报工
+            </el-link> -->
+            <!-- <el-link
+              v-if="
+                row.status == 4 && row.isSplit == 0 && clientEnvironmentId != 9
+              "
+              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> -->
+            <!-- <el-link
+              v-if="dispatchBtn(row)"
+              type="primary"
+              :underline="false"
+              @click="toReleaseOpen(row)"
+            >
+              任务派单
+            </el-link> -->
+          <!-- </template> -->
+
+          <!-- <el-link
+            v-if="
+              tabValue == '6' &&
+              row.checklistStatus != 1 &&
+              row.checklistStatus != 2
+            "
+            type="primary"
+            @click="toRelease(row)"
+            >放行单</el-link
+          > -->
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import {
+    getPage,
+    batchCompletion,
+    cancelCompletion,
+    updatePriority,
+    update,
+    getTaskIdByInstanceId,
+    updateStatusPause,
+    updateStatusTerminate,
+    getMyPage,
+    getTaskInstanceList
+  } from '@/api/mes/produceOrder/index.js';
+  import storageApi from '@/api/warehouseManagement';
+
+  import { debounce } from 'lodash';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+
+  export default {
+    mixins: [tableColumnsMixin],
+    components: {
+   
+    },
+
+    data() {
+      return {
+        activeName: 'first',
+        tabValue: '1',
+        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: [],
+        columns: [],
+        cacheKeyUrl: '7cc8e5d2-mes-produceOrder-todo',
+        columnsVersion: 0,
+        dispatchVisible: false,
+        dispatchRow: {},
+        tableHeight: 'calc(100vh - 375px)',
+        workDataList: [],
+        taskNameMap: {}
+      };
+    },
+    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',
+            width: 240
+          },
+          {
+            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: 'productName',
+            type: 'input',
+
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '牌号',
+            value: 'brandNo',
+            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
+          }
+        ];
+      },
+      basicColumns() {
+        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'
+          },
+
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'lineNumber',
+            label: '行号',
+            align: 'center',
+            minWidth: 130,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'code',
+            // slot: 'code',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          // {
+          //   prop: 'originalCode',
+          //   label: '原始工单号',
+          //   align: 'center',
+          //   minWidth: 110
+          // },
+
+        //   {
+        //     prop: 'QRcode',
+        //     slot: 'QRcode',
+        //     label: '二维码',
+        //     align: 'center',
+        //     minWidth: 110,
+        //     showOverflowTooltip: true
+        //   },
+          {
+            prop: 'apsWorkOrderCode',
+            label: '生产订单号',
+            slot: 'apsWorkOrderCode',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'sourceType',
+            label: '来源类型',
+            slot: 'sourceType',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'sourceCode',
+            label: '来源编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'workOrderType',
+            label: '订单类型',
+            slot: 'workOrderType',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'planType',
+            label: '计划类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              const obj = this.planType.find((i) => i.value == row.planType);
+              return obj && obj.label;
+            }
+          },
+          {
+            prop: 'bomType',
+            label: '生产类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 120,
+            formatter: (row) => {
+              if (row.bomType == 1) {
+                return '产品(PBOM)';
+              }
+              if (row.bomType == 2) {
+                return '加工(MBOM)';
+              }
+              if (row.bomType == 3) {
+                return '装配(ABOM)';
+              }
+              // if (row.bomType == 4) {
+              //   return '装配(EBOM)';
+              // }
+              return '';
+            }
+          },
+          {
+            prop: 'bomCategoryName',
+            label: 'BOM版本',
+            align: 'center',
+            width: 130,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.bomCategoryName) {
+                return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'modelKey',
+            label: '机型',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productionCodes',
+            label: '生产编号',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'taskName',
+            slot: 'taskName',
+            label: '工序进度',
+            align: 'center',
+            minWidth: 280
+          },
+          {
+            prop: 'singleReport',
+            slot: 'singleReport',
+            label: '报工类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'outsourceStatus',
+            label: '委外状态',
+            align: 'center',
+            slot: 'outsourceStatus',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'priority',
+            label: '优先级',
+            align: 'center',
+            minWidth: 120,
+            slot: 'priority',
+            sortable: 'custom'
+          },
+
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            slot: 'formingNum',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'unit',
+            label: '单位',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'factoriesName',
+            label: '所属工厂',
+            align: 'center',
+            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'
+          },
+          {
+            prop: 'completeTime',
+            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: 'entrustStatus',
+            label: '请托状态',
+            align: 'center',
+            slot: 'entrustStatus',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'crewNames',
+            slot: 'crewNames',
+            label: '报工人员',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'teamName',
+            label: '班组',
+            align: 'center',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+      dispatchBtn() {
+        return (row) => {
+          if (Number(row.taskId) == NaN || Number(row.taskId) <= 0) {
+            return false;
+          }
+          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();
+          }
+        },
+        immediate: true
+      }
+    },
+    created() {
+      this.getFieldModel();
+    },
+    mounted() {
+      this.reload();
+    },
+
+    methods: {
+      handelRouterTo(row) {
+        window.history.pushState(null, '', '/page-mes/produceOrder?businessId=' + row.id);
+        // this.$router.push(path);
+      },
+      //派单
+      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);
+      },
+
+      // 查看序列号
+      toView(row) {
+        this.$refs.xlhRef.open(row);
+      },
+
+      handlePicking() {
+        this.$router.push({
+          path: '/produceOrder/picking'
+        });
+      },
+      statusFormatter(status) {
+        const obj = this.statusOpt[this.activeName].find(
+          (i) => i.value == status
+        );
+
+        return obj && obj.label;
+      },
+
+      btnPrint() {
+        const url = this.$router.resolve({ path: '/print' }).href; // 获取目标URL路径的完整URL字符串
+        window.open(url, '_blank');
+        // this.$router.push({
+        //   path: '/print'
+        // });
+      },
+
+      routing(row) {
+        this.id = row.id;
+
+        this.$refs.equipmentRef.open();
+      },
+      handleTabClick() {
+        if (this.tabValue == '6') {
+          this.activeName = 'second';
+        } else {
+          this.activeName = 'first';
+        }
+        this.reload();
+      },
+
+      async loadTaskNames(list) {
+        for (const row of list) {
+          try {
+            const res = await getTaskInstanceList(row.id);
+            const findIndex = res.findIndex(
+              (item) => item.taskId == row.taskId
+            );
+
+            const markedList = res.map((item, index) => {
+              let flag = 'after';
+
+              if (findIndex != -1) {
+                if (index < findIndex) {
+                  flag = '4';
+                } else if (index === findIndex) {
+                  flag = '3';
+                } else {
+                  flag = '1';
+                }
+              }
+
+              return {
+                ...item,
+                flag
+              };
+            });
+
+            this.$set(this.taskNameMap, row.id, markedList);
+
+            // this.$set(
+            //   this.taskNameMap,
+            //   row.taskId,
+            //   res.list.map((i) => i.name)
+            // );
+            // console.log(res, '工序数据');
+          } catch (e) {
+            this.$set(this.taskNameMap, row.id, []);
+          }
+        }
+
+        this.$nextTick(() => {
+          this.$refs.table?.doLayout?.();
+        });
+      },
+
+      getTaskTagTypeByStatus(status) {
+        return (
+          {
+            1: 'info',
+            2: 'primary',
+            3: 'warning',
+            4: 'success'
+          }[status] || ''
+        );
+      },
+
+      originCode() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条工单!');
+        }
+
+        if (this.selection.length > 1) {
+          return this.$message.warning('只能选择一条工单');
+        }
+
+        this.$refs.originCodeRef.open(this.selection[0].id);
+      },
+
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        console.log(this.tabValue, '888');
+        let statusList = this.tabValue == 1 ? [4, 5, 7] : [this.tabValue];
+
+        let params = {
+          ...where,
+          ...order,
+          queryTermination: this.tabValue == '10' ? 1 : 0,
+          pageNum: page,
+          size: limit,
+          ...this.sort
+        };
+
+        // 只有 tabValue == 1 才可能需要 workCenterIds 字段,可根据业务决定是否添加
+        if (this.tabValue == 1) {
+          params.workCenterIds = this.$store.state.user.info.workCenterIds;
+        }
+
+        const URL = this.tabValue == 1 ? getMyPage : getPage;
+
+        let res = await URL({ ...params, statusList });
+
+        this.loadTaskNames(res.list);
+
+        return res;
+      },
+
+      getWorkData() {
+        if (this.$refs.table.getData().length != 0) {
+          // const data = this.deep()
+        }
+      },
+
+      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 result;
+      },
+
+      /* 数据转为树形结构 */
+      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(row) {
+        this.$refs.workReport.open(row);
+        // this.$router.push({
+        //   path: '/produce',
+        //   query: {
+        //     workOrderId: row.id
+        //   }
+        // });
+        // this.$router.push({
+        //   path: '/produceOrder/workReport',
+        //   query: {
+        //     workOrderId: row.id
+        //   }
+        // });
+      },
+
+      fullscreenChange(fullscreen) {
+        if (fullscreen) {
+          this.tableHeight = 'calc(100vh - 120px)';
+        } else {
+          this.tableHeight = 'calc(100vh - 375px)';
+        }
+      },
+
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          const privateColumn = [
+            {
+              columnKey: 'action',
+              label: '操作',
+              width: 120,
+              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.columns = [...this.basicColumns, ...newRes, ...privateColumn];
+          this.getTabColumns();
+          this.$forceUpdate();
+        });
+      },
+
+      toPause() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条工单!');
+        }
+
+        let ids = [];
+
+        this.selection.forEach((item) => {
+          ids.push(item.id);
+        });
+        this.$confirm(`是否要暂停工单?`, '提醒', {
+          confirmButtonText: '确认',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            updateStatusPause(ids).then((res) => {
+              this.$message.success('成功');
+              this.reload();
+            });
+          })
+          .catch(() => {});
+      },
+
+      toTermination() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条工单!');
+        }
+
+        let ids = [];
+
+        this.selection.forEach((item) => {
+          ids.push(item.id);
+        });
+        this.$confirm(`是否要终止工单?`, '提醒', {
+          confirmButtonText: '确认',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            updateStatusTerminate(ids).then((res) => {
+              this.$message.success('成功');
+              this.reload();
+            });
+          })
+          .catch(() => {});
+      },
+
+      // 完结与批量完结
+      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(() => {});
+        }
+      },
+
+      // 取消完结
+      toCancel(row) {
+        cancelCompletion([row.id]).then((res) => {
+          this.$message.success('成功');
+          this.reload();
+        });
+      },
+
+      // 拆分
+      toUnpack(row) {
+        this.$refs.unpackRef.open(row);
+      },
+      handleTabChange() {
+        this.$refs.searchRef.reset();
+      },
+
+      /* 刷新表格 */
+      reload(where = {}) {
+        this.$nextTick(() => {
+          where.statusList = (
+            where.status || this.statusOpt[this.activeName][0].value
+          ).split(',');
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
+
+      // 生产工单跳转
+      goDetail(row) {
+        this.$refs.detailsRef.open(row);
+      },
+      handleDelete({ id }) {
+        this.$confirm('确定删除当前数据?', '提示').then(async () => {
+          await del(id);
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
+
+      handleQRcode(row) {
+        console.log('clientEnvironmentId', this.clientEnvironmentId);
+        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]);
+        }
+      },
+
+      allPrinting() {
+        let ids = this.findAllIds(this.selection);
+        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);
+        }
+      },
+      // 工艺卡打印
+      cardPrinting() {
+        if (this.selection.length < 1) {
+          return this.$message.warning('请选择一条工单!');
+        }
+        let ids = this.findAllIds(this.selection);
+        this.$refs.printCardRef.open(ids);
+      },
+
+      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;
+      },
+
+      choose(row) {
+        this.updateFn(row);
+      },
+
+      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();
+      },
+
+      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),
+      // 批量放行
+      batchRelease() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条工单!');
+        }
+        console.log('this.selection', this.selection);
+
+        const productCode = this.selection[0].productCode;
+        const batchNo = this.selection[0].batchNo;
+        const isSame = this.selection.every(
+          (item) => item.productCode === productCode && item.batchNo === batchNo
+        );
+
+        const item = this.selection.find(
+          (item) => item.checklistStatus === 1 || item.checklistStatus === 2
+        );
+
+        if (item) {
+          this.$message.warning(
+            `工单【${item.code}】已生成或已完成放行单,不能重复放行`
+          );
+          return;
+        }
+
+        if (!isSame) {
+          this.$message.warning('请选择同产品同批次号工单发起批量放行');
+          return;
+        }
+        // 添加
+        this.$refs.checkAddRef?.open('add', '1', this.selection);
+      },
+      // 单个放行
+      toRelease(row) {
+        this.$refs.checkAddRef?.open('add', '1', [row]);
+      },
+      // 确定放行
+      checkAddConfirm(type, data) {
+        this.$refs.checkDetailsRef?.open(type, data);
+      }
+    }
+  };
+</script>
+
+<style scoped>
+  .task-flow {
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+  }
+
+  .task-arrow {
+    margin: 0 6px;
+    color: #999;
+    font-weight: bold;
+  }
+</style>

+ 514 - 0
src/views/bpm/tickets/work/components/disposeDialog.vue

@@ -0,0 +1,514 @@
+<template>
+  <div>
+    <ele-modal
+      :title="`处理工单`"
+      append-to-body
+      :visible.sync="visibleDialog"
+      destroy-on-close
+      @close="closeWindows"
+      width="80vw"
+      :maxable="true"
+      :resizable="true"
+    >
+      <div class="flex_info">
+        <div class="flex_right">
+          <div class="search_box">
+            <el-input
+              placeholder="请输入关键词"
+              v-model="keyWord"
+              class="input-with-select"
+            >
+              <el-button slot="append" icon="el-icon-search" @click="search">搜索</el-button>
+            </el-input>
+            <el-button type="primary" @click="control">处理</el-button>
+          </div>
+          <el-table
+            ref="multipleTable"
+            :data="tableData"
+            border
+            height="500px"
+            tooltip-effect="dark"
+            @selection-change="handleSelectionChange"
+          >
+            <el-table-column
+              type="selection"
+              :selectable="checkSelectable"
+              width="55"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="info.categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+
+            <!-- <el-table-column
+              width="150"
+              prop="categoryLevelPath"
+              label="产品分类"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <!-- <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <!-- <el-table-column
+              label="包装数量"
+              prop="info.packingCountBase"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <!-- <el-table-column
+              label="包装单位"
+              prop="info.packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <!-- <el-table-column
+              label="牌号"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <el-table-column
+              label="计量数量"
+              prop="info.measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="info.measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="info.weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="info.weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="info.warehouseName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+          </el-table>
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            :page-sizes="[10, 20, 50, 100]"
+            :page-size.sync="pages.size"
+            :current-page.sync="pages.pageNum"
+            @current-change="_getInformation"
+            @size-change="_getInformation"
+          >
+          </el-pagination>
+        </div>
+        <div class="flex_right" style="margin-left: 10px">
+          <el-table
+            ref="table"
+            :data="controlTableData"
+            border
+            height="600px"
+            tooltip-effect="dark"
+          >
+            <el-table-column
+              label="盘点状态"
+              width="100"
+              prop="controlStatus"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <el-select v-model="row.controlStatus" placeholder="请选择">
+                  <el-option
+                    v-for="item in statusOption"
+                    :label="item.label"
+                    :value="item.value"
+                    :key="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="数量"
+              prop="count"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <el-input
+                  v-model="row.count"
+                  placeholder="请输入内容"
+                ></el-input> </template
+            ></el-table-column>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="info.categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <!-- <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="info.packingCountBase"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="info.packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column> -->
+            <el-table-column
+              label="计量数量"
+              prop="info.measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="info.measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="info.weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="info.weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="仓库"
+              prop="info.warehouseName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column label="操作" width="100" fixed="right">
+              <template slot-scope="{ row, $index }">
+                <el-button
+                  @click="deleted(row, $index)"
+                  type="text"
+                  size="small"
+                  >删除</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <div class="select-btn">
+        <el-button type="primary" @click="onConfirm">确定</el-button>
+        <el-button @click="closeWindows">关闭</el-button>
+      </div>
+    </ele-modal>
+  </div>
+</template>
+
+<script>
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getUserPage } from '@/api/system/organization';
+  import { reportWork, getPlanDetailList } from '@/api/warehouseManagement/inventory';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    watch: {
+      tableData() {
+        this.doLayout();
+      },
+      visibleDialog(val) {
+        if (val) {
+          this._getInformation();
+        }
+      }
+    },
+    components: { deptSelect },
+    data() {
+      return {
+        statusOption: [
+          {
+            label: '盘盈',
+            value: '2'
+          },
+          {
+            label: '丢失',
+            value: '3'
+          },
+          {
+            label: '破损',
+            value: '4'
+          }
+        ],
+        visibleDialog: false,
+        planOrderId: '',
+        keyWord: '',
+        formData: {},
+        tableData: [],
+        controlTableData: [],
+        executorList: [],
+        factoryList: [],
+        factoryId: '',
+        value: '',
+        treeType: '',
+        treeList: [],
+        selection: [],
+        selectionIds: [],
+        pages: {
+          pageNum: 1,
+          size: 10,
+          keyWord: ''
+        },
+        total: 0,
+        curType: '',
+        classificationId: '',
+        memoSelection: [],
+        newColumns: [] // 动态表头
+      };
+    },
+    created() {
+      this.getFieldModel();
+    },
+    methods: {
+      // 搜索
+      search() {
+        this.pages.keyWord = this.keyWord;
+        this.pages.pageNum = 1;
+        this._getInformation();
+      },
+      control() {
+        if (this.selection.length > 0) {
+          console.log(this.selection);
+          console.log(this.selectionIds);
+          let boolen = this.selection.every((item) =>
+            this.selectionIds.includes(item.id)
+          );
+          if (this.selection.length > 0 && !boolen) {
+            this.selection = this.selection.filter(
+              (item) => !this.selectionIds.includes(item.id)
+            );
+            this.selectionIds = this.selectionIds.concat(
+              this.selection.map((item) => item.id)
+            );
+            console.log('this.selection---------', this.selection);
+            console.log('this.selectionIds---', this.selectionIds);
+            this.controlTableData = this.controlTableData.concat(
+              this.selection.map((item) => {
+                return {
+                  ...item
+                };
+              })
+            );
+            console.log('this.tableData---------', this.controlTableData);
+          } else {
+            this.$message.error('请选择正确的行');
+          }
+        } else {
+          this.$message.error('请选择调出物品信息');
+        }
+      },
+      checkSelectable(row) {
+        return !this.selectionIds.includes(row.id);
+      },
+      executorChange(val) {
+        this.formData.executorName = this.executorList.filter(
+          (item) => item.id == val
+        )[0].name;
+      },
+      //选择部门(搜索)
+      searchDeptNodeClick(info, row) {
+        this.formData.executorId = '';
+        if (info) {
+          const params = { groupId: info };
+          this.getUserList(params);
+          this.formData.executeGroupName = row.name;
+        } else {
+          this.formData.executeGroupId = null;
+        }
+      },
+      // 获取审核人列表、巡点检人员
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          this.executorList = res.list;
+        } catch (error) {}
+      },
+      doLayout() {
+        let that = this;
+        this.$nextTick(() => {
+          that.$refs.multipleTable.doLayout();
+        });
+      },
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
+      deleted(row, index) {
+        this.controlTableData.splice(index, 1);
+        this.selectionIds = this.selectionIds.filter((item) => item !== row.id);
+      },
+      onConfirm() {
+        let arr = []
+        if (this.controlTableData.length > 0) {
+          let isBoolen = this.controlTableData.every(
+            (item) => item.controlStatus > 0 && item.count > 0
+          );
+          if (!isBoolen) {
+            return this.$message.error('请选择盘点状态和数量!');
+          }
+          arr = this.controlTableData.map((item) => {
+            let key = null;
+            switch (item.controlStatus) {
+              case '2':
+                key = 'surplusQuantity';
+                break;
+              case '3':
+                key = 'loseQuantity';
+                break;
+              case '4':
+                key = 'wornQuantity';
+                break;
+            }
+            return {
+              id: item.id,
+              status: item.controlStatus,
+              planOrderId: this.planOrderId,
+              [key]: item.count
+            };
+          });
+        } else {
+          arr = []
+        }
+        console.log(arr);
+        reportWork(arr, { planOrderId: this.planOrderId }).then(() => {
+          this.$message.success('报工成功!');
+          this.$emit('flushed');
+          this.closeWindows();
+        });
+        // } else {
+        //   this.$message.error('请选择物品!');
+        // }
+      },
+      open(id) {
+        this.planOrderId = id;
+        this.visibleDialog = true;
+      },
+      handleSelectionChange(val) {
+        this.selection = val;
+      },
+      closeWindows() {
+        this.keyWord = '';
+        this.pages.keyWord = '';
+        this.selection = [];
+        this.controlTableData = [];
+        this.visibleDialog = false;
+      },
+      async _getInformation() {
+        getPlanDetailList({
+          ...this.pages,
+          planOrderId: this.planOrderId
+        }).then((data) => {
+          this.tableData = data.list;
+          this.total = data.count;
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.el-checkbox__input.is-disabled .el-checkbox__inner) {
+    background-color: #eee !important;
+  }
+  .flex_info {
+    display: flex;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    .flex_right {
+      flex: 1;
+      overflow: hidden;
+      .search_box {
+        display: flex;
+        margin-bottom: 10px;
+        > div {
+          flex: 1;
+        }
+        > button {
+          margin-left: 10px;
+        }
+      }
+    }
+  }
+  .search_box {
+    overflow: hidden;
+  }
+  .select-btn {
+    text-align: right;
+  }
+  .right {
+    text-align: right;
+  }
+  .mt10 {
+    margin-top: 10px;
+  }
+</style>

+ 258 - 0
src/views/bpm/tickets/work/components/work-search.vue

@@ -0,0 +1,258 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    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="factoryId">
+          <el-select
+            filterable
+            placeholder="请选择"
+            @change="getTreeData"
+            v-model="where.factoryId"
+            clearable
+            class="w100"
+          >
+            <el-option
+              v-for="item in factoryList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col> -->
+      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="盘点仓库" prop="warehouseId">
+          <el-select
+            filterable
+            placeholder="请选择"
+            v-model="where.warehouseId"
+            clearable
+            class="w100"
+          >
+            <el-option
+              v-for="item in warehouseList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col> -->
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划单号:">
+          <el-input clearable v-model="where.planCode" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="盘点单号:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划名称:">
+          <el-input clearable v-model="where.planName" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="盘点部门:">
+          <DeptSelect v-model="where.executeGroupId" />
+        </el-form-item>
+      </el-col> -->
+      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="盘点人员:">
+          <el-select
+            filterable
+            class="w100"
+            size="small"
+            v-model="where.executorId"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in userList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col> -->
+      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="状态:">
+          <el-select
+            filterable
+            class="w100"
+            size="small"
+            v-model="where.status"
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in statusOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </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 DeptSelect from '@/components/CommomSelect/dept-select.vue';
+  import storageApi from '@/api/warehouseManagement/index.js';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  export default {
+    components: { DeptSelect },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        factoryId: '',
+        warehouseId: '',
+        executorId: '',
+        code: '',
+        executeGroupId: '',
+        status: '',
+        planCode: '',
+        executeGroupName: '',
+        executorName: ''
+      };
+      return {
+        defaultWhere: { ...defaultWhere },
+        // 表单数据
+        statusOptions: [
+          {
+            label: '待处理',
+            value: 0
+          },
+          {
+            label: '执行中',
+            value: 1
+          },
+          {
+            label: '已完成',
+            value: 2
+          }
+        ],
+        statusObj: {
+          0: '待处理',
+          1: '执行中',
+          2: '已完成'
+        },
+        userList: [],
+        warehouseList: [],
+        factoryList: [],
+        where: { ...defaultWhere },
+        treeData: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+      this.getFactoryList();
+      this.getuserList();
+    },
+    methods: {
+      /* async nodeClick(id, data) {
+        this.where.executeGroupId = id;
+        if (data) {
+          this.where.executeGroupName = data.name;
+        }
+        this.where.executorName = '';
+        this.where.executorId = '';
+        if (id) {
+          let userData = await warehouseDefinition.getUserPage({
+            groupId: id,
+            size: 9999,
+            pageNum: 1
+          });
+          this.userList = userData.list;
+        }
+      }, */
+
+      async getuserList() {
+        let userData = await warehouseDefinition.getUserPage({
+          size: 9999,
+          pageNum: 1
+        });
+        this.userList = userData.list;
+      },
+      async getTreeData(val) {
+        this.where.targetWarehouse = '';
+        this.where.sourceWarehouse = '';
+        try {
+          this.treeLoading = true;
+          let res = await storageApi.getWarehouseTrees({
+            factoriesId: val
+          });
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.warehouseList = res.data;
+          }
+        } catch (error) {
+          console.log(error);
+        }
+        this.treeLoading = false;
+      },
+      //获取工厂列表
+      async getFactoryList() {
+        const res = await warehouseDefinition.getFactoryarea({
+          pageNum: 1,
+          size: 9999,
+          type: 1
+        });
+        this.factoryList = res.list;
+      },
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+</style>

+ 232 - 0
src/views/bpm/tickets/work/index.vue

@@ -0,0 +1,232 @@
+<template>
+  <div id="stocktakingWork_index">
+    <el-card shadow="never" v-loading="loading">
+      <work-search @search="reload"> </work-search>
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        height="calc(100vh-300px)"
+        :pageSize="20"
+        :datasource="datasource"
+      >
+        <template v-slot:code="{ row }">
+          <el-link type="primary" @click="goDetail(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+        <template v-slot:action="{ row }">
+          <el-link
+            v-if="row.status == 0"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="control(row)"
+          >
+            报工
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <DisposeDialog ref="disposeDialogRef" @flushed="reload"></DisposeDialog>
+  </div>
+</template>
+
+<script>
+  import DisposeDialog from './components/disposeDialog.vue';
+  import WorkSearch from './components/work-search.vue';
+  import { getPlanOrderList } from '@/api/warehouseManagement/inventory';
+  export default {
+    components: {
+      WorkSearch,
+      DisposeDialog
+    },
+    data() {
+      return {
+        visibleDialog: false,
+        // 	0-待处理,1-执行中,2-已完成
+        statusObj: {
+          0: '待处理',
+          1: '执行中',
+          2: '已完成'
+        },
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            slot: 'code',
+            prop: 'code',
+            label: '盘点单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'status',
+            minWidth: 110,
+            formatter: (row) => {
+              return this.statusObj[Number(row.status)];
+            }
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'warehouseName',
+            label: '盘点仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeGroupName',
+            label: '盘点部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executorName',
+            label: '盘点人员',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'startTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'endTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 加载状态
+        loading: false,
+        planOrderId: '',
+        userInfo: {}
+      };
+    },
+    created() {
+      let info = JSON.parse(localStorage.getItem('info'));
+      this.userInfo = info;
+    },
+    methods: {
+      control(row) {
+        console.log(row, this.userInfo);
+        if (row.executorId != this.userInfo.userId) {
+          this.$message({
+            type: 'error',
+            message: '您不是盘点人员,不能报工!',
+          });
+          return;
+        }
+        this.$refs.disposeDialogRef.open(row.id);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        where.status = 0
+        where.executorId = this.userInfo.userId;
+        return getPlanOrderList({ pageNum: page, size: limit, ...where });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
+          this.reload();
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      // 详情
+      goDetail(row) {
+        this.$router.push({
+          path: '/warehouseManagement/stocktaking/work/details',
+          query: {
+            id: row.id,
+            planId: row.planId
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  #stocktakingWork_index {
+    height: calc(100vh - 96px);
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    // element-ui样式穿透
+    :deep(.el-card) {
+      height: 100%;
+      .el-card__body {
+        height: 100%;
+        box-sizing: border-box;
+        display: flex;
+        flex-direction: column;
+        .ele-pro-table {
+          flex: 1;
+          display: flex;
+          flex-direction: column;
+          .el-table {
+            flex: 1;
+            // display: flex;
+            // flex-direction: column;
+            // .el-table__body-wrapper {
+            //   flex: 1;
+            // }
+          }
+        }
+      }
+      .el-form-item {
+        margin-bottom: 5px !important;
+      }
+    }
+  }
+</style>