|
|
@@ -228,12 +228,6 @@
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
- <bpmTask
|
|
|
- v-if="form.processInstanceId"
|
|
|
- :id="form.processInstanceId"
|
|
|
- :businessId="form.id"
|
|
|
- ></bpmTask>
|
|
|
-
|
|
|
<!-- 选择生产工单 -->
|
|
|
<selectWorkOrder
|
|
|
ref="selectWorkOrderRef"
|
|
|
@@ -251,15 +245,15 @@
|
|
|
</el-form>
|
|
|
|
|
|
<template v-slot:footer>
|
|
|
- <!-- <el-button
|
|
|
- v-if="type != 'detail'"
|
|
|
+ <el-button
|
|
|
+ v-if="type != 'detail' && !form.approvalStatus"
|
|
|
type="primary"
|
|
|
- @click="submit"
|
|
|
+ @click="submit('submit')"
|
|
|
:loading="butLoading"
|
|
|
- >提 交</el-button
|
|
|
- > -->
|
|
|
+ >保存并提交</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
- v-if="type != 'detail'"
|
|
|
+ v-if="type != 'detail' && !form.approvalStatus"
|
|
|
type="primary"
|
|
|
@click="submit('save')"
|
|
|
:loading="butLoading"
|
|
|
@@ -269,6 +263,13 @@
|
|
|
</template>
|
|
|
|
|
|
<detailsPop ref="detailsRef"> </detailsPop>
|
|
|
+
|
|
|
+ <process-submit-dialog
|
|
|
+ :processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
+ v-if="processSubmitDialogFlag"
|
|
|
+ ref="processSubmitDialogRef"
|
|
|
+ :isNotNeedProcess="false"
|
|
|
+ ></process-submit-dialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -287,10 +288,18 @@
|
|
|
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
import detailsPop from '@/views/produceOrder/components/details/index.vue';
|
|
|
import { getById as getworkOrderById } from '@/api/produceOrder/index';
|
|
|
+ import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
- components: { selectWorkOrder, SelectUser, bpmTask, bpmDetail, detailsPop },
|
|
|
+ components: {
|
|
|
+ selectWorkOrder,
|
|
|
+ SelectUser,
|
|
|
+ bpmTask,
|
|
|
+ bpmDetail,
|
|
|
+ detailsPop,
|
|
|
+ processSubmitDialog
|
|
|
+ },
|
|
|
props: {
|
|
|
// 保存是否关闭弹窗
|
|
|
saveClose: {
|
|
|
@@ -349,7 +358,8 @@
|
|
|
activeComp: 'main',
|
|
|
showSelectUser: false,
|
|
|
// 0 生产验收人 1 质检验收人
|
|
|
- selectUserType: 0
|
|
|
+ selectUserType: 0,
|
|
|
+ processSubmitDialogFlag: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -381,6 +391,17 @@
|
|
|
}
|
|
|
},
|
|
|
deep: true
|
|
|
+ },
|
|
|
+ processSubmitDialogFlag(val) {
|
|
|
+ if (!val) {
|
|
|
+ // 关闭后 刷新详情
|
|
|
+ if (this.form.id) {
|
|
|
+ this.$emit('reload');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.handleClose();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -562,25 +583,32 @@
|
|
|
// 存在id 则更新
|
|
|
if (this.form.id) {
|
|
|
await checklistrecordUpdate(this.form);
|
|
|
- this.$message.success('操作成功');
|
|
|
+ this.$message.success('操作成功,已保存到放行单列表');
|
|
|
} else {
|
|
|
this.form.createUserName = this.$store.state.user.info.name;
|
|
|
const data = await checklistrecordSave(this.form);
|
|
|
- this.$message.success('操作成功');
|
|
|
+ this.$message.success('操作成功,已保存到放行单列表');
|
|
|
this.form.id = data;
|
|
|
- this.getCheckDetails(data);
|
|
|
+ this.getCheckDetails(this.form.id);
|
|
|
}
|
|
|
} else {
|
|
|
+ // submit 保存并提交审核
|
|
|
+ // 存在id 则更新
|
|
|
+ if (this.form.id) {
|
|
|
+ await checklistrecordUpdate(this.form);
|
|
|
+ } else {
|
|
|
+ this.form.createUserName = this.$store.state.user.info.name;
|
|
|
+ const data = await checklistrecordSave(this.form);
|
|
|
+ this.form.id = data;
|
|
|
+ await this.getCheckDetails(this.form.id);
|
|
|
+ }
|
|
|
+ this.openApproval();
|
|
|
}
|
|
|
this.butLoading = false;
|
|
|
this.$emit('reload');
|
|
|
} catch (error) {
|
|
|
this.butLoading = false;
|
|
|
}
|
|
|
-
|
|
|
- if (type != 'save') {
|
|
|
- this.handleClose();
|
|
|
- }
|
|
|
} else {
|
|
|
// 转换为数组
|
|
|
const firstErrorField = Object.values(invalidFields);
|
|
|
@@ -781,6 +809,47 @@
|
|
|
console.log('row', row);
|
|
|
const info = await getworkOrderById(row.workOrderId);
|
|
|
this.$refs.detailsRef.open(info);
|
|
|
+ },
|
|
|
+ // 提交审批
|
|
|
+ openApproval() {
|
|
|
+ const row = this.form;
|
|
|
+ console.log('row', row);
|
|
|
+
|
|
|
+ let businessType = this.getDictValue(
|
|
|
+ '放行类型',
|
|
|
+ row.checklistType + ''
|
|
|
+ );
|
|
|
+ console.log('businessType', businessType);
|
|
|
+ this.processSubmitDialogFlag = true;
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ let params = {
|
|
|
+ businessId: row.id,
|
|
|
+ businessKey: 'work_order_checklist_approval',
|
|
|
+ formCreateUserId: row.createUserId,
|
|
|
+ variables: {
|
|
|
+ businessCode: row.code,
|
|
|
+ businessName: '放行单',
|
|
|
+ businessType: businessType
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ if (this.clientEnvironmentId == 5) {
|
|
|
+ // 嘉实环境
|
|
|
+ const data = await getCategoryByCode(row.orders[0]?.productCode);
|
|
|
+
|
|
|
+ // 判断品类
|
|
|
+ if (data && data.categoryLevelCodePath?.includes('W3-209')) {
|
|
|
+ // 药品
|
|
|
+ params.businessKey = 'work_order_checklist_approval1';
|
|
|
+ } else {
|
|
|
+ // 器械
|
|
|
+ params.businessKey = 'work_order_checklist_approval';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('params', params);
|
|
|
+ this.$refs.processSubmitDialogRef.init(params);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|