695593266@qq.com 8 месяцев назад
Родитель
Сommit
c462d364f4

+ 10 - 0
src/api/wms/index.js

@@ -8,3 +8,13 @@ export async function getPages(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+// /wms/outintwo/batchRecordPage post
+export async function getBatchRecordPage(params) {
+  const res = await request.post(`/wms/outintwo/batchRecordPage`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 0 - 268
src/views/batchRecord/components/bpmList.vue

@@ -1,268 +0,0 @@
-<template>
-  <el-col :span="12">
-    <!-- 审批记录 -->
-    <el-card class="box-card" v-loading="tasksLoad">
-      <div slot="header" class="clearfix">
-        <span class="el-icon-picture-outline">审批记录</span>
-      </div>
-      <div class="block details-bpm-list">
-        <el-timeline>
-          <el-timeline-item
-            v-for="(item, index) in tasks"
-            :key="index"
-            :icon="getTimelineItemIcon(item)"
-            :type="getTimelineItemType(item)"
-          >
-            <p style="font-weight: 700">任务:{{ item.name }}</p>
-            <el-card :body-style="{ padding: '10px' }">
-              <label
-                v-if="item.assigneeUser"
-                style="font-weight: normal; margin-right: 30px"
-              >
-                审批人:{{ item.assigneeUser.nickname }}
-                <el-tag type="info" size="mini">{{
-                  item.assigneeUser.deptName
-                }}</el-tag>
-              </label>
-              <label style="font-weight: normal" v-if="item.createTime"
-                >创建时间:</label
-              >
-              <label style="color: #8a909c; font-weight: normal">{{
-                item.createTime
-              }}</label>
-              <label
-                v-if="item.endTime"
-                style="margin-left: 30px; font-weight: normal"
-                >审批时间:</label
-              >
-              <label
-                v-if="item.endTime"
-                style="color: #8a909c; font-weight: normal"
-              >
-                {{ item.endTime }}</label
-              >
-              <label
-                v-if="item.durationInMillis"
-                style="margin-left: 30px; font-weight: normal"
-                >耗时:</label
-              >
-              <label
-                v-if="item.durationInMillis"
-                style="color: #8a909c; font-weight: normal"
-              >
-                {{ getDateStar(item.durationInMillis) }}
-              </label>
-              <p v-if="item.reason">
-                <el-tag :type="getTimelineItemType(item)">{{
-                  item.reason
-                }}</el-tag>
-              </p>
-            </el-card>
-          </el-timeline-item>
-        </el-timeline>
-      </div>
-    </el-card>
-  </el-col>
-</template>
-
-<script>
-  import {
-    getProcessDefinitionBpmnXML,
-    getProcessInstance,
-    getActivityList,
-    getTaskListByProcessInstanceId
-  } from '@/api/produce/bom.js';
-  import store from '@/store';
-  // import { getProcessInstance } from '@/api/bpm/processInstance';
-  import { getDate } from '@/utils/dateUtils';
-  import dictMixins from '@/mixins/dictMixins';
-  // import { getTaskListByProcessInstanceId } from '@/api/bpm/task';
-  // import { getActivityList } from '@/api/bpm/activity';
-  // import Vue from 'vue';
-
-  // 流程实例的详情页,可用于审批
-  export default {
-    name: 'bpmList',
-    mixins: [dictMixins],
-    emits: ['setCurrenNode'],
-    components: {},
-    props: {
-      // 流程id
-      id: {
-        default: ''
-      }
-    },
-    data() {
-      return {
-        // 遮罩层
-        processInstanceLoading: true,
-        dialogVisible: false,
-
-        processInstance: {},
-
-        // BPMN 数据
-        bpmnXML: null,
-        bpmnControlForm: {
-          prefix: 'flowable'
-        },
-        activityList: [],
-
-        // 审批记录
-        tasksLoad: true,
-        tasks: []
-      };
-    },
-    created() {
-      // this.id = this.$route.query.id;
-      // if (!this.id) {
-      //   this.$message.error('未传递 id 参数,无法查看流程信息');
-      //   return;
-      // }
-      this.getDetail();
-    },
-    methods: {
-      /** 获得流程实例 */
-      getDetail() {
-        // 获得流程实例相关
-        this.processInstanceLoading = true;
-        getProcessInstance(this.id).then((response) => {
-          if (!response) {
-            this.$message.error('查询不到流程信息!');
-            return;
-          }
-          // 设置流程信息
-          this.processInstance = response;
-
-          // //将业务表单,注册为动态组件
-          // const path = this.processInstance.processDefinition.formCustomViewPath;
-          // Vue.component("async-biz-form-component", function (resolve) {
-          //   require([`@/views${path}`], resolve);
-          // });
-          // 加载流程图
-          getProcessDefinitionBpmnXML(
-            this.processInstance.processDefinition.id
-          ).then((response) => {
-            this.bpmnXML = response;
-          });
-          // 加载活动列表
-          getActivityList({
-            processInstanceId: this.processInstance.id
-          }).then((response) => {
-            console.log(response, 'response');
-            this.activityList = response;
-          });
-
-          // 取消加载中
-          this.processInstanceLoading = false;
-        });
-
-        // 获得流程任务列表(审批记录)
-        this.tasksLoad = true;
-        getTaskListByProcessInstanceId(this.id).then((response) => {
-          // 审批记录
-          this.tasks = [];
-          // 移除已取消的审批
-          response.forEach((task) => {
-            if (task.result !== 4) {
-              this.tasks.push(task);
-            }
-          });
-          // 排序,将未完成的排在前面,已完成的排在后面;
-          this.tasks.sort((a, b) => {
-            // 有已完成的情况,按照完成时间倒序
-            if (a.endTime && b.endTime) {
-              return b.endTime - a.endTime;
-            } else if (a.endTime) {
-              return 1;
-            } else if (b.endTime) {
-              return -1;
-              // 都是未完成,按照创建时间倒序
-            } else {
-              return b.createTime - a.createTime;
-            }
-          });
-
-          // 需要审核的记录
-          const userId = store.getters.userId;
-          this.tasks.forEach((task) => {
-            if (task.result !== 1 && task.result !== 6) {
-              // 只有待处理才需要
-              return;
-            }
-            if (!task.assigneeUser || task.assigneeUser.id !== userId) {
-              // 自己不是处理人
-              return;
-            }
-          });
-
-          const currenItem = this.tasks.find((i) => i.result == 1);
-          if (currenItem) {
-            // 当前处理中的节点
-            this.$emit('setCurrenNode', currenItem);
-          }
-
-          // 取消加载中
-          this.tasksLoad = false;
-        });
-      },
-      getDateStar(ms) {
-        return getDate(ms);
-      },
-      getTimelineItemIcon(item) {
-        if (item.result === 1) {
-          return 'el-icon-time';
-        }
-        if (item.result === 2) {
-          return 'el-icon-check';
-        }
-        if (item.result === 3) {
-          return 'el-icon-close';
-        }
-        if (item.result === 4) {
-          return 'el-icon-remove-outline';
-        }
-        if (item.result === 5) {
-          return 'el-icon-back';
-        }
-        return '';
-      },
-      getTimelineItemType(item) {
-        if (item.result === 1) {
-          return 'primary';
-        }
-        if (item.result === 2) {
-          return 'success';
-        }
-        if (item.result === 3) {
-          return 'danger';
-        }
-        if (item.result === 4) {
-          return 'info';
-        }
-        if (item.result === 5) {
-          return 'warning';
-        }
-        if (item.result === 6) {
-          return 'default';
-        }
-        return '';
-      }
-    }
-  };
-</script>
-
-<style lang="scss">
-  .my-process-designer {
-    height: calc(100vh - 200px);
-  }
-
-  .box-card {
-    width: 100%;
-    margin-bottom: 20px;
-  }
-
-  .details-bpm-list {
-    max-height: 120px;
-    overflow-y: auto;
-  }
-</style>

+ 0 - 141
src/views/batchRecord/components/bpmSubmit.vue

@@ -1,141 +0,0 @@
-<template>
-  <el-col :span="12">
-    <el-card v-loading="!taskDefinitionKey" class="box-card">
-      <div slot="header" class="clearfix">
-        <span class="el-icon-picture-outline">审批任务</span>
-      </div>
-      <el-form label-width="100px" ref="formRef" :model="form">
-        <el-form-item
-          label="审批建议"
-          style="margin-bottom: 20px"
-          :rules="{
-            required: true,
-            message: '请选择',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            type="textarea"
-            v-model="form.reason"
-            placeholder="请输入审批建议"
-          />
-        </el-form-item>
-      </el-form>
-
-      <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
-        <el-button
-          icon="el-icon-edit-outline"
-          type="success"
-          size="mini"
-          @click="handleAudit(1)"
-          >通过
-        </el-button>
-
-        <el-button
-          icon="el-icon-circle-close"
-          type="danger"
-          size="mini"
-          @click="handleAudit(0)"
-          >驳回
-        </el-button>
-      </div>
-    </el-card>
-  </el-col>
-</template>
-<script>
-  import { approveTaskWithVariables } from '@/api/bpm/task';
-  import storageApi from '@/api/warehouseManagement';
-  export default {
-    data() {
-      return {
-        form: {}
-      };
-    },
-    props: {
-      businessId: {
-        default: ''
-      },
-      taskId: {
-        default: ''
-      },
-      id: {
-        default: ''
-      },
-      taskDefinitionKey: {
-        default: ''
-      }
-    },
-    methods: {
-      handleAudit(status) {
-        if (!this.form.reason && status == 1) {
-          this.$message.warning(`请填写审批意见!`);
-          return;
-        }
-
-        this._approveTaskWithVariables(status);
-      },
-      async _approveTaskWithVariables(status) {
-        console.log(status);
-        if (status == 1) {
-          if (this.taskDefinitionKey === 'storage') {
-            const res = await storageApi.allot({ applyId: this.businessId });
-            if (res.data.code != '-1') {
-              const params = {
-                id: this.taskId,
-                reason: this.form.reason,
-                variables: { pass: true }
-              };
-              const data = await approveTaskWithVariables(params);
-              if (data.data.code != '-1') {
-                this.$emit('handleAudit', {
-                  status,
-                  title: '通过'
-                });
-              }
-            }
-          } else {
-            const params = {
-              id: this.taskId,
-              reason: this.form.reason,
-              variables: { pass: true }
-            };
-            const data = await approveTaskWithVariables(params);
-            if (data.data.code != '-1') {
-              this.$emit('handleAudit', {
-                status,
-                title: '通过'
-              });
-            }
-          }
-        } else {
-          if (this.taskDefinitionKey === 'outbound') {
-            const data = await storageApi.notAllotPass({
-              id: this.businessId,
-              reason: this.form.reason,
-              taskId: this.taskId
-            });
-            if (data.data.code != '-1') {
-              this.$emit('handleAudit', {
-                status,
-                title: '驳回'
-              });
-            }
-          } else {
-            const params = {
-              id: this.taskId,
-              reason: this.form.reason,
-              variables: { pass: false }
-            };
-            const data = await approveTaskWithVariables(params);
-            if (data.data.code != '-1') {
-              this.$emit('handleAudit', {
-                status,
-                title: '驳回'
-              });
-            }
-          }
-        }
-      }
-    }
-  };
-</script>

+ 0 - 753
src/views/batchRecord/components/detialsModal.vue

@@ -1,753 +0,0 @@
-<template>
-  <ele-modal
-    :title="title"
-    :visible.sync="visible"
-    :close-on-click-modal="false"
-    @close="handleClose"
-    resizable
-    maxable
-    width="80%"
-  >
-    <div
-      class="switch"
-      v-if="
-        details &&
-        details.executeMethod == 2 &&
-        details.approvalStatus != null &&
-        details.approvalStatus != 0
-      "
-      :maxable="true"
-      style="margin-bottom: 20px"
-    >
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key"
-          >
-            {{ item.name }}
-          </li>
-        </ul>
-      </div>
-    </div>
-    <el-form
-      v-if="details && activeComp == 'main'"
-      ref="formRef"
-      :model="form"
-      :rules="rules"
-      label-width="130px"
-      v-loading="loading"
-    >
-      <header-title title="产品信息"></header-title>
-      <el-row style="margin-bottom: 20px">
-        <el-col :span="8">
-          <el-form-item label="生产订单">
-            <el-input :value="details.workOrderCode" disabled></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="工序名称">
-            <el-input :value="details.produceTaskName" disabled></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row style="margin-bottom: 20px">
-        <el-col :span="8">
-          <el-form-item label="产品编码">
-            <el-input :value="details.productCode" disabled></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="产品名称">
-            <el-input :value="details.productName" disabled></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="批次号">
-            <el-input
-              :value="details.batchNo"
-              disabled
-            ></el-input> </el-form-item
-        ></el-col>
-      </el-row>
-      <el-row style="margin-bottom: 20px">
-        <el-col :span="8">
-          <el-form-item label="规格">
-            <el-input :value="details.specification" disabled></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="型号">
-            <el-input :value="details.productModel" disabled></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="要求生产数量">
-            <el-input :value="details.formingNum" disabled></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <header-title title="基本信息"></header-title>
-      <!-- 记录规则 -->
-      <template v-if="details.executeMethod == 2">
-        <el-row style="margin-bottom: 20px">
-          <el-col :span="8">
-            <el-form-item label="记录规则名称">
-              <el-input :value="details.ruleName" disabled></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="记录规则分类">
-              <DictSelection
-                dictName="记录规则类型"
-                clearable
-                v-model="details.recordRulesClassify"
-                disabled
-              >
-              </DictSelection>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="车间区域">
-              <el-input
-                :value="details.workshopArea"
-                disabled
-              ></el-input> </el-form-item
-          ></el-col>
-        </el-row>
-        <el-row style="margin-bottom: 20px">
-          <el-col :span="8">
-            <el-form-item label="检查完成时间">
-              <el-input
-                :value="details.checkFinishTime"
-                disabled
-              ></el-input> </el-form-item
-          ></el-col>
-          <el-col :span="8">
-            <el-form-item label="检查有效期">
-              <el-input
-                placeholder="请输入"
-                v-model="details.checkValidity"
-                type="text"
-                disabled
-              >
-                <template slot="append">
-                  <div style="width: 40px; box-sizing: border-box">
-                    <el-form-item required>
-                      <DictSelection
-                        dictName="检查有效期单位"
-                        clearable
-                        v-model="details.checkValidityUnit"
-                        placeholder="单位"
-                        style="
-                          width: auto;
-                          box-sizing: border-box;
-                          height: 36px;
-                        "
-                        disabled
-                      >
-                      </DictSelection>
-                    </el-form-item>
-                  </div>
-                </template>
-              </el-input> </el-form-item
-          ></el-col>
-          <el-col :span="8">
-            <el-form-item label="结论">
-              <el-radio-group v-model="details.conclution" disabled>
-                <el-radio :label="1">合格</el-radio>
-                <el-radio :label="2">不合格</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </template>
-
-      <header-title
-        v-if="details.executeMethod == 2"
-        title="检查项目"
-      ></header-title>
-      <!-- 记录规则 -->
-      <div v-if="details.executeMethod == 2">
-        <el-table
-          v-loading="loading"
-          :data="details.details"
-          style="width: 100%"
-        >
-          <el-table-column type="index" label="序号" width="50">
-          </el-table-column>
-          <el-table-column label="检查内容">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.paramValue }}
-              </div>
-            </template>
-          </el-table-column>
-
-          <el-table-column label="检查工具">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.toolNames }}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查人">
-            <template slot-scope="scope">
-              <div style="display: flex; align-items: center; cursor: pointer">
-                <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查情况">
-            <template slot-scope="scope">
-              <div>
-                <div>
-                  <el-radio-group v-model="scope.row.checkStatus" disabled>
-                    <el-radio :label="1">已检查</el-radio>
-                    <el-radio :label="0">未检查</el-radio>
-                  </el-radio-group>
-                </div>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查结果">
-            <template slot-scope="scope">
-              <div>
-                <el-radio-group v-model="scope.row.checkResult" disabled>
-                  <el-radio :label="1">合格</el-radio>
-                  <el-radio :label="0">不合格</el-radio>
-                </el-radio-group>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="异常描述">
-            <template slot-scope="scope">
-              <div>
-                <el-input
-                  type="textarea"
-                  :rows="1"
-                  placeholder="请输入"
-                  v-model="scope.row.errorMsg"
-                  disabled
-                >
-                </el-input>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 事项规则 -->
-      <div v-if="details.executeMethod == 1 && eamPlanInfo">
-        <el-row style="margin-bottom: 20px">
-          <el-col :span="8">
-            <el-form-item label="计划配置单号">
-              <el-input :value="eamPlanInfo.code" disabled></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划配置名称">
-              <el-input :value="eamPlanInfo.name" disabled></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="自动派单">
-              <el-select
-                v-model="eamPlanInfo.autoOrder"
-                size="small"
-                style="width: 100%"
-                disabled
-              >
-                <el-option :value="1" label="是"></el-option>
-                <el-option :value="0" label="否"></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="计划完成时长">
-              <el-input :value="eamPlanInfo.duration" disabled
-                ><template #suffix>分钟</template></el-input
-              >
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="部门">
-              <el-input :value="eamPlanInfo.groupName" disabled></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="负责人" prop="executorId">
-              <el-select
-                v-model="eamPlanInfo.executorId"
-                size="small"
-                style="width: 100%"
-                multiple
-                filterable
-                disabled
-              >
-                <el-option
-                  v-for="item in executorList"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.name"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="审核人" prop="approvalUserId">
-              <el-select
-                v-model="eamPlanInfo.approvalUserId"
-                size="small"
-                clearable
-                style="width: 100%"
-                filterable
-                disabled
-              >
-                <el-option
-                  v-for="item in uerList"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.name"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="紧急程度" prop="urgent">
-              <DictSelection
-                dictName="紧急程度"
-                clearable
-                v-model="eamPlanInfo.urgent"
-                disabled
-              >
-              </DictSelection>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="备注" prop="remark">
-              <el-input
-                type="textarea"
-                resize="none"
-                v-model="eamPlanInfo.remark"
-                :rows="2"
-                placeholder="请详细说明"
-                size="small"
-                disabled
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-tabs type="card">
-          <el-tab-pane v-if="ruleInfo" :label="ruleInfo.name">
-            <div class="el-tab_box">
-              <div class="equipmentList_box">
-                <header-title title="设备列表"> </header-title>
-                <el-table :data="deviceList" border>
-                  <el-table-column label="序号" type="index" width="50">
-                  </el-table-column>
-                  <el-table-column label="设备名称" align="center" prop="name">
-                    <template slot-scope="{ row }">
-                      <template>
-                        {{ row.name }}
-                      </template>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    label="编号"
-                    align="center"
-                    prop="codeNumber"
-                  >
-                    <template slot-scope="{ row }">
-                      <template>
-                        {{ row.codeNumber }}
-                      </template>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    label="固资编码"
-                    align="center"
-                    prop="fixCode"
-                  >
-                    <template slot-scope="{ row }">
-                      <template>
-                        {{ row.fixCode }}
-                      </template>
-                    </template>
-                  </el-table-column>
-                </el-table>
-              </div>
-              <div class="ruleMatters_box">
-                <header-title title="规则事项"> </header-title>
-                <el-table v-if="ruleInfo" :data="ruleInfo.ruleItems" border>
-                  <el-table-column label="序号" width="50">
-                    <template slot-scope="scope">
-                      <span>{{ scope.$index + 1 }}</span>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    label="零部件编码"
-                    prop="categoryCode"
-                    width="150"
-                  >
-                    <template slot-scope="scope">
-                      <div v-if="scope.row.isNew">
-                        <el-input
-                          v-model="scope.row.categoryCode"
-                          placeholder="请输入零部件编码"
-                        ></el-input>
-                      </div>
-                      <div v-else>
-                        <span>{{ scope.row.categoryCode }}</span>
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="零部件名称" prop="categoryName">
-                    <template slot-scope="scope">
-                      <div v-if="scope.row.isNew">
-                        <el-input
-                          v-model="scope.row.categoryName"
-                          placeholder="请输入零部件名称"
-                        ></el-input>
-                      </div>
-                      <div v-else>
-                        <span>{{ scope.row.categoryName }}</span>
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="事项" prop="name">
-                    <template slot-scope="scope">
-                      <div v-if="scope.row.isNew">
-                        <el-input
-                          v-model="scope.row.name"
-                          placeholder="请输入内容"
-                        ></el-input>
-                      </div>
-                      <div v-else>
-                        <span>{{ scope.row.name }}</span>
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="内容" prop="content">
-                    <template slot-scope="scope">
-                      <div v-if="scope.row.isNew">
-                        <el-input
-                          v-model="scope.row.content"
-                          placeholder="请输入内容"
-                        ></el-input>
-                      </div>
-                      <div v-else>
-                        <span>{{ scope.row.content }}</span>
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="操作指导" prop="operationGuide">
-                    <template slot-scope="scope">
-                      <div class="operationGuide_box">
-                        <div class="left_content">
-                          <template v-if="scope.row.operationGuide">
-                            <div
-                              v-for="(item, index) in scope.row.operationGuide
-                                .toolList"
-                              :key="item.id"
-                              >{{ index + 1 }}.{{ item.name }}</div
-                            >
-                          </template>
-                        </div>
-                        <div class="right_content">
-                          <template v-if="scope.row.operationGuide">
-                            <div
-                              v-for="(item, index) in scope.row.operationGuide
-                                .procedureList"
-                              :key="item.id"
-                              >{{ index + 1 }}.{{ item.content }}</div
-                            >
-                          </template>
-                        </div>
-                      </div>
-                    </template>
-                  </el-table-column>
-                  <el-table-column label="标准" prop="norm" width="100">
-                    <template slot-scope="scope">
-                      <div v-if="scope.row.isNew">
-                        <el-input
-                          v-model="scope.row.norm"
-                          placeholder="请输入内容"
-                        ></el-input>
-                      </div>
-                      <div v-else>
-                        <span>{{ scope.row.norm }}</span>
-                      </div>
-                    </template>
-                  </el-table-column>
-                </el-table>
-              </div>
-            </div>
-          </el-tab-pane>
-        </el-tabs>
-
-        <!--  -->
-      </div>
-    </el-form>
-
-    <bpmDetail
-      v-if="activeComp == 'bpm' && details && details.processInstanceId"
-      :id="details.processInstanceId"
-    >
-    </bpmDetail>
-
-    <!-- 底部审批 -->
-    <el-row
-      v-if="
-        details &&
-        visible &&
-        details.processInstanceId &&
-        details.approvalStatus == 1
-      "
-      :gutter="20"
-      style="margin-top: 40px"
-    >
-      <bpmSubmit
-        :id="details.processInstanceId"
-        :taskId="currenNode ? currenNode.id : ''"
-        :businessId="details.id"
-        :taskDefinitionKey="currenNode ? currenNode.taskDefinitionKey : ''"
-        @handleAudit="handleAudit"
-      ></bpmSubmit>
-      <bpmList
-        :id="details.processInstanceId"
-        @setCurrenNode="setCurrenNode"
-      ></bpmList>
-    </el-row>
-
-    <template v-slot:footer>
-      <el-button @click="handleClose">返回</el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import dictMixins from '@/mixins/dictMixins';
-  import { getById } from '@/api/producetaskrecordrulesrecord/index.js';
-  import { getById as maintenanceGetById } from '@/api/maintenance/patrol_maintenance.js';
-  import { getUserPage } from '@/api/system/organization';
-  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-  import bpmSubmit from './bpmSubmit.vue';
-  import bpmList from './bpmList.vue';
-
-  export default {
-    name: 'editModal',
-    mixins: [dictMixins],
-    components: {
-      bpmDetail,
-      bpmSubmit,
-      bpmList
-    },
-    data() {
-      const formBaseData = {};
-
-      return {
-        visible: false,
-        title: '表单弹窗',
-        formBaseData,
-        form: JSON.parse(JSON.stringify(formBaseData)),
-        rules: {},
-        tabOptions: [
-          { key: 'main', name: '记录表' },
-          { key: 'bpm', name: '流程详情' }
-        ],
-        // 详情或者是审核
-        type: 'detail',
-        // 当前选项
-        activeComp: 'main',
-        details: null,
-        loading: false,
-        // 计划信息
-        eamPlanInfo: null,
-        // 事项规则相关数据
-        // 负责人
-        executorList: [],
-        // 审核人
-        uerList: [],
-        deviceList: [],
-        // ruleInfo
-        ruleInfo: '',
-        currenNode: null
-      };
-    },
-    methods: {
-      // 外部调用,打开弹窗
-      open(data, type) {
-        this.type = type;
-        this.title = type == 'detail' ? '详情' : '审核';
-        this.activeComp = 'main';
-        console.log('当前行数据', data);
-        this.getDatails(data.id);
-        if (data.executeMethod == 1) {
-          // 查询事项规则信息
-          this.maintenanceGetById(data.eamPlanId);
-          // 获取审核人列表数据
-          this.getUserList();
-        }
-        this.visible = true;
-      },
-      // 关闭时清理表单
-      handleClose() {
-        this.currenNode = null;
-        this.visible = false;
-      },
-      // 获取详情
-      async getDatails(id) {
-        try {
-          this.loading = true;
-          const data = await getById(id);
-          console.log('data 详情数据', data);
-          this.details = data;
-          this.loading = false;
-        } catch (error) {
-          this.loading = false;
-        }
-      },
-      showCheckUserNames(userList) {
-        if (userList.length == 0) return '';
-
-        return userList
-          .map((i) => {
-            return i.groupName + '-' + i.userName;
-          })
-          .join(',');
-      },
-      // 事项规则 详情
-      async maintenanceGetById(id) {
-        const { data } = await maintenanceGetById(id);
-        console.log('事项规则 data', data);
-        data.executorId = data.executorId.split(',');
-        this.eamPlanInfo = data;
-        this.getUserList({ groupId: data.groupId });
-
-        this.ruleInfo = data.ruleInfo;
-        this.ruleInfo.ruleItems = data.planDeviceList[0]?.workItems || [];
-
-        this.deviceList = data.planDeviceList.map((item) => {
-          return {
-            name: item.substance.name,
-            position: item.substance.position,
-            id: item.substance.id,
-            fixCode: item.substance.fixCode,
-            codeNumber: item.substance.codeNumber
-          };
-        });
-      },
-      // 获取审核人列表、巡点检人员
-      async getUserList(params) {
-        try {
-          let data = { pageNum: 1, size: -1 };
-          // 如果传了参数就是获取巡点检人员数据
-          if (params) {
-            data = Object.assign(data, params);
-          }
-          const res = await getUserPage(data);
-          if (params) {
-            this.executorList = res.list;
-          } else {
-            this.uerList = res.list;
-          }
-        } catch (error) {}
-      },
-      // currenNode
-      setCurrenNode(currenNode) {
-        this.currenNode = currenNode;
-      },
-      // 审核通过刷新数据
-      handleAudit() {
-        this.getDatails(this.details.id);
-      }
-    }
-  };
-</script>
-
-<style scoped lang="scss">
-  .el-form-item .el-form-item {
-    margin-bottom: 0 !important;
-  }
-
-  ::v-deep .el-tab_box {
-    display: flex;
-    margin-top: 10px;
-    height: 300px;
-    width: 100%;
-
-    .equipmentList_box {
-      flex: 1;
-      height: 100%;
-      margin-right: 10px;
-      display: flex;
-      flex-direction: column;
-
-      .divider {
-        flex: 0 0 50px;
-
-        .title {
-          height: 35px;
-        }
-      }
-
-      .el-table {
-        overflow: auto;
-      }
-    }
-
-    .ruleMatters_box {
-      flex: 3;
-      height: 100%;
-      display: flex;
-      flex-direction: column;
-      overflow: hidden;
-
-      .divider {
-        flex: 0 0 50px;
-
-        .title {
-          height: 35px;
-        }
-      }
-
-      .el-table {
-        overflow: auto;
-
-        .operationGuide_box {
-          width: 100%;
-          height: 50px;
-          display: flex;
-          overflow: hidden;
-          cursor: pointer;
-
-          .left_content {
-            flex: 0 0 200px;
-            padding: 10px;
-            box-sizing: border-box;
-            border: 1px solid #c0c4cc;
-            border-radius: 10px;
-            margin-right: 10px;
-            overflow-y: auto;
-          }
-
-          .right_content {
-            flex: 1;
-            padding: 10px;
-            box-sizing: border-box;
-            border: 1px solid #c0c4cc;
-            border-radius: 10px;
-            overflow-y: auto;
-          }
-        }
-      }
-
-      .el-table::before {
-        display: none;
-      }
-    }
-  }
-</style>

