供应商审核改为:审核驳回时必填审核原因

This commit is contained in:
1378012178@qq.com 2026-01-14 16:19:26 +08:00
parent 9f0d625d4b
commit fdd12f9edd
1 changed files with 208 additions and 196 deletions

View File

@ -2,59 +2,71 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled"> <JFormContainer :disabled="disabled">
<template #detail> <template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuConfigSuppliersApplyForm"> <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuConfigSuppliersApplyForm">
<a-row> <a-row>
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;"> <a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'基本信息'" /> <SectionDivider :title="'基本信息'" />
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName" id="NuConfigSuppliersApplyForm-suppliersName" name="suppliersName"> <a-form-item label="供应商名称" v-bind="validateInfos.suppliersName"
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" disabled ></a-input> id="NuConfigSuppliersApplyForm-suppliersName" name="suppliersName">
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature_dictText" id="NuConfigSuppliersApplyForm-suppliersNature_dictText" name="suppliersNature_dictText"> <a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature_dictText"
<a-input v-model:value="formData.suppliersNature_dictText" placeholder="请输入供应商性质" disabled ></a-input> id="NuConfigSuppliersApplyForm-suppliersNature_dictText" name="suppliersNature_dictText">
<a-input v-model:value="formData.suppliersNature_dictText" placeholder="请输入供应商性质" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress" id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress"> <a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress"
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" disabled ></a-input> id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="负责人" v-bind="validateInfos.personInCharge" id="NuConfigSuppliersApplyForm-personInCharge" name="personInCharge"> <a-form-item label="负责人" v-bind="validateInfos.personInCharge"
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" disabled ></a-input> id="NuConfigSuppliersApplyForm-personInCharge" name="personInCharge">
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber" id="NuConfigSuppliersApplyForm-contactNumber" name="contactNumber"> <a-form-item label="联系电话" v-bind="validateInfos.contactNumber"
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" disabled ></a-input> id="NuConfigSuppliersApplyForm-contactNumber" name="contactNumber">
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuConfigSuppliersApplyForm-openingBank" name="openingBank"> <a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuConfigSuppliersApplyForm-openingBank"
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" disabled ></a-input> name="openingBank">
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo" id="NuConfigSuppliersApplyForm-openingBankNo" name="openingBankNo"> <a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo"
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" disabled ></a-input> id="NuConfigSuppliersApplyForm-openingBankNo" name="openingBankNo">
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" disabled></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="资质照片" :labelCol="labelCol2" :wrapperCol="wrapperCol2" v-bind="validateInfos.imgPath" id="NuConfigSuppliersApplyForm-imgPath" name="imgPath"> <a-form-item label="资质照片" :labelCol="labelCol2" :wrapperCol="wrapperCol2" v-bind="validateInfos.imgPath"
id="NuConfigSuppliersApplyForm-imgPath" name="imgPath">
<!-- <a-input v-model:value="formData.imgPath" placeholder="请输入资质照片" disabled ></a-input> --> <!-- <a-input v-model:value="formData.imgPath" placeholder="请输入资质照片" disabled ></a-input> -->
<j-image-upload v-if="formData.imgPath" :fileMax="1" :value="opeMediaAddress + formData.imgPath" disabled></j-image-upload> <j-image-upload v-if="formData.imgPath" :fileMax="1" :value="opeMediaAddress + formData.imgPath"
disabled></j-image-upload>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;"> <a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'审核信息'" /> <SectionDivider :title="'审核信息'" />
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="审核状态" :labelCol="labelCol2" :wrapperCol="wrapperCol2" v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus" name="applyStatus"> <a-form-item label="审核状态" :labelCol="labelCol2" :wrapperCol="wrapperCol2"
v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus" name="applyStatus">
<!-- <a-input v-model:value="formData.applyStatus" placeholder="请输入审核状态" ></a-input> --> <!-- <a-input v-model:value="formData.applyStatus" placeholder="请输入审核状态" ></a-input> -->
<a-select v-model:value="formData.applyStatus" placeholder="请选择审核状态" style="width: 200px" :disabled="false"> <a-select v-model:value="formData.applyStatus" placeholder="请选择审核状态" style="width: 200px"
:disabled="false">
<a-select-option value="1">待审核</a-select-option> <a-select-option value="1">待审核</a-select-option>
<a-select-option value="2">审核通过</a-select-option> <a-select-option value="2">审核通过</a-select-option>
<a-select-option value="3">审核驳回</a-select-option> <a-select-option value="3">审核驳回</a-select-option>
@ -62,9 +74,10 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="审核备注" :labelCol="labelCol2" :wrapperCol="wrapperCol2" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent" name="applyContent"> <a-form-item label="审核备注" :labelCol="labelCol2" :wrapperCol="wrapperCol2"
v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent" name="applyContent">
<!-- <a-input v-model:value="formData.applyContent" placeholder="请输入审核备注" ></a-input> --> <!-- <a-input v-model:value="formData.applyContent" placeholder="请输入审核备注" ></a-input> -->
<a-textarea v-model:value="formData.applyContent" placeholder="请输入审核备注" rows="4" ></a-textarea> <a-textarea v-model:value="formData.applyContent" placeholder="请输入审核备注" rows="4"></a-textarea>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -75,24 +88,24 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue'; import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuConfigSuppliersApply.api'; import { saveOrUpdate } from '../NuConfigSuppliersApply.api';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'; import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue'; import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})}, formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true } formBpm: { type: Boolean, default: true }
}); });
const formRef = ref(); const formRef = ref();
const useForm = Form.useForm; const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']); const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({ const formData = reactive<Record<string, any>>({
id: '', id: '',
suppliersName: '', suppliersName: '',
suppliersNature: '', suppliersNature: '',
@ -108,61 +121,60 @@ const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
applyContent: '', applyContent: '',
suppliersNature_dictText: '', suppliersNature_dictText: '',
applyId: '', applyId: '',
suppliersId : '', suppliersId: '',
}); });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } }); const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } }); const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } }); const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref<boolean>(false); const confirmLoading = ref<boolean>(false);
// //
const validatorRules = reactive({ const validatorRules = reactive({
applyContent: [{ required: true, message: '请输入审核备注!' }], });
}); const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
// //
const disabled = computed(()=>{ const disabled = computed(() => {
if(props.formBpm === true){ if (props.formBpm === true) {
if(props.formData.disabled === false){ if (props.formData.disabled === false) {
return false; return false;
}else{ } else {
return true; return true;
} }
} }
return props.formDisabled; return props.formDisabled;
}); });
/** /**
* 新增 * 新增
*/ */
function add() { function add() {
edit({}); edit({});
} }
/** /**
* 编辑 * 编辑
*/ */
function edit(record) { function edit(record) {
nextTick(() => { nextTick(() => {
resetFields(); resetFields();
const tmpData = {}; const tmpData = {};
Object.keys(formData).forEach((key) => { Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){ if (record.hasOwnProperty(key)) {
tmpData[key] = record[key] tmpData[key] = record[key]
} }
}) })
// //
Object.assign(formData, tmpData); Object.assign(formData, tmpData);
}); });
} }
/** /**
* 提交数据 * 提交数据
*/ */
async function submitForm() { async function submitForm() {
try { try {
// //
await validate(); await validate();
@ -193,12 +205,12 @@ const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
} }
} }
} }
if(model.applyStatus=='1'){ if (model.applyStatus == '1') {
createMessage.warning('请选择审核状态'); createMessage.warning('请选择审核状态');
confirmLoading.value = false; confirmLoading.value = false;
return; return;
} }
if(model.applyStatus=='3' && model.applyContent==''){ if (model.applyStatus == 3 && !model.applyContent) {
createMessage.warning('请填写审核备注'); createMessage.warning('请填写审核备注');
confirmLoading.value = false; confirmLoading.value = false;
return; return;
@ -215,18 +227,18 @@ const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
.finally(() => { .finally(() => {
confirmLoading.value = false; confirmLoading.value = false;
}); });
} }
defineExpose({ defineExpose({
add, add,
edit, edit,
submitForm, submitForm,
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
padding: 0px; padding: 0px;
} }
</style> </style>