|
@@ -14,23 +14,42 @@
|
|
<el-radio :label="2" :value="2">驳回</el-radio>
|
|
<el-radio :label="2" :value="2">驳回</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
- <el-form-item v-if="approvalStatus == 1">
|
|
|
|
|
|
+<div v-if="formData.status === 0">
|
|
|
|
+ <el-form-item v-if="approvalStatus === 1">
|
|
<el-input
|
|
<el-input
|
|
v-model="formData.processInstanceId"
|
|
v-model="formData.processInstanceId"
|
|
style="width:800px; height: 200px"
|
|
style="width:800px; height: 200px"
|
|
- placeholder="请输入审批建议"
|
|
|
|
|
|
+ placeholder="请输入审批建议11"
|
|
type="textarea"
|
|
type="textarea"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-if="approvalStatus === 2">
|
|
<el-form-item v-if="approvalStatus === 2">
|
|
<el-input
|
|
<el-input
|
|
- v-model="formData.rejectionReasons"
|
|
|
|
|
|
+ v-model="formData.processInstanceId"
|
|
style="width:800px ;height: 200px"
|
|
style="width:800px ;height: 200px"
|
|
- placeholder="请输入驳回原因"
|
|
|
|
|
|
+ placeholder="请输入审批建议"
|
|
type="textarea"
|
|
type="textarea"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+</div>
|
|
|
|
+ <div v-if="formData.status === 1">
|
|
|
|
+ <el-form-item v-if="approvalStatus === 3">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formData.rejectionReasons"
|
|
|
|
+ style="width:800px; height: 200px"
|
|
|
|
+ placeholder="请输入审批建议22"
|
|
|
|
+ type="textarea"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item v-if="approvalStatus === 4">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formData.rejectionReasons"
|
|
|
|
+ style="width:800px ;height: 200px"
|
|
|
|
+ placeholder="请输入审批建议"
|
|
|
|
+ type="textarea"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
</el-form>
|
|
</el-form>
|
|
<div>
|
|
<div>
|
|
<el-button :disabled="formLoading" type="primary" @click="submitApproval">确定</el-button>
|
|
<el-button :disabled="formLoading" type="primary" @click="submitApproval">确定</el-button>
|
|
@@ -77,7 +96,7 @@ const open = async (id?: number) => {
|
|
if (id) {
|
|
if (id) {
|
|
formLoading.value = true
|
|
formLoading.value = true
|
|
try {
|
|
try {
|
|
- console.log('hhh', formData.value)
|
|
|
|
|
|
+ console.log('2345234', formData.value)
|
|
// formData.value.id = id
|
|
// formData.value.id = id
|
|
formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
|
|
formData.value = await SpecimenOutboundApi.getSpecimenOutbound(id)
|
|
formData.value.processInstanceId = undefined
|
|
formData.value.processInstanceId = undefined
|
|
@@ -93,8 +112,8 @@ defineExpose({ open })// 提供 open 方法,用于打开弹窗
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
|
const submitApproval = async () => {
|
|
const submitApproval = async () => {
|
|
- if (approvalStatus.value === 2 && (formData.value.rejectionReasons == '' || formData.value.rejectionReasons == undefined) ) {
|
|
|
|
- message.error(t('请输入驳回原因'));
|
|
|
|
|
|
+ if ((approvalStatus.value === 2 && (formData.value.processInstanceId == '' || formData.value.processInstanceId == undefined )) || (approvalStatus.value == 4 && (formData.value.rejectionReasons == '' || formData.value.rejectionReasons == undefined ))) {
|
|
|
|
+ message.error(t('请输入审批意见'));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
@@ -102,16 +121,21 @@ const submitApproval = async () => {
|
|
let statusCode;
|
|
let statusCode;
|
|
console.log('tj', approvalStatus.value)
|
|
console.log('tj', approvalStatus.value)
|
|
if (approvalStatus.value === 1) {
|
|
if (approvalStatus.value === 1) {
|
|
- statusCode = formData.value.status === 0 ? 1 : 5 ;
|
|
|
|
|
|
+ statusCode = formData.value.status === 1 ;
|
|
} else if (approvalStatus.value === 2){
|
|
} else if (approvalStatus.value === 2){
|
|
- statusCode = formData.value.status === 0 ? 2 : 6;
|
|
|
|
- }
|
|
|
|
|
|
+ statusCode = formData.value.status === 2;
|
|
|
|
+ } if (approvalStatus.value === 3) {
|
|
|
|
+ statusCode = formData.value.status === 5 ;
|
|
|
|
+ } else if (approvalStatus.value === 4){
|
|
|
|
+ statusCode = formData.value.status === 6;
|
|
|
|
+ }
|
|
const data = {
|
|
const data = {
|
|
...formData.value,
|
|
...formData.value,
|
|
status: statusCode,
|
|
status: statusCode,
|
|
processInstanceId: formData.value.processInstanceId,
|
|
processInstanceId: formData.value.processInstanceId,
|
|
rejectionReasons: formData.value.rejectionReasons,
|
|
rejectionReasons: formData.value.rejectionReasons,
|
|
};
|
|
};
|
|
|
|
+ console.log('Sending data:', data);
|
|
await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
|
|
await SpecimenOutboundApi.ApprovalSpecimenOutbound(data);
|
|
message.success(t('审批成功'));
|
|
message.success(t('审批成功'));
|
|
dialogVisible.value = false;
|
|
dialogVisible.value = false;
|