+ 221 - 99
src/views/batchRecord/components/editModal.vue

@@ -110,80 +110,6 @@
           >
         </el-row>
 
-        <header-title
-          v-if="form.executeMethod == 2 && ruleDetails"
-          title="检查项目"
-          style="margin-top: 20px"
-        ></header-title>
-        <!-- 记录规则 -->
-        <div v-if="form.executeMethod == 2 && ruleDetails">
-          <el-table :data="ruleDetails" style="width: 100%">
-            <el-table-column type="index" label="序号" width="50">
-            </el-table-column>
-            <el-table-column label="检查内容">
-              <template slot-scope="scope">
-                <div>
-                  {{ scope.row.paramValue || scope.row.productName }}
-                </div>
-              </template>
-            </el-table-column>
-
-            <el-table-column label="检查工具">
-              <template slot-scope="scope">
-                <div>
-                  {{ scope.row.tools.map((i) => i.toolName).join(',') || '无' }}
-                </div>
-              </template>
-            </el-table-column>
-
-            <el-table-column label="检查情况">
-              <template slot-scope="scope">
-                <div>
-                  <div>
-                    <el-radio-group v-model="scope.row.checkStatus" disabled>
-                      <el-radio :label="1">已检查</el-radio>
-                      <el-radio :label="0">未检查</el-radio>
-                    </el-radio-group>
-                  </div>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="检查结果">
-              <template slot-scope="scope">
-                <div>
-                  <el-radio-group v-model="scope.row.checkResult" disabled>
-                    <el-radio :label="1">合格</el-radio>
-                    <el-radio :label="0">不合格</el-radio>
-                  </el-radio-group>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="描述">
-              <template slot-scope="scope">
-                <div>
-                  <el-input
-                    type="textarea"
-                    :rows="1"
-                    placeholder="请输入"
-                    v-model="scope.row.errorMsg"
-                    disabled
-                  >
-                  </el-input>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="备注">
-              <template slot-scope="scope">
-                <div
-                  style="display: flex; align-items: center; cursor: pointer"
-                >
-                  <div>{{ scope.row.remark || '无' }}</div>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-
         <header-title title="关联产品" style="margin-top: 20px"></header-title>
         <el-row style="margin-bottom: 20px">
           <el-col :span="8">
