Ver Fonte

修改时间段显示

695593266@qq.com há 3 meses atrás
pai
commit
f603927fba

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

@@ -0,0 +1,13 @@
+import request from '@/utils/request';
+
+/**
+ * 工单交接分页列表
+ * @param {Object} data - { pageNum, size, ...where }
+ */
+export async function handoverPage(data) {
+  const res = await request.post('/mes/workorder/handover/page', data);
+  if (res.data.code === 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message || '请求失败'));
+}

+ 1 - 1
src/views/produce/components/footBtn.vue

@@ -101,7 +101,7 @@
           },
           {
             name: '工单交接',
-            type: '',
+            type: 'workOrder',
             bjColor: '#2B56C2',
             isShow: 'mes:producetaskrulerecord:save4'
           },

+ 6 - 0
src/views/produce/components/jobBooking/index.vue

@@ -910,6 +910,12 @@
           code: 'work_hour'
         }).then((res) => {
           this.isReportTime = res.value == '1' ? true : false;
+
+          if (this.isReportTime && this.idsList.length == 1) {
+            this.List.forEach((item) => {
+              item.workReportInfo.executorStartTime = item.feedLastTime;
+            });
+          }
         });
 
         const res = await parameterGetByCode({

+ 12 - 66
src/views/produce/components/picking/index.vue

@@ -193,7 +193,7 @@
             <el-table-column
               label="计量库存数量"
               prop="availableCountBase"
-              width="220"
+              width="300"
               show-overflow-tooltip
             >
               <template slot-scope="{ row, $index }">
@@ -205,8 +205,14 @@
                     >{{ it.name ? it.name : it.warehouse_name }}库存数:<span
                       style="color: green"
                       >{{ it.availableCountBase }}</span
-                    >{{ row.measuringUnit }}</span
-                  >
+                    >{{ row.measuringUnit }}
+                    <span v-if="it.lockQuantity || it.lockQuantity == 0"
+                      >锁库数:<span style="color: red">{{
+                        it.lockQuantity
+                      }}</span
+                      >{{ row.measuringUnit }}
+                    </span>
+                  </span>
                 </div>
               </template>
             </el-table-column>
@@ -472,39 +478,7 @@
         }
       },
 
-      changeWarehouse(item, index) {
-        // const data = [];
-        // if (item.warehouseIdList.length != 0) {
-        //   item.warehouseIdList.forEach((it) => {
-        //     const chooseData = item.warehouseList.find((item) => item.id == it);
-        //     data.push(chooseData);
-        //   });
-        // }
-        // const pickData = [...data];
-        // if (data.length != 0) {
-        //   const totalNum = data.reduce((acc, pro) => {
-        //     return pro.availableCountBase
-        //       ? acc + Number(pro.availableCountBase)
-        //       : acc;
-        //   }, 0);
-        //   this.$set(
-        //     this.workList[0].pickList[index],
-        //     'availableCountBase',
-        //     totalNum
-        //   );
-        //   this.$set(
-        //     this.workList[0].pickList[index],
-        //     'warehousePick',
-        //     pickData
-        //   );
-        //   console.log(this.workList[0], 'this.workList[0]');
-        //   this.$forceUpdate();
-        // } else {
-        //   this.$set(this.workList[0].pickList[index], 'warehousePick', []);
-        //   this.$set(this.workList[0].pickList[index], 'availableCountBase', 0);
-        //   this.$set(this.workList[0].pickList[index], 'demandQuantity', 0);
-        // }
-      },
+      changeWarehouse(item, index) {},
 
       changeInput(item, index) {
         const pickItem = this.workList[0].pickList[index];
@@ -809,42 +783,14 @@
         });
         this.loadingBtn = true;
 
-        // _arr.forEach((item) => {
-        //   item.pickList.forEach((it) => {
-        //     const warehousePick = [];
-        //     if (it.warehouseIdList.length != 0) {
-        //       it.warehouseIdList.forEach((i) => {
-        //         const data = it.warehouseList.find((ii) => ii.id == i);
-        //         if (data) {
-        //           warehousePick.push({
-        //             availableCountBase: data.availableCountBase,
-        //             demandQuantity: data.demandQuantity,
-        //             warehouseId: data.id
-        //           });
-        //         }
-        //       });
-        //     }
-        //     it.warehousePick = warehousePick;
-        //   });
-        // });
         console.log(_arr, '_arr');
-        // return;
-
-        // if (this.clientEnvironmentId == 21) {
-        //   let param = {
-        //     workOrderId: this.workListIds[0],
-        //     pickingCode: this.pickCode
-        //   };
-        //   znfindVoucherList(param).then((res) => {
-        //     this.loadingBtn = false;
-        //     this.$message.success('领料成功');
-        //   });
-        // }
+
         let param = {
           allPickList: _arr,
           pickName: this.pickName,
           pickCode: this.pickCode
         };
