|
@@ -14,7 +14,7 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item v-if="approvalStatus === 1">
|
|
|
+ <el-form-item v-if="approvalStatus == 1">
|
|
|
<el-input
|
|
|
v-model="formData.processInstanceId"
|
|
|
style="width:800px; height: 200px"
|
|
@@ -68,17 +68,16 @@ const formData = ref({
|
|
|
/** 打开弹窗 */
|
|
|
const open = async (id?: number) => {
|
|
|
dialogVisible.value = true
|
|
|
- approvalStatus.value = 0
|
|
|
+ approvalStatus.value = 1
|
|
|
chkRemarks.value = '';
|
|
|
formData.value.id = id;
|
|
|
-
|
|
|
resetForm()
|
|
|
console.log(id)
|
|
|
|
|
|
}
|
|
|
-defineExpose({ open })// 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
|
+defineExpose({ open })// 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
/** 提交审批 */
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
@@ -113,15 +112,20 @@ const submitApproval = async () => {
|
|
|
try {
|
|
|
formLoading.value = true;
|
|
|
let statusCode;
|
|
|
- if (approvalStatus.value === 1) {
|
|
|
- statusCode = formData.value.status === 1 ? 1 : 5;
|
|
|
- } else {
|
|
|
- statusCode = formData.value.status === 1 ? 2 : 6;
|
|
|
+ let processInstanceId;
|
|
|
+ if (approvalStatus.value === 0) {
|
|
|
+ statusCode = formData.value.status === 0 ? 1 : 2 ;
|
|
|
+ processInstanceId = formData.value.status === 1 ?
|
|
|
+ formData.value.processInstanceId : formData.value.rejectionReasons;
|
|
|
+ } else if (approvalStatus.value === 1){
|
|
|
+ statusCode = formData.value.status === 1 ? 5 : 6;
|
|
|
+ processInstanceId = formData.value.status === 2 ?
|
|
|
+ formData.value.rejectionReasons : formData.value.processInstanceId;
|
|
|
}
|
|
|
const data = {
|
|
|
...formData.value,
|
|
|
status: statusCode,
|
|
|
- processInstanceId: approvalStatus.value === 2 ? formData.value.rejectionReasons : formData.value.processInstanceId,
|
|
|
+ processInstanceId: processInstanceId,
|
|
|
};
|
|
|
await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
|
|
|
message.success(t('审批成功'));
|