@@ -226,6 +152,14 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="牌号">
+              <el-input
+                v-model="form.brandNo"
+                placeholder="请输入牌号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row style="margin-bottom: 20px">
           <el-col :span="8">
@@ -295,10 +229,108 @@
             </el-form-item>
           </el-col>
         </el-row>
+
+        <header-title
+          v-if="form.executeMethod == 2"
+          title="检查项目"
+          style="margin-top: 20px"
+        ></header-title>
+        <!-- 记录规则 -->
+        <div v-if="form.executeMethod == 2">
+          <el-table :data="form.details" style="width: 100%">
+            <el-table-column type="index" label="序号" width="50">
+            </el-table-column>
+            <el-table-column label="检查内容">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.paramValue || scope.row.productName }}
+                </div>
+              </template>
+            </el-table-column>
+
+            <el-table-column label="检查工具">
+              <template slot-scope="{ row }">
+                <el-link :underline="false" style="cursor: pointer">
+                  <div class="ele-cell">
+                    <div @click="handleAdd(row)">
+                      {{ row.toolNames ? row.toolNames : '请选择' }}
+                    </div>
+                    <i
+                      v-if="!row.toolNames"
+                      class="el-icon-arrow-down"
+                      @click="handleAdd(row)"
+                    ></i>
+                    <i v-else class="el-icon-close" @click="clearTool(row)"></i>
+                  </div>
+                </el-link>
+              </template>
+            </el-table-column>
+
+            <!-- <el-table-column label="检查工具">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.tools.map((i) => i.toolName).join(',') || '无' }}
+                </div>
+              </template>
+            </el-table-column> -->
+
+            <el-table-column label="检查人">
+              <template slot-scope="scope">
+                <div
+                  @click="openSelectUser(scope.row)"
+                  style="display: flex; align-items: center; cursor: pointer"
+                >
+                  <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div
+                  ><i class="el-icon-caret-bottom"></i>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="检查情况">
+              <template slot-scope="scope">
+                <div>
+                  <el-radio-group v-model="scope.row.checkStatus">
+                    <el-radio :label="1">已检查</el-radio>
+                    <el-radio :label="0">未检查</el-radio>
+                  </el-radio-group>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="描述">
+              <template slot-scope="scope">
+                <div>
+                  <el-input
+                    type="text"
+                    :rows="1"
+                    placeholder="请输入"
+                    v-model="scope.row.errorMsg"
+                  >
+                    <template v-if="scope.row.unitName" slot="append">
+                      <div>{{ scope.row.unitName }}</div>
+                    </template>
+                  </el-input>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="检查结果">
+              <template slot-scope="scope">
+                <div>
+                  <el-radio-group v-model="scope.row.checkResult">
+                    <el-radio :label="1">合格</el-radio>
+                    <el-radio :label="0">不合格</el-radio>
+                  </el-radio-group>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </el-form>
     </div>
 
