评价优化
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</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 v-model:value="formState.gsId" :disabled="isDisable" placeholder="请选择评价体系" @mouseenter="gsIdFocus(formState.gsId)" @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>
|
||||
@ -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) => {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</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 v-model:value="formState.gsId" :disabled="isDisable" placeholder="请选择评价体系" @mouseenter="gsIdFocus(formState.gsId)" @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>
|
||||
@ -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')
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
|
||||
Reference in New Issue
Block a user