修改bug

This commit is contained in:
yangjun 2026-02-04 09:52:53 +08:00
parent c3307322f4
commit 2eae348127
7 changed files with 760 additions and 2 deletions

View File

@ -15,6 +15,7 @@ export const columns: BasicColumn[] = [
title: '供应商性质',
align: 'center',
dataIndex: 'suppliersNature_dictText',
width: 100,
},
{
title: '供应商地址',
@ -25,11 +26,13 @@ export const columns: BasicColumn[] = [
title: '负责人',
align: 'center',
dataIndex: 'personInCharge',
width: 100,
},
{
title: '联系电话',
align: 'center',
dataIndex: 'contactNumber',
width: 140,
},
{
title: '开户行',
@ -50,6 +53,7 @@ export const columns: BasicColumn[] = [
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
return render.renderImage({ text: imageUrl });
},
width: 120,
},
{
title: '审核状态',
@ -67,11 +71,95 @@ export const columns: BasicColumn[] = [
}
return applyStatus;
},
width: 100,
},
{
title: '审核备注',
align: 'center',
dataIndex: 'applyContent',
width: 150,
},
];
export const columns2: BasicColumn[] = [
{
title: '供应商名称',
align: 'center',
dataIndex: 'suppliersName',
},
{
title: '供应商性质',
align: 'center',
dataIndex: 'suppliersNature_dictText',
width: 100,
},
{
title: '供应商地址',
align: 'center',
dataIndex: 'suppliersAddress',
},
{
title: '负责人',
align: 'center',
dataIndex: 'personInCharge',
width: 100,
},
{
title: '联系电话',
align: 'center',
dataIndex: 'contactNumber',
width: 140,
},
{
title: '开户行',
align: 'center',
dataIndex: 'openingBank',
},
{
title: '开户行账号',
align: 'center',
dataIndex: 'openingBankNo',
},
{
title: '资质照片',
align: 'center',
dataIndex: 'imgPath',
customRender: ({ text }) => {
// 如果 text 为空或 null/undefined使用默认图片
const imageUrl = text ? opeMediaAddress + text : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
return render.renderImage({ text: imageUrl });
},
width: 120,
},
{
title: '审核状态',
align: 'center',
dataIndex: 'applyStatus',
customRender: ({ text, record }) => {
console.log(text);
var applyStatus = '';
if (text == '1' || text == '4') {
applyStatus = '待审核';
} else if (text == '2') {
applyStatus = '审核通过';
} else if (text == '3' || text == '5') {
applyStatus = '审核未通过';
}
return applyStatus;
},
width: 100,
},
{
title: '审核备注',
align: 'center',
dataIndex: 'applyContent',
width: 150,
},
{
title: '类型',
align: 'center',
dataIndex: 'optType',
width: 100,
},
];

View File