-    <template v-slot:footer>
+    <template v-if="type == 'detail'" v-slot:footer>
+      <el-button @click="handleClose" :loading="butLoading">关 闭</el-button>
+    </template>
+
+    <template v-else v-slot:footer>
       <template
         v-if="
           ($hasPermission('mes:producetaskrulerecord:tempsu') ||
@@ -393,7 +425,19 @@
       :isTempRecord="1"
     />
 
+    <taskDialog ref="taskDialogRef" @reload="reload" :isTempRecord="1" />
+
     <EquipmentDialog ref="EquipmentDialogRef" isMultiple="0" @choose="choose" />
+
+    <!-- 选择用户 -->
+    <SelectUser
+      ref="SelectUserRef"
+      v-model="showSelectUser"
+      multipleSelect
+      @selectUserFinished="selectUserFinished"
+    ></SelectUser>
+
+    <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
   </ele-modal>
 </template>
 
@@ -408,11 +452,14 @@
   import { tempSaveOrUpdate } from '@/api/producetaskrulerecord/index.js';
   import programRulesDialog from '@/views/produce/components/prenatalExamination/programRulesDialog.vue';
   import releaseRulesDialog from '@/views/produce/components/prenatalExamination/releaseRulesDialog.vue';
+  import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
   import { saveOrUpdate } from '@/api/producetaskrecordrulesrecord/index';
   import { getById } from '@/api/produceOrder/index.js';
   import EquipmentDialog from './EquipmentDialog.vue';
   import { recordRulesDetailPage } from '@/api/recordRules/index.js';
-  import { size } from 'ele-admin/lib/ele-avatar-list/props';
+  import SelectUser from '@/components/select/SelectUser/index.vue';
+  import toolModal from './toolModal.vue';
+  import { getById as producetaskrulerecordGetById } from '@/api/producetaskrecordrulesrecord/index.js';
 
   export default {
     name: 'editModal',
@@ -424,7 +471,10 @@
       selectDevices,
       programRulesDialog,
       releaseRulesDialog,
-      EquipmentDialog
+      EquipmentDialog,
+      taskDialog,
+      SelectUser,
+      toolModal
     },
     props: {
       // 1-产前准备,2-过程监测,3-产后检查
@@ -473,12 +523,16 @@
         recordRulesClassify: null,
         // 产品批次号
         batchNo: '',
+        // 牌号
+        brandNo: '',
         // 产品规格
         specification: '',
         // 要求生产数量
         formingNum: null,
         // 是否临时执行
-        isTempRecord: 1
+        isTempRecord: 1,
+        // 记录规则详情
+        details: []
       };
 
       var validatepProduceTaskId = (rule, value, callback) => {
@@ -530,8 +584,9 @@
         butLoading: false,
         showReleaseRulesDialog: false,
         dialogTitle: '',
-        // 记录规则详情
-        ruleDetails: null
+        showSelectUser: false,
+        currentRow: null,
+        type: ''
       };
     },
     computed: {
@@ -557,22 +612,37 @@
       // 外部调用,打开弹窗
       open(type, data) {
         console.log('data', type, data);
+        this.type = type;
         if (type == 'add') {
           this.title = `新增${this.reportWorkTypeName}事项`;
-        } else {
+        } else if (type == 'edit' || type == 'detail') {
           this.title = `编辑${this.reportWorkTypeName}事项`;
-          // 混入参数
-          this.$util.assignObject(this.form, data);
+          this.form.workOrderId = data.workOrderId;
+          this.form.id = data.id;
           console.log('this.form', this.form);
           if (this.form.workOrderId) {
             this.getProductTaskList(this.form.workOrderId);
             // 根据工单id 获取详情
             this.getWorkOrderById(this.form.workOrderId);
-            this.getRulesDetias();
+            this.getDetias();
           }
+        } else {
         }
         this.visible = true;
       },
+      // 查询详情
+      async getDetias() {
+        const data = await producetaskrulerecordGetById(this.form.id);
+        data.tools = data.tools || [];
+        this.$util.assignObject(this.form, data);
+        this.form.details = this.form.details.map((i) => {
+          return {
+            ...i,
+            toolNames: i.tools.map((i) => i.toolName).join(',')
+          };
+        });
+        console.log('this.form', this.form);
+      },
       // 查询规则详情
       async getRulesDetias() {
         if (this.form.ruleId) {
@@ -581,8 +651,19 @@
             size: 999,
             rulesId: this.form.ruleId
           });
-          this.ruleDetails = list;
-          console.log('this.ruleDetails', this.ruleDetails);
+          this.form.details = list.map((i) => {
+            return {
+              ...i,
+              id: null,
+              checkResult: null,
+              checkStatus: null,
+              checkStatusDesc: i.defaultValue || '',
+              errorMsg: '',
+              checkUsers: [],
+              paramValue: i.paramValue,
+              toolNames: i.tools.map((i) => i.toolName).join(',')
+            };
+          });
         }
       },
       // 关闭时清理表单
