diff --git a/src/views/sales/CustomerGroup/components/Form.vue b/src/views/sales/CustomerGroup/components/Form.vue index 55d03d8..e219097 100644 --- a/src/views/sales/CustomerGroup/components/Form.vue +++ b/src/views/sales/CustomerGroup/components/Form.vue @@ -52,7 +52,7 @@ import { Form, Col, Row, Tabs, TabPane, Divider, message } from 'ant-design-vue'; import { useI18n } from '/@/hooks/web/useI18n'; import { useModal } from '/@/components/Modal'; - import customerListModal from './customerListModal.vue'; + import customerListModal from '/@/components/common/customerListModal.vue'; import dayjs from 'dayjs'; const FormItem = Form.Item; diff --git a/src/views/sales/ScoreCustomer/components/config.ts b/src/views/sales/ScoreCustomer/components/config.ts index ff4f1ee..5a469e8 100644 --- a/src/views/sales/ScoreCustomer/components/config.ts +++ b/src/views/sales/ScoreCustomer/components/config.ts @@ -11,7 +11,7 @@ export const searchFormSchema: FormSchema[] = [ label: '日期', component: 'RangePicker', componentProps: { - format: 'YYYY-MM-DD HH:mm:ss', + format: 'YYYY-MM-DD', style: { width: '100%' }, getPopupContainer: () => document.body, }, diff --git a/src/views/sales/ScoreCustomer/components/createForm.vue b/src/views/sales/ScoreCustomer/components/createForm.vue index ec564c3..cadd39c 100644 --- a/src/views/sales/ScoreCustomer/components/createForm.vue +++ b/src/views/sales/ScoreCustomer/components/createForm.vue @@ -16,7 +16,7 @@ - + {{ item.gsName }} @@ -84,6 +84,7 @@ 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'; const columnName = 'ScoreCustomer' @@ -127,7 +128,7 @@ 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}, @@ -202,13 +203,52 @@ 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) - 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 + 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) => { diff --git a/src/views/sales/ScoreCustomer/index.vue b/src/views/sales/ScoreCustomer/index.vue index bcd7c4a..6862534 100644 --- a/src/views/sales/ScoreCustomer/index.vue +++ b/src/views/sales/ScoreCustomer/index.vue @@ -121,8 +121,8 @@ gutter: 16, }, schemas: customSearchFormSchema, - fieldMapToTime: [['dateGrade', ['dateGradeStart', 'dateGradeEnd'], 'YYYY-MM-DD HH:mm:ss ', true],], - showResetButton: false, + fieldMapToTime: [['dateGrade', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true],], + showResetButton: true, }, beforeFetch: (params) => { return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; @@ -425,6 +425,9 @@ :deep(.ant-table-selection-col) { width: 50px; } + :deep(.w-full .ant-col-8:nth-child(1) .ant-form-item-label) { + width: 50px !important; + } .show{ display: flex; } diff --git a/src/views/supplier/ScoreSupplier/components/config.ts b/src/views/supplier/ScoreSupplier/components/config.ts index a6b8a5c..25e507e 100644 --- a/src/views/supplier/ScoreSupplier/components/config.ts +++ b/src/views/supplier/ScoreSupplier/components/config.ts @@ -6,41 +6,19 @@ 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: '评价日期', - component: 'TimeRangePicker', + label: '日期', + component: 'RangePicker', componentProps: { - format: 'HH:mm:ss', + format: 'YYYY-MM-DD', style: { width: '100%' }, getPopupContainer: () => document.body, }, }, { - field: 'score', - label: '分数合计', + field: 'cpCode', + label: '供应商', component: 'Input', }, { @@ -56,11 +34,6 @@ export const searchFormSchema: FormSchema[] = [ getPopupContainer: () => document.body, }, }, - { - field: 'note', - label: '备注', - component: 'Input', - }, ]; export const columns: BasicColumn[] = [ @@ -83,18 +56,17 @@ export const columns: BasicColumn[] = [ }, { - dataIndex: 'dateGrade', - title: '评价日期', - componentType: 'time', + dataIndex: 'score', + title: '评价分数', + componentType: 'input', align: 'left', sorter: true, }, - { - dataIndex: 'score', - title: '分数合计', - componentType: 'input', + dataIndex: 'dateGrade', + title: '评价日期', + componentType: 'time', align: 'left', sorter: true, diff --git a/src/views/supplier/ScoreSupplier/components/createForm.vue b/src/views/supplier/ScoreSupplier/components/createForm.vue index 18080bd..80b58d6 100644 --- a/src/views/supplier/ScoreSupplier/components/createForm.vue +++ b/src/views/supplier/ScoreSupplier/components/createForm.vue @@ -16,7 +16,7 @@ - + {{ item.gsName }} @@ -84,6 +84,7 @@ import UploadList from '/@/components/Form/src/components/UploadList.vue'; import supplierListModal from '/@/components/common/supplierListModal.vue'; import { getUserInfo } from '/@/api/system/login'; + import { Modal } from 'ant-design-vue'; const tableName = 'ScoreSupplier'; const columnName = 'ScoreSupplier' @@ -127,7 +128,7 @@ 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}, @@ -202,14 +203,56 @@ formState.classCode = val[0].classCode formState.cpCodeName = val[0].suName } + const gsIdFocus = (val) => { + gsIdOld.value = val + console.log(444, val) + } async function gsIdChange (val) { + if (!val) { + dataList.value = [] + return + } const res = await getLngGradeSystem(val) - 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 - }) + 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 + }) + 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') diff --git a/src/views/supplier/ScoreSupplier/index.vue b/src/views/supplier/ScoreSupplier/index.vue index cad6797..3406e5e 100644 --- a/src/views/supplier/ScoreSupplier/index.vue +++ b/src/views/supplier/ScoreSupplier/index.vue @@ -121,8 +121,8 @@ gutter: 16, }, schemas: customSearchFormSchema, - fieldMapToTime: [['dateGrade', ['dateGradeStart', 'dateGradeEnd'], 'HH:mm:ss ', true],], - showResetButton: false, + fieldMapToTime: [['dateGrade', ['startDate', 'endDate'], 'HH:mm:ss ', true],], + showResetButton: true, }, beforeFetch: (params) => { return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; @@ -425,6 +425,9 @@ :deep(.ant-table-selection-col) { width: 50px; } + :deep(.w-full .ant-col-8:nth-child(1) .ant-form-item-label) { + width: 50px !important; + } .show{ display: flex; } diff --git a/src/views/supplier/Supplier/index.vue b/src/views/supplier/Supplier/index.vue index 9c44aa7..1bcfb45 100644 --- a/src/views/supplier/Supplier/index.vue +++ b/src/views/supplier/Supplier/index.vue @@ -122,7 +122,7 @@ }, schemas: customSearchFormSchema, fieldMapToTime: [], - showResetButton: false, + showResetButton: true, }, beforeFetch: (params) => { return { ...params, FormId: formIdComputedRef.value, PK: 'id' };