@ -0,0 +1,219 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="suppliersName">
<template #label><span title="供应商名称">供应商名称</span></template>
<j-input placeholder="请输入供应商名称" v-model:value="queryParam.suppliersName" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="personInCharge">
<template #label><span title="负责人">负责人</span></template>
<j-input placeholder="请输入负责人" v-model:value="queryParam.personInCharge" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="applyStatus">
<template #label><span title="审核状态">审核状态</span></template>
<a-select v-model:value="queryParam.applyStatus" placeholder="请选择审核状态" style="width: 200px"
:disabled="false">
<a-select-option value="1,2,3,4,5">全部</a-select-option>
<a-select-option value="1,4">待审核</a-select-option>
<a-select-option value="2">审核通过</a-select-option>
<a-select-option value="3,5">审核驳回</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
<!-- <template v-if="column.dataIndex ==='imgPath'">
<j-image-upload :fileMax="1" :value="opeMediaAddress + text" disabled></j-image-upload>
</template> -->
</template>
</BasicTable>
<!-- 表单区域 -->
<NuConfigSuppliersApplyHistoryModal ref="registerModal" @success="handleSuccess"></NuConfigSuppliersApplyHistoryModal>
</div>
</template>
<script lang="ts" name="configSuppliersApply-nuConfigSuppliersApply" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns2, superQuerySchema } from './NuConfigSuppliersApply.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuConfigSuppliersApply.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuConfigSuppliersApplyHistoryModal from './components/NuConfigSuppliersApplyHistoryModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const suppliersId = ref<any>('');
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'nu_config_suppliers_apply',
api: list,
columns:columns2,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 100,
fixed: 'right',
},
beforeFetch: async (params) => {
if (!queryParam.applyStatus) {
// queryParam.applyStatus = '1,2,3,4,5'
}
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 6
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
queryParam.suppliersId = suppliersId.value;
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
searchQuery();
}
//
function init(record) {
console.log("🚀 ~ init ~ record:", record)
suppliersId.value = record.suppliersId;
searchQuery();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,94 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<NuConfigSuppliersAuditHistoryList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</NuConfigSuppliersAuditHistoryList>
<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>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuConfigSuppliersAuditHistoryList from './NuConfigSuppliersAuditHistoryList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('1400');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const upInfoForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = "审核历史";
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
/**
* 信息变更确认
*/
function handleUpInfoOk() {
upInfoForm.value.submitForm();
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -58,6 +58,7 @@
</BasicTable>
<!-- 表单区域 -->
<NuConfigSuppliersApplyModal ref="registerModal" @success="handleSuccess"></NuConfigSuppliersApplyModal>
<NuConfigSuppliersAuditHistoryModal ref="registerHistoryModal" @success="handleSuccess"></NuConfigSuppliersAuditHistoryModal>
</div>
</template>
@ -69,6 +70,7 @@ import { columns, superQuerySchema } from './NuConfigSuppliersApply.data';
import { listPage, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuConfigSuppliersApply.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuConfigSuppliersApplyModal from './components/NuConfigSuppliersApplyModal.vue'
import NuConfigSuppliersAuditHistoryModal from './NuConfigSuppliersAuditHistoryModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
@ -78,6 +80,7 @@ const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerHistoryModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
@ -88,7 +91,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
canResize: false,
useSearchForm: false,
actionColumn: {
width: 160,
width: 240,
fixed: 'right',
},
beforeFetch: async (params) => {
@ -156,6 +159,13 @@ function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 审核历史详情
*/
function handleHistoryList(record: Recordable) {
registerHistoryModal.value.disableSubmit = true;
registerHistoryModal.value.edit(record);
}
/**
* 删除事件
@ -206,6 +216,10 @@ function getTableAction(record) {
onClick: handleUpEdit.bind(null, record),
ifShow: record.applyStatus == '4'
},
{
label: '审核历史',
onClick: handleHistoryList.bind(null, record),
},
];
}

View File

@ -0,0 +1,258 @@
<template>
<div class="container2" >
<a-row>
<a-col :span="24">
<a-table :dataSource="filteredTableData" :columns="columns" :pagination="false" bordered size="small"
:rowClassName="setRowClassName">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'd1'">
<span>{{ applyObj[record.d1] }}</span>
</template>
<template v-if="column.dataIndex === 'd2' && isImg(record.d1)">
<JImageUpload v-if="!!record.d2" :fileMax="1" :value="opeMediaAddress + record.d2" disabled>
</JImageUpload>
<span v-else>未上传</span>
</template>
<template v-if="column.dataIndex === 'd3' && isImg(record.d1)">
<JImageUpload v-if="!!record.d3" :fileMax="1" :value="opeMediaAddress + record.d3" disabled>
</JImageUpload>
<span v-else>未上传</span>
</template>
<template
v-if="column.dataIndex === 'd2' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
<span>{{ provinceOptions[record.d2] }}</span>
</template>
<template
v-if="column.dataIndex === 'd3' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
<span>{{ provinceOptions[record.d3] }}</span>
</template>
<template v-if="column.dataIndex === 'd2' && record.d1 == 'orgBuildingArea'">
<span>{{ record.d2 }}</span>
</template>
<template v-if="column.dataIndex === 'd3' && record.d1 == 'orgBuildingArea'">
<span>{{ record.d3 }}</span>
</template>
<template v-if="column.dataIndex === 'd2' && record.d1 == 'endTime'">
<span>{{ record.d2 == '9999-12-31' ? '长期' : record.d2 }}</span>
</template>
<template v-if="column.dataIndex === 'd3' && record.d1 == 'endTime'">
<span>{{ record.d3 == '9999-12-31' ? '长期' : record.d3 }}</span>
</template>
</template>
</a-table>
</a-col>
</a-row>
<JFormContainer :disabled="true">
<template #detail>
<a-form style="margin-top: 14px;height: 100px;" ref="formRef" layout="horizontal" :model="formData"
:label-col="labelCol" :wrapper-col="wrapperCol" >
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="审核结果" name="status" v-bind="validateInfos.status">
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核结果">
<a-select-option value="modifyPass">审核通过</a-select-option>
<a-select-option value="modifyFail">审核驳回</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" v-if="formData.status == 'modifyFail'">
<a-form-item label="驳回原因" name="applyContent" v-bind="validateInfos.applyContent">
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因(如驳回)"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, computed, onMounted } from 'vue';
import { Table as ATable, Input, Row, Col, Form } from 'ant-design-vue';
import { applyObj } from '../NuConfigSuppliersApply.data'
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { getModifyInfo, auditSubmit } from '../NuConfigSuppliersApply.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { initDictOptions } from '/@/utils/dict';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
const formRef = ref();
const AForm = Form;
const AFormItem = Form.Item;
const useForm = Form.useForm;
const { createMessage } = useMessage();
//
const labelCol = { span: 6 }; //
const wrapperCol = { span: 18 }; //
const isImg = (v_) => {
return v_ == 'imgPath'
}
const provinceOptions = ref({})
const formData = reactive<Record<string, any>>({
status: undefined,
applyContent: '',
id: '',
pkId: ''
});
const validatorRules = reactive({
})
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
const tableData = ref([]);
const emit = defineEmits(['ok']);
//
const filteredTableData = computed(() => {
return tableData.value.filter(item =>
item.d1 !== 'id'
&& item.d1 !== 'supplyState'
&& item.d1 !== 'wechartId'
&& item.d1 !== 'delFlag'
&& item.d1 !== 'createBy'
&& item.d1 !== 'createTime'
&& item.d1 !== 'updateBy'
&& item.d1 !== 'updateTime'
&& item.d1 !== 'sysOrgCode'
&& item.d1 !== 'izEnabled'
&& item.d1 !== 'sourceType'
);
});
const columns = [
{
title: '名称',
dataIndex: 'd1',
key: 'd1',
width: 150,
},
{
title: '变更前',
dataIndex: 'd2',
key: 'd2',
},
{
title: '变更后',
dataIndex: 'd3',
key: 'd3',
}
];
//
const setRowClassName = (record) => {
return record.d2 !== record.d3 && record.d1 !== 'createTime' ? 'highlight-row' : '';
};
const fieldMap = {
suppliersName: 'suppliersName',
suppliersNature: 'suppliersNature',
suppliersAddress: 'suppliersAddress',
personInCharge: 'personInCharge',
contactNumber: 'contactNumber',
openingBank: 'openingBank',
openingBankNo: 'openingBankNo',
imgPath: 'imgPath',
};
async function show(record) {
console.log("🚀 ~ show ~ record:", record)
let data = await getModifyInfo({ id: record.id })
formData.id = record.id
formData.suppliersId = record.suppliersId
if(record.applyStatus == '5' || record.applyStatus == '3'){
formData.status = 'modifyFail'
}else if(record.applyStatus == '4' || record.applyStatus == '2'){
formData.status = 'modifyPass'
}
formData.applyContent = record.applyContent
// idpkIdformData
Object.keys(fieldMap).forEach(fieldName => {
const record = data.find(item => item.d1 === fieldName);
if (record) {
formData[fieldName] = record.d3;
}
});
console.log("🚀 ~ show ~ formData:", formData)
tableData.value = data.map(item => ({
...item,
// null/undefined
d2: item.d2 ?? '',
d3: item.d3 ?? ''
}));
}
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);
}
if (formData.startTime) {
formData.startTime = formData.startTime.replace(/-/g, '.');
}
if (formData.endTime) {
formData.endTime = formData.endTime.replace(/-/g, '.');
}
auditSubmit(formData)
.then((res) => {
emit('ok');
})
}
// numberValues
onMounted(async () => {
const dictData = await initDictOptions('sys_category,name,id,first_letter is not null order by code asc', '');
dictData.reduce((prev, next) => {
if (next) {
provinceOptions.value[next['value']] = next['text'] || next['label']
}
return prev;
}, []);
});
defineExpose({
show,
submitForm
});
</script>
<style lang="less" scoped>
.container2 {
// padding: 16px;
}
.antd-modal-form {
// padding: 14px;
}
:deep(.ant-table-cell) {
padding: 8px 12px !important;
}
//
:deep(.highlight-row) {
background-color: #fff1f0 !important; //
}
//
:deep(.ant-form-item) {
// margin-bottom: 16px;
}
:deep(.ant-table-cell-row-hover) {
// border: 1px solid red;
}
</style>

View File

@ -0,0 +1,85 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<NuConfigSuppliersApplyHistoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</NuConfigSuppliersApplyHistoryForm>
<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>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuConfigSuppliersApplyHistoryForm from './NuConfigSuppliersApplyHistoryForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('800');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const upInfoForm = ref();
const upInfoVisible = ref<boolean>(false);
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = "审核历史比对";
visible.value = true;
nextTick(() => {
registerForm.value.show(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
/**
* 信息变更确认
*/
function handleUpInfoOk() {
upInfoForm.value.submitForm();
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -80,7 +80,7 @@ const AFormItem = Form.Item;
const useForm = Form.useForm;
const { createMessage } = useMessage();
//
const labelCol = { span: 4 }; //
const labelCol = { span: 6 }; //
const wrapperCol = { span: 18 }; //
const isImg = (v_) => {
return v_ == 'imgPath'