@@ -597,7 +678,7 @@
         this.form.executeMethod = this.form.itemType;
         this.form.ruleId = null;
         this.form.ruleName = '';
-        this.ruleDetails = null;
+        this.form.details = [];
       },
       // 去选择设备
       selectDeviceId() {
@@ -659,6 +740,7 @@
           this.form.batchNo = workOrder.batchNo;
           this.form.specification = workOrder.specification;
           this.form.formingNum = workOrder.formingNum;
+          this.form.brandNo = workOrder.brandNo;
           this.getProductTaskList(workOrder.id);
         } else {
           this.workOrderInfo = null;
@@ -672,6 +754,7 @@
           this.form.formingNum = null;
           this.form.produceTaskId = null;
           this.form.produceTaskName = '';
+          this.form.brandNo = '';
 
           this.produceTaskList = [];
         }
@@ -710,11 +793,16 @@
                 name: this.form.produceTaskName
               }
             );
-          } else {
+          } else if (this.form.executeMethod == 2) {
             this.$refs.releaseRulesDialogRef.open(
               this.form,
-              this.workOrderInfo ? this.workOrderInfo : this.form,
-              {}
+              this.workOrderInfo ? this.workOrderInfo : this.form
+            );
+          } else {
+            // 任务确认
+            this.$refs.taskDialogRef.open(
+              this.form,
+              this.workOrderInfo ? this.workOrderInfo : this.form
             );
           }
         });
@@ -729,15 +817,7 @@
           console.log('this.form', this.form);
           try {
             this.butLoading = true;
-            // 区分事项规则 和 记录规则
-            // if (this.form.executeMethod == 1) {
-            //   const data = await tempSaveOrUpdate(this.form);
-            //   // 赋值返回的id
-            //   this.form.id = data;
-            // } else {
-            //   const id = await tempSaveOrUpdate(this.form);
-            //   this.form.id = id;
-            // }
+
             const id = await tempSaveOrUpdate(this.form);
             this.form.id = id;
 
@@ -778,6 +858,48 @@
           this.form.productModel = info.model;
           this.form.specification = info.specification;
         }
+      },
+      showCheckUserNames(userList) {
+        if (userList.length == 0) return '请选择部门-选择员工';
+
+        return userList
+          .map((i) => {
+            return i.groupName + '-' + i.userName;
+          })
+          .join(',');
+      },
+      openSelectUser(row) {
+        this.currentRow = row;
+        console.log('row', row);
+        this.showSelectUser = true;
+      },
+      selectUserFinished(userInfo) {
+        console.log('userInfo', userInfo);
+        this.currentRow.checkUsers = userInfo.map((i) => {
+          // 构建参数和接口的对应上
+          return { ...i, userName: i.name, userId: i.id };
+        });
+      },
+      // 选择工具
+      handleAdd(row) {
+        this.currentRow = row;
+        this.$refs.toolModalRef.open(row.tools.map((i) => i.toolCode));
+      },
+      chooseModal(data) {
+        console.log('data', data);
+        this.currentRow.tools = data.map((i) => {
+          return {
+            toolCode: i.code,
+            toolName: i.name
+          };
+        });
+        this.currentRow.toolNames = this.currentRow.tools
+          .map((i) => i.toolName)
+          .join(',');
+      },
+      clearTool(row) {
+        row.tools = [];
+        row.toolNames = '';
       }
     }
   };

+ 27 - 22
src/views/batchRecord/components/list.vue

@@ -10,6 +10,7 @@
       :cache-key="cacheKeyUrl"
       autoAmendPage
       :pageSize="20"
+      height="600px"
     >
       <!-- 操作列 -->
       <!-- 表头工具栏 -->
@@ -35,7 +36,7 @@
         <el-link
           type="primary"
           :underline="false"
-          @click="openDetial(row, 'detail')"
+          @click="openEdit('detail', row)"
         >
           {{ row.code }}
         </el-link>
@@ -43,7 +44,10 @@
 
       <template v-slot:action="{ row }">
         <el-link
-          v-if="row.executeStatus == 0"
+          v-if="
+            row.executeStatus == 0 ||
+            (row.executeStatus == 1 && row.executeMethod == 3)
+          "
           type="primary"
           :underline="false"
           @click="openEdit('edit', row)"
@@ -54,7 +58,8 @@
         <el-link
           v-if="
             row.executeStatus == 0 ||
-            (row.executeStatus == 1 && row.executeMethod == 2)
+            (row.executeStatus == 1 && row.executeMethod == 2) ||
+            (row.executeStatus == 1 && row.executeMethod == 3)
           "
           type="primary"
           :underline="false"
@@ -62,14 +67,7 @@
         >
           执行
         </el-link>
-        <!-- <el-link
-          v-if="row.approvalStatus === 0"
-          type="primary"
-          :underline="false"
-          @click="openApproval(row)"
-        >
-          处理
-        </el-link> -->
+
         <el-popconfirm
           v-if="
             row.executeStatus == 0 &&
@@ -91,8 +89,6 @@
       :reportWorkType="reportWorkType"
       @reload="reload"
     ></editModal>
-    <!-- 详情 审核组件 -->
-    <detialsModal ref="detialsModalRef"></detialsModal>
     <!-- 记录规则 执行 -->
     <releaseRulesDialog
       ref="releaseRulesDialogRef"
@@ -105,6 +101,8 @@
       :isTempRecord="1"
     />
 
+    <taskDialog ref="taskDialogRef" @reload="reload" :isTempRecord="1" />
+
     <!-- <process-submit-dialog
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
       v-if="processSubmitDialogFlag"
@@ -123,19 +121,19 @@
     logicDeleteById
   } from '@/api/producetaskrulerecord/index';
   import editModal from './editModal.vue';
-  import detialsModal from './detialsModal.vue';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
   import releaseRulesDialog from '@/views/produce/components/prenatalExamination/releaseRulesDialog.vue';
   import programRulesDialog from '@/views/produce/components/prenatalExamination/programRulesDialog.vue';
