供应商信息变更审核

This commit is contained in:
1378012178@qq.com 2026-01-26 14:27:09 +08:00
parent 6aa2d097ec
commit e96bdfd192
6 changed files with 679 additions and 53 deletions

View File

@ -1,5 +1,5 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage"; import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage(); const { createConfirm } = useMessage();
@ -11,6 +11,8 @@ enum Api {
deleteBatch = '/configSuppliersApply/nuConfigSuppliersApply/deleteBatch', deleteBatch = '/configSuppliersApply/nuConfigSuppliersApply/deleteBatch',
importExcel = '/configSuppliersApply/nuConfigSuppliersApply/importExcel', importExcel = '/configSuppliersApply/nuConfigSuppliersApply/importExcel',
exportXls = '/configSuppliersApply/nuConfigSuppliersApply/exportXls', exportXls = '/configSuppliersApply/nuConfigSuppliersApply/exportXls',
getModifyInfo = '/configSuppliersApply/nuConfigSuppliersApply/getModifyInfo',
audit = '/configSuppliersApply/nuConfigSuppliersApply/audit',
} }
/** /**
@ -39,7 +41,7 @@ export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => { return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} };
/** /**
* *
@ -57,9 +59,9 @@ export const batchDelete = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => { return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess(); handleSuccess();
}); });
} },
}); });
} };
/** /**
* *
@ -69,4 +71,20 @@ export const batchDelete = (params, handleSuccess) => {
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false }); return defHttp.post({ url: url, params }, { isTransformResponse: false });
} };
/**
*
* @param params
*/
export const getModifyInfo = (params) => {
return defHttp.post({ url: Api.getModifyInfo, params });
};
/**
*
* @param params
*/
export const auditSubmit = (params) => {
return defHttp.post({ url: Api.audit, params });
};

View File

@ -4,46 +4,46 @@ import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils'; import { getWeekMonthQuarterYear } from '/@/utils';
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS; const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
//列表数据 //申请审核列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '供应商名称', title: '供应商名称',
align: "center", align: 'center',
dataIndex: 'suppliersName' dataIndex: 'suppliersName',
}, },
{ {
title: '供应商性质', title: '供应商性质',
align: "center", align: 'center',
dataIndex: 'suppliersNature_dictText' dataIndex: 'suppliersNature_dictText',
}, },
{ {
title: '供应商地址', title: '供应商地址',
align: "center", align: 'center',
dataIndex: 'suppliersAddress' dataIndex: 'suppliersAddress',
}, },
{ {
title: '负责人', title: '负责人',
align: "center", align: 'center',
dataIndex: 'personInCharge' dataIndex: 'personInCharge',
}, },
{ {
title: '联系电话', title: '联系电话',
align: "center", align: 'center',
dataIndex: 'contactNumber' dataIndex: 'contactNumber',
}, },
{ {
title: '开户行', title: '开户行',
align: "center", align: 'center',
dataIndex: 'openingBank' dataIndex: 'openingBank',
}, },
{ {
title: '开户行账号', title: '开户行账号',
align: "center", align: 'center',
dataIndex: 'openingBankNo' dataIndex: 'openingBankNo',
}, },
{ {
title: '资质照片', title: '资质照片',
align: "center", align: 'center',
dataIndex: 'imgPath', dataIndex: 'imgPath',
customRender: ({ text }) => { customRender: ({ text }) => {
// 如果 text 为空或 null/undefined使用默认图片 // 如果 text 为空或 null/undefined使用默认图片
@ -53,40 +53,100 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '审核状态', title: '审核状态',
align: "center", align: 'center',
dataIndex: 'applyStatus', dataIndex: 'applyStatus',
customRender: ({ text, record }) => { customRender: ({ text, record }) => {
console.log(text); console.log(text);
var applyStatus = "" var applyStatus = '';
if (text == '1') { if (text == '1') {
applyStatus = "待审核" applyStatus = '待审核';
} else if (text == '2') { } else if (text == '2') {
applyStatus = "审核通过" applyStatus = '审核通过';
} else if (text == '3') { } else if (text == '3') {
applyStatus = "审核未通过" applyStatus = '审核未通过';
} }
return applyStatus; return applyStatus;
}, },
}, },
{ {
title: '审核备注', title: '审核备注',
align: "center", align: 'center',
dataIndex: 'applyContent' dataIndex: 'applyContent',
}, },
]; ];
//变更审核列表数据
export const upColumns: BasicColumn[] = [
{
title: '供应商名称',
align: 'center',
dataIndex: 'suppliersName',
},
{
title: '供应商性质',
align: 'center',
dataIndex: 'suppliersNature_dictText',
},
{
title: '供应商地址',
align: 'center',
dataIndex: 'suppliersAddress',
},
{
title: '负责人',
align: 'center',
dataIndex: 'personInCharge',
},
{
title: '联系电话',
align: 'center',
dataIndex: 'contactNumber',
},
{
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 });
},
}
];
export const applyObj = {
suppliersName: '供应商名称',
suppliersNature: '供应商性质',
suppliersAddress: '供应商地址',
personInCharge: '负责人',
contactNumber: '联系电话',
openingBank: '开户行',
openingBankNo: '开户行账号',
imgPath: '资质照片',
};
// 高级查询数据 // 高级查询数据
export const superQuerySchema = { export const superQuerySchema = {
suppliersName: {title: '供应商名称',order: 0,view: 'text', type: 'string',}, suppliersName: { title: '供应商名称', order: 0, view: 'text', type: 'string' },
suppliersNature: {title: '供应商性质 1代理商 2批发商 3制造商',order: 1,view: 'text', type: 'string',}, suppliersNature: { title: '供应商性质 1代理商 2批发商 3制造商', order: 1, view: 'text', type: 'string' },
suppliersAddress: {title: '供应商地址',order: 2,view: 'text', type: 'string',}, suppliersAddress: { title: '供应商地址', order: 2, view: 'text', type: 'string' },
personInCharge: {title: '负责人',order: 3,view: 'text', type: 'string',}, personInCharge: { title: '负责人', order: 3, view: 'text', type: 'string' },
contactNumber: {title: '联系电话',order: 4,view: 'text', type: 'string',}, contactNumber: { title: '联系电话', order: 4, view: 'text', type: 'string' },
supplyState: {title: '供应状态 1正常供应 2暂停供应',order: 5,view: 'text', type: 'string',}, supplyState: { title: '供应状态 1正常供应 2暂停供应', order: 5, view: 'text', type: 'string' },
openingBank: {title: '开户行',order: 6,view: 'text', type: 'string',}, openingBank: { title: '开户行', order: 6, view: 'text', type: 'string' },
openingBankNo: {title: '开户行账号',order: 7,view: 'text', type: 'string',}, openingBankNo: { title: '开户行账号', order: 7, view: 'text', type: 'string' },
wechartId: {title: '微信账号',order: 8,view: 'text', type: 'string',}, wechartId: { title: '微信账号', order: 8, view: 'text', type: 'string' },
imgPath: {title: '资质照片',order: 9,view: 'text', type: 'string',}, imgPath: { title: '资质照片', order: 9, view: 'text', type: 'string' },
applyStatus: {title: '审核状态',order: 10,view: 'text', type: 'string',}, applyStatus: { title: '审核状态', order: 10, view: 'text', type: 'string' },
applyContent: {title: '审核备注',order: 11,view: 'text', type: 'string',}, applyContent: { title: '审核备注', order: 11, view: 'text', type: 'string' },
}; };

