This commit is contained in:
‘huanghaiixia’
2025-12-19 17:50:27 +08:00
parent 694d3cc2ee
commit 2b2c8df0f7
6 changed files with 104 additions and 145 deletions

View File

@ -2,35 +2,63 @@
<a-spin :spinning="spinning" tip="加载中..."> <a-spin :spinning="spinning" tip="加载中...">
<div class="page-bg-wrap formViewStyle"> <div class="page-bg-wrap formViewStyle">
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout"> <a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
<a-card title="评价基础信息" :bordered="false" > <a-card title="" :bordered="false" >
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="客户名称" name="cpCodeName"> <a-form-item label="编号" name="code">
<a-input-search v-model:value="formState.cpCodeName" placeholder="请选择客户" readonly @search="onSearch"/> <a-input v-model:value="formState.code" disabled />
</a-form-item>
</a-col>
<a-col :span="16">
<a-form-item label="标题" name="title" :label-col="{ span: 5, offset }" :wrapper-col="{ span: 24 }">
<a-input v-model:value="formState.title" placeholder="请输入标题"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="客户分类" name="classCode"> <a-form-item label="签报类型" name="typeCode">
<a-input v-model:value="formState.classCode" disabled /> <a-select v-model:value="formState.typeCode" :disabled="isDisable" placeholder="请选择签报类型" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="评价体系" name="gsId"> <a-form-item label="密级" name="securityCode">
<a-select v-model:value="formState.gsId" :disabled="isDisable" placeholder="请选择评价体系" @mouseenter="gsIdFocus(formState.gsId)" @change="gsIdChange" style="width: 100%" allow-clear> <a-select v-model:value="formState.securityCode" :disabled="isDisable" placeholder="请选择密级" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.gsIdList" :key="item.id" :value="item.id"> <a-select-option v-for="item in optionSelect.securityCodeList" :key="item.code" :value="item.code">
{{ item.gsName }} {{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="缓急" name="urgencyCode">
<a-select v-model:value="formState.urgencyCode" :disabled="isDisable" placeholder="请选择缓急" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="评价日期" name="dateGrade"> <a-form-item label="拟稿人" name="empIdName">
<a-date-picker v-model:value="formState.dateGrade" disabled style="width: 100%" placeholder="请选择评价日期" /> <a-input-search v-model:value="formState.empIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="分类合计" name="score"> <a-form-item label="拟稿人所属部门" name="bDeptIdName">
<a-input v-model:value="formState.score" disabled/> <a-input-search v-model:value="formState.bDeptIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="拟稿人所属公司" name="comIdName">
<a-input-search v-model:value="formState.comIdName" placeholder="请选择拟稿人" readonly @search="onSearch"/>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="拟稿日期" name="dateAppro">
<a-date-picker v-model:value="formState.dateAppro" style="width: 100%" placeholder="请选择评价日期" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -42,20 +70,18 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24">
<a-form-item label="内容摘要" name="content" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.content" :disabled="isDisable" placeholder="请输入备注最多1000字" :maxlength="1000" :auto-size="{ minRows: 4, }"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</a-form-item>
</a-col>
</a-row> </a-row>
</a-card> </a-card>
<a-card title="填写评分表信息" :bordered="false" >
<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" @change="numChagne('score', record, index)"/>
</template>
<template v-if="column.dataIndex === 'scoreDesc'">
<a-input v-model:value="record.scoreDesc" @change="numChagne('scoreDesc', record, index)"/>
</template>
</template>
</a-table>
</a-card>
<a-card title="附件信息" :bordered="false" > <a-card title="附件信息" :bordered="false" >
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/> <UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</a-card> </a-card>
@ -75,7 +101,6 @@
import useEventBus from '/@/hooks/event/useEventBus'; import useEventBus from '/@/hooks/event/useEventBus';
import type { Rule } from 'ant-design-vue/es/form'; import type { Rule } from 'ant-design-vue/es/form';
import { getDictionary } from '/@/api/sales/Customer'; import { getDictionary } from '/@/api/sales/Customer';
import { getLngGradeSystemPageList, getLngGradeSystem} from '/@/api/sales/GradeSystem';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { addLngScore,updateLngScore,getLngScore } from '/@/api/sales/ScoreCustomer'; import { addLngScore,updateLngScore,getLngScore } from '/@/api/sales/ScoreCustomer';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
@ -83,7 +108,6 @@
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import UploadList from '/@/components/Form/src/components/UploadList.vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue';
import customerListModal from '/@/components/common/customerListModal.vue'; import customerListModal from '/@/components/common/customerListModal.vue';
import { getUserInfo } from '/@/api/system/login';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
const tableName = 'ScoreCustomer'; const tableName = 'ScoreCustomer';
@ -116,9 +140,8 @@
const { t } = useI18n(); const { t } = useI18n();
const formState = reactive({ const formState = reactive({
approCode: 'WTJ', approCode: 'WTJ',
dateGrade: dayjs(new Date()), dateAppro: dayjs(new Date()),
}); });
const userInfo = reactive({})
const [register, { openModal:openModal}] = useModal(); const [register, { openModal:openModal}] = useModal();
const rules: Record<string, Rule[]> = { const rules: Record<string, Rule[]> = {
cpCodeName: [{ required: true, message: "该项为必填项", trigger: 'change' }], cpCodeName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
@ -128,23 +151,13 @@
labelCol: { span: 9 }, labelCol: { span: 9 },
wrapperCol: { span: 15 }, wrapperCol: { span: 15 },
} }
const gsIdOld = ref()
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 dataList= ref([]);
const dataFile = ref([]); const dataFile = ref([]);
let optionSelect= reactive({ let optionSelect= reactive({
gsIdList: [],
approCodeList: [], approCodeList: [],
typeCodeList: [],
securityCodeList: [],
urgencyCodeList: []
}); });
watch( watch(
() => props.id, () => props.id,
@ -182,18 +195,17 @@
let data = await getLngScore(id) let data = await getLngScore(id)
spinning.value = false spinning.value = false
Object.assign(formState, {...data}) Object.assign(formState, {...data})
Object.assign(dataList.value, formState.lngScoreDtlList || [])
Object.assign(dataFile.value, formState.lngFileUploadList || []) Object.assign(dataFile.value, formState.lngFileUploadList || [])
formState.dateGrade = formState.dateGrade ? dayjs(formState.dateGrade) : null formState.dateAppro = formState.dateAppro ? dayjs(formState.dateAppro) : null
} catch (error) { } catch (error) {
spinning.value = false spinning.value = false
} }
} }
async function getOption() { async function getOption() {
optionSelect.gsIdList = await getLngGradeSystemPageList({'valid': 'Y', 'typeCode': 'CU'}) optionSelect.typeCodeList = await getDictionary('LNG_QB')
optionSelect.securityCodeList = await getDictionary('LNG_SECRET')
optionSelect.urgencyCodeList = await getDictionary('LNG_URGEN')
optionSelect.approCodeList = await getDictionary('LNG_APPRO') optionSelect.approCodeList = await getDictionary('LNG_APPRO')
let res = await getUserInfo()
Object.assign(userInfo, {...res})
} }
const onSearch = (val)=> { const onSearch = (val)=> {
openModal(true,{isUpdate: false}) openModal(true,{isUpdate: false})
@ -203,64 +215,7 @@
formState.classCode = val[0].classCode formState.classCode = val[0].classCode
formState.cpCodeName = val[0].cuName formState.cpCodeName = val[0].cuName
} }
const gsIdFocus = (val) => {
gsIdOld.value = val
}
async function gsIdChange (val) {
if (!val) {
dataList.value = []
return
}
const res = await getLngGradeSystem(val)
let arr = res.lngGradeSystemItemList || []
if (!gsIdOld.value) {
dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => {
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
return
}
if (arr.length && gsIdOld.value) {
Modal.confirm({
title: t('提示'),
content: t('变更将重新设置评分表,是否继续'),
okText: t('确定'),
cancelText: t('取消'),
onOk() {
dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => {
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
},
onCancel() {
formState.gsId = gsIdOld.value
}
});
} else {
if (!arr.length) {
dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => {
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
}
}
}
const numChagne = (type, record, index) => {
record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
if (type == 'score') {
let num = 0
dataList.value.forEach(v => {
num+=Number(v.score || 0)
})
formState.score = num
}
}
function close() { function close() {
tabStore.closeTab(currentRoute.value, router); tabStore.closeTab(currentRoute.value, router);
} }

View File

@ -17,7 +17,7 @@ export const searchFormSchema: FormSchema[] = [
}, },
}, },
{ {
field: 'cpCode', field: 'cpName',
label: '客户', label: '客户',
component: 'Input', component: 'Input',
}, },
@ -38,7 +38,7 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
dataIndex: 'cpCode', dataIndex: 'cpName',
title: '客户', title: '客户',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
@ -47,7 +47,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'gsId', dataIndex: 'gsName',
title: '评价体系', title: '评价体系',
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',

