Parcourir la source

批记录管理-记录管理-功能完善

lucw il y a 9 mois
Parent
commit
4d81239d30

+ 2 - 1
src/components/Dict/DictSelection.vue

@@ -62,7 +62,8 @@
           this.$emit('itemChange', this.getDict(this.dictName, val));
         },
         get() {
-          return this.value;
+          // 字典列表code是string类型 这里也需要转换
+          return this.value + '';
         }
       }
     },

+ 92 - 0
src/components/processSubmitDialog/api.js

@@ -0,0 +1,92 @@
+import request from '@/utils/request';
+
+export async function getProcessDefinitionBpmnXML(id) {
+  const res = await request({
+    url: '/bpm/process-definition/get-bpmn-xml?id=' + id,
+    method: 'get'
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getTaskAssignRuleList(query) {
+  const res = await request({
+    url: '/bpm/task-assign-rule/list',
+    method: 'get',
+    params: query
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function processInstanceCreateAPI(data) {
+  const res = await request(
+    {
+      url: '/bpm/process-instance/create',
+      method: 'post',
+      data
+    },
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getModelPage(query) {
+  const res = await request({
+    url: '/bpm/model/page',
+    method: 'get',
+    params: query
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getProcessDefinitionInfo(params) {
+  const res = await request({
+    url: `/bpm/process-definition/get`,
+    method: 'get',
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function listAllUserBind() {
+  const res = await request.get('/main/user/listAllUserBind');
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 获取用户组精简信息列表
+export async function listSimpleUserGroups() {
+  const res = await request({
+    url: '/bpm/user-group/list-all-simple',
+    method: 'get'
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 产品分类指定code查询
+ */
+
+export async function getProduceTreeByCode(code) {
+  const res = await request.get(
+    `/main/categoryLevel/getProduceTreeByPid?code=${code}`,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 441 - 0
src/components/processSubmitDialog/processSubmitDialog.vue

@@ -0,0 +1,441 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible="processSubmitDialogFlag"
+    title="提交审核"
+    append-to-body
+    :close-on-click-modal="false"
+    width="50%"
+    :before-close="cancel"
+  >
+    <!--    <el-steps :active="active" align-center style="transform: scale(0.8)">-->
+    <!--      <el-step title="流程发起"></el-step>-->
+    <!--      <el-step title="流程通知"></el-step>-->
+    <!--    </el-steps>-->
+
+    <el-form
+      ref="form"
+      :rules="rules"
+      class="el-form-box"
+      :model="form"
+      label-width="80px"
+    >
+      <el-row v-show="active == 0">
+        <el-col :span="12">
+          <el-form-item label="流程分类">
+            <ele-tree-select
+              @change="changeLCFL"
+              clearable
+              ref="processTypeRef"
+              filterable
+              :data="LCFLList"
+              v-model="form.LCFL"
+              childrenKey="children"
+              valueKey="id"
+              labelKey="name"
+              placeholder="请选择"
+              default-expand-all
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="发起流程">
+            <el-select
+              filterable
+              v-model="form.FQLC"
+              @change="changeFQLC"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in processList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row v-show="active == 0">
+        <el-col :span="12">
+          <el-form-item label="流程名称">
+            <el-input v-model="form.name" clearable></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="流程标识">
+            <el-input v-model="form.key" disabled></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle
+        v-show="active == 0"
+        title="流程执行人/流程图"
+        style="margin-top: 30px"
+      ></headerTitle>
+      <el-table
+        v-show="active == 0"
+        :data="datasource"
+        border
+        style="margin-bottom: 10px"
+      >
+        <el-table-column
+          label="任务节点"
+          align="center"
+          prop="taskDefinitionName"
+          width="140"
+          fixed
+        />
+        <el-table-column
+          label="执行人"
+          align="center"
+          prop="options"
+          min-width="140px"
+        >
+          <template v-slot="scope">
+            <div v-if="scope.row.type !== 60 && scope.row.options.length > 0">
+              <el-tag
+                size="medium"
+                :key="option"
+                v-for="option in scope.row.options"
+              >
+                {{ getAssignRuleOptionName(scope.row, option) }}
+              </el-tag>
+            </div>
+
+            <el-tag size="medium" v-if="scope.row.type === 60">
+              {{ getAssignRuleOptionName(scope.row) }}
+            </el-tag>
+          </template>
+        </el-table-column>
+      </el-table>
+      <my-process-viewer
+        v-show="active == 0"
+        style="min-width: 100%; height: 200px"
+        key="designer"
+        v-model="bpmnXML"
+      />
+      <el-table v-show="active == 1" :data="form.noticeScope" border>
+        <el-table-column
+          label="类型"
+          align="center"
+          prop="taskDefinitionName"
+          width="140"
+          fixed
+        />
+        <el-table-column
+          label="结果"
+          align="center"
+          prop="options"
+          min-width="140px"
+        >
+        </el-table-column>
+      </el-table>
+    </el-form>
+
+    <div slot="footer">
+      <!--      <el-button-->
+      <!--        type="primary"-->
+      <!--        size="small"-->
+      <!--        v-if="active == 0"-->
+      <!--        @click="() => (active = 1)"-->
+      <!--        >下一步-->
+      <!--      </el-button>-->
+      <!--      <el-button-->
+      <!--        type="primary"-->
+      <!--        size="small"-->
+      <!--        v-if="active == 1"-->
+      <!--        @click="() => (active = 0)"-->
+      <!--        >上一步-->
+      <!--      </el-button>-->
+      <el-button type="primary" size="small" @click="submit" v-click-once
+        >提交</el-button
+      >
+      <el-button
+        v-if="isNotNeedProcess && $hasPermission('eom:common:submitrelease')"
+        type="primary"
+        size="small"
+        @click="submit1"
+        v-click-once
+        >提交并发布</el-button
+      >
+      <el-button size="small" @click="cancel">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+<script>
+  import {
+    getModelPage,
+    getProcessDefinitionBpmnXML,
+    getProcessDefinitionInfo,
+    getTaskAssignRuleList,
+    listAllUserBind,
+    listSimpleUserGroups,
+    processInstanceCreateAPI,
+    getProduceTreeByCode
+  } from './api';
+  import { listRoles } from '@/api/system/role';
+  import { listOrganizations } from '@/api/system/organization';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getByCode } from '@/api/system/dictionary-data';
+
+  export default {
+    name: 'processSubmitDialog',
+    mixins: [dictMixins],
+    props: {
+      processSubmitDialogFlag: {
+        type: Boolean,
+        default: false
+      },
+      isNotNeedProcess: {
+        type: Boolean,
+        default: false
+      },
+      approvalStatus: {
+        type: Number,
+        default: 2
+      },
+      apiFunName: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          LCFL: '',
+          FQLC: '',
+          processDefinitionId: '',
+          name: '',
+          businessId: '',
+          noticeScope: [],
+          businessKey: '',
+          formCreateUserId: ''
+        },
+        active: 0,
+        bpmnXML: null,
+        LCFLList: [],
+        processList: [],
+        datasource: [],
+        roleOptions: [],
+        deptOptions: [],
+        deptTreeOptions: [],
+        postOptions: [],
+        userOptions: [],
+        userGroupOptions: [],
+        dictList: {},
+        rules: {}
+      };
+    },
+    async created() {
+      let typeObj = await getProduceTreeByCode('PROCESS001');
+      this.LCFLList = typeObj[0].children;
+
+      // 获得角色列表
+      this.roleOptions = [];
+      listRoles({
+        current: 1,
+        size: 9999
+      }).then((data) => {
+        this.roleOptions.push(...data.list);
+      });
+      // 获得部门列表
+      this.deptOptions = [];
+      this.deptTreeOptions = [];
+      listOrganizations().then((data) => {
+        this.deptOptions.push(...data);
+        this.deptTreeOptions.push(...this.handleTree(data, 'id'));
+      });
+      // 获得岗位列表 暂无岗位概念
+      this.postOptions = [];
+      /*listSimplePosts().then(response => {
+  this.postOptions.push(...response.data);
+});*/
+      // 获得用户列表
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+      // 获得用户组列表
+      this.userGroupOptions = [];
+      listSimpleUserGroups().then((response) => {
+        this.userGroupOptions.push(...response);
+      });
+
+      //this.dictEnum['工作流任务分配自定义脚本']
+      await this.getDictList('bpm_task_assign_script');
+      await this.getDictList('work_type');
+    },
+    methods: {
+      init(row = {}) {
+        this.form = { ...this.form, ...row };
+        // this.form.businessId = row.id;
+        // this.form.businessKey = row.businessKey;
+        // this.form.formCreateUserId = row.createUserId;
+        this.getDefaultInfo(row.businessKey);
+      },
+      async getDefaultInfo(businessKey) {
+        let info = await getProcessDefinitionInfo({ code: businessKey });
+        this.form.LCFL = info?.category;
+        this.form.FQLC = info?.modelId;
+        this.form.name = info?.name;
+        this.form.key = info?.key;
+        this.form.processDefinitionId = info?.id;
+        if (this.form.LCFL) await this.getProcessList(this.form.LCFL);
+        if (this.form.FQLC) {
+          await this.getProcessDefinitionBpmnXMLInfo(info.id);
+          await this.getTaskAssignRuleListInfo({
+            modelId: info.modelId,
+            processDefinitionId: info.id
+          });
+        }
+      },
+      async changeLCFL(val) {
+        this.bpmnXML = null;
+        this.form.processDefinitionId = null;
+        this.form.FQLC = null;
+        await this.getProcessList(val);
+      },
+      async getProcessList(val) {
+        let params = {
+          pageNo: 1,
+          pageSize: 999,
+          processTypeId: val
+        };
+        const { list } = await getModelPage(params);
+        this.processList = list.filter((item) => item.processDefinition);
+      },
+      async changeFQLC(val) {
+        if (!val) return;
+        let find = this.processList.find((item) => item.id === val) || {};
+        this.form.name = find.name;
+        this.form.key = find.key;
+        this.form.processDefinitionId = find.processDefinition.id;
+        await this.getProcessDefinitionBpmnXMLInfo(find.processDefinition.id);
+        await this.getTaskAssignRuleListInfo({
+          modelId: find.id,
+          processDefinitionId: find.processDefinition.id
+        });
+      },
+      async getProcessDefinitionBpmnXMLInfo(val) {
+        // 加载流程图
+        this.bpmnXML = await getProcessDefinitionBpmnXML(val);
+      },
+      async getTaskAssignRuleListInfo(find) {
+        this.datasource = await getTaskAssignRuleList({
+          modelId: find.modelId,
+          processDefinitionId: find.processDefinitionId
+        });
+      },
+      getAssignRuleOptionName(row, option) {
+        console.log(row, 'row');
+        if (row.type == 10) {
+          for (const roleOption of this.roleOptions) {
+            if (roleOption.id === option) {
+              return roleOption.name;
+            }
+          }
+        } else if (row.type === 20 || row.type === 21) {
+          for (const deptOption of this.deptOptions) {
+            if (deptOption.id === option) {
+              return deptOption.name;
+            }
+          }
+        } else if (row.type === 22) {
+          option = option + ''; // 转换成 string
+          return this.getDictV('work_type', option);
+        } else if (row.type === 30 || row.type === 31 || row.type === 32) {
+          for (const userOption of this.userOptions) {
+            if (userOption.id === option) {
+              return userOption.nickname || userOption.name;
+            }
+          }
+        } else if (row.type === 40) {
+          for (const userGroupOption of this.userGroupOptions) {
+            if (userGroupOption.id === option) {
+              return userGroupOption.name;
+            }
+          }
+        } else if (row.type === 50) {
+          option = option + ''; // 转换成 string
+          return this.getDictV('bpm_task_assign_script', option);
+        } else if (row.type === 60) {
+          return row.variableName;
+        }
+        return '未知(' + option + ')';
+      },
+      /**
+       * 构造树型结构数据
+       * @param {*} data 数据源
+       * @param {*} id id字段 默认 'id'
+       * @param {*} parentId 父节点字段 默认 'parentId'
+       * @param {*} children 孩子节点字段 默认 'children'
+       * @param {*} rootId 根Id 默认 0
+       */
+      handleTree(data, id, parentId, children, rootId) {
+        id = id || 'id';
+        parentId = parentId || 'parentId';
+        children = children || 'children';
+        rootId =
+          rootId ||
+          Math.min.apply(
+            Math,
+            data.map((item) => {
+              return item[parentId];
+            })
+          ) ||
+          0;
+        //对源数据深度克隆
+        const cloneData = JSON.parse(JSON.stringify(data));
+        //循环所有项
+        const treeData = cloneData.filter((father) => {
+          let branchArr = cloneData.filter((child) => {
+            //返回每一项的子级数组
+            return father[id] == child[parentId];
+          });
+          branchArr.length > 0 ? (father.children = branchArr) : '';
+          //返回第一层
+          return father[parentId] == rootId;
+        });
+        return treeData !== '' ? treeData : data;
+      },
+      getDictV(code, val) {
+        if (!this.dictList[code]) return '';
+        return this.dictList[code].find((item) => item.value == val)?.label;
+      },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList[code] = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+      },
+      async submit() {
+        await processInstanceCreateAPI(this.form);
+        this.$message('提交审核成功');
+        this.$emit('reload');
+        this.cancel();
+      },
+      async submit1() {
+        let params = {
+          id: this.form.businessId,
+          approvalStatus: this.approvalStatus,
+          ...this.form
+        };
+        await this[this.apiFunName](params);
+        //await processInstanceUpdateStatusAPI(params);
+        this.$message('提交发布成功');
+        this.$emit('reload');
+        this.cancel();
+      },
+      cancel() {
+        this.$emit('update:processSubmitDialogFlag', false);
+      }
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 1 - 1
src/mixins/dictMixins.js

@@ -8,7 +8,7 @@ export default {
     };
   },
   computed: {
-    ...mapGetters(['getDictValue', 'dict', 'getDict', 'getDictList'])
+    ...mapGetters(['getDictValue', 'dict', 'getDict', 'getDictListByName'])
   },
   methods: {
     ...mapActions('dict', ['requestDict'])

+ 1 - 1
src/store/getters.js

@@ -21,7 +21,7 @@ export default {
     return obj && obj.dictValue;
   },
   // 根据字典enumName 获取字典列表 label value 格式
-  getDictList: (sate) => (enumName) => {
+  getDictListByName: (sate) => (enumName) => {
     const dList = sate.dict[dictEnum[enumName]] || [];
     return dList.map((i) => {
       return {

+ 640 - 31
src/views/batchRecord/components/detialsModal.vue

@@ -6,15 +6,473 @@
     @close="handleClose"
     resizable
     maxable
+    width="80%"
   >
-    <el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
-      <el-form-item label="用户名" prop="username">
-        <el-input v-model="form.username" placeholder="请输入用户名"></el-input>
-      </el-form-item>
-
-      <el-form-item label="邮箱" prop="email">
-        <el-input v-model="form.email" placeholder="请输入邮箱"></el-input>
-      </el-form-item>
+    <div
+      class="switch"
+      v-if="type == 'detail' && details && details.executeMethod == 2"
+      :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"
+      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.taskTypeName" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8"> </el-col>
+        <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-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>
+      <!-- 记录规则 -->
+      <el-row v-if="details.executeMethod == 2" style="margin-bottom: 20px">
+        <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="记录规则分类">
+            <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-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-col :span="8"> </el-col>
+      </el-row>
+
+      <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>
 
     <template v-slot:footer>
@@ -25,6 +483,10 @@
 
 <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';
+
   export default {
     name: 'editModal',
     mixins: [dictMixins],
@@ -39,44 +501,191 @@
         title: '表单弹窗',
         formBaseData,
         form: JSON.parse(JSON.stringify(formBaseData)),
-        rules: {
-          username: [
-            { required: true, message: '请输入用户名', trigger: 'blur' }
-          ],
-          email: [
-            { required: true, message: '请输入邮箱', trigger: 'blur' },
-            { type: 'email', message: '邮箱格式不正确', trigger: 'change' }
-          ]
-        }
+        rules: {},
+        tabOptions: [
+          { key: 'main', name: '记录表' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        // 详情或者是审核
+        type: 'detail',
+        // 当前选项
+        activeComp: 'main',
+        details: null,
+        loading: false,
+        // 计划信息
+        eamPlanInfo: null,
+        // 事项规则相关数据
+        // 负责人
+        executorList: [],
+        // 审核人
+        uerList: [],
+        deviceList: [],
+        // ruleInfo
+        ruleInfo: ''
       };
     },
     methods: {
       // 外部调用,打开弹窗
-      open(data, title) {
+      open(data, type) {
+        this.type = type;
+        this.details = data;
+        this.title = type == 'detail' ? '详情' : '审核';
         console.log('data', data);
-        if (data) {
-          this.form = Object.assign({}, this.formBaseData, data);
+        this.getDatails(data.id);
+        if (data.executeMethod == 1) {
+          // 查询事项规则信息
+          this.maintenanceGetById(data.eamPlanId);
+          // 获取审核人列表数据
+          this.getUserList();
         }
-        this.title = title || '表单弹窗';
         this.visible = true;
       },
       // 关闭时清理表单
       handleClose() {
         this.visible = false;
-        this.form = JSON.parse(JSON.stringify(this.formBaseData));
-        this.$refs.formRef && this.$refs.formRef.resetFields();
       },
-      // 提交
-      submit() {
-        this.$refs.formRef.validate((valid) => {
-          if (valid) {
-            this.$emit('submit', this.form);
-            this.handleClose();
-          }
+      // 获取详情
+      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) {}
       }
     }
   };
 </script>
 
-<style scoped lang="scss"></style>
+<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>

+ 59 - 3
src/views/batchRecord/components/editModal.vue

@@ -150,6 +150,7 @@
                 v-model="form.produceTaskId"
                 placeholder="请选择工序"
                 style="width: 100%"
+                @change="produceTaskIdChange"
               >
                 <el-option
                   v-for="item in produceTaskList"
@@ -224,7 +225,11 @@
     </div>
 
     <template v-slot:footer>
-      <el-button type="primary" @click="save" :loading="butLoading"
+      <el-button
+        type="primary"
+        @click="save"
+        :loading="butLoading"
+        :disabled="form.executeStatus != 0"
         >保存</el-button
       >
       <el-button type="primary" @click="submit" :loading="butLoading"
@@ -277,10 +282,13 @@
   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 { saveOrUpdate } from '@/api/producetaskrecordrulesrecord/index';
+  import { getById } from '@/api/produceOrder/index.js';
 
   export default {
     name: 'editModal',
     mixins: [dictMixins],
+    emits: ['reload'],
     components: {
       selectMatterRules,
       selectReleaseRules,
@@ -304,10 +312,14 @@
         deviceName: '',
         // 记录规则执行方式,参考字典项:record_rules_execute_method
         executeMethod: '1',
+        // 执行状态
+        executeStatus: 0,
         // 记录规则事项类型,参考字典项:record_rules_item_type
         itemType: '1',
         // 工序ID
         produceTaskId: null,
+        // 工序名称
+        produceTaskName: '',
         // 记录规则报工类型,参考字典项:record_rules_report_work_type
         reportWorkType: null,
         // 规则id,包括事项规则id,记录规则id,根据事项类型区分
@@ -413,6 +425,14 @@
           this.title = `新增${this.reportWorkTypeName}事项`;
         } else {
           this.title = `编辑${this.reportWorkTypeName}事项`;
+          // 混入参数
+          this.$util.assignObject(this.form, data);
+          console.log('this.form', this.form);
+          if (this.form.workOrderId) {
+            this.getProductTaskList(this.form.workOrderId);
+            // 根据工单id 获取详情
+            this.getWorkOrderById(this.form.workOrderId);
+          }
         }
         this.visible = true;
       },
@@ -507,6 +527,8 @@
           this.form.specification = null;
           this.form.formingNum = null;
           this.form.produceTaskId = null;
+          this.form.produceTaskName = '';
+
           this.produceTaskList = [];
         }
       },
@@ -516,6 +538,15 @@
         console.log('data 工序列表', data);
         this.produceTaskList = data;
       },
+      // 选择工序
+      produceTaskIdChange() {
+        const prodceTask = this.produceTaskList.find(
+          (i) => i.taskId == this.form.produceTaskId
+        );
+        if (prodceTask) {
+          this.form.produceTaskName = prodceTask.taskTypeName;
+        }
+      },
       // 执行
       submit() {
         this.$refs.formRef.validate((valid) => {
@@ -524,6 +555,11 @@
           }
           this.form.reportWorkType = this.reportWorkType;
           console.log('this.form', this.form);
+
+          if (!this.workOrderInfo) {
+            return this.$message.warning('工单信息不能为空');
+          }
+
           if (this.form.executeMethod == 1) {
             // 设备保养计划相关逻辑
             this.dialogTitle = '新增设备保养计划';
@@ -551,8 +587,19 @@
           console.log('this.form', this.form);
           try {
             this.butLoading = true;
-            const data = await tempSaveOrUpdate(this.form);
+            // 区分事项规则 和 记录规则
+            if (this.form.executeMethod == 1) {
+              const data = await tempSaveOrUpdate(this.form);
+              // 赋值返回的id
+              this.form.id = data;
+            } else {
+              const id = await saveOrUpdate(this.addForm);
+              this.addForm.id = id;
+            }
             this.$message.success('保存成功!');
+            this.$emit('reload');
+
+            // this.handleClose();
             this.butLoading = false;
           } catch (error) {
             this.butLoading = false;
@@ -560,7 +607,16 @@
         });
       },
       // 执行完成
-      reload() {}
+      reload() {
+        this.$emit('reload');
+        this.handleClose();
+      },
+      // 获取工单详情
+      async getWorkOrderById(id) {
+        const data = await getById(id);
+        console.log('工单详情', data);
+        this.workOrderInfo = data;
+      }
     }
   };
 </script>

+ 107 - 9
src/views/batchRecord/components/list.vue

@@ -28,6 +28,7 @@
           v-if="row.executeStatus == 0"
           type="primary"
           :underline="false"
+          @click="openEdit('edit', row)"
         >
           编辑
         </el-link>
@@ -36,20 +37,26 @@
           v-if="row.executeStatus != 0"
           type="primary"
           :underline="false"
+          @click="openDetial(row, 'detail')"
         >
           详情
         </el-link>
         <el-link
-          v-if="row.executeStatus != 2"
+          v-if="
+            row.executeStatus == 0 ||
+            (row.executeStatus == 1 && row.executeMethod == 2)
+          "
           type="primary"
           :underline="false"
+          @click="execute(row)"
         >
           执行
         </el-link>
         <el-link
-          v-if="row.executeStatus == 2"
+          v-if="row.executeStatus == 2 && showBut"
           type="primary"
           :underline="false"
+          @click="openApproval"
         >
           处理
         </el-link>
@@ -57,7 +64,7 @@
           v-if="row.executeStatus == 0"
           title="确定要删除此用户吗?"
           class="ele-action"
-          @confirm="deleteById(item)"
+          @confirm="deleteById(row)"
         >
           <template v-slot:reference>
             <el-link type="danger" :underline="false"> 删除 </el-link>
@@ -65,8 +72,33 @@
         </el-popconfirm>
       </template>
     </ele-pro-table>
-    <!-- 详情-审核组件 -->
-    <editModal ref="detailsRef" :reportWorkType="reportWorkType"></editModal>
+    <!-- 编辑添加组件 -->
+    <editModal
+      ref="detailsRef"
+      :reportWorkType="reportWorkType"
+      @reload="reload"
+    ></editModal>
+    <!-- 详情 审核组件 -->
+    <detialsModal ref="detialsModalRef"></detialsModal>
+    <!-- 记录规则 执行 -->
+    <releaseRulesDialog
+      ref="releaseRulesDialogRef"
+      @reload="reload"
+      :isTempRecord="1"
+    />
+    <programRulesDialog
+      ref="programRulesDialogRef"
+      @reload="reload"
+      :isTempRecord="1"
+    />
+
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
   </el-card>
 </template>
 
@@ -78,10 +110,20 @@
     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 { getById } from '@/api/produceOrder/index.js';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 
   export default {
     components: {
-      editModal
+      editModal,
+      detialsModal,
+      releaseRulesDialog,
+      programRulesDialog,
+      processSubmitDialog
     },
     name: 'batchRecordTable',
     mixins: [dictMixins, tableColumnsMixin],
@@ -207,7 +249,11 @@
             align: 'center',
             fixed: 'right'
           }
-        ]
+        ],
+        // 是否展示处理按钮
+        showBut: false,
+        showReleaseRulesDialog: false,
+        processSubmitDialogFlag: false
       };
     },
     computed: {
@@ -224,7 +270,7 @@
             value: 'itemType',
             type: 'select',
             placeholder: '请选择',
-            planList: this.getDictList('事项类型')
+            planList: this.getDictListByName('事项类型')
           },
           {
             label: '产品名称:',
@@ -259,6 +305,7 @@
       this.requestDict('事项类型');
       this.requestDict('报工类型');
       this.requestDict('执行方式');
+      this.parameterGetByCode();
     },
     methods: {
       // 刷新表格
@@ -281,7 +328,7 @@
           reportWorkType: this.reportWorkType
         });
       },
-      // 打开详情
+      // 打开编辑新增
       openEdit(type, row) {
         this.$refs.detailsRef.open(type, row);
       },
@@ -289,6 +336,57 @@
       async deleteById(item) {
         await logicDeleteById(item.id);
         this.$message.warning('删除成功!');
+        this.reload();
+      },
+      // 打开详情
+      openDetial(row, type) {
+        this.$refs.detialsModalRef?.open(row, type);
+      },
+      // 查询是否显示处理按钮
+      async parameterGetByCode() {
+        const data = await parameterGetByCode({
+          code: 'form_submission_requires_approval',
+          moduleCode: 'mes_'
+        });
+        this.showBut = data?.tenantId == '1';
+        console.log('是否显示处理按钮(审批)', this.showBut);
+      },
+      // 提交审批
+      openApproval(row) {
+        console.log('row', row);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: row.id,
+            businessKey: 'mes_produce_task_record_rule_check',
+            formCreateUserId: row.createUserId,
+            variables: {
+              businessCode: row.code
+            }
+          };
+          console.log('1', 1);
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      // 执行
+      async execute(row) {
+        console.log('row', row);
+        const workOrderInfo = await getById(row.workOrderId);
+
+        if (row.executeMethod == 1) {
+          // 设备保养计划相关逻辑
+          this.$refs.programRulesDialogRef.init(
+            { ...row, recordId: row.id },
+            workOrderInfo,
+            {}
+          );
+          return;
+        }
+        console.log('workOrderInfo', workOrderInfo);
+        this.$refs.releaseRulesDialogRef?.open(
+          { ...row, recordId: row.id },
+          workOrderInfo
+        );
       }
     }
   };

+ 1 - 1
src/views/batchRecord/index.vue

@@ -125,7 +125,7 @@
             name: '领料单'
           },
           {
-            name: '退单'
+            name: '退单'
           },
           {
             name: '报工'

+ 2 - 6
src/views/produce/components/prenatalExamination/index.vue

@@ -46,11 +46,7 @@
       @reload="getData"
     />
 
-    <releaseRulesDialog
-      v-model="showReleaseRulesDialog"
-      ref="releaseRulesDialogRef"
-      @reload="getData"
-    />
+    <releaseRulesDialog ref="releaseRulesDialogRef" @reload="getData" />
   </el-dialog>
 </template>
 
@@ -81,7 +77,7 @@
     },
     methods: {
       open(workOrderInfo, produceTaskInfo, reportWorkType) {
-        console.log('workOrderInfo 工艺路线', workOrderInfo);
+        console.log('workOrderInfo 工单信息', workOrderInfo);
         console.log('工序信息', produceTaskInfo);
         this.workOrderInfo = workOrderInfo;
         this.produceTaskInfo = produceTaskInfo;

+ 6 - 6
src/views/produce/components/prenatalExamination/operationGuideDialog.vue

@@ -233,10 +233,10 @@
     margin-top: 20px;
   }
 
-  :deep(.el-dialog:not(.ele-dialog-form)
-      .el-dialog__body
-      .el-form
-      .el-form-item:last-child) {
-    margin-bottom: 22px;
-  }
+  // :deep(.el-dialog:not(.ele-dialog-form)
+  //     .el-dialog__body
+  //     .el-form
+  //     .el-form-item:last-child) {
+  //   margin-bottom: 22px;
+  // }
 </style>

+ 3 - 5
src/views/produce/components/prenatalExamination/programRulesDialog.vue

@@ -427,8 +427,6 @@
         productionInfo: null,
         // 工艺路线
         workOrderInfo: null,
-        // 工序信息
-        produceTaskInfo: null,
         // 加载状态
         loading: false,
         // 提交状态
@@ -465,11 +463,10 @@
         this.visible = false;
       },
       // 初始化
-      async init(row, workOrderInfo, produceTaskInfo) {
-        console.log(row);
+      async init(row, workOrderInfo) {
+        console.log('row, workOrderInfo', row, workOrderInfo);
         this.productionInfo = row;
         this.workOrderInfo = workOrderInfo;
-        this.produceTaskInfo = produceTaskInfo;
         this.visible = true;
 
         if (
@@ -656,6 +653,7 @@
               produceRoutingName: this.workOrderInfo.produceRoutingName,
               produceTaskConfigId: this.productionInfo.produceTaskConfigId,
               produceTaskId: this.productionInfo.produceTaskId,
+              produceTaskName: this.productionInfo.produceTaskName,
               reportWorkType: this.productionInfo.reportWorkType,
               ruleId: this.ruleInfo.id,
               ruleName: this.ruleInfo.name,

+ 17 - 23
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -254,7 +254,6 @@
     logicDelete,
     getById
   } from '@/api/producetaskrecordrulesrecord/index';
-  import { tempSaveOrUpdateAndSubmit } from '@/api/producetaskrulerecord/index.js';
 
   export default {
     components: { SelectUser },
@@ -285,6 +284,7 @@
         produceRoutingName: '',
         produceTaskConfigId: 0,
         produceTaskId: 0,
+        produceTaskName: '',
         productCode: '',
         productModel: '',
         productName: '',
@@ -335,8 +335,6 @@
         butLoading: false,
         // 工艺路线
         workOrderInfo: null,
-        //工序信息
-        produceTaskInfo: null,
         // 加载中 loading
         loading: false
       };
@@ -358,11 +356,15 @@
       }
     },
     methods: {
-      open(productionInfo, workOrderInfo, produceTaskInfo) {
+      open(productionInfo, workOrderInfo) {
+        console.log(
+          'productionInfo, workOrderInfo',
+          productionInfo,
+          workOrderInfo
+        );
         this.visible = true;
         this.productionInfo = productionInfo;
         this.workOrderInfo = workOrderInfo;
-        this.produceTaskInfo = produceTaskInfo;
 
         // 存在缓存记录
         if (this.productionInfo.recordId != null) {
@@ -377,6 +379,7 @@
           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;
@@ -506,26 +509,14 @@
           // 提交
           this.butLoading = true;
           try {
-            if (this.isTempRecord) {
-              if (type == 'submit') {
-                await tempSaveOrUpdateAndSubmit(this.addForm);
-                this.$message.success('报工成功!');
-              } else {
-                const id = await saveOrUpdate(this.addForm);
-                this.addForm.id = id;
-                this.$message.success('缓存成功!');
-              }
+            if (type == 'submit') {
+              await saveOrUpdateAndSubmit(this.addForm);
+              this.$message.success('报工成功!');
             } else {
-              if (type == 'submit') {
-                await saveOrUpdateAndSubmit(this.addForm);
-                this.$message.success('报工成功!');
-              } else {
-                const id = await saveOrUpdate(this.addForm);
-                this.addForm.id = id;
-                this.$message.success('缓存成功!');
-              }
+              const id = await saveOrUpdate(this.addForm);
+              this.addForm.id = id;
+              this.$message.success('缓存成功!');
             }
-
             this.butLoading = false;
 
             // 返回
@@ -553,6 +544,9 @@
           this.getRuleList();
           this.$message.success('缓存清空成功!');
           this.productionInfo.executeStatus = 0;
+          if (this.isTempRecord) {
+            this.handleBeforeClose();
+          }
           this.$emit('reload');
         } catch (error) {
           this.butLoading = false;

+ 3 - 3
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // 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.125:18086',
         // target: 'http://192.168.1.116:18086',
@@ -41,9 +41,9 @@ module.exports = {
         // target: 'http://192.168.1.30:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.33:18086',
-        target: 'http://192.168.1.251:18186',
+        // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18087',
-        // target: 'http://192.168.1.116:18086',
+        target: 'http://192.168.1.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''