修改bug

This commit is contained in:
yangjun 2026-02-06 10:06:40 +08:00
parent 241a83c38d
commit 59632e2bcc
5 changed files with 258 additions and 41 deletions

View File

@ -111,11 +111,11 @@
<a-input v-model:value="formData.lowerLimit" maxlength="10" placeholder="请输入物料下限" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="8">
<!-- <a-col :span="8">
<a-form-item label="物料标签" v-bind="validateInfos.tagType" id="ConfigMaterialInfoForm-tagType" name="izEnabled">
<j-dict-select-tag type='list' v-model:value="formData.tagType" dictCode="wl_tag_type" placeholder="请选择物料标签" />
</a-form-item>
</a-col>
</a-col> -->
<a-col :span="8">
<a-form-item label="是否医保报销" v-bind="validateInfos.izYbbx" id="ConfigMaterialInfoForm-izYbbx" name="izYbbx">
<j-dict-select-tag type='list' v-model:value="formData.izYbbx" dictCode="yn" placeholder="请选择医保报销" />

View File

@ -136,8 +136,8 @@ function handleSuperQuery(params) {
function handleDetail(record: Recordable) {
console.log("🚀 ~ handleDetail ~ record:", record)
if(record.optType == '变更'){
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}else if(record.optType == '入驻'){
registerDetailModal.value.disableSubmit = true;
registerDetailModal.value.edit(record);

View File

@ -0,0 +1,245 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuConfigSuppliersApplyForm">
<a-row>
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'基本信息1'" />
</a-col>
<a-col :span="24">
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName"
id="NuConfigSuppliersApplyForm-suppliersName" name="suppliersName">
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature_dictText"
id="NuConfigSuppliersApplyForm-suppliersNature_dictText" name="suppliersNature_dictText">
<a-input v-model:value="formData.suppliersNature_dictText" placeholder="请输入供应商性质" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress"
id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="负责人" v-bind="validateInfos.personInCharge"
id="NuConfigSuppliersApplyForm-personInCharge" name="personInCharge">
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber"
id="NuConfigSuppliersApplyForm-contactNumber" name="contactNumber">
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuConfigSuppliersApplyForm-openingBank"
name="openingBank">
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo"
id="NuConfigSuppliersApplyForm-openingBankNo" name="openingBankNo">
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="营业执照" v-bind="validateInfos.imgPath" id="NuConfigSuppliersApplyForm-imgPath"
name="imgPath">
<!-- <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>
</a-form-item>
</a-col>
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;" >
<SectionDivider :title="'审核信息'" />
</a-col>
<a-col :span="24" >
<a-form-item label="审核状态" v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus"
name="applyStatus">
<!-- <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-option value="2">审核通过</a-select-option>
<a-select-option value="3">审核驳回</a-select-option>
<a-select-option value="4">待审核</a-select-option>
<a-select-option value="5">审核驳回</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24" v-show="formData.applyStatus == 3 || formData.applyStatus == 5" v-if="!disabled">
<a-form-item label="驳回原因" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent"
name="applyContent">
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因" rows="4"></a-textarea>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuConfigSuppliersApply.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
suppliersName: '',
suppliersNature: '',
suppliersAddress: '',
personInCharge: '',
contactNumber: '',
supplyState: '',
openingBank: '',
openingBankNo: '',
wechartId: '',
imgPath: '',
applyStatus: '',
applyContent: '',
suppliersNature_dictText: '',
applyId: '',
suppliersId: '',
sourceType: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
if (model.applyStatus == '1') {
createMessage.warning('请选择审核状态');
confirmLoading.value = false;
return;
}
if (model.applyStatus == 3 && !model.applyContent) {
createMessage.warning('请填写驳回原因');
confirmLoading.value = false;
return;
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 0px;
}
</style>

View File

@ -58,10 +58,10 @@
disabled></j-image-upload>
</a-form-item>
</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;" v-if="!disabled">
<SectionDivider :title="'审核信息'" />
</a-col>
<a-col :span="24">
<a-col :span="24" v-if="!disabled">
<a-form-item label="审核状态" v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus"
name="applyStatus">
<!-- <a-input v-model:value="formData.applyStatus" placeholder="请输入审核状态" ></a-input> -->
@ -76,7 +76,7 @@
</a-select>
</a-form-item>
</a-col>
<a-col :span="24" v-show="formData.applyStatus == 3">
<a-col :span="24" v-show="formData.applyStatus == 3" v-if="!disabled">
<a-form-item label="驳回原因" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent"
name="applyContent">
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因" rows="4"></a-textarea>

View File

@ -2,30 +2,20 @@
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<NuConfigSuppliersApplyForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</NuConfigSuppliersApplyForm>
<NuConfigSuppliersApplyDetailForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</NuConfigSuppliersApplyDetailForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
</a-drawer>
<!-- 信息变更审核 -->
<a-drawer :title="title" width="900" :visible="upInfoVisible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleUpInfoCancel">
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleUpInfoCancel">关闭</a-button>
<a-button type="primary" @click="handleUpInfoOk">确认</a-button>
</template>
<NuConfigSuppliersApplyUpInfoForm v-if="upInfoVisible" ref="upInfoForm" @ok="handleUpInfoCancel" :formBpm="false">
</NuConfigSuppliersApplyUpInfoForm>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuConfigSuppliersApplyForm from './NuConfigSuppliersApplyForm.vue'
import NuConfigSuppliersApplyUpInfoForm from './NuConfigSuppliersApplyUpInfoForm.vue'
import NuConfigSuppliersApplyDetailForm from './NuConfigSuppliersApplyDetailForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
@ -60,18 +50,7 @@ function edit(record) {
});
}
/**
* 编辑
* @param record
*/
function upInfoEdit(record) {
title.value = disableSubmit.value ? '详情' : '信息变更审核';
upInfoVisible.value = true;
nextTick(() => {
upInfoForm.value.show(record);
});
}
/**
* 确定按钮点击事件
*/
@ -102,18 +81,11 @@ function handleUpInfoCancel() {
upInfoVisible.value = false
emit('success');
}
/**
* 信息变更确认
*/
function handleUpInfoOk() {
upInfoForm.value.submitForm();
}
defineExpose({
add,
edit,
upInfoEdit,
disableSubmit,
});
</script>