diff --git a/src/api/dayPlan/LngAppro/index.ts b/src/api/dayPlan/LngAppro/index.ts index 58000b5..a140ff0 100644 --- a/src/api/dayPlan/LngAppro/index.ts +++ b/src/api/dayPlan/LngAppro/index.ts @@ -3,17 +3,28 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/dayPlan/lngAppro/page', + // Page = '/dayPlan/lngAppro/page', + Page = '/magic-api/dayPlan/lngAppro/page', List = '/dayPlan/lngAppro/list', Info = '/dayPlan/lngAppro/info', - LngLngAppro = '/dayPlan/lngAppro', - - + // LngLngAppro = '/dayPlan/lngAppro', + LngLngAppro = '/dayPlan/lngAppro/approve', + compare = '/dayPlan/lngAppro/compare', DataLog = '/dayPlan/lngAppro/datalog', } - +export async function getLngLngApproCompare(orgId: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.compare, + params: { orgId }, + }, + { + errorMessageMode: mode, + }, + ); +} /** * @description: 查询LngLngAppro分页列表 */ diff --git a/src/components/common/settleLngHdrList.vue b/src/components/common/settleLngHdrList.vue index b326529..96bf906 100644 --- a/src/components/common/settleLngHdrList.vue +++ b/src/components/common/settleLngHdrList.vue @@ -11,15 +11,15 @@
修改价格/吉焦 - +
修改价格/吨 - +
修改金额 - +
@@ -28,7 +28,7 @@ 删除 @@ -45,6 +45,7 @@ import { message } from 'ant-design-vue'; import priceLngHdrListModal from '/@/components/common/priceLngHdrListModal.vue'; import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat'; +import { kStringMaxLength } from 'node:buffer'; const router = useRouter(); const { t } = useI18n(); @@ -78,18 +79,32 @@ formState: Object, pageType: String }); - const rowKey = props.pageType=='supplier' ? 'salesPurId': 'salesId' + const rowKey = 'salesId' const emit = defineEmits(['change']); const onSelectChange = (rowKeys) => { selectedKeys.value = rowKeys; } - const editBtn = (val) => { - + const editBtn = (k) => { + if (!formData[k]) { + message.warn('价格不能为空') + return + } + if (!selectedKeys.value.length) { + message.warn('请选择需要批量修改的数据') + return + } + dataList.value.forEach(v=> { + selectedKeys.value.forEach(i => { + if (v.id == i) { + v[k] = formData[k] + } + }) + }) } const handleBtn = (type) => { if (type === 'add') { if (!props.formState.cpCode || !props.formState.comId) { - message.warn(props.pageType == 'customer' ? '请选择客户和交易主体' : '请选择供应商和交易主体') + message.warn('请选择客户和交易主体') return } let obj = { @@ -114,8 +129,6 @@ } const handleSuccessHdr = (val) => { val.forEach(i =>{ - i.qtyMeaGj = props.pageType == 'supplier' ? i.qtyMeaPurGj : i.qtyMeaSalesGj - i.qtyMeaM3 = props.pageType == 'supplier' ? i.qtyMeaPurM3 : i.qtyMeaPurM3 delete i.lngFileUploadList }) if (!dataList.value.length) { @@ -136,17 +149,6 @@ emit('change', dataList.value) } if (type == 'kName'){ - if (props.pageType == 'supplier') { - router.push({ - path: '/contract/ContractPurPng/viewForm', - query: { - formPath: 'dayPlan/PngSettleHdrPur', - id: record.kpId, - disabled: true - } - }); - return - } router.push({ path: '/contract/ContractSales/viewForm', query: { @@ -197,15 +199,7 @@ () => props.pageType, (val) => { if (val) { - let idx1 = columns.value.findIndex(v=>v.dataIndex == 'pointUpName') - let idx2 = columns.value.findIndex(v=>v.dataIndex == 'cuSname') - if (val == 'supplier') { - idx1 < 0 && columns.value.splice(4, 0, { title: t('上载点'), dataIndex: 'pointUpName', width: 200}) - idx2 < 0 && columns.value.splice(5, 0, { title: t('客户'), dataIndex: 'cuSname', width: 200}) - } else { - idx1>-1 && columns.value.splice(idx1, 1) - idx2>-1 && columns.value.splice(idx2, 1) - } + } }, { diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index fc3b57f..2e0a055 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -350,9 +350,17 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{ title: (route) => route.query.formName } }, + { + path: '/dayPlan/LngAppro/createForm', + name: 'LngAppro', + component: () => import('/@/views/dayPlan/LngAppro/components/createForm.vue'), + meta: { + title: (route) => route.query.formName + } + }, { path: '/system/LngSmsTemplate/LngSmsRecord', - name: 'LngDemand', + name: 'LngSmsTemplate', component: () => import('/@/views/system/LngSmsTemplate/LngSmsRecord.vue'), meta: { title: (route) => (route.query.formName || '短信记录') diff --git a/src/views/dayPlan/LngAppro/components/basicForm.vue b/src/views/dayPlan/LngAppro/components/basicForm.vue new file mode 100644 index 0000000..a7fa56e --- /dev/null +++ b/src/views/dayPlan/LngAppro/components/basicForm.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/src/views/dayPlan/LngAppro/components/config.ts b/src/views/dayPlan/LngAppro/components/config.ts index 170d290..f44a0d6 100644 --- a/src/views/dayPlan/LngAppro/components/config.ts +++ b/src/views/dayPlan/LngAppro/components/config.ts @@ -27,8 +27,8 @@ export const searchFormSchema: FormSchema[] = [ component: 'Input', }, { - field: 'kName', - label: '销售合同名称/编码', + field: 'cuName', + label: '客户名称/简称/编码', component: 'Input', }, { @@ -39,18 +39,12 @@ export const searchFormSchema: FormSchema[] = [ { field: 'approCode', label: '审批状态', - component: 'Select', + component: 'XjrSelect', componentProps: { - showSearch: true, - optionFilterProp: 'label', - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; - }, - options: [ - // { label: '全部', value: '' }, - ], - placeholder: '请选择', - allowClear: true, + datasourceType: 'dic', + params: { itemId: '2011630929726271489' }, + labelField: 'name', + valueField: 'value', getPopupContainer: () => document.body, }, @@ -64,7 +58,7 @@ export const columns: BasicColumn[] = [ title: '版本号', componentType: 'input', align: 'left', - + width: 80, sorter: true, }, @@ -73,7 +67,7 @@ export const columns: BasicColumn[] = [ title: '计划日期', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -82,7 +76,7 @@ export const columns: BasicColumn[] = [ title: '客户简称', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -91,7 +85,7 @@ export const columns: BasicColumn[] = [ title: '气源地', componentType: 'input', align: 'left', - + width: 130, sorter: true, }, @@ -100,7 +94,7 @@ export const columns: BasicColumn[] = [ title: '车头号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -109,7 +103,7 @@ export const columns: BasicColumn[] = [ title: '挂车号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -118,7 +112,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员身份证号', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -127,7 +121,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员姓名', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -136,7 +130,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员手机号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -145,7 +139,7 @@ export const columns: BasicColumn[] = [ title: '押运员身份证号', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -154,7 +148,7 @@ export const columns: BasicColumn[] = [ title: '押运员姓名', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -163,7 +157,7 @@ export const columns: BasicColumn[] = [ title: '押运员手机号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -172,16 +166,16 @@ export const columns: BasicColumn[] = [ title: '承运商', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, { - dataIndex: 'ksName', + dataIndex: 'kName', title: '销售合同', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -190,7 +184,7 @@ export const columns: BasicColumn[] = [ title: '卸货站点', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -199,7 +193,7 @@ export const columns: BasicColumn[] = [ title: '变更', componentType: 'input', align: 'left', - + width: 80, sorter: true, }, @@ -208,7 +202,7 @@ export const columns: BasicColumn[] = [ title: '审批状态', componentType: 'input', align: 'left', - + width: 100, sorter: true, }, ]; diff --git a/src/views/dayPlan/LngAppro/components/createForm.vue b/src/views/dayPlan/LngAppro/components/createForm.vue new file mode 100644 index 0000000..a51235c --- /dev/null +++ b/src/views/dayPlan/LngAppro/components/createForm.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/views/dayPlan/LngAppro/index.vue b/src/views/dayPlan/LngAppro/index.vue index 9f26d82..c997cab 100644 --- a/src/views/dayPlan/LngAppro/index.vue +++ b/src/views/dayPlan/LngAppro/index.vue @@ -32,7 +32,7 @@ import { ref, computed, onMounted, onUnmounted, } from 'vue'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; - import { getLngLngApproPage, deleteLngLngAppro} from '/@/api/dayPlan/LngAppro'; + import { getLngLngApproPage, deleteLngLngAppro,addLngLngAppro} from '/@/api/dayPlan/LngAppro'; import { PageWrapper } from '/@/components/Page'; import { useMessage } from '/@/hooks/web/useMessage'; import { useI18n } from '/@/hooks/web/useI18n'; @@ -79,7 +79,7 @@ return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); }); - const btnEvent = {refresh : handleRefresh,view : handleView,datalog : handleDatalog,approve : handleApprove,} + const btnEvent = {refresh : handleRefresh,view : handleView,datalog : handleDatalog,approve : handleApprove,compare: handleCompare} const { currentRoute } = useRouter(); const selectedKeys = ref([]) @@ -90,7 +90,7 @@ schemaIdComputedRef.value = currentRoute.value.meta.schemaId const [registerModal, { openModal }] = useModal(); const formName=currentRoute.value.meta?.title; - const [registerTable, { reload, }] = useTable({ + const [registerTable, { reload, clearSelectedRowKeys }] = useTable({ title: '' || (formName + '列表'), api: getLngLngApproPage, rowKey: 'id', @@ -100,11 +100,11 @@ gutter: 16, }, schemas: customSearchFormSchema, - fieldMapToTime: [], - showResetButton: false, + fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD']], + showResetButton: true, }, beforeFetch: (params) => { - return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; + return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit }; }, afterFetch: (res) => { tableRef.value.setToolBarWidth(); @@ -134,47 +134,72 @@ selectedKeys.value = rowKeys; } function dbClickRow(record) { - if (!actionButtonConfig?.value.some(element => element.code == 'view')) { - return; - } - const { processId, taskIds, schemaId } = record.workflowData || {}; - if (taskIds && taskIds.length) { - router.push({ - path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow', - query: { - taskId: taskIds[0], - formName: formName, - formId:currentRoute.value.meta.formId - } - }); - } else if (schemaId && !taskIds && processId) { - router.push({ - path: '/flow/' + schemaId + '/' + processId + '/approveFlow', - query: { - readonly: 1, - taskId: '', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); - } else { - router.push({ - path: '/form/LngAppro/' + record.id + '/viewForm', - query: { + router.push({ + path: '/dayPlan/LngAppro/createForm', + query: { formPath: 'dayPlan/LngAppro', - formName: formName, - formId:currentRoute.value.meta.formId - } - }); - } + formName: '查看'+formName, + formId:currentRoute.value.meta.formId, + id: record.id, + type: 'view' + } + }); } function buttonClick(code) { - btnEvent[code](); + btnEvent[code]('batch'); } - function handleApprove () { + async function handleApprove(record: Recordable) { + if (record !== 'batch') { + router.push({ + path: '/dayPlan/LngAppro/createForm', + query: { + formPath: 'dayPlan/LngAppro', + formName: '审批'+formName, + formId:currentRoute.value.meta.formId, + id: record.id, + } + }); + return + } + if (!selectedKeys.value.length) { + notification.warning({ + message: '提示', + description: t('请选择需要审批的数据'), + }); + return; + } + let arr = selectedKeys.value.map(v=> { + return { + id: v + } + }) + let obj = { + "result": "C", + "remark": "", + "data": arr + } + await addLngLngAppro(obj) + handleSuccess(); + notification.success({ + message: '提示', + description: t('已审批!'), + }) + + } + function handleCompare (record: Recordable) { + router.push({ + path: '/dayPlan/LngAppro/createForm', + query: { + formPath: 'dayPlan/LngAppro', + formName: '对比'+formName, + formId:currentRoute.value.meta.formId, + id: record.demandOrgId, + type: 'compare' + } + }); } function handleDatalog (record: Recordable) { modalVisible.value = true @@ -184,7 +209,7 @@ reload(); } function handleSuccess() { - + clearSelectedRowKeys() reload(); } @@ -214,27 +239,29 @@ } }); function getActions(record: Recordable):ActionItem[] { - - const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { - if (!record.workflowData?.processId) { - return { + let actionsList: ActionItem[] = []; + let approveBtn: ActionItem[] = []; + let viewBtn: ActionItem[] = []; + actionButtonConfig.value?.map((button) => { + if (['view', 'copyData','compare', 'datalog'].includes(button.code)) { + viewBtn.push({ icon: button?.icon, tooltip: button?.name, - color: button.code === 'delete' ? 'error' : undefined, onClick: btnEvent[button.code].bind(null, record), - }; - } else { - if (button.code === 'view') { - return { - icon: button?.icon, - tooltip: button?.name, - onClick: btnEvent[button.code].bind(null, record), - }; - } else { - return {}; - } + }); + } + if (['approve'].includes(button.code)) { + approveBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); } }); + if (record.approCode == 'DD') { + actionsList = actionsList.concat(approveBtn); + } + actionsList = actionsList.concat(viewBtn); return actionsList; } async function mergeCustomListRenderConfig(){ @@ -275,11 +302,11 @@ max-width: 320px !important; } :deep(.ant-col-8:nth-child(4) .ant-form-item-label) { - width: 130px !important; - max-width: 130px !important; + width: 150px !important; + max-width: 150px !important; } :deep(.ant-col-8:nth-child(4) .ant-form-item-label label) { - width: 130px !important; - max-width: 130px !important; + width: 150px !important; + max-width: 150px !important; } \ No newline at end of file diff --git a/src/views/dayPlan/LngDemand/components/basicForm.vue b/src/views/dayPlan/LngDemand/components/basicForm.vue index 69ea28d..cce8ca2 100644 --- a/src/views/dayPlan/LngDemand/components/basicForm.vue +++ b/src/views/dayPlan/LngDemand/components/basicForm.vue @@ -6,19 +6,19 @@
{{ formState.datePlan ? dayjs(formState.datePlan).format('YYYY-MM-DD'): null }}
- +
{{ formState.kName }}
- +
{{ formState.staName }}
- +
@@ -191,7 +191,8 @@ }); const optionSelect= reactive({ timePeriodList: [], - supplyCodeList: [] + supplyCodeList: [], + approCodeList: [] }) const diffResultList = ref([]) const formState = ref({}) @@ -362,4 +363,7 @@ :deep(.changeStyle .ant-input) { color: red !important; } + :deep(.changeStyle .ant-select-selection-item) { + color: red !important; + } diff --git a/src/views/dayPlan/LngDemand/components/config.ts b/src/views/dayPlan/LngDemand/components/config.ts index daadbd2..7d71fa0 100644 --- a/src/views/dayPlan/LngDemand/components/config.ts +++ b/src/views/dayPlan/LngDemand/components/config.ts @@ -59,7 +59,7 @@ export const columns: BasicColumn[] = [ title: '版本号', componentType: 'input', align: 'left', - + width: 80, sorter: true, }, @@ -68,7 +68,7 @@ export const columns: BasicColumn[] = [ title: '计划日期', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -77,7 +77,7 @@ export const columns: BasicColumn[] = [ title: '气源地', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -86,7 +86,7 @@ export const columns: BasicColumn[] = [ title: '车头号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -95,7 +95,7 @@ export const columns: BasicColumn[] = [ title: '挂车号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -104,7 +104,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员身份证号', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -113,7 +113,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员姓名', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -122,7 +122,7 @@ export const columns: BasicColumn[] = [ title: '驾驶员手机号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -131,7 +131,7 @@ export const columns: BasicColumn[] = [ title: '押运员身份证号', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -140,7 +140,7 @@ export const columns: BasicColumn[] = [ title: '押运员姓名', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -149,7 +149,7 @@ export const columns: BasicColumn[] = [ title: '押运员手机号', componentType: 'input', align: 'left', - + width: 120, sorter: true, }, @@ -158,7 +158,7 @@ export const columns: BasicColumn[] = [ title: '承运商', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -167,7 +167,7 @@ export const columns: BasicColumn[] = [ title: '合同', componentType: 'input', align: 'left', - + width: 150, sorter: true, }, @@ -176,7 +176,7 @@ export const columns: BasicColumn[] = [ title: '变更', componentType: 'input', align: 'left', - + width: 80, sorter: true, }, @@ -185,7 +185,7 @@ export const columns: BasicColumn[] = [ title: '审批状态', componentType: 'input', align: 'left', - + width: 80, sorter: true, }, ]; diff --git a/src/views/dayPlan/LngDemand/components/createForm.vue b/src/views/dayPlan/LngDemand/components/createForm.vue index 6098371..f4d5aee 100644 --- a/src/views/dayPlan/LngDemand/components/createForm.vue +++ b/src/views/dayPlan/LngDemand/components/createForm.vue @@ -183,7 +183,7 @@ spinning.value = true; let request = submitSaveLngDemand if (type == 'save') { - request = !pageId.value ? addLngLngDemand : updateLngLngDemand + request = (!pageId.value || pageType.value=='update') ? addLngLngDemand : updateLngLngDemand } await request(obj) spinning.value = false; diff --git a/src/views/dayPlan/LngDemand/index.vue b/src/views/dayPlan/LngDemand/index.vue index 0888701..5981a21 100644 --- a/src/views/dayPlan/LngDemand/index.vue +++ b/src/views/dayPlan/LngDemand/index.vue @@ -101,7 +101,7 @@ let arr =[{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"}, {"isUse":true,"name":"提交","code":"submit","icon":"ant-design:send-outlined","isDefault":true}, - {"isUse":true,"name":"撤回","code":"withdraw","icon":"ant-design:rollback-outlined","isDefault":false}, + {"isUse":true,"name":"撤回","code":"withdraw","icon":"ant-design:rollback-outlined","isDefault":true}, {"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true}, {"isUse":true,"name":"导出模板","code":"export","icon":"ant-design:export-outlined","isDefault":true}, {"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},] @@ -290,7 +290,7 @@ path: '/dayPlan/LngDemand/createForm', query: { formPath: 'dayPlan/LngDemand', - formName: formName, + formName: '变更'+formName, formId:currentRoute.value.meta.formId, id: record.id, type: 'update' diff --git a/src/views/dayPlan/LngSettleHdr/components/createForm.vue b/src/views/dayPlan/LngSettleHdr/components/createForm.vue index 4471018..7f182da 100644 --- a/src/views/dayPlan/LngSettleHdr/components/createForm.vue +++ b/src/views/dayPlan/LngSettleHdr/components/createForm.vue @@ -77,7 +77,7 @@ - + diff --git a/src/views/dayPlan/LngSettleHdr/index.vue b/src/views/dayPlan/LngSettleHdr/index.vue index 3c95036..5f04a05 100644 --- a/src/views/dayPlan/LngSettleHdr/index.vue +++ b/src/views/dayPlan/LngSettleHdr/index.vue @@ -15,6 +15,11 @@