+  import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 
   export default {
     components: {
       editModal,
-      detialsModal,
       releaseRulesDialog,
       programRulesDialog,
-      processSubmitDialog
+      processSubmitDialog,
+      taskDialog
     },
     name: 'batchRecordTable',
     mixins: [dictMixins, tableColumnsMixin],
@@ -201,7 +199,10 @@
           {
             label: '事项名称',
             prop: 'ruleName',
-            minWidth: 180
+            minWidth: 180,
+            formatter: (row) => {
+              return row.ruleName || row.itemTaskName;
+            }
           },
           {
             label: '状态',
@@ -354,10 +355,6 @@
         this.$message.warning('删除成功!');
         this.reload();
       },
-      // 打开详情
-      openDetial(row, type) {
-        this.$refs.detialsModalRef?.open(row, type);
-      },
       // 查询是否显示处理按钮
       async parameterGetByCode() {
         const data = await parameterGetByCode({
@@ -397,7 +394,15 @@
           });
           return;
         }
-        this.$refs.releaseRulesDialogRef?.open(currentItem, currentItem);
+        if (row.executeMethod == 2) {
+          return this.$refs.releaseRulesDialogRef?.open(
+            currentItem,
+            currentItem
+          );
+        }
+
+        // 任务确认
+        this.$refs.taskDialogRef?.open(currentItem, currentItem);
       }
     }
   };

+ 4 - 4
src/views/batchRecord/components/tables/batchRecordTable.vue

@@ -22,7 +22,7 @@
       </template>
     </ele-pro-table>
 
-    <detialsModal ref="detialsModalRef"></detialsModal>
+    <editModal ref="editModalRef"></editModal>
   </div>
 </template>
 
@@ -30,11 +30,11 @@
   import dictMixins from '@/mixins/dictMixins';
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import { producetaskrulerecordPage } from '@/api/producetaskrulerecord/index';
-  import detialsModal from '../detialsModal.vue';
+  import editModal from '../editModal.vue';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
-    components: { detialsModal },
+    components: { editModal },
     props: {
       tableQuery: {
         type: Object,
@@ -212,7 +212,7 @@
         this.reload(where);
       },
       goToDetail(row) {
-        this.$refs.detialsModalRef.open(row, 'detail');
+        this.$refs.editModalRef.open('detail', row);
       }
     }
   };

+ 1 - 0
src/views/batchRecord/components/tables/materialTable.vue

@@ -136,6 +136,7 @@
         ],
         cacheKeyUrl: 'mes-259231040-material-table',
         detailedShow: false,
+        selfDetailedShow: false,
         detailedObj: null
       };
     },

+ 5 - 2
src/views/batchRecord/components/tables/wmsOutInt.vue

@@ -30,6 +30,7 @@
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import { getPages } from '@/api/wms/index';
   import { sceneState } from '@/utils/dict/index';
+  import { getBatchRecordPage } from '@/api/wms/index';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
@@ -177,9 +178,11 @@
           ...order,
           pageNum: page,
           size: limit,
-          ...this.tableQuery
+          ...this.tableQuery,
+          // type  "1=入库 2=出库" 默认1
+          type: 1
         };
-        return getPages(body);
+        return getBatchRecordPage(body);
       },
       search(where) {
         console.log('where', where);

+ 261 - 0
src/views/batchRecord/components/toolModal.vue

@@ -0,0 +1,261 @@
+<template>
+  <ele-modal
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+  >
+    <el-card shadow="never">
+      <ele-split-layout
+        width="236px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <div class="ele-border-lighter split-layout-right-content">
+            <el-tree
+              :data="treeList"
+              :props="defaultProps"
+              ref="treeRef"
+              :default-expanded-keys="categoryId ? [categoryId] : []"
+              :highlight-current="true"
+              node-key="id"
+              @node-click="handleNodeClick"
+            ></el-tree>
+          </div>
+        </div>
+
+        <!-- 数据表格 -->
+        <template v-slot:content>
+          <!-- <ProductSearch @search="reload" ref="searchRef" /> -->
+          <seek-page :seekList="seekList" @search="reload"> </seek-page>
+          <ele-pro-table
+            style="min-height: 400px"
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            :selection.sync="selection"
+            row-key="id"
+          >
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="rx-sc">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import {
+    getProduceTreeByPid,
+    getList as getMaterialList
+  } from '@/api/classifyManage/index.js';
+  import SeekPage from '@/components/common/seekPage.vue';
+
+  export default {
+    components: {
+      SeekPage
+    },
+    data() {
+      return {
+        visible: false,
+        title: '选择工具',
+
+        categoryLevelId: null,
+        categoryId: 1,
+        treeList: [],
+        treeLoading: false,
+
+        defaultProps: {
+          children: 'children',
+          label: 'name'
+        },
+        type: null,
+
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            selectable: (row, index) => {
+              return !this.processData.some((it) => row.id == it.categoryId);
+            },
+            reserveSelection: true,
+            fixed: 'left'
+          },
+
+          {
+            label: '物料名称',
+            prop: 'name'
+          },
+
+          {
+            label: '物料编码',
+            prop: 'code'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+
+          {
+            prop: 'availableCountBase',
+            label: '包装库存',
+            sortable: 'custom'
+          },
+          {
+            label: '单位',
+            prop: 'weightUnit'
+          },
+
+          {
+            prop: 'packingCountBase',
+            label: '计量库存',
+            sortable: 'custom'
+          },
+
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
+
+          {
+            label: '数量',
+            prop: 'count'
+          }
+        ],
+
+        // 表格选中数据
+        selection: [],
+
+        processData: [],
+        current: null,
+        seekList: [
+          {
+            label: '编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '型号:',
+            value: 'modelType',
+            type: 'input',
+            placeholder: '请输入'
+          }
+        ]
+      };
+    },
+
+    watch: {},
+    methods: {
+      /* 表格数据源 */
+      async datasource({ page, limit, where }) {
+        const res = await getMaterialList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId
+        });
+        return res;
+      },
+
+      open(item) {
+        this.processData = item || [];
+        this.visible = true;
+
+        this.getTreeData();
+      },
+
+      async getTreeData() {
+        try {
+          this.treeLoading = true;
+
+          const res = await getProduceTreeByPid(5);
+          this.treeLoading = false;
+          if (res?.code === '0') {
+            this.treeList = res.data;
+
+            this.$nextTick(() => {
+              // 默认高亮第一级树节点
+              if (this.treeList[0]) {
+                this.rootTreeId = this.treeList[0].id;
+                this.$nextTick(() => {
+                  this.$refs.treeRef.setCurrentKey(this.treeList[0].id);
+                });
+              }
+            });
+            return this.treeList;
+          }
+        } catch (error) {}
+        this.treeLoading = false;
+      },
+
+      handleNodeClick(data) {
+        this.categoryLevelId = data.id;
+        this.$refs.table.reload({ pageNum: 1, where: {} });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.$refs.table.setSelectedRows([]);
+        this.selection = [];
+      },
+      selected() {
+        let _arr = [];
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+
+        _arr = this.selection.map((m) => {
+          m.categoryId = m.id;
+          delete m.id;
+          return {
+            ...m
+          };
+        });
+
+        this.$emit('chooseModal', _arr);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .rx-sc {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .ml60 {
+    margin-left: 60px;
+  }
+</style>

+ 35 - 3
src/views/checklistManagement/checklist.vue

@@ -22,7 +22,12 @@
           <el-link type="text" @click="checkAddConfirm('edit', row)"
             >编辑</el-link
           >
-          <el-link type="text">提交</el-link>
+          <el-link
+            type="text"
+            v-if="row.approvalStatus == 0"
+            @click="openApproval(row)"
+            >提交</el-link
+          >
           <el-popconfirm
             title="您确定要删除这条数据吗?"
             @confirm="deleteRow(row)"
@@ -45,6 +50,14 @@
       @confirm="checkAddConfirm('add', $event)"
     ></checkAdd>
     <checkDetails ref="checkDetailsRef" @reload="reload"></checkDetails>
+
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
   </div>
 </template>
 
@@ -57,10 +70,11 @@
   } from '@/api/checklistrecord/index';
   import checkAdd from './components/checkAdd.vue';
   import checkDetails from './components/checkDetails.vue';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
-    components: { checkAdd, checkDetails },
+    components: { checkAdd, checkDetails, processSubmitDialog },
     data() {
       return {
         columns: [
@@ -196,7 +210,8 @@
           }
         ],
         cacheKeyUrl: 'mes-25925-material-table',
-        tableHeight: 'calc(100vh - 320px)'
+        tableHeight: 'calc(100vh - 320px)',
+        processSubmitDialogFlag: false
       };
     },
     computed: {
@@ -269,6 +284,23 @@
         } else {
           this.tableHeight = 'calc(100vh - 320px)';
         }
+      },
+      // 提交审批
+      openApproval(row) {
+        console.log('row', row);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: row.id,
+            businessKey: 'work_order_checklist_approval',
+            formCreateUserId: row.createUserId,
+            variables: {
+              businessCode: row.code
+            }
+          };
+          console.log('1', 1);
+          this.$refs.processSubmitDialogRef.init(params);
+        });
       }
     }
   };

+ 10 - 1
src/views/checklistManagement/components/checkDetails.vue

@@ -222,6 +222,13 @@
           </td>
         </tr>
       </table>
+
+      <bpmTask
+        v-if="form.processInstanceId"
+        :id="form.processInstanceId"
+        :businessId="form.id"
+      ></bpmTask>
+
       <!-- 选择生产工单 -->
       <selectWorkOrder
         ref="selectWorkOrderRef"
@@ -269,10 +276,12 @@
     checklistrecordUpdate,
     checklistrecordKitCheck
   } from '@/api/checklistrecord/index';
