客户评价
This commit is contained in:
@ -15,7 +15,17 @@ enum Api {
|
||||
|
||||
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分页列表
|
||||
*/
|
||||
|
||||
@ -615,6 +615,19 @@
|
||||
})
|
||||
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))
|
||||
arrCertificate.forEach(v => {
|
||||
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : '';
|
||||
|
||||
@ -227,7 +227,7 @@
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Customer/0/createFormCustomer',
|
||||
path: '/form/Customer/0/createForm',
|
||||
query: {
|
||||
formPath: 'sales/Customer',
|
||||
formName: formName,
|
||||
|
||||
@ -6,31 +6,9 @@ export const formConfig = {
|
||||
};
|
||||
|
||||
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',
|
||||
label: '日期选择',
|
||||
label: '日期',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
@ -38,10 +16,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
field: 'score',
|
||||
label: '分数合计',
|
||||
field: 'cpCode',
|
||||
label: '客户',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
@ -57,11 +34,6 @@ export const searchFormSchema: FormSchema[] = [
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
@ -82,20 +54,18 @@ export const columns: BasicColumn[] = [
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'dateGrade',
|
||||
title: '日期选择',
|
||||
componentType: 'date',
|
||||
dataIndex: 'score',
|
||||
title: '评价分数',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'score',
|
||||
title: '分数合计',
|
||||
componentType: 'input',
|
||||
dataIndex: 'dateGrade',
|
||||
title: '评价日期',
|
||||
componentType: 'date',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
@ -109,15 +79,6 @@ export const columns: BasicColumn[] = [
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'note',
|
||||
title: '备注',
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
|
||||
271
src/views/sales/ScoreCustomer/components/createForm.vue
Normal file
271
src/views/sales/ScoreCustomer/components/createForm.vue
Normal 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>
|
||||
@ -1,5 +1,5 @@
|
||||
export const customFormConfig = {
|
||||
codeList: ['addCustomer','addSupplier'],
|
||||
codeList: ['addCustomer','addSupplier', 'addCustomerScore'],
|
||||
router: [
|
||||
{code: 'addCustomer', src: ''}
|
||||
]
|
||||
|
||||
@ -11,44 +11,30 @@ export const searchFormSchema: FormSchema[] = [
|
||||
label: '供应商名称',
|
||||
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',
|
||||
label: '审批状态',
|
||||
component: 'Input',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1990669393069129729' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
dataIndex: 'suCode',
|
||||
title: '供应商编码',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'suName',
|
||||
title: '供应商名称',
|
||||
|
||||
@ -285,7 +285,7 @@
|
||||
suSname: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
suMcode: [{ 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'}],
|
||||
classCode: [{ required: true, message: "该项为必填项", trigger: 'change'}],
|
||||
typeCode: [{ required: true, message: "该项为必填项", trigger: 'change'}],
|
||||
@ -518,6 +518,19 @@
|
||||
})
|
||||
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))
|
||||
arrCertificate.forEach(v => {
|
||||
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom ).format('YYYY-MM-DD HH:mm:ss') : '';
|
||||
|
||||
@ -159,7 +159,8 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -169,19 +170,34 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
status
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/form/Supplier/' + record.id + '/viewForm',
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'supplier/Supplier',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
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
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
@ -211,7 +227,18 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'supplier/Supplier',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Supplier/' + record.id + '/updateForm',
|
||||
query: {
|
||||
@ -221,6 +248,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user