View File

@ -89,6 +89,7 @@ const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
fixed: 'right', fixed: 'right',
}, },
beforeFetch: async (params) => { beforeFetch: async (params) => {
queryParam.applyStatus = '2'
return Object.assign(params, queryParam); return Object.assign(params, queryParam);
}, },
}, },

View File

@ -0,0 +1,251 @@
<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" :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>
<!-- 表单区域 -->
<NuConfigSuppliersApplyModal ref="registerModal" @success="handleSuccess"></NuConfigSuppliersApplyModal>
</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 { upColumns, superQuerySchema } from './NuConfigSuppliersApply.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuConfigSuppliersApply.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuConfigSuppliersApplyModal from './components/NuConfigSuppliersApplyModal.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 userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'nu_config_suppliers_apply',
api: list,
columns: upColumns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
queryParam.applyStatus = '4'
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "nu_config_suppliers_apply",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
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 handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.upInfoEdit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '审核',
onClick: handleEdit.bind(null, record)
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'configSuppliersApply:nu_config_suppliers_apply:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</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

@ -9,11 +9,22 @@
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button> <a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template> </template>
</a-drawer> </a-drawer>
<!-- 信息变更审核 -->
<a-drawer :title="'审核'" width="70vw" :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> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue'; import { ref, nextTick, defineExpose } from 'vue';
import NuConfigSuppliersApplyForm from './NuConfigSuppliersApplyForm.vue' import NuConfigSuppliersApplyUpInfoForm from './NuConfigSuppliersApplyUpInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue'; import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>(''); const title = ref<string>('');
@ -21,6 +32,8 @@ const width = ref<string>('80%');
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false); const disableSubmit = ref<boolean>(false);
const registerForm = ref(); const registerForm = ref();
const upInfoForm = ref();
const upInfoVisible = ref<boolean>(false);
const emit = defineEmits(['register', 'success']); const emit = defineEmits(['register', 'success']);
/** /**
@ -46,6 +59,18 @@ function edit(record) {
}); });
} }
/**
* 编辑
* @param record
*/
function upInfoEdit(record) {
title.value = disableSubmit.value ? '详情' : '审核';
upInfoVisible.value = true;
nextTick(() => {
upInfoForm.value.show(record);
});
}
/** /**
* 确定按钮点击事件 * 确定按钮点击事件
*/ */
@ -68,9 +93,26 @@ function handleCancel() {
visible.value = false; visible.value = false;
} }
/**
* 信息变更-关闭
*/
function handleUpInfoCancel() {
console.log(123123)
upInfoVisible.value = false
emit('success');
}
/**
* 信息变更确认
*/
function handleUpInfoOk() {
upInfoForm.value.submitForm();
}
defineExpose({ defineExpose({
add, add,
edit, edit,
upInfoEdit,
disableSubmit, disableSubmit,
}); });
</script> </script>

View File

@ -0,0 +1,254 @@
<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>
<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>
</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';
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: 4 }; //
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({
status: [{ required: true, message: '请选择审核结果!' },],
applyContent: [
{
validator: async (_rule, value) => {
if (formData.status === 'modifyFail' && !value) {
return Promise.reject('请输入驳回原因!');
}
return Promise.resolve();
},
},
],
})
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) {
let data = await getModifyInfo({ id: record.id })
formData.id = record.id
formData.suppliersId = record.suppliersId
// idpkIdformData
Object.keys(fieldMap).forEach(fieldName => {
const record = data.find(item => item.d1 === fieldName);
if (record) {
formData[fieldName] = record.d3;
}
});
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>