+  import bpmTask from '@/components/bpmTask/bpmTask.vue';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
 
   export default {
     mixins: [dictMixins],
-    components: { selectWorkOrder, SelectUser },
+    components: { selectWorkOrder, SelectUser, bpmTask, bpmDetail },
     data() {
       const formBaseData = {
         id: null,

+ 2 - 2
src/views/checklistManagement/components/selectWorkOrder.vue

@@ -32,8 +32,8 @@
         </template>
 
         <template v-slot:QRcode="{ row }">
-          <el-link type="primary" :underline="false" @click="handleQRcode(row)"
-            >生成二维码
+          <el-link type="primary" :underline="false" @click="handleQRcode(row)">
+            生成二维码
           </el-link>
         </template>
 

+ 16 - 4
src/views/produce/components/prenatalExamination/index.vue

@@ -2,7 +2,7 @@
   <el-dialog
     title="报工"
     :visible.sync="dialogVisible"
-    width="30%"
+    width="500px"
     :before-close="handleClose"
   >
     <div>
@@ -21,7 +21,7 @@
           @click="openMaintenancePlan(item)"
         >
           <div class="circle">{{ index + 1 }}</div>
-          <div class="desc">{{ item.ruleName }}</div>
+          <div class="desc">{{ item.ruleName || item.itemTaskName }}</div>
           <el-button
             :type="item.executeStatus == 0 ? 'primary' : 'default'"
             class="status-btn"
@@ -47,6 +47,8 @@
     />
 
     <releaseRulesDialog ref="releaseRulesDialogRef" @reload="getData" />
+
+    <taskDialog ref="taskDialogRef" @reload="getData" />
   </el-dialog>
 </template>
 
@@ -55,9 +57,10 @@
   import programRulesDialog from './programRulesDialog.vue';
   import { getLastRuleRecords } from '@/api/producetaskrulerecord/index.js';
   import { getDate } from '@/utils/dateUtils';
+  import taskDialog from './taskDialog.vue';
 
   export default {
-    components: { programRulesDialog, releaseRulesDialog },
+    components: { programRulesDialog, releaseRulesDialog, taskDialog },
     data() {
       return {
         dialogVisible: false,
@@ -139,12 +142,19 @@
             this.workOrderInfo,
             this.produceTaskInfo
           );
-        } else {
+        } else if (item.executeMethod == 2) {
           this.$refs.releaseRulesDialogRef.open(
             item,
             this.workOrderInfo,
             this.produceTaskInfo
           );
+        } else {
+          // 任务确认
+          this.$refs.taskDialogRef.open(
+            item,
+            this.workOrderInfo,
+            this.produceTaskInfo
+          );
         }
       }
     }
@@ -161,6 +171,7 @@
 
   .step-item {
     display: flex;
+    flex-flow: row wrap;
     align-items: center;
     gap: 32px;
 
@@ -175,6 +186,7 @@
       justify-content: center;
       font-size: 16px;
       font-weight: bold;
+      flex-shrink: 0;
     }
 
     .desc {

+ 76 - 34
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -120,12 +120,23 @@
       </el-table-column>
 
       <el-table-column label="检查工具">
-        <template slot-scope="scope">
-          <div>
-            {{ scope.row.toolNames }}
-          </div>
+        <template slot-scope="{ row }">
+          <el-link :underline="false" style="cursor: pointer">
+            <div class="ele-cell">
+              <div @click="handleAdd(row)">
+                {{ row.toolNames ? row.toolNames : '请选择' }}
+              </div>
+              <i
+                v-if="!row.toolNames"
+                class="el-icon-arrow-down"
+                @click="handleAdd(row)"
+              ></i>
+              <i v-else class="el-icon-close" @click="clearTool(row)"></i>
+            </div>
+          </el-link>
         </template>
       </el-table-column>
+
       <el-table-column label="检查人">
         <template slot-scope="scope">
           <div
@@ -140,50 +151,39 @@
       <el-table-column label="检查情况">
         <template slot-scope="scope">
           <div>
-            <el-input
-              v-if="
-                ruleInfo && (ruleInfo.classify == 3 || ruleInfo.classify == 4)
-              "
-              type="text"
-              :rows="1"
-              v-model="scope.row.checkStatusDesc"
-            >
-              <template
-                v-if="ruleInfo.classify == 4 && scope.row.unitName"
-                slot="append"
-                >{{ scope.row.unitName }}</template
-              >
-            </el-input>
-            <el-radio-group v-else v-model="scope.row.checkStatus">
+            <el-radio-group v-model="scope.row.checkStatus">
               <el-radio :label="1">已检查</el-radio>
               <el-radio :label="0">未检查</el-radio>
             </el-radio-group>
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="检查结果">
-        <template slot-scope="scope">
-          <div>
-            <el-radio-group v-model="scope.row.checkResult">
-              <el-radio :label="1">合格</el-radio>
-              <el-radio :label="0">不合格</el-radio>
-            </el-radio-group>
-          </div>
-        </template>
-      </el-table-column>
       <el-table-column label="描述">
         <template slot-scope="scope">
           <div>
             <el-input
-              type="textarea"
+              type="text"
               :rows="1"
               placeholder="请输入"
               v-model="scope.row.errorMsg"
             >
+              <template v-if="scope.row.unitName" slot="append">
+                <div>{{ scope.row.unitName }}</div>
+              </template>
             </el-input>
           </div>
         </template>
       </el-table-column>
+      <el-table-column label="检查结果">
+        <template slot-scope="scope">
+          <div>
+            <el-radio-group v-model="scope.row.checkResult">
+              <el-radio :label="1">合格</el-radio>
+              <el-radio :label="0">不合格</el-radio>
+            </el-radio-group>
+          </div>
+        </template>
+      </el-table-column>
     </el-table>
 
     <!-- 底部按钮 -->
@@ -242,6 +242,8 @@
       multipleSelect
       @selectUserFinished="selectUserFinished"
     ></SelectUser>
+
+    <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
   </ele-modal>
 </template>
 
@@ -259,10 +261,10 @@
     logicDelete,
     getById
   } from '@/api/producetaskrecordrulesrecord/index';
-  import { row } from 'mathjs';
+  import toolModal from '@/views/batchRecord/components/toolModal.vue';
 
   export default {
-    components: { SelectUser },
+    components: { SelectUser, toolModal },
     emits: ['reload'],
     props: {
       isTempRecord: {
@@ -300,7 +302,9 @@
         reportWorkType: 0,
         specification: '',
         workOrderCode: '',
-        workOrderId: 0
+        workOrderId: 0,
+        itemTaskName: '',
+        brandNo: ''
       };
 
       return {
@@ -393,8 +397,21 @@
           this.addForm.specification = workOrderInfo.specification;
           this.addForm.workOrderCode = workOrderInfo.code;
           this.addForm.workOrderId = workOrderInfo.id;
+          this.addForm.brandNo = productionInfo.brandNo;
 
-          this.getRuleList();
+          // 临时添加存在规则详情
+
+          if (
+            this.productionInfo.details &&
+            this.productionInfo.details.length > 0
+          ) {
+            this.addForm.details = this.productionInfo.details.map((i) => {
+              i.toolNames = i.tools.map((j) => j.toolName).join(',');
+              return i;
+            });
+          } else {
+            this.getRuleList();
+          }
         }
 
         console.log('this.productionInfo', this.productionInfo);
@@ -407,6 +424,10 @@
         try {
           const data = await getById(this.productionInfo.recordId);
           console.log('dat 缓存', data);
+          data.details = data.details.map((i) => {
+            i.toolNames = i.tools.map((j) => j.toolName).join(',');
+            return i;
+          });
           this.$util.assignObject(this.addForm, data);
           this.addForm.recordRulesClassify += '';
           if (this.addForm.details?.length == 0) {
@@ -560,6 +581,27 @@
         } catch (error) {
           this.butLoading = false;
         }
+      },
+      // 选择工具
+      handleAdd(row) {
+        this.currentRow = row;
+        this.$refs.toolModalRef.open(row.tools.map((i) => i.toolCode));
+      },
+      chooseModal(data) {
+        console.log('data', data);
+        this.currentRow.tools = data.map((i) => {
+          return {
+            toolCode: i.code,
+            toolName: i.name
+          };
+        });
+        this.currentRow.toolNames = this.currentRow.tools
+          .map((i) => i.toolName)
+          .join(',');
+      },
+      clearTool(row) {
+        row.tools = [];
+        row.toolNames = '';
       }
     }
   };

+ 262 - 0
src/views/produce/components/prenatalExamination/taskDialog.vue

@@ -0,0 +1,262 @@
+<template>
+  <ele-modal
+    width="80%"
+    :visible="visible"
+    append-to-body
+    custom-class="ele-dialog-form"
+    :title="title"
+    :close-on-click-modal="false"
+    :before-close="handleBeforeClose"
+    maxable
+  >
+    <header-title title="基本信息"></header-title>
+    <el-form
+      :model="addForm"
+      :rules="formRules"
+      ref="ruleFormRef"
+      label-width="120px"
+      v-loading="loading"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="类型" required prop="itemType">
+            <DictSelection
+              dictName="记录规则事项类型"
+              clearable
+              v-model="addForm.itemType"
+              disabled
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="执行方式" required prop="executeMethod">
+            <DictSelection
+              dictName="记录规则执行方式"
+              clearable
+              v-model="addForm.executeMethod"
+              disabled
+            >
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="关联任务">
+            <el-input
+              v-model="addForm.itemTaskName"
+              placeholder="请输入任务名称"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <!-- 底部按钮 -->
+    <template #footer>
+      <div class="modal-footer">
+        <el-button
+          :loading="butLoading"
+          type="primary"
+          @click="submit('submit')"
+          :disabled="productionInfo && productionInfo.executeStatus == 2"
+        >
+          一键报工
+        </el-button>
+
+        <el-button
+          v-if="productionInfo && productionInfo.executeStatus == 2"
+          @click="handleBeforeClose"
+        >
+          关闭
+        </el-button>
+      </div>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import DictSelection from '@/components/Dict/DictSelection.vue';
+  import SelectUser from '@/components/select/SelectUser/index.vue';
+  import { saveRuleRecord } from '@/api/producetaskrulerecord/index.js';
+
+  export default {
+    components: { SelectUser },
+    emits: ['reload'],
+    props: {
+      isTempRecord: {
+        type: Number,
+        default: 0
+      }
+    },
+    data() {
+      const formDate = {
+        id: null,
+        workshopArea: '',
+        checkFinishTime: '',
+        checkValidity: null,
+        checkValidityUnit: '',
+        conclution: null,
+        isTempRecord: this.isTempRecord,
+        details: [],
+        planList: [],
+        deviceId: 0,
+        deviceName: '',
+        batchNo: '',
+        brandNo: '',
+        executeMethod: 0,
+        formingNum: 0,
+        itemType: 0,
+        produceRoutingId: 0,
+        produceRoutingName: '',
+        produceTaskConfigId: 0,
+        produceTaskId: 0,
+        produceTaskName: '',
+        productCode: '',
+        productModel: '',
+        productName: '',
+        recordRulesClassify: null,
+        ruleId: 0,
+        ruleName: '',
+        reportWorkType: 0,
+        specification: '',
+        workOrderCode: '',
+        workOrderId: 0,
+        itemTaskName: ''
+      };
+
+      return {
+        visible: false,
+        formDate,
+        addForm: JSON.parse(JSON.stringify(formDate)),
+        formRules: {
+          checkFinishTime: [
+            { required: true, message: '请选择检查完成时间', trigger: 'blur' },
+            { required: true, message: '请选择检查完成时间', trigger: 'change' }
+          ],
+          conclution: [
+            { required: true, message: '请选择结论', trigger: 'blur' },
+            { required: true, message: '请选择结论', trigger: 'change' }
+          ],
+          checkValidity: [
+            { required: true, message: '请输入检查有效期', trigger: 'blur' },
+            { required: true, message: '请输入检查有效期', trigger: 'change' }
+          ],
+          checkValidityUnit: [
+            {
+              required: true,
+              message: '请选择检查有效期单位',
+              trigger: 'blur'
+            },
+            {
+              required: true,
+              message: '请选择检查有效期单位',
+              trigger: 'change'
+            }
+          ]
+        },
+        productionInfo: null,
+        list: [],
+        ruleInfo: null,
+        showSelectUser: false,
+        currentRow: null,
+        butLoading: false,
+        // 工艺路线
+        workOrderInfo: null,
+        // 加载中 loading
+        loading: false,
+        title: '任务确认'
+      };
+    },
+    computed: {},
+    methods: {
+      open(productionInfo, workOrderInfo) {
+        console.log(
+          'productionInfo, workOrderInfo',
+          productionInfo,
+          workOrderInfo
+        );
+        this.visible = true;
+        this.productionInfo = productionInfo;
+        this.workOrderInfo = workOrderInfo;
+
+        this.addForm.batchNo = workOrderInfo.batchNo;
+        this.addForm.executeMethod = productionInfo.executeMethod;
+        this.addForm.formingNum = workOrderInfo.formingNum;
+        this.addForm.itemType = productionInfo.itemType;
+        this.addForm.produceRoutingId = workOrderInfo.produceRoutingId;
+        this.addForm.produceRoutingName = workOrderInfo.produceRoutingName;
+        this.addForm.produceTaskConfigId = productionInfo.produceTaskConfigId;
+        this.addForm.produceTaskId = productionInfo.produceTaskId;
+        this.addForm.produceTaskName = productionInfo.produceTaskName;
+        this.addForm.productCode = workOrderInfo.productCode;
+        this.addForm.productModel = workOrderInfo.model;
+        this.addForm.productName = workOrderInfo.productName;
+        this.addForm.reportWorkType = productionInfo.reportWorkType;
+        this.addForm.specification = workOrderInfo.specification;
+        this.addForm.workOrderCode = workOrderInfo.code;
+        this.addForm.workOrderId = workOrderInfo.id;
+        this.addForm.itemTaskName = productionInfo.itemTaskName;
+        this.addForm.ruleId = productionInfo.ruleId;
+        this.addForm.brandNo = productionInfo.brandNo;
+
+        console.log('this.productionInfo', this.productionInfo);
+        console.log('this.addForm', this.addForm);
+      },
+      handleBeforeClose() {
+        this.addForm = JSON.parse(JSON.stringify(this.formDate));
+        console.log('this.$refs.ruleFormRef', this.addForm);
+        this.$refs.ruleFormRef?.clearValidate();
+        this.$nextTick(() => {
+          this.visible = false;
+        });
+      },
+      // 提交
+      submit(type) {
+        console.log('this.addForm', this.addForm);
+
+        // 验证表单
+        this.$refs.ruleFormRef.validate(async (valid) => {
+          if (!valid) {
+            return;
+          }
+
+          // 提交
+          this.butLoading = true;
+          try {
+            await saveRuleRecord(this.addForm);
+            this.$message.success('报工成功!');
+
+            this.butLoading = false;
+
+            // 返回
+            this.$emit('reload');
+
+            this.handleBeforeClose();
+          } catch (error) {
+            this.butLoading = false;
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .modal-body {
+    padding: 16px;
+    min-height: 100px;
+  }
+  .modal-footer {
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    justify-content: flex-end;
+  }
+
+  .el-form-item .el-form-item {
+    margin-bottom: -5px;
+  }
+</style>

+ 14 - 8
src/views/produceOrder/print.vue

@@ -10,14 +10,14 @@
         <div style="text-align: center; font-size: 16px; font-weight: bold; margin: 5px 0;">工艺流程卡</div>
         <table style="width: 100%; border-collapse: collapse; margin-bottom: 6px;">
           <tr>
-            <td rowspan="6" style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle; text-align: center; width: 100px; height: 120px;">
+            <td rowspan="7" style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle; text-align: center; width: 100px; height: 120px;">
               <img :src="card.qrLeft" alt="二维码" style="width: 90px; height: 90px;" />
             </td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">单号</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.code }}</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">单据日期</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.createDate }}</td>
-            <td rowspan="6" style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle; text-align: center; width: 100px; height: 120px;">
+            <td rowspan="7" style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle; text-align: center; width: 100px; height: 120px;">
               <img :src="card.qrRight" alt="二维码" style="width: 90px; height: 90px;" />
             </td>
           </tr>
@@ -28,8 +28,8 @@
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.productName }}</td>
           </tr>
           <tr>
-            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">图号</td>
-            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.imgCode }}</td>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">数量</td>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.quantity }}</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">计量单位</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.unit }}</td>
           </tr>