+
         batchSave(param)
           .then((res) => {
             this.loadingBtn = false;

+ 496 - 0
src/views/produce/components/workOrderHandover/index.vue

@@ -0,0 +1,496 @@
+<template>
+  <div class="work-order-handover">
+    <!-- 顶部操作按钮 -->
+    <div class="top_fixed rx-bc">
+      <div></div>
+      <div class="rx-bc action_btns">
+        <el-button type="primary" size="small" @click="onSubmit">提交</el-button>
+        <el-button type="primary" size="small" @click="onSave">保存</el-button>
+        <el-button size="small" @click="onCancel">取消</el-button>
+      </div>
+    </div>
+
+    <div class="handover_content">
+      <!-- 工单信息 -->
+      <div class="card_box">
+        <div class="title_box rx-bc">
+          <div class="name">工单信息</div>
+        </div>
+        <div class="material">
+          <div class="content_table">
+            <div class="item rx-sc">
+              <div class="rx ww16">
+                <div class="lable rx-cc">工单编码</div>
+                <div class="content">{{ workOrderInfo.code || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">产品编码</div>
+                <div class="content">{{ workOrderInfo.productCode || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">批次号</div>
+                <div class="content">{{ workOrderInfo.batchNo || '自动带出' }}</div>
+              </div>
+            </div>
+            <div class="item rx-sc">
+              <div class="rx ww16">
+                <div class="lable rx-cc">产品名称</div>
+                <div class="content">{{ workOrderInfo.productName || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">要求生产数量</div>
+                <div class="content">{{ workOrderInfo.formingNum || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">要求生产重量</div>
+                <div class="content">{{ workOrderInfo.formingWeight || '自动带出' }}</div>
+              </div>
+            </div>
+            <div class="item rx-sc">
+              <div class="rx ww16">
+                <div class="lable rx-cc">生产编号</div>
+                <div class="content">{{ workOrderInfo.productionCodes || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">已生产数量</div>
+                <div class="content">{{ workOrderInfo.producedNum || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc">已生产重量</div>
+                <div class="content">{{ workOrderInfo.producedWeight || '自动带出' }}</div>
+              </div>
+            </div>
+            <div class="item rx-sc">
+              <div class="rx ww16">
+                <div class="lable rx-cc">当前工序</div>
+                <div class="content">{{ workOrderInfo.currentProcess || '自动带出' }}</div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc"></div>
+                <div class="content"></div>
+              </div>
+              <div class="rx ww16">
+                <div class="lable rx-cc"></div>
+                <div class="content"></div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <!-- 交接信息 -->
+      <div class="card_box">
+        <div class="title_box rx-bc">
+          <div class="name">交接信息</div>
+        </div>
+        <el-form
+          ref="handoverForm"
+          :model="handoverForm"
+          :rules="handoverRules"
+          label-width="100px"
+          class="handover_form"
+          size="small"
+        >
+          <div class="form_row rx-bc">
+            <el-form-item label="交接类型" prop="handoverType" class="form_item" required>
+              <el-select
+                v-model="handoverForm.handoverType"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option label="物品移交" value="item" />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="交接时间" prop="handoverTime" class="form_item" required>
+              <el-date-picker
+                v-model="handoverForm.handoverTime"
+                type="date"
+                placeholder="年/月/日"
+                value-format="yyyy-MM-dd"
+                style="width: 100%"
+              />
+            </el-form-item>
+            <el-form-item label="交接单编码" class="form_item">
+              <el-input v-model="handoverForm.handoverCode" disabled placeholder="系统自动生成" />
+            </el-form-item>
+          </div>
+          <div class="form_row rx-bc">
+            <el-form-item label="交接班组" prop="handoverTeam" class="form_item" required>
+              <el-select
+                v-model="handoverForm.handoverTeam"
+                placeholder="默认下道工序班组,可修改"
+                filterable
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in teamList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="交接人" prop="handoverPerson" class="form_item" required>
+              <el-select
+                v-model="handoverForm.handoverPerson"
+                placeholder="自动带出,交接班组长"
+                filterable
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in personList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+            <div class="form_item form_item_empty"></div>
+          </div>
+          <div class="form_row rx-bc">
+            <el-form-item label="交接数量" prop="handoverQuantity" class="form_item form_item_with_unit" required>
+              <el-input
+                v-model="handoverForm.handoverQuantity"
+                placeholder="请输入"
+                type="number"
+              >
+                <template slot="append">PCS</template>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="交接重量" prop="handoverWeight" class="form_item form_item_with_unit" required>
+              <el-input
+                v-model="handoverForm.handoverWeight"
+                placeholder="请输入"
+                type="number"
+              >
+                <template slot="append">KG</template>
+              </el-input>
+            </el-form-item>
+            <div class="form_item form_item_empty"></div>
+          </div>
+          <div class="form_row_full">
+            <el-form-item label="交接注意事项" prop="handoverNotes" class="form_item_full">
+              <el-input
+                v-model="handoverForm.handoverNotes"
+                type="textarea"
+                :rows="3"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </div>
+        </el-form>
+      </div>
+
+      <!-- 物料清单 -->
+      <div class="card_box">
+        <div class="title_box rx-bc">
+          <div class="name">物料清单</div>
+          <el-button type="primary" size="small" @click="addMaterial">+ 物料</el-button>
+        </div>
+        <el-table
+          :data="materialList"
+          border
+          stripe
+          class="material_table"
+          max-height="400"
+        >
+          <el-table-column type="selection" width="45" align="center" />
+          <el-table-column type="index" label="序号" width="55" align="center" />
+          <el-table-column prop="code" label="编码" min-width="90" show-overflow-tooltip />
+          <el-table-column prop="name" label="名称" min-width="100" show-overflow-tooltip />
+          <el-table-column prop="batchNo" label="批次号" min-width="90" />
+          <el-table-column prop="type" label="类型" width="80" />
+          <el-table-column label="刻码" min-width="90">
+            <template slot-scope="{ row }">
+              <el-input v-model="row.engrave" size="mini" placeholder="请输入" />
+            </template>
+          </el-table-column>
+          <el-table-column prop="serialNo" label="序列号" min-width="90" />
+          <el-table-column label="物料代号" min-width="90">
+            <template slot-scope="{ row }">
+              <el-input v-model="row.materialAlias" size="mini" placeholder="请输入" />
+            </template>
+          </el-table-column>
+          <el-table-column label="客户代号" min-width="90">
+            <template slot-scope="{ row }">
+              <el-input v-model="row.customerAlias" size="mini" placeholder="请输入" />
+            </template>
+          </el-table-column>
+          <el-table-column prop="equipment" label="设备" min-width="90" />
+          <el-table-column label="炉次" min-width="90">
+            <template slot-scope="{ row }">
+              <el-input v-model="row.heatNo" size="mini" placeholder="请输入" />
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'WorkOrderHandover',
+  props: {
+    workListIds: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      workOrderInfo: {},
+      handoverForm: {
+        handoverType: 'item',
+        handoverTime: '',
+        handoverCode: '',
+        handoverTeam: '',
+        handoverPerson: '',
+        handoverQuantity: '',
+        handoverWeight: '',
+        handoverNotes: ''
+      },
+      handoverRules: {
+        handoverType: [{ required: true, message: '请选择交接类型', trigger: 'change' }],
+        handoverTime: [{ required: true, message: '请选择交接时间', trigger: 'change' }],
+        handoverTeam: [{ required: true, message: '请选择交接班组', trigger: 'change' }],
+        handoverPerson: [{ required: true, message: '请选择交接人', trigger: 'change' }],
+        handoverQuantity: [{ required: true, message: '请输入交接数量', trigger: 'blur' }],
+        handoverWeight: [{ required: true, message: '请输入交接重量', trigger: 'blur' }]
+      },
+      teamList: [],
+      personList: [],
+      materialList: [
+        {
+          code: '905',
+          name: '哈密瓜...',
+          batchNo: '905',
+          type: '产品',
+          engrave: '',
+          serialNo: '',
+          materialAlias: '',
+          customerAlias: '请输入',
+          equipment: '',
+          heatNo: ''
+        }
+      ]
+    };
+  },
+  watch: {
+    workListIds: {
+      immediate: true,
+      handler(ids) {
+        if (ids && ids.length) {
+          this.loadWorkOrderInfo();
+        }
+      }
+    }
+  },
+  methods: {
+    loadWorkOrderInfo() {
+      // TODO: 根据 workListIds 请求工单详情,赋值 workOrderInfo
+      this.workOrderInfo = {};
+    },
+    onSubmit() {
+      this.$refs.handoverForm.validate(valid => {
+        if (valid) {
+          // TODO: 提交接口
+          this.$message.success('提交成功');
+        }
+      });
+    },
+    onSave() {
+      this.$refs.handoverForm.validate(valid => {
+        if (valid) {
+          // TODO: 保存接口
+          this.$message.success('保存成功');
+        }
+      });
+    },
+    onCancel() {
+      this.$emit('cancel');
+    },
+    addMaterial() {
+      this.materialList.push({
+        code: '',
+        name: '',
+        batchNo: '',
+        type: '',
+        engrave: '',
+        serialNo: '',
+        materialAlias: '',
+        customerAlias: '',
+        equipment: '',
+        heatNo: ''
+      });
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.work-order-handover {
+  background: #fff;
+  padding: 12px;
+  min-height: 100%;
+}
+
+.top_fixed {
+  margin-bottom: 12px;
+  .action_btns {
+    gap: 10px;
+  }
+}
+
+.handover_content {
+  display: flex;
+  flex-direction: column;
+  gap: 16px;
+}
+
+.card_box {
+  background: #fff;
+  padding: 12px;
+  border-radius: 2px;
+  border: 1px solid #e3e5e5;
+}
+
+.title_box {
+  padding: 10px 0;
+  margin-bottom: 8px;
+
+  .name {
+    font-size: 14px;
+    font-style: normal;
+    font-weight: 400;
+    color: #157a2c;
+    padding-left: 5px;
+    position: relative;
+
+    &::before {
+      position: absolute;
+      content: '';
+      left: 0;
+      top: 0;
+      bottom: 0;
+      width: 2px;
+      height: 14px;
+      background: #157a2c;
+      margin: auto;
+    }
+  }
+}
+
+/* 工单信息表格 */
+.material {
+  margin-top: 6px;
+
+  .content_table {
+    width: 100%;
+    border: 1px solid #e3e5e5;
+
+    .item {
+      display: flex;
+      border-bottom: 1px solid #e3e5e5;
+
+      &:last-child {
+        border-bottom: none;
+      }
+
+      .rx {
+        display: flex;
+        flex: 1;
+        min-width: 0;
+      }
+
+      .ww16 {
+        width: 33.33%;
+        flex: 0 0 33.33%;
+      }
+
+      .lable {
+        width: 100px;
+        min-width: 100px;
+        text-align: center;
+        background-color: #f7f9fa;
+        font-size: 12px;
+        border-right: 1px solid #e3e5e5;
+        padding: 8px 4px;
+        box-sizing: border-box;
+      }
+
+      .content {
+        flex: 1;
+        min-height: 32px;
+        font-size: 13px;
+        padding: 8px 10px;
+        background: #fff;
+        border-right: 1px solid #e3e5e5;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+
+        &:last-child {
+          border-right: none;
+        }
+      }
+    }
+  }
+}
+
+/* 交接信息表单 */
+.handover_form {
+  .form_row,
+  .form_row_full {
+    display: flex;
+    flex-wrap: wrap;
+    margin-bottom: 0;
+  }
+
+  .form_row {
+    align-items: flex-start;
+    gap: 16px;
+    margin-bottom: 12px;
+  }
+
+  .form_row_full {
+    margin-bottom: 12px;
+  }
+
+  .form_item {
+    flex: 1;
+    min-width: 200px;
+    margin-bottom: 12px;
+    display: flex;
+    align-items: center;
+
+    ::v-deep .el-form-item__label {
+      padding-right: 4px;
+    }
+
+    ::v-deep .el-form-item__content {
+      flex: 1;
+      margin-left: 0 !important;
+    }
+  }
+
+  .form_item_empty {
+    min-width: 0;
+    flex: 1;
+    max-width: 200px;
+  }
+
+  .form_item_with_unit {
+    max-width: 280px;
+  }
+
+  .form_item_full {
+    width: 100%;
+    margin-bottom: 0;
+  }
+}
+
+.material_table {
+  margin-top: 8px;
+}
+</style>

+ 14 - 732
src/views/produce/index.vue

@@ -200,6 +200,13 @@
                 />
               </div>
 
+              <div v-if="operationType == 'workOrder'">
+                <workOrderHandover
+                  :workListIds="workListIds"
+                  ref="workOrderHandoverRef"
+                ></workOrderHandover>
+              </div>
+
               <!-- 工步 -->
               <div v-if="operationType == 'workStep'"> </div>
               <!-- 质检工序 -->
@@ -361,6 +368,7 @@
   import taskWorkList from './components/taskWorkList.vue';
   import taskReport from './components/taskReport.vue';
   import { getProduceTaskList } from '@/api/aps';
+  import workOrderHandover from './components/workOrderHandover/index.vue';
 
   export default {
     components: {
@@ -391,7 +399,8 @@
       addPlease,
       qualityInspection,
       taskWorkList,
-      taskReport
+      taskReport,
+      workOrderHandover
     },
     data() {
       return {
@@ -491,6 +500,7 @@
           error: this.handleError,
           Outsourcing: this.handleOutsourcing,
           qualityInspection: this.handleQualityInspection,
+          workOrder: this.handleWorkOrder,
           prenatalExamination: () => this.handleInspection(1),
           processDetection: () => this.handleInspection(2),
           postpartumExamination: () => this.handleInspection(3)
@@ -944,661 +954,6 @@
         }
       },
 
-      // async footBtn(t) {
-      //   this.workPlanType = '';
-      //   if ((t == 'work' || t == 'workStep', t === 'task')) {
-      //     this.popupType = t;
-      //   } else {
-      //     this.operationType = t;
-      //   }
-      //   if (
-      //     Object.keys(this.$store.state.user.taskObj).length === 0 &&
-      //     this.$store.state.user.taskObj.constructor === Object
-      //   ) {
-      //     this.$message.warning('请选择工序');
-      //     return true;
-      //   }
-      //   if (['pick', 'feed', 'job', 'work', 'workStep', 'task'].includes(t)) {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length == 0) {
-      //         this.$message.warning('请选择工单列表');
-      //         return false;
-      //       }
-      //     }
-      //   }
-
-      //   if (t === 'job') {
-      //     let resultValue = '0';
-      //     await parameterGetByCode({
-      //       code: 'first_article_dual_inspection_for_report'
-      //     }).then((res) => {
-      //       resultValue = res.value;
-      //     });
-      //     if (this.activeName == '1') {
-      //       if (!this.taskData) {
-      //         this.isFinalCheckProduction = false;
-      //         return this.$message.warning('请选择一条任务单进行报工');
-      //       } else {
-      //         this.isFinalCheckProduction = true;
-      //       }
-      //       const row = this.taskData;
-      //       if (resultValue == '1') {
-      //         if (row.totalFirstArticleDualInspectionStatus != 2) {
-      //           this.isFinalCheckProduction = false;
-      //           return this.$message.warning('请先完成首件两检再报工');
-      //         }
-      //       } else {
-      //         this.isFinalCheckProduction = true;
-      //       }
-      //       let currentRow = {
-      //         assignCode: row.assignCode,
-      //         mesWorkOrderCode: row.mesWorkOrderCode,
-      //         workOrderCode: row.workOrderCode,
-      //         productionPlanCode: row.productionPlanCode,
-      //         produceRoutingName: row.produceRoutingName,
-      //         formingNum: row.formingNum,
-      //         assignTeamName: row.assignTeamName,
-      //         formingWeight: row.formingWeight,
-      //         planStartTime: row.planStartTime,
-      //         planCompleteTime: row.planCompleteTime,
-      //         startTime: row.startTime,
-      //         firstTaskId: row.firstTaskId,
-      //         endTime: row.endTime,
-      //         taskName: row.taskName,
-      //         firstTaskName: row.firstTaskName,
-      //         assigneeType: row.assigneeType ? row.assigneeType.desc : '',
-      //         assigneeName: row.assigneeName,
-      //         weight: row.weight,
-      //         quantity: row.quantity,
-      //         durationText: row.durationText,
-      //         apsAssigneeId: row.id,
-      //         batchNo: row.batchNo,
-      //         productCode: row.productCode,
-      //         productName: row.productName,
-      //         specification: row.specification,
-      //         newWeightUnit: row.newWeightUnit,
-      //         measuringUnit: row.measuringUnit
-      //       };
-      //       let form = {
-      //         realEndTime: row.realEndTime,
-      //         realStartTime: row.realStartTime,
-      //         unqualifiedWeight: row.unqualifiedWeight,
-      //         unqualifiedQuantity: row.unqualifiedQuantity,
-      //         qualifiedWeight: row.qualifiedWeight,
-      //         remark: row.assigneeRemark,
-      //         qualifiedQuantity: row.qualifiedQuantity,
-      //         reportQuantity: row.reportQuantity,
-      //         lossQuantity: row.lossQuantity
-      //       };
-
-      //       this.$nextTick(() => {
-      //         this.$refs.taskReportRef.open('repoort', currentRow, form);
-      //       });
-      //     } else {
-      //       this.isFinalCheckProduction = true;
-      //       let req = {
-      //         taskId: this.taskObj.id,
-      //         workOrderId: this.workListIds[0],
-      //         data: this.workData.list
-      //       };
-
-      //       if (resultValue == '1') {
-      //         const result = await this.checkQualityResult();
-      //         if (!result) return;
-
-      //         const firstArticleResult =
-      //           result.firstArticleDualInspectionResult ?? true;
-
-      //         this.isFinalCheckProduction = firstArticleResult;
-
-      //         if (!firstArticleResult) {
-      //           return this.$message.warning('请完成首件两检再报工!');
-      //         }
-      //       }
-
-      //       if (
-      //         this.taskObj.type == 2 ||
-      //         this.taskObj.type == 3 ||
-      //         this.taskObj.type == 6
-      //       ) {
-      //         this.getCodeData(req);
-      //       }
-      //     }
-      //   }
-
-      //   if (t == 'pick') {
-      //     if (this.activeName == '0') {
-      //       this.$nextTick(() => {
-      //         console.log(this.taskObj);
-      //         this.$refs.pickListRef.getList(this.workListIds);
-      //       });
-      //     }
-      //   }
-      //   // 工步
-      //   if (t === 'workStep') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('工步只能选择一个工单!');
-      //       }
-      //       this.$refs.workStepRef.open(this.workStepQueryParam);
-      //     }
-      //   }
-      //   if (t === 'task') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('任务只能选择一个工单!');
-      //       }
-      //       this.$refs.taskDialogRef.open(
-      //         this.workStepQueryParam,
-      //         this.workData.list[0]
-      //       );
-      //     }
-      //   }
-
-      //   if (t === 'error') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('异常只能选择一个工单!');
-      //       } else if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       }
-
-      //       this.$refs.createErrorRef.open('add', this.workData.list[0]);
-      //     }
-      //   }
-      //   // 工艺路线 *** 修改 判断只能选择一个
-      //   // if (t === 'work') {
-      //   //   let req = {
-      //   //     taskId: this.taskObj.id,
-      //   //     workOrderId: this.workListIds[0]
-      //   //   };
-
-      //   //   this.$refs.wokePopupRef.open(req);
-      //   // }
-      //   if (t === 'work') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('工艺文件只能选择一个工单!');
-      //       } else if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       }
-
-      //       await parameterGetByCode({
-      //         code: 'mes_craft_file_by_category_code'
-      //       }).then((res) => {
-      //         console.log(this.workData.list, 'this.workData.list');
-      //         if (res.value == '1') {
-      //           let req = {
-      //             taskId: this.taskObj.id,
-      //             workOrderId: this.workListIds[0],
-      //             productCode: this.workData.list[0].productCode
-      //           };
-
-      //           this.$refs.wokePopupRef.openTwo(req);
-      //         } else {
-      //           let req = {
-      //             taskId: this.taskObj.id,
-      //             workOrderId: this.workListIds[0]
-      //           };
-
-      //           this.$refs.wokePopupRef.open(req);
-      //         }
-      //       });
-      //     }
-      //   }
-      //   if (t == 'feed') {
-      //   }
-
-      //   if (t == 'device') {
-      //     if (this.activeName == '0') {
-      //       if (this.taskObj.id) {
-      //         this.$refs.deviceRef.open(this.taskObj.id);
-      //       } else {
-      //         this.$message.warning('请选择工序');
-      //       }
-      //     }
-      //   }
-
-      //   if (t == 'turnover') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       } else {
-      //         const codeListData = [];
-      //         this.workData.list.forEach((it) => {
-      //           codeListData.push(it.code);
-      //         });
-      //         this.$refs.turnoverRef.open(codeListData);
-      //       }
-      //     }
-      //   }
-
-      //   if (t == 'bom') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('查看BOM详情只能选择一个工单!');
-      //       } else if (this.workListIds.length < 1)
-      //         return this.$message.warning('请选择工单!');
-      //       else {
-      //         console.log(this.workData);
-      //         const row = this.workData.list[0];
-      //         let rowData = {
-      //           categoryId: row.categoryId,
-      //           categoryName: row.bomCategoryName,
-      //           code: row.code,
-      //           versions: row.bomCategoryVersions,
-      //           rootPathIdParent: row.categoryLevelPathIdParent || '',
-      //           isProduct: true,
-      //           bomType: Number(row.bomType),
-      //           isTemp: 0
-      //         };
-      //         this.$refs.bomDrawer.open(rowData);
-      //       }
-      //     }
-      //   }
-
-      //   // 委外
-      //   if (t == 'Outsourcing') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('委外请托工序只能选择一个工单!');
-      //       } else if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       } else {
-      //         console.log(this.workData, 'this.workData');
-      //         // /
-      //         this.handOutsource(this.workListIds[0]);
-      //       }
-      //     }
-      //   }
-
-      //   // 产前准备 过程控制 产后检查
-      //   if (
-      //     t == 'prenatalExamination' ||
-      //     t == 'processDetection' ||
-      //     t == 'postpartumExamination'
-      //   ) {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length > 1) {
-      //         if (t == 'prenatalExamination') {
-      //           return this.$message.warning('产前准备只能选择一个工单!');
-      //         }
-      //         if (t == 'processDetection') {
-      //           return this.$message.warning('过程控制只能选择一个工单!');
-      //         }
-      //         return this.$message.warning('产后检查只能选择一个工单!');
-      //       }
-
-      //       if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       }
-
-      //       let reportWorkType = 1;
-
-      //       switch (t) {
-      //         case 'prenatalExamination':
-      //           reportWorkType = 1;
-      //           break;
-      //         case 'processDetection':
-      //           reportWorkType = 2;
-      //           break;
-      //         default:
-      //           reportWorkType = 3;
-      //           break;
-      //       }
-
-      //       this.$refs.prenatalExaminationRef.open(
-      //         this.workData.list[0],
-      //         this.produceTaskInfo,
-      //         reportWorkType
-      //       );
-      //     }
-      //   }
-
-      //   // 首件两检
-      //   if (t == 'qualityInspection') {
-      //     if (this.activeName == '0') {
-      //       if (this.workListIds.length < 1) {
-      //         return this.$message.warning('请选择工单!');
-      //       }
-      //       if (this.workListIds.length > 1) {
-      //         return this.$message.warning('首件两检只能选择一个工单!');
-      //       }
-      //       this.$refs.qualityInspectionRef.open(
-      //         this.workData.list[0],
-      //         this.produceTaskInfo
-      //       );
-      //     } else {
-      //       if (!this.taskData) {
-      //         return this.$message.warning('请选择一条任务单首件两检');
-      //       }
-
-      //       this.selfRequest(this.taskData);
-      //     }
-      //   }
-      // },
-
-      // async footBtn(t) {
-      //   this.initOperationType(t);
-
-      //   if (!this.checkTaskSelected()) return;
-      //   if (!this.checkWorkOrderSelected(t)) return;
-
-      //   switch (t) {
-      //     case 'job':
-      //       await this.handleJob();
-      //       break;
-      //     case 'pick':
-      //       this.handlePick();
-      //       break;
-      //     case 'workStep':
-      //       this.handleWorkStep();
-      //       break;
-      //     case 'task':
-      //       this.handleTask();
-      //       break;
-      //     case 'error':
-      //       this.handleError();
-      //       break;
-      //     case 'work':
-      //       await this.handleWork();
-      //       break;
-      //     case 'device':
-      //       this.handleDevice();
-      //       break;
-      //     case 'turnover':
-      //       this.handleTurnover();
-      //       break;
-      //     case 'bom':
-      //       this.handleBom();
-      //       break;
-      //     case 'Outsourcing':
-      //       this.handleOutsourcing();
-      //       break;
-      //     case 'prenatalExamination':
-      //     case 'processDetection':
-      //     case 'postpartumExamination':
-      //       this.handleInspection(t);
-      //       break;
-      //     case 'qualityInspection':
-      //       this.handleQualityInspection();
-      //       break;
-      //     default:
-      //       break;
-      //   }
-      // },
-      // initOperationType(t) {
-      //   this.workPlanType = '';
-      //   if (['work', 'workStep', 'task'].includes(t)) {
-      //     this.popupType = t;
-      //   } else {
-      //     this.operationType = t;
-      //   }
-      // },
-
-      // checkTaskSelected() {
-      //   const taskObj = this.$store.state.user.taskObj;
-      //   if (!taskObj || Object.keys(taskObj).length === 0) {
-      //     this.$message.warning('请选择工序');
-      //     return false;
-      //   }
-      //   return true;
-      // },
-
-      // checkWorkOrderSelected(t) {
-      //   const needCheck = ['pick', 'feed', 'job', 'work', 'workStep', 'task'];
-      //   if (!needCheck.includes(t)) return true;
-
-      //   if (this.activeName === '0' && this.workListIds.length === 0) {
-      //     this.$message.warning('请选择工单列表');
-      //     return false;
-      //   }
-      //   return true;
-      // },
-
-      // async needFirstArticleCheck() {
-      //   const res = await parameterGetByCode({
-      //     code: 'first_article_dual_inspection_for_report'
-      //   });
-      //   return res?.value === '1';
-      // },
-
-      // async handleJob() {
-      //   const needCheck = await this.needFirstArticleCheck();
-
-      //   if (this.activeName === '1') {
-      //     this.handleSingleTaskJob(needCheck);
-      //   } else {
-      //     await this.handleBatchJob(needCheck);
-      //   }
-      // },
-
-      // handleSingleTaskJob(needCheck) {
-      //   if (!this.taskData) {
-      //     this.isFinalCheckProduction = false;
-      //     return this.$message.warning('请选择一条任务单进行报工');
-      //   }
-
-      //   const row = this.taskData;
-
-      //   if (needCheck && row.totalFirstArticleDualInspectionStatus !== 2) {
-      //     this.isFinalCheckProduction = false;
-      //     return this.$message.warning('请先完成首件两检再报工');
-      //   }
-
-      //   this.isFinalCheckProduction = true;
-
-      //   const currentRow = this.buildTaskRow(row);
-      //   const form = this.buildTaskForm(row);
-
-      //   this.$nextTick(() => {
-      //     this.$refs.taskReportRef.open('repoort', currentRow, form);
-      //   });
-      // },
-
-      // async handleBatchJob(needCheck) {
-      //   this.isFinalCheckProduction = true;
-
-      //   const req = {
-      //     taskId: this.taskObj.id,
-      //     workOrderId: this.workListIds[0],
-      //     data: this.workData.list
-      //   };
-
-      //   if (needCheck) {
-      //     const result = await this.checkQualityResult();
-      //     const ok = result?.firstArticleDualInspectionResult ?? true;
-      //     if (!ok) {
-      //       this.isFinalCheckProduction = false;
-      //       return this.$message.warning('请完成首件两检再报工!');
-      //     }
-      //   }
-
-      //   if ([2, 3, 6].includes(this.taskObj.type)) {
-      //     this.getCodeData(req);
-      //   }
-      // },
-
-      // buildTaskRow(row) {
-      //   return {
-      //     assignCode: row.assignCode,
-      //     mesWorkOrderCode: row.mesWorkOrderCode,
-      //     workOrderCode: row.workOrderCode,
-      //     productionPlanCode: row.productionPlanCode,
-      //     produceRoutingName: row.produceRoutingName,
-      //     formingNum: row.formingNum,
-      //     assignTeamName: row.assignTeamName,
-      //     formingWeight: row.formingWeight,
-      //     planStartTime: row.planStartTime,
-      //     planCompleteTime: row.planCompleteTime,
-      //     startTime: row.startTime,
-      //     firstTaskId: row.firstTaskId,
-      //     endTime: row.endTime,
-      //     taskName: row.taskName,
-      //     firstTaskName: row.firstTaskName,
-      //     assigneeType: row.assigneeType?.desc || '',
-      //     assigneeName: row.assigneeName,
-      //     weight: row.weight,
-      //     quantity: row.quantity,
-      //     durationText: row.durationText,
-      //     apsAssigneeId: row.id,
-      //     batchNo: row.batchNo,
-      //     productCode: row.productCode,
-      //     productName: row.productName,
-      //     specification: row.specification,
-      //     newWeightUnit: row.newWeightUnit,
-      //     measuringUnit: row.measuringUnit
-      //   };
-      // },
-
-      // buildTaskForm(row) {
-      //   return {
-      //     realEndTime: row.realEndTime,
-      //     realStartTime: row.realStartTime,
-      //     unqualifiedWeight: row.unqualifiedWeight,
-      //     unqualifiedQuantity: row.unqualifiedQuantity,
-      //     qualifiedWeight: row.qualifiedWeight,
-      //     remark: row.assigneeRemark,
-      //     qualifiedQuantity: row.qualifiedQuantity,
-      //     reportQuantity: row.reportQuantity,
-      //     lossQuantity: row.lossQuantity
-      //   };
-      // },
-
-      // handlePick() {
-      //   this.$nextTick(() => {
-      //     this.$refs.pickListRef.getList(this.workListIds);
-      //   });
-      // },
-
-      // handleWorkStep() {
-      //   if (this.workListIds.length > 1) {
-      //     return this.$message.warning('工步只能选择一个工单!');
-      //   }
-      //   this.$refs.workStepRef.open(this.workStepQueryParam);
-      // },
-
-      // handleTask() {
-      //   if (this.workListIds.length > 1) {
-      //     return this.$message.warning('任务只能选择一个工单!');
-      //   }
-      //   this.$refs.taskDialogRef.open(
-      //     this.workStepQueryParam,
-      //     this.workData.list[0]
-      //   );
-      // },
-
-      // handleError() {
-      //   if (this.workListIds.length !== 1) {
-      //     return this.$message.warning('异常只能选择一个工单!');
-      //   }
-      //   this.$refs.createErrorRef.open('add', this.workData.list[0]);
-      // },
-
-      // async handleWork() {
-      //   if (this.workListIds.length !== 1) {
-      //     return this.$message.warning('工艺文件只能选择一个工单!');
-      //   }
-
-      //   const res = await parameterGetByCode({
-      //     code: 'mes_craft_file_by_category_code'
-      //   });
-
-      //   const baseReq = {
-      //     taskId: this.taskObj.id,
-      //     workOrderId: this.workListIds[0]
-      //   };
-
-      //   if (res?.value === '1') {
-      //     this.$refs.wokePopupRef.openTwo({
-      //       ...baseReq,
-      //       productCode: this.workData.list[0].productCode
-      //     });
-      //   } else {
-      //     this.$refs.wokePopupRef.open(baseReq);
-      //   }
-      // },
-
-      // handleDevice() {
-      //   if (!this.taskObj.id) {
-      //     return this.$message.warning('请选择工序');
-      //   }
-      //   this.$refs.deviceRef.open(this.taskObj.id);
-      // },
-
-      // handleTurnover() {
-      //   if (this.workListIds.length < 1) {
-      //     return this.$message.warning('请选择工单!');
-      //   }
-      //   const codes = this.workData.list.map((it) => it.code);
-      //   this.$refs.turnoverRef.open(codes);
-      // },
-
-      // handleBom() {
-      //   if (this.workListIds.length !== 1) {
-      //     return this.$message.warning('查看BOM只能选择一个工单!');
-      //   }
-
-      //   const row = this.workData.list[0];
-      //   this.$refs.bomDrawer.open({
-      //     categoryId: row.categoryId,
-      //     categoryName: row.bomCategoryName,
-      //     code: row.code,
-      //     versions: row.bomCategoryVersions,
-      //     rootPathIdParent: row.categoryLevelPathIdParent || '',
-      //     isProduct: true,
-      //     bomType: Number(row.bomType),
-      //     isTemp: 0
-      //   });
-      // },
-
-      // handleOutsourcing() {
-      //   if (this.workListIds.length !== 1) {
-      //     return this.$message.warning('委外只能选择一个工单!');
-      //   }
-      //   this.handOutsource(this.workListIds[0]);
-      // },
-
-      // handleInspection(t) {
-      //   if (this.workListIds.length !== 1) {
-      //     const map = {
-      //       prenatalExamination: '产前准备',
-      //       processDetection: '过程控制',
-      //       postpartumExamination: '产后检查'
-      //     };
-      //     return this.$message.warning(`${map[t]}只能选择一个工单!`);
-      //   }
-
-      //   const typeMap = {
-      //     prenatalExamination: 1,
-      //     processDetection: 2,
-      //     postpartumExamination: 3
-      //   };
-
-      //   this.$refs.prenatalExaminationRef.open(
-      //     this.workData.list[0],
-      //     this.produceTaskInfo,
-      //     typeMap[t]
-      //   );
-      // },
-
-      // handleQualityInspection() {
-      //   if (this.activeName === '0') {
-      //     if (this.workListIds.length !== 1) {
-      //       return this.$message.warning('首件两检只能选择一个工单!');
-      //     }
-      //     this.$refs.qualityInspectionRef.open(
-      //       this.workData.list[0],
-      //       this.produceTaskInfo
-      //     );
-      //   } else {
-      //     if (!this.taskData) {
-      //       return this.$message.warning('请选择一条任务单首件两检');
-      //     }
-      //     this.selfRequest(this.taskData);
-      //   }
-      // },
-
       async footBtn(t) {
         this.workPlanType = '';
 
@@ -1763,82 +1118,6 @@
         };
       },
 
-      // async handleTaskJob() {
-      //   if (!this.taskData) {
-      //     this.isFinalCheckProduction = false;
-      //     return this.$message.warning('请选择一条任务单进行报工');
-      //   }
-
-      //   if (this.taskData.disposalStatus == '0') {
-      //     this.isFinalCheckProduction = false;
-      //     return this.$message.warning('请先接收任务再做首件两检');
-      //   }
-
-      //   if (this.taskData.disposalStatus == '2') {
-      //     this.isFinalCheckProduction = false;
-      //     return this.$message.warning('该任务单已被拒绝');
-      //   }
-
-      //   const row = this.taskData;
-      //   this.isFinalCheckProduction = false;
-      //   if (this.taskObj.id != '-1') {
-      //     if (
-      //       row.hasFirstArticleDualInspection == '1' &&
-      //       row.totalFirstArticleDualInspectionStatus != '2'
-      //     ) {
-      //       return this.$message.warning('请先完成首件两检再报工');
-      //     }
-      //   }
-
-      //   this.isFinalCheckProduction = true;
-
-      //   const currentRow = {
-      //     assignCode: row.assignCode,
-      //     mesWorkOrderCode: row.mesWorkOrderCode,
-      //     workOrderCode: row.workOrderCode,
-      //     productionPlanCode: row.productionPlanCode,
-      //     produceRoutingName: row.produceRoutingName,
-      //     formingNum: row.formingNum,
-      //     assignTeamName: row.assignTeamName,
-      //     formingWeight: row.formingWeight,
-      //     planStartTime: row.planStartTime,
-      //     planCompleteTime: row.planCompleteTime,
-      //     startTime: row.startTime,
-      //     firstTaskId: row.firstTaskId,
-      //     endTime: row.endTime,
-      //     taskName: row.taskName,
-      //     firstTaskName: row.firstTaskName,
-      //     assigneeType: row.assigneeType?.desc || '',
-      //     assigneeName: row.assigneeName,
-      //     weight: row.weight,
-      //     quantity: row.quantity,
-      //     durationText: row.durationText,
-      //     apsAssigneeId: row.id,
-      //     batchNo: row.batchNo,
-      //     productCode: row.productCode,
-      //     productName: row.productName,
-      //     specification: row.specification,
-      //     newWeightUnit: row.newWeightUnit,
-      //     measuringUnit: row.measuringUnit
-      //   };
-
-      //   const form = {
-      //     realEndTime: row.realEndTime,
-      //     realStartTime: row.realStartTime,
-      //     unqualifiedWeight: row.unqualifiedWeight,
-      //     unqualifiedQuantity: row.unqualifiedQuantity,
-      //     qualifiedWeight: row.qualifiedWeight,
-      //     remark: row.assigneeRemark,
-      //     qualifiedQuantity: row.qualifiedQuantity,
-      //     reportQuantity: row.reportQuantity,
-      //     lossQuantity: row.lossQuantity
-      //   };
-
-      //   this.$nextTick(() => {
-      //     this.$refs.taskReportRef.open('repoort', currentRow, form);
-      //   });
-      // },
-
       async handleWorkOrderJob() {
         if (!this.checkWorkOrder({ min: 1 })) return;
 
@@ -2103,6 +1382,9 @@
         }
       },
 
+      /* ================== workOrder ================== */
+      handleWorkOrder() {},
+
       successTask() {
         this.isFinalCheckProduction = false;
       },

+ 177 - 0
src/views/workOrderHandover/components/handover-search.vue

@@ -0,0 +1,177 @@
+<!-- 工单交接 - 搜索表单 -->
+<template>
+  <el-form
+    label-width="120px"
+    class="ele-form-search handover-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col :span="6">
+        <el-form-item label="生产工单号">
+          <el-input
+            v-model="where.workOrderCode"
+            clearable
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="交接类型">
+          <el-select
+            v-model="where.handoverType"
+            placeholder="请选择"
+            clearable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in handoverTypeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="交接时间">
+          <el-date-picker
+            v-model="where.handoverTime"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+            style="width: 100%"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label-width="0">
+          <div class="search-actions">
+            <el-link
+              type="primary"
+              :underline="false"
+              class="more-query"
+              @click="expandMore = !expandMore"
+            >
+              {{ expandMore ? '收起' : '+ 更多查询' }}
+            </el-link>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+            >
+              查询
+            </el-button>
+            <el-button
+              icon="el-icon-refresh-left"
+              type="primary"
+              plain
+              @click="reset"
+            >
+              重置
+            </el-button>
+          </div>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row v-show="expandMore" :gutter="15">
+      <el-col :span="6">
+        <el-form-item label="产品编码">
+          <el-input
+            v-model="where.productCode"
+            clearable
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="产品名称">
+          <el-input
+            v-model="where.productName"
+            clearable
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="批次号">
+          <el-input
+            v-model="where.batchNo"
+            clearable
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="交接班组/班次">
+          <el-input
+            v-model="where.handoverTeamShift"
+            clearable
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  data() {
+    const defaultWhere = {
+      workOrderCode: '',
+      handoverType: '',
+      handoverTime: [],
+      productCode: '',
+      productName: '',
+      batchNo: '',
+      handoverTeamShift: ''
+    };
+    return {
+      where: { ...defaultWhere },
+      defaultWhere,
+      expandMore: false,
+      handoverTypeOptions: [
+        { label: '物品移交', value: 'item' },
+        { label: '班次交接', value: 'shift' },
+        { label: '工序交接', value: 'process' }
+      ]
+    };
+  },
+  methods: {
+    search() {
+      const where = { ...this.where };
+      if (where.handoverTime && where.handoverTime.length === 2) {
+        where.handoverTimeStart = where.handoverTime[0];
+        where.handoverTimeEnd = where.handoverTime[1];
+      }
+      delete where.handoverTime;
+      this.$emit('search', where);
+    },
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.handover-form-search {
+  .search-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    flex-wrap: wrap;
+    gap: 8px;
+  }
+  .more-query {
+    margin-right: 8px;
+    font-size: 14px;
+  }
+}
+</style>

+ 261 - 0
src/views/workOrderHandover/index.vue

@@ -0,0 +1,261 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <!-- <handover-search ref="searchRef" @search="reload" /> -->
+      <seek-page :seekList="seekList" @search="search"></seek-page>
+
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        cache-key="workOrderHandoverTable"
+        :init-load="true"
+        :height="tableHeight"
+        :pageSize="10"
+        @fullscreen-change="fullscreenChange"
+      >
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handleAdd"
+          >
+            新增
+          </el-button>
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import handoverSearch from './components/handover-search.vue';
+  import { handoverPage } from '@/api/workOrderHandover/index.js';
+
+  export default {
+    name: 'WorkOrderHandover',
+    components: {
+      handoverSearch
+    },
+    data() {
+      return {
+        loading: false,
+        tableHeight: 'calc(100vh - 340px)',
+        handoverTypeOptions: [
+          { label: '物品移交', value: 'item' },
+          { label: '班次交接', value: 'shift' },
+          { label: '工序交接', value: 'process' }
+        ]
+      };
+    },
+    computed: {
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 60,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverType',
+            label: '交接类型',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              const map = {
+                item: '物品移交',
+                shift: '班次交接',
+                process: '工序交接'
+              };
+              return map[cellValue] || cellValue;
+            }
+          },
+          {
+            prop: 'handoverCode',
+            label: '交接单编码',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverTime',
+            label: '交接时间',
+            align: 'center',
+            minWidth: 160,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'workOrderCode',
+            label: '生产工单号',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'processName',
+            label: '工序名称',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formingWeight',
+            label: '要求生成重量',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'producedNum',
+            label: '已生产数量',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'producedWeight',
+            label: '已生产重量',
+            align: 'center',
+            minWidth: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverTeamShift',
+            label: '交接班组/班次',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverUser',
+            label: '交接人',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverNuM',
+            label: '交接数量',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'handoverWeight',
+            label: '交接重量',
+            align: 'center',
+            minWidth: 120,
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 90,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      },
+
+      seekList() {
+        return [
+          {
+            label: '生产工单号:',
+            value: 'code',
+            type: 'input',
+            placeholder: '',
+            labelWidth: 100
+          },
+          {
+            label: '交接类型:',
+            value: 'planType',
+            type: 'select',
+            placeholder: '',
+            planList: this.handoverTypeOptions
+          },
+          {
+            label: '交接时间:',
+            value: 'planType',
+            type: 'date',
+            dateType: 'daterange',
+            placeholder: ''
+          }
+        ];
+      }
+    },
+    methods: {
+      datasource({ page, limit, where }) {
+        return handoverPage({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where: where || {} });
+        });
+      },
+
+      search(e) {
+        this.reload(e);
+      },
+
+      handleAdd() {
+        // 跳转至生产-工单交接新增或打开弹窗,按业务接入
+        this.$message.info(
+          '请在生产-工单详情中发起交接,或在此处接入新增弹窗/路由'
+        );
+      },
+      fullscreenChange(fullscreen) {
+        this.tableHeight = fullscreen
+          ? 'calc(100vh - 120px)'
+          : 'calc(100vh - 340px)';
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .ele-body {
+    padding: 12px;
+  }
+</style>