This commit is contained in:
2025-12-18 18:36:40 +08:00
11 changed files with 400 additions and 110 deletions

View File

@ -15,7 +15,17 @@ enum Api {
DataLog = '/sales/gradeSystem/datalog', DataLog = '/sales/gradeSystem/datalog',
} }
export async function getLngGradeSystemPageList(params: LngGradeSystemPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngGradeSystemPageResult>(
{
url: Api.List,
params,
},
{
errorMessageMode: mode,
},
);
}
/** /**
* @description: 查询LngGradeSystem分页列表 * @description: 查询LngGradeSystem分页列表
*/ */

View File

@ -130,9 +130,6 @@
deep: true, deep: true,
} }
); );
defineExpose({
getFileList
})
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.btn { .btn {

View File

@ -55,7 +55,7 @@ import type { FormInstance } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import Upload from '/@/components/Form/src/components/Upload.vue'; import Upload from '/@/components/Form/src/components/Upload.vue';
const tableName = 'Customer' let tableName = 'Customer'
const columnName = 'fileList' const columnName = 'fileList'
const { t } = useI18n(); const { t } = useI18n();
const isUpdate = ref(true); const isUpdate = ref(true);
@ -78,7 +78,9 @@ const rules = {
docTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], docTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
}; };
const curData = ref() const curData = ref()
const props = defineProps({
type: String
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
curData.value = '' curData.value = ''
formState.filePath = '' formState.filePath = ''
@ -119,7 +121,14 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
console.log(val, 532, ) console.log(val, 532, )
} }
async function getOption() { async function getOption() {
optionList = await getDocCpList({'valid': 'Y'}) let obj = {}
if (props.type == 'cuSign') {
obj = {'cuSign': 'Y'}
} else {
obj = {'suSign': 'Y'}
tableName = 'supplier'
}
optionList = await getDocCpList({'valid': 'Y',...obj })
} }
const handleCancel = () => { const handleCancel = () => {
formRef.value.resetFields(); formRef.value.resetFields();

View File

@ -289,7 +289,7 @@
</a-form> </a-form>
</div> </div>
</a-spin> </a-spin>
<certificateModal @register="registerCertificate" @success="handleSuccessCertificate" /> <certificateModal @register="registerCertificate" @success="handleSuccessCertificate" type="cuSign" />
<contactModal @register="registerContact" @success="handleSuccessContact" /> <contactModal @register="registerContact" @success="handleSuccessContact" />
<bankModal @register="registerBank" @success="handleSuccessBank"/> <bankModal @register="registerBank" @success="handleSuccessBank"/>
</template> </template>
@ -615,6 +615,19 @@
}) })
return return
} }
let arr = []
dataBank.forEach(v => {
if (v.defaultSign == 'Y') {
arr.push(v)
}
})
if (arr.length > 1 || !arr.length) {
notification.warning({
message: 'Tip',
description: '默认银行有且仅有一个'
})
return
}
let arrCertificate = JSON.parse(JSON.stringify(dataCertificate)) let arrCertificate = JSON.parse(JSON.stringify(dataCertificate))
arrCertificate.forEach(v => { arrCertificate.forEach(v => {
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : ''; v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : '';

View File

@ -228,7 +228,7 @@
}); });
} else { } else {
router.push({ router.push({
path: '/form/Customer/0/createFormCustomer', path: '/form/Customer/0/createForm',
query: { query: {
formPath: 'sales/Customer', formPath: 'sales/Customer',
formName: formName, formName: formName,

View File

@ -6,31 +6,9 @@ export const formConfig = {
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{
field: 'cpCode',
label: '客户',
component: 'Input',
},
{
field: 'gsId',
label: '评价体系',
component: 'XjrSelect',
componentProps: {
datasourceType: 'api',
apiConfig: {
path: 'CodeGeneration/selection',
method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
},
labelField: 'label',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{ {
field: 'dateGrade', field: 'dateGrade',
label: '日期选择', label: '日期',
component: 'RangePicker', component: 'RangePicker',
componentProps: { componentProps: {
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
@ -38,10 +16,9 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, },
}, },
{ {
field: 'score', field: 'cpCode',
label: '分数合计', label: '客户',
component: 'Input', component: 'Input',
}, },
{ {
@ -57,11 +34,6 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, },
}, },
{
field: 'note',
label: '备注',
component: 'Input',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -82,20 +54,18 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'dateGrade', dataIndex: 'score',
title: '日期选择', title: '评价分数',
componentType: 'date', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'score', dataIndex: 'dateGrade',
title: '分数合计', title: '评价日期',
componentType: 'input', componentType: 'date',
align: 'left', align: 'left',
sorter: true, sorter: true,
@ -109,15 +79,6 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
}, },
{
dataIndex: 'note',
title: '备注',
componentType: 'textarea',
align: 'left',
sorter: true,
},
]; ];
//表单事件 //表单事件
export const formEventConfigs = { export const formEventConfigs = {

View File

@ -0,0 +1,271 @@
<template>
<a-spin :spinning="spinning" tip="加载中...">
<div class="page-bg-wrap">
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
<a-card title="供应商基本信息" :bordered="false" >
<div>
<h4>评价基础信息</h4>
<a-row>
<a-col :span="8">
<a-form-item label="客户名称" name="cpCode">
<a-input-search v-model:value="formState.cpCode" placeholder="请选择客户" readonly @search="onSearch"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="客户分类" name="">
<a-input v-model:value="formState.suMcode" disabled />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="评价体系" name="gsId">
<a-select v-model:value="formState.gsId" :disabled="isDisable" placeholder="请选择评价体系" @change="gsIdChange" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.gsIdList" :key="item.id" :value="item.id">
{{ item.gsName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="评价日期" name="dateGrade">
<a-date-picker v-model:value="formState.dateGrade" disabled style="width: 100%" placeholder="请选择成立日期" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="分类合计" name="score">
<a-input v-model:value="formState.score" disabled/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="审批状态" name="approCode">
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</div>
</a-card>
<a-card :bordered="false" >
<h4>填写评分表信息</h4>
<a-table :columns="columns" :data-source="dataList" >
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'score'">
<a-input-number v-model:value="record.score"/>
</template>
<template v-if="column.dataIndex === 'scoreDesc'">
<a-input v-model:value="record.scoreDesc"/>
</template>
</template>
</a-table>
</a-card>
<a-card :bordered="false" >
<h4>附件信息</h4>
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</a-card>
</a-form>
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { FromPageType } from '/@/enums/workflowEnum';
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { CheckCircleOutlined, StopOutlined, CloseOutlined, UploadOutlined, SaveOutlined, DownloadOutlined,ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons-vue';
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
import useEventBus from '/@/hooks/event/useEventBus';
import type { Rule } from 'ant-design-vue/es/form';
import { getDictionary } from '/@/api/sales/Customer';
import { getLngGradeSystemPageList, getLngGradeSystem} from '/@/api/sales/GradeSystem';
import { useModal } from '/@/components/Modal';
import { addLngSupplier,updateLngSupplier,getLngSupplier } from '/@/api/supplier/Supplier';
import dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue';
import UploadList from '/@/components/Form/src/components/UploadList.vue';
import customerListModal from '/@/views/sales/CustomerGroup/components/customerListModal.vue';
const tableName = '1';
const columnName = '1'
const formType = ref('2'); // 0 新建 1 修改 2 查看
const formRef = ref();
const uploadFile = ref()
const props = defineProps({
disabled: false,
id: ''
});
const { bus, FORM_LIST_MODIFIED } = useEventBus();
const router = useRouter();
const { currentRoute } = router;
const isDisable = ref(false);
const { formPath } = currentRoute.value.query;
const pathArr = [];
const tabStore = useMultipleTabStore();
const formProps = ref(null);
const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id)
const spinning = ref(false);
const curIdx = ref(null)
const { notification } = useMessage();
const { t } = useI18n();
const formState = reactive({
approCode: 'WTJ',
dateGrade: dayjs(new Date()),
});
const [registerCertificate, { openModal:openModalCertificate }] = useModal();
const rules: Record<string, Rule[]> = {
cpCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
gsId: [{ required: true, message: "该项为必填项", trigger: 'change' }],
};
const layout = {
labelCol: { span: 9 },
wrapperCol: { span: 15 },
}
const columns = ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('评价事项'), dataIndex: 'itemName', sorter: true},
{ title: t('评价标准'), dataIndex: 'itemDesc', sorter: true},
{ title: t('评价部门'), dataIndex: 'eDeptCode', sorter: true},
{ title: t('评分'), dataIndex: 'score', sorter: true},
{ title: t('分数说明'), dataIndex: 'scoreDesc', sorter: true},
{ title: t('评价人'), dataIndex: 'aEmpCode', sorter: true},
{ title: t('评价时间'), dataIndex: 'aTime', sorter: true},
{ title: t('实际评价部门'), dataIndex: 'aDeptCode', sorter: true},
]);
const dataList= ref([]);
const dataFile = ref([]);
let optionSelect= reactive({
gsIdList: [],
approCodeList: [],
});
watch(
() => props.id,
(val) => {
if (val) {
getList(val)
}
},
{
immediate: true
}
);
watch(
() => props.disabled,
(val) => {
isDisable.value = val
},
{
immediate: true
}
);
onMounted(() => {
getOption()
if (pageId.value) {
getList(pageId.value)
}
});
const uploadListChange = (val) => {
dataFile.value = val
}
async function getList(id) {
spinning.value = true
try {
let data = await getLngSupplier(id)
spinning.value = false
Object.assign(formState, {...data})
Object.assign(dataList.value, formState.lngSupplierDocList || [])
Object.assign(dataFile.value, formState.lngFileUploadList || [])
formState.dateEntry = formState.dateEntry ? dayjs(formState.dateEntry) : null
formState.dateEstab = formState.dateEstab ? dayjs(formState.dateEstab) : null
} catch (error) {
spinning.value = false
}
}
async function getOption() {
optionSelect.gsIdList = await getLngGradeSystemPageList({'valid': 'Y', 'typeCode': 'CU'})
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
}
async function gsIdChange (val) {
console.log(val, 8)
const res = await getLngGradeSystem(val)
dataList.value = res.lngGradeSystemItemList || []
console.log(dataList.value, 88, res)
}
function close() {
tabStore.closeTab(currentRoute.value, router);
}
async function getFormValue() {
return formState
}
async function handleSubmit(type) {
try {
await formRef.value.validateFields();
let obj = {
...formState,
lngSupplierBankList: dataList.value,
lngFileUploadList: dataFile.value
}
spinning.value = true;
let request = !formState.id ? addLngSupplier :updateLngSupplier
try {
const data = await request(obj);
// 新增保存
if (data?.id) {
getList(data?.id)
}
// 同意保存不提示
if (!type) {
notification.success({
message: 'Tip',
description: data?.id ? t('新增成功!') : t('修改成功!')
}); //提示消息
}
return data?.id ? data : obj
} finally {
spinning.value = false;
}
} catch (errorInfo) {
spinning.value = false;
errorInfo?.errorFields?.length && notification.warning({
message: 'Tip',
description: '请完善信息'
});
return false
}
}
defineExpose({
handleSubmit,
getFormValue
});
</script>
<style lang="less" scoped>
.page-bg-wrap {
background-color: #fff;
}
.top-toolbar {
min-height: 44px;
margin-bottom: 12px;
border-bottom: 1px solid #eee;
}
</style>

View File

@ -1,5 +1,5 @@
export const customFormConfig = { export const customFormConfig = {
codeList: ['addCustomer','addSupplier'], codeList: ['addCustomer','addSupplier', 'addCustomerScore'],
router: [ router: [
{code: 'addCustomer', src: ''} {code: 'addCustomer', src: ''}
] ]

View File

@ -11,44 +11,30 @@ export const searchFormSchema: FormSchema[] = [
label: '供应商名称', label: '供应商名称',
component: 'Input', component: 'Input',
}, },
{
field: 'suSname',
label: '供应商简称',
component: 'Input',
},
{
field: 'natureCode',
label: '企业性质',
component: 'Input',
},
{
field: 'typeCode',
label: '供应商类型',
component: 'Input',
},
{
field: 'classCode',
label: '供应商分类',
component: 'Input',
},
{
field: 'dI',
label: '国内/国外',
component: 'Input',
},
{
field: 'valid',
label: '有效',
component: 'Input',
},
{ {
field: 'approCode', field: 'approCode',
label: '审批状态', label: '审批状态',
component: 'Input', component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1990669393069129729' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
}, },
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{
dataIndex: 'suCode',
title: '供应商编码',
componentType: 'input',
align: 'left',
sorter: true,
},
{ {
dataIndex: 'suName', dataIndex: 'suName',
title: '供应商名称', title: '供应商名称',

View File

@ -210,7 +210,7 @@
<span style="font-size: 12px;font-weight: normal;">上传公司财报等附件</span> <span style="font-size: 12px;font-weight: normal;">上传公司财报等附件</span>
</div> </div>
</template> </template>
<UploadList ref="uploadFile" :disabled="isDisable" :file-list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName"/> <UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</a-card> </a-card>
</a-form> </a-form>
</div> </div>
@ -285,7 +285,7 @@
suSname: [{ required: true, message: "该项为必填项", trigger: 'change' }], suSname: [{ required: true, message: "该项为必填项", trigger: 'change' }],
suMcode: [{ required: true, message: "该项为必填项", trigger: 'change' }], suMcode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
dI: [{ required: true, message: "该项为必填项", trigger: 'change' }], dI: [{ required: true, message: "该项为必填项", trigger: 'change' }],
cuName: [{ required: true, message: "该项为必填项", trigger: 'change'}], suName: [{ required: true, message: "该项为必填项", trigger: 'change'}],
natureCode: [{ required: true, message: "该项为必填项", trigger: 'change'}], natureCode: [{ required: true, message: "该项为必填项", trigger: 'change'}],
classCode: [{ required: true, message: "该项为必填项", trigger: 'change'}], classCode: [{ required: true, message: "该项为必填项", trigger: 'change'}],
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change'}], typeCode: [{ required: true, message: "该项为必填项", trigger: 'change'}],
@ -372,6 +372,9 @@
} }
}); });
const uploadListChange = (val) => {
dataFile.value = val
}
async function getList(id) { async function getList(id) {
spinning.value = true spinning.value = true
try { try {
@ -515,18 +518,30 @@
}) })
return return
} }
let arr = []
dataBank.forEach(v => {
if (v.defaultSign == 'Y') {
arr.push(v)
}
})
if (arr.length > 1 || !arr.length) {
notification.warning({
message: 'Tip',
description: '默认银行有且仅有一个'
})
return
}
let arrCertificate = JSON.parse(JSON.stringify(dataCertificate)) let arrCertificate = JSON.parse(JSON.stringify(dataCertificate))
arrCertificate.forEach(v => { arrCertificate.forEach(v => {
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : ''; v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : '';
v.dateTo = v.dateTo ? dayjs(v.dateTo ).format('YYYY-MM-DD HH:mm:ss'): ''; v.dateTo = v.dateTo ? dayjs(v.dateTo ).format('YYYY-MM-DD HH:mm:ss'): '';
}) })
let file = await uploadFile.value.getFileList()
let obj = { let obj = {
...formState, ...formState,
lngSupplierBankList: dataBank, lngSupplierBankList: dataBank,
lngSupplierDocList: arrCertificate, lngSupplierDocList: arrCertificate,
lngSupplierContactList: dataContact, lngSupplierContactList: dataContact,
lngFileUploadList: file lngFileUploadList: dataFile.value
} }
spinning.value = true; spinning.value = true;

View File

@ -159,7 +159,8 @@
query: { query: {
taskId: taskIds[0], taskId: taskIds[0],
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId:currentRoute.value.meta.formId,
id: record.id
} }
}); });
} else if (schemaId && !taskIds && processId) { } else if (schemaId && !taskIds && processId) {
@ -169,18 +170,33 @@
readonly: 1, readonly: 1,
taskId: '', taskId: '',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId:currentRoute.value.meta.formId,
id: record.id,
status
} }
}); });
} else { } else {
router.push({ if (schemaIdComputedRef.value) {
path: '/form/Supplier/' + record.id + '/viewForm', router.push({
query: { path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
formPath: 'supplier/Supplier', query: {
formName: formName, formPath: 'supplier/Supplier',
formId:currentRoute.value.meta.formId formName: formName,
} formId:currentRoute.value.meta.formId,
}); type:'edit',
id: record.id,
disabled: 1,
}
});
}
// router.push({
// path: '/form/Supplier/' + record.id + '/viewForm',
// query: {
// formPath: 'supplier/Supplier',
// formName: formName,
// formId:currentRoute.value.meta.formId
// }
// });
} }
} }
@ -211,15 +227,27 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
if (schemaIdComputedRef.value) {
router.push({ router.push({
path: '/form/Supplier/' + record.id + '/updateForm', path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
query: { query: {
formPath: 'supplier/Supplier', formPath: 'supplier/Supplier',
formName: formName, formName: formName,
formId:currentRoute.value.meta.formId formId:currentRoute.value.meta.formId,
} type:'edit',
}); id: record.id
}
});
} else {
router.push({
path: '/form/Supplier/' + record.id + '/updateForm',
query: {
formPath: 'supplier/Supplier',
formName: formName,
formId:currentRoute.value.meta.formId
}
});
}
} }
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);