From 2b2c8df0f79cf4828ce1c95991ef580b91c02972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Fri, 19 Dec 2025 17:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../approve/Appro/components/createForm.vue | 167 +++++++----------- .../sales/ScoreCustomer/components/config.ts | 6 +- .../ScoreCustomer/components/createForm.vue | 33 ++-- src/views/secondDev/customFormConfig.ts | 2 +- .../ScoreSupplier/components/config.ts | 6 +- .../ScoreSupplier/components/createForm.vue | 35 ++-- 6 files changed, 104 insertions(+), 145 deletions(-) diff --git a/src/views/approve/Appro/components/createForm.vue b/src/views/approve/Appro/components/createForm.vue index 58b8f90..00ab0c8 100644 --- a/src/views/approve/Appro/components/createForm.vue +++ b/src/views/approve/Appro/components/createForm.vue @@ -2,35 +2,63 @@
- + - - + + + + + + + - - + + + + {{ item.name }} + + - - - - - {{ item.gsName }} + + + + + {{ item.name }} + + + + + + + + + {{ item.name }} - - + + - - + + + + + + + + + + + + @@ -42,20 +70,18 @@ + + + + + + + + + + - - - - - @@ -75,7 +101,6 @@ 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 { addLngScore,updateLngScore,getLngScore } from '/@/api/sales/ScoreCustomer'; import dayjs from 'dayjs'; @@ -83,7 +108,6 @@ import { message } from 'ant-design-vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue'; import customerListModal from '/@/components/common/customerListModal.vue'; - import { getUserInfo } from '/@/api/system/login'; import { Modal } from 'ant-design-vue'; const tableName = 'ScoreCustomer'; @@ -116,9 +140,8 @@ const { t } = useI18n(); const formState = reactive({ approCode: 'WTJ', - dateGrade: dayjs(new Date()), + dateAppro: dayjs(new Date()), }); - const userInfo = reactive({}) const [register, { openModal:openModal}] = useModal(); const rules: Record = { cpCodeName: [{ required: true, message: "该项为必填项", trigger: 'change' }], @@ -128,23 +151,13 @@ labelCol: { span: 9 }, 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 dataFile = ref([]); let optionSelect= reactive({ - gsIdList: [], approCodeList: [], + typeCodeList: [], + securityCodeList: [], + urgencyCodeList: [] }); watch( () => props.id, @@ -182,18 +195,17 @@ let data = await getLngScore(id) spinning.value = false Object.assign(formState, {...data}) - Object.assign(dataList.value, formState.lngScoreDtlList || []) Object.assign(dataFile.value, formState.lngFileUploadList || []) - formState.dateGrade = formState.dateGrade ? dayjs(formState.dateGrade) : null + formState.dateAppro = formState.dateAppro ? dayjs(formState.dateAppro) : null } catch (error) { spinning.value = false } } 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') - let res = await getUserInfo() - Object.assign(userInfo, {...res}) } const onSearch = (val)=> { openModal(true,{isUpdate: false}) @@ -203,64 +215,7 @@ formState.classCode = val[0].classCode 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() { tabStore.closeTab(currentRoute.value, router); } diff --git a/src/views/sales/ScoreCustomer/components/config.ts b/src/views/sales/ScoreCustomer/components/config.ts index 5a469e8..277fe1a 100644 --- a/src/views/sales/ScoreCustomer/components/config.ts +++ b/src/views/sales/ScoreCustomer/components/config.ts @@ -17,7 +17,7 @@ export const searchFormSchema: FormSchema[] = [ }, }, { - field: 'cpCode', + field: 'cpName', label: '客户', component: 'Input', }, @@ -38,7 +38,7 @@ export const searchFormSchema: FormSchema[] = [ export const columns: BasicColumn[] = [ { - dataIndex: 'cpCode', + dataIndex: 'cpName', title: '客户', componentType: 'input', align: 'left', @@ -47,7 +47,7 @@ export const columns: BasicColumn[] = [ }, { - dataIndex: 'gsId', + dataIndex: 'gsName', title: '评价体系', componentType: 'select', align: 'left', diff --git a/src/views/sales/ScoreCustomer/components/createForm.vue b/src/views/sales/ScoreCustomer/components/createForm.vue index 58b8f90..956ac34 100644 --- a/src/views/sales/ScoreCustomer/components/createForm.vue +++ b/src/views/sales/ScoreCustomer/components/createForm.vue @@ -209,17 +209,14 @@ async function gsIdChange (val) { if (!val) { dataList.value = [] + formState.score = null 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 - }) + listUpdate() return } if (arr.length && gsIdOld.value) { @@ -230,11 +227,7 @@ 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 - }) + listUpdate() }, onCancel() { formState.gsId = gsIdOld.value @@ -243,14 +236,24 @@ } 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 - }) + listUpdate() } } } + 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) => { record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') if (type == 'score') { diff --git a/src/views/secondDev/customFormConfig.ts b/src/views/secondDev/customFormConfig.ts index a0e1165..5662cc1 100644 --- a/src/views/secondDev/customFormConfig.ts +++ b/src/views/secondDev/customFormConfig.ts @@ -1,5 +1,5 @@ export const customFormConfig = { - codeList: ['addCustomer','addSupplier', 'addCustomerScore', 'addSupplierScore'], + codeList: ['addCustomer','addSupplier', 'addCustomerScore', 'addSupplierScore', 'addAppro'], router: [ {code: 'addCustomer', src: ''} ] diff --git a/src/views/supplier/ScoreSupplier/components/config.ts b/src/views/supplier/ScoreSupplier/components/config.ts index 25e507e..99bd150 100644 --- a/src/views/supplier/ScoreSupplier/components/config.ts +++ b/src/views/supplier/ScoreSupplier/components/config.ts @@ -17,7 +17,7 @@ export const searchFormSchema: FormSchema[] = [ }, }, { - field: 'cpCode', + field: 'cpName', label: '供应商', component: 'Input', }, @@ -38,7 +38,7 @@ export const searchFormSchema: FormSchema[] = [ export const columns: BasicColumn[] = [ { - dataIndex: 'cpCode', + dataIndex: 'cpName', title: '供应商', componentType: 'input', align: 'left', @@ -47,7 +47,7 @@ export const columns: BasicColumn[] = [ }, { - dataIndex: 'gsId', + dataIndex: 'gsName', title: '评价体系', componentType: 'select', align: 'left', diff --git a/src/views/supplier/ScoreSupplier/components/createForm.vue b/src/views/supplier/ScoreSupplier/components/createForm.vue index 80b58d6..be74c8d 100644 --- a/src/views/supplier/ScoreSupplier/components/createForm.vue +++ b/src/views/supplier/ScoreSupplier/components/createForm.vue @@ -210,22 +210,17 @@ async function gsIdChange (val) { if (!val) { dataList.value = [] + formState.score = null return } const res = await getLngGradeSystem(val) let arr = res.lngGradeSystemItemList || [] - console.log(arr.length, 66, gsIdOld.value) 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 - }) + listUpdate() return } if (arr.length && gsIdOld.value) { - Modal.confirm({ title: t('提示'), content: t('变更将重新设置评分表,是否继续'), @@ -233,11 +228,7 @@ 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 - }) + listUpdate() }, onCancel() { formState.gsId = gsIdOld.value @@ -246,14 +237,24 @@ } 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 - }) + listUpdate() } } } + 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) => { record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') if (type == 'score') {