@@ -45,6 +45,12 @@
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">机型</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.modelKey }}</td>
           </tr>
+          <tr>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">客户代号</td>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.serialNo }}</td>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">图号</td>
+            <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.imgCode }}</td>
+          </tr>
           <tr>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">计划开始时间</td>
             <td style="border: 1px solid #000; padding: 3px 5px; vertical-align: middle;">{{ card.planStartTime }}</td>
@@ -72,10 +78,10 @@
           <tbody>
             <tr v-for="(row, idx) in card.printTaskCarDetail" :key="idx">
               <td style="border: 1px solid #000; padding: 3px; text-align: center;">{{ row.taskName }}</td>
-              <td style="border: 1px solid #000; padding: 3px; text-align: center;">{{ row.formingNum || '' }}</td>
-              <td style="border: 1px solid #000; padding: 3px; text-align: center;">{{ row.formedNum || '' }}</td>
-              <td style="border: 1px solid #000; padding: 3px; text-align: center;">{{ row.qualified || '' }}</td>
-              <td style="border: 1px solid #000; padding: 3px; text-align: center;">{{ row.noQualifiedSum || '' }}</td>
+              <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
+              <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
+              <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
+              <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
               <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
               <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>
               <td style="border: 1px solid #000; padding: 3px; text-align: center;"></td>

+ 3 - 0
vue.config.js

@@ -37,6 +37,8 @@ module.exports = {
         target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金
+        // target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.30:18086',
@@ -44,6 +46,7 @@ module.exports = {
         // target: 'http://192.168.1.33:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
+        // target: 'http://116.163.22.90:86/api', // 嘉实生产
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''