View File

@ -209,17 +209,14 @@
async function gsIdChange (val) { async function gsIdChange (val) {
if (!val) { if (!val) {
dataList.value = [] dataList.value = []
formState.score = null
return return
} }
const res = await getLngGradeSystem(val) const res = await getLngGradeSystem(val)
let arr = res.lngGradeSystemItemList || [] let arr = res.lngGradeSystemItemList || []
if (!gsIdOld.value) { if (!gsIdOld.value) {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
return return
} }
if (arr.length && gsIdOld.value) { if (arr.length && gsIdOld.value) {
@ -230,11 +227,7 @@
cancelText: t('取消'), cancelText: t('取消'),
onOk() { onOk() {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
}, },
onCancel() { onCancel() {
formState.gsId = gsIdOld.value formState.gsId = gsIdOld.value
@ -243,14 +236,24 @@
} else { } else {
if (!arr.length) { if (!arr.length) {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
} }
} }
} }
const listUpdate = () => {
formState.score = null
dataList.value.forEach(v => {
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
delete v.id
delete v.createUserId
delete v.createDate
delete v.ruleUserId
delete v.tenantId
})
}
const numChagne = (type, record, index) => { const numChagne = (type, record, index) => {
record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
if (type == 'score') { if (type == 'score') {

View File

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

View File

@ -17,7 +17,7 @@ export const searchFormSchema: FormSchema[] = [
}, },
}, },
{ {
field: 'cpCode', field: 'cpName',
label: '供应商', label: '供应商',
component: 'Input', component: 'Input',
}, },
@ -38,7 +38,7 @@ export const searchFormSchema: FormSchema[] = [
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
dataIndex: 'cpCode', dataIndex: 'cpName',
title: '供应商', title: '供应商',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
@ -47,7 +47,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'gsId', dataIndex: 'gsName',
title: '评价体系', title: '评价体系',
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',

View File

@ -210,22 +210,17 @@
async function gsIdChange (val) { async function gsIdChange (val) {
if (!val) { if (!val) {
dataList.value = [] dataList.value = []
formState.score = null
return return
} }
const res = await getLngGradeSystem(val) const res = await getLngGradeSystem(val)
let arr = res.lngGradeSystemItemList || [] let arr = res.lngGradeSystemItemList || []
console.log(arr.length, 66, gsIdOld.value)
if (!gsIdOld.value) { if (!gsIdOld.value) {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
return return
} }
if (arr.length && gsIdOld.value) { if (arr.length && gsIdOld.value) {
Modal.confirm({ Modal.confirm({
title: t('提示'), title: t('提示'),
content: t('变更将重新设置评分表,是否继续'), content: t('变更将重新设置评分表,是否继续'),
@ -233,11 +228,7 @@
cancelText: t('取消'), cancelText: t('取消'),
onOk() { onOk() {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
}, },
onCancel() { onCancel() {
formState.gsId = gsIdOld.value formState.gsId = gsIdOld.value
@ -246,14 +237,24 @@
} else { } else {
if (!arr.length) { if (!arr.length) {
dataList.value = res.lngGradeSystemItemList || [] dataList.value = res.lngGradeSystemItemList || []
dataList.value.forEach(v => { listUpdate()
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
})
} }
} }
} }
const listUpdate = () => {
formState.score = null
dataList.value.forEach(v => {
v.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
v.aEmpCode = userInfo.name
v.gsiId = v.id
delete v.id
delete v.createUserId
delete v.createDate
delete v.ruleUserId
delete v.tenantId
})
}
const numChagne = (type, record, index) => { const numChagne = (type, record, index) => {
record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
if (type == 'score') { if (type == 'score') {