From 93c0f9fc74553b9ef2fa79d47261a23ef06d8f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98huanghaiixia=E2=80=99?= <980486410@.com> Date: Mon, 5 Jan 2026 17:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=20=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=AE=A1=E6=89=B9=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateCodeStep/src/ViewDesignStep.vue | 14 + src/components/Tree/src/Tree.vue | 2 +- .../common/correlationContractFactList.vue | 3 +- src/components/common/downloadPointModal.vue | 104 ++++++ src/router/routes/basic.ts | 8 + .../ContractFact/components/createForm.vue | 10 +- .../ContractPurPng/components/createForm.vue | 317 +++++++++++++----- src/views/contract/ContractPurPng/index.vue | 26 +- .../areaManager/components/AreaModal.vue | 4 +- src/views/dataconfig/areaManager/index.vue | 2 +- src/views/sales/Customer/components/config.ts | 2 +- src/views/sales/Customer/index.vue | 136 +++++--- .../ScoreCustomer/components/createForm.vue | 5 + src/views/secondDev/approveFlowPage.vue | 8 +- .../ScoreSupplier/components/createForm.vue | 5 + src/views/supplier/Supplier/index.vue | 123 ++++--- 16 files changed, 595 insertions(+), 174 deletions(-) create mode 100644 src/components/common/downloadPointModal.vue diff --git a/src/components/CreateCodeStep/src/ViewDesignStep.vue b/src/components/CreateCodeStep/src/ViewDesignStep.vue index 271a1fa..61471d3 100644 --- a/src/components/CreateCodeStep/src/ViewDesignStep.vue +++ b/src/components/CreateCodeStep/src/ViewDesignStep.vue @@ -670,6 +670,20 @@ code: PrintButton.CODE, icon: 'ant-design:printer-outlined', isDefault: true + }, + { + isUse: false, + name: t('变更'), + code: 'update', + icon: 'ant-design:edit-filled', + isDefault: true + }, + { + isUse: false, + name: t('审批'), + code: 'approve', + icon: 'ant-design:check-outlined', + isDefault: true } ]; diff --git a/src/components/Tree/src/Tree.vue b/src/components/Tree/src/Tree.vue index 6bc1df7..ec5ec82 100644 --- a/src/components/Tree/src/Tree.vue +++ b/src/components/Tree/src/Tree.vue @@ -382,7 +382,7 @@ return () => { const { title, helpMessage, toolbar, search, checkable } = props; const showTitle = title || toolbar || search || slots.headerTitle; - const scrollStyle: CSSProperties = { height: 'calc(100% - 100px)' }; + const scrollStyle: CSSProperties = { height: 'calc(100% - 150px)' }; const inputslots = { prefix: () => }; return (
diff --git a/src/components/common/correlationContractFactList.vue b/src/components/common/correlationContractFactList.vue index 1741965..81f8a78 100644 --- a/src/components/common/correlationContractFactList.vue +++ b/src/components/common/correlationContractFactList.vue @@ -63,7 +63,6 @@ } const handleSuccess = (val) =>{ val.forEach(v => { - v.approId = v.id v.id = null }) if (!dataList.value.length) { @@ -110,7 +109,7 @@ } if (btn == 'view') { router.push({ - path: '/approve/Appro/form', + path: '/contract/ContractFact/form', query: { id: record.id || record.approId, disabled: true diff --git a/src/components/common/downloadPointModal.vue b/src/components/common/downloadPointModal.vue new file mode 100644 index 0000000..9458f60 --- /dev/null +++ b/src/components/common/downloadPointModal.vue @@ -0,0 +1,104 @@ + + + diff --git a/src/router/routes/basic.ts b/src/router/routes/basic.ts index 18db286..12af665 100644 --- a/src/router/routes/basic.ts +++ b/src/router/routes/basic.ts @@ -262,6 +262,14 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{ title: (route) => '签报详情' } }, + { + path: '/contract/ContractFact/form', + name: 'ContractFactForm', + component: () => import('/@/views/contract/ContractFact/components/createForm.vue'), + meta: { + title: (route) => '合同详情' + } + }, ] diff --git a/src/views/contract/ContractFact/components/createForm.vue b/src/views/contract/ContractFact/components/createForm.vue index 32c60c1..dad62b5 100644 --- a/src/views/contract/ContractFact/components/createForm.vue +++ b/src/views/contract/ContractFact/components/createForm.vue @@ -76,7 +76,7 @@ - + @@ -297,7 +297,7 @@ relTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], kTypeCode1: [{ required: true, message: "该项为必填项", trigger: 'change' }], periodTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - cpCount: [{ required: true, message: "该项为必填项", trigger: 'change' }], + cpCount: [{ required: false, message: "该项为必填项", trigger: 'change' }], amountTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], settleTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], bidSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], @@ -521,12 +521,14 @@ return } dataList.value.push({...val}) + formState.cpCount = dataList.value.length } const btnCheck = (type, btn, record, index) => { curIdx.value = null if (type == 'cp') { if (btn == 'delete') { dataList.value.splice(index, 1) + formState.cpCount = dataList.value.length } if (btn == 'edit') { openModalUser(true, {record: record,isUpdate: true}); @@ -555,10 +557,10 @@ try { await formRef.value.validateFields(); - if (Number(formState.cpCount) !== dataList.value.length) { + if (Number(formState.cpCount)<0 || Number(formState.cpCount)>20) { notification.warning({ message: 'Tip', - description: '相对数量需与相对方信息个数一致' + description: '相对方信息个数必须在0-20间' }); return } diff --git a/src/views/contract/ContractPurPng/components/createForm.vue b/src/views/contract/ContractPurPng/components/createForm.vue index fa77d1a..61f1728 100644 --- a/src/views/contract/ContractPurPng/components/createForm.vue +++ b/src/views/contract/ContractPurPng/components/createForm.vue @@ -40,17 +40,17 @@ - + - + - + @@ -110,20 +110,16 @@

上载点

新增 删除 -
+
- - - - {{ item.name }} - - + + - + {{ item.name }} @@ -132,12 +128,16 @@ - + - - + +
+ + + +
@@ -146,13 +146,33 @@
新增行 - + + @@ -203,6 +223,8 @@ + + @@ -218,9 +240,11 @@ import type { Rule } from 'ant-design-vue/es/form'; import { getDictionary } from '/@/api/sales/Customer'; import { useModal } from '/@/components/Modal'; - import { addLngContractFact,updateLngContractFact,getAllCurrency,getAllUser, getLngContractFact } from '/@/api/contract/ContractFact'; + import { addLngContract,updateLngContract, getLngContract } from '/@/api/contract/ContractPurPng'; import { getLngAppro,getCompDept } from '/@/api/approve/Appro'; import dayjs from 'dayjs'; + import { h } from 'vue'; + import { SearchOutlined } from '@ant-design/icons-vue'; import { getAppEnvConfig } from '/@/utils/env'; import { message } from 'ant-design-vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue'; @@ -229,9 +253,10 @@ import correlationApproList from '/@/components/common/correlationApproList.vue'; import correlationContractFactList from '/@/components/common/correlationContractFactList.vue'; import contractFactListModal from '/@/components/common/contractFactListModal.vue'; - - import { Modal } from 'ant-design-vue'; + import downloadPointModal from '/@/components/common/downloadPointModal.vue'; + import supplierListModal from '/@/components/common/supplierListModal.vue'; import { useUserStore } from '/@/store/modules/user'; + const userStore = useUserStore(); const userInfo = userStore.getUserInfo; @@ -265,29 +290,26 @@ const { t } = useI18n(); const formState = reactive({ approCode: 'WTJ', - dateDraft: dayjs(new Date()), + typeCode: 'PP', + onlineSign: 'N', + cpTableName: 'lng_supplier', + curCode: 'CNY' }); const [register, { openModal:openModal}] = useModal(); const [registerDept, { openModal:openModalDept}] = useModal(); const [registerContractFact, { openModal:openModalContractFact}] = useModal(); + const [registerDownLoad, { openModal:openModalDownLoad}] = useModal(); + const [registerSupplier, { openModal:openModalSupplier}] = useModal(); const rules= reactive({ kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }], kName: [{ required: true, message: "该项为必填项", trigger: 'change' }], - relTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - kTypeCode1: [{ required: true, message: "该项为必填项", trigger: 'change' }], - periodTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - cpCount: [{ required: true, message: "该项为必填项", trigger: 'change' }], - amountTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - settleTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], - bidSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], - preApproSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], - aheadSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], - tempSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], - impSign: [{ required: true, message: "该项为必填项", trigger: 'change' }], + cpName: [{ required: true, message: "该项为必填项", trigger: 'change' }], + prcTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], + uomCode: [{ required: true, message: "该项为必填项", trigger: 'change' }], empName: [{ required: true, message: "该项为必填项", trigger: 'change' }], - tel: [{ required: true, message: "该项为必填项", trigger: 'change' }], bDeptName: [{ required: true, message: "该项为必填项", trigger: 'change' }], - + dateTo:[{ required: true, message: "该项为必填项", trigger: 'change' }], + dateFrom:[{ required: true, message: "该项为必填项", trigger: 'change' }] }); const layout = { labelCol: { span: 8 }, @@ -297,11 +319,11 @@ { title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80}, { title: t('开始日期'), dataIndex: 'dateFrom', sorter: true, width:150}, { title: t('结束日期'), dataIndex: 'dateTo', sorter: true, width: 150}, - { title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 180}, + { title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130}, { title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100}, - { title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 180}, - { title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 120}, - { title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 120}, + { title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 150}, + { title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 150}, + { title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 150}, { title: t('日气量(吉焦)'), dataIndex: 'qtyGjDay', sorter: true, width: 120}, { title: t('日气量(万方)'), dataIndex: 'qtyM3Day', sorter: true, width: 120}, { title: t('照付不议类型'), dataIndex: 'zfbyTypeCode', sorter: true, width: 120}, @@ -309,11 +331,18 @@ { title: t('备注'), dataIndex: 'note', sorter: true, width: 200}, { title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'}, ]); + const selectType = ref() + const isShow = ref(false) const dataListContractAgree = ref([]) const dataFile = ref([]); const dataListAppro = ref([]) const dataListContractFact = ref([]) - const dataListUpLoad = ref([{}]) + const dataListPoint = ref([{ + "pointUpCode": "", + "transSign": "", + "note": null, + "lngContractPurPngPointSalesList": [] + }]) let optionSelect= reactive({ approCodeList: [], kPriodList: [], @@ -365,15 +394,27 @@ async function getInfo(id) { spinning.value = true try { - let data = await getLngContractFact(id) + let data = await getLngContract(id) spinning.value = false Object.assign(formState, {...data}) + Object.assign(dataListPoint.value, formState.lngContractPurPngPointList || [{}]) + Object.assign(dataListContractAgree.value, formState.lngContractPurPngQtyList || []) Object.assign(dataFile.value, formState.lngFileUploadList || []) - Object.assign(dataList.value, formState.lngContractFactCpList || []) - Object.assign(dataListAppro.value, formState.lngApproVoList || []) - formState.dateDraft = formState.dateDraft ? dayjs(formState.dateDraft) : null + Object.assign(dataListContractFact.value, formState.lngContractFactRelList || []) + Object.assign(dataListAppro.value, formState.lngContractApproRelList || []) + formState.dateCfmFrom = formState.dateCfmFrom ? dayjs(formState.dateCfmFrom) : null + formState.dateCfmTo = formState.dateCfmTo ? dayjs(formState.dateCfmTo) : null + formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null + formState.prcTypeCode = (formState?.lngContractPurPngList[0] || {}).uomCode + formState.periodTypeCode = (formState?.lngContractPurPngList[0] || {}).periodTypeCode + formState.uomCode = (formState?.lngContractPurPngList[0] || {}).uomCode + + dataListContractAgree.forEach(v => { + v.qtyM3Month = Number(v.qtyM3Month)/10000 + v.qtyM3Day = Number(v.qtyM3Day)/10000 + }); } catch (error) { spinning.value = false @@ -414,32 +455,124 @@ } return startValue.valueOf() >= endValue.valueOf(); } - const disabledDateEnd = (endValue) => { - const startValue = formState?.dateFrom; + const disabledDateEnd = (endValue) => { + const startValue = formState?.dateFrom; if (!endValue || !startValue) { return false } return endValue.valueOf() <= startValue.valueOf(); } + const disabledDateCfmStart = (startValue) => { + const endValue = formState?.dateCfmTo; + if (!startValue || !endValue) { + return false + } + return startValue.valueOf() >= endValue.valueOf(); + } + const disabledDateCfmEnd = (endValue) => { + const startValue = formState?.dateCfmFrom; + if (!endValue || !startValue) { + return false + } + return endValue.valueOf() <= startValue.valueOf(); + } + const dateFromTb = (startValue, index, record) => { + if (!startValue) return + const endValue = dataListContractAgree.value[index]?.dateTo; + if (!startValue || !endValue) { + return false + } + if (startValue.valueOf() > endValue.valueOf()) { + message.warning('结束日期须大于等于开始日期') + dataListContractAgree.value[index].dateFrom = '' + return + } + dayCount(record) + } + + const dateToTb = (endValue, index, record) => { + if (!endValue) return + const startValue = dataListContractAgree.value[index]?.dateFrom; + if (!endValue || !startValue) { + return false + } + if (startValue.valueOf() > endValue.valueOf()) { + message.warning('结束日期须大于等于开始日期') + dataListContractAgree.value.splice(index, 1, { ...dataListContractAgree.value[index], dateTo: '' }); + return + } + dayCount(record) + } + const numChange = (key, record) => { + if (key == 'qtyGjMonth') { + numCount2(record) + dayCount(record) + } + if (key == 'qtyM3Month') { + numCount1(record) + dayCount(record) + } + if (key == 'rateM3Gj') { + numCount1(record) + numCount2(record) + dayCount(record) + } + } + const numCount1 = (record) => { + // 月气量(吉焦) =月气量(方)qty_m3_month*rate_m3_gj (比值(方/吉焦) + record.qtyGjMonth = (Number(record.qtyM3Month) || 0) * (Number(record.rateM3Gj) || 0) + record.qtyGjMonth = record.qtyGjMonth ? record.qtyGjMonth.toFixed(4) : '0' + } + const numCount2 = (record) => { + // 月气量(方) = 月气量(吉焦) qty_gj_month/rate_m3_gj/10000 显示时字段值/10000;保存时页面值*10000 + record.qtyM3Month = Number(record.rateM3Gj) ? (Number(record.qtyGjMonth) || 0) /Number(record.rateM3Gj) : 0 + record.qtyM3Month = record.qtyM3Month ? record.qtyM3Month.toFixed(4) : '0' + } + const dayCount = (record) => { + // 日气量(吉焦) = 月气量(吉焦)qty_gj_month/开始日期到结束日期的天数;计算结果保留整数 + const days = dayjs(record.dateTo).diff(dayjs(record.dateFrom), 'day'); + record.qtyGjDay = days ? (Number(record.qtyGjMonth) || 0) /days : 0 + record.qtyGjDay = parseInt(record.qtyGjDay) + // 日气量(方) = 月气量(万方)/开始日期到结束日期的天数;计算结果保留4位小数;显示时字段值/10000;保存时页面值*10000 + record.qtyM3Day = days ? (Number(record.qtyM3Month) || 0) /days : 0 + record.qtyM3Day = record.qtyM3Day ? record.qtyM3Day.toFixed(4) : '0' + } const onSearch = (val)=> { openModalDept(true,{isUpdate: false}) } + const onSearcSupplier = () => { + openModalSupplier(true,{isUpdate: false}) + } const onSearchUser = (val)=> { openModal(true,{isUpdate: false}) } const onContract = (val)=> { openModalContractFact(true,{isUpdate: false}) - + } + const onSearchDownLoad = (val, index)=> { + selectType.value = val=='up'? 'radio' : 'checkbox' + curIdx.value = index + isShow.value = true + nextTick(() => { + openModalDownLoad(true,{isUpdate: false, type: val}) + }); } const addContractAgree = () => { - dataListContractAgree.value.push({}) + dataListContractAgree.value.push({ + dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null + }) } const addUpLoad = ()=> { - dataListUpLoad.value.push({}) + dataListPoint.value.push({ + "pointUpCode": "", + "transSign": "", + "note": null, + "lngContractPurPngPointSalesList": [] + }) } const deleteUpLoad = () => { - if (dataListUpLoad.value.length == 1) return - dataListUpLoad.value.pop() + if (dataListPoint.value.length == 1) return + dataListPoint.value.pop() } const handleSuccess = (val) => { @@ -454,9 +587,12 @@ formState.comName = info.name formState.comId = info.id } + const handleSuccessSupplier = (val) => { + formState.cpCode = val[0].suCode + formState.cpName = val[0].suName + } const handleSuccessContractFact = (val) => { val.forEach(v => { - v.approId = v.id v.id = null }) if (!dataListContractFact.value.length) { @@ -475,17 +611,22 @@ }) dataListContractFact.value = unique([...dataListContractFact.value, ...arr], 'kNo') } - const btnCheck = (type, btn, record, index) => { - curIdx.value = null - if (type == 'cp') { - if (btn == 'delete') { - dataList.value.splice(index, 1) - } - if (btn == 'edit') { - openModalContract(true, {record: record,isUpdate: true}); - } + const cancel = () => { + isShow.value = false + } + const handleSuccessDownLoad = (val, type) => { + isShow.value = false + if (type == 'up') { + dataListPoint.value[curIdx.value].pointUpCode = val[0].code + dataListPoint.value[curIdx.value].pointUpName = val[0].fullName + } else { + let nameList = val.map(v=>v.fullName) + dataListPoint.value[curIdx.value].pointDelyName = nameList.join(',') + dataListPoint.value[curIdx.value].lngContractPurPngPointSalesList = val || [] } - + } + const btnCheck = (record, index) => { + dataListContractAgree.value.splice(index, 1) } function unique(arr, u_key) { const map = new Map() @@ -505,23 +646,41 @@ async function handleSubmit(type) { try { await formRef.value.validateFields(); - - if (Number(formState.cpCount) !== dataList.value.length) { - notification.warning({ - message: 'Tip', - description: '相对数量需与相对方信息个数一致' - }); - return + let arr = JSON.parse(JSON.stringify(dataListContractAgree.value)) + for(let i=0; i{ + v.approId = '' + }) let obj = { ...formState, + lngContractPurPngPointList: dataListPoint.value, + lngContractPurPngQtyList: arr, lngFileUploadList: dataFile.value, - lngContractFactCpList: dataList.value, - lngContractApproRelList: dataListAppro.value + lngContractFactRelList: dataListContractFact.value, + lngContractApproRelList: dataListAppro.value, + lngContractPurPngList: [ + { + ...formState.lngContractPurPngList[0], + "kId": formState.id, + "prcTypeCode": formState.prcTypeCode, + "periodTypeCode": formState.periodTypeCode, + "uomCode": formState.uomCode, + } + ] } spinning.value = true; - let request = !formState.id ? addLngContractFact :updateLngContractFact + let request = !formState.id ? addLngContract :updateLngContract try { const data = await request(obj); @@ -572,5 +731,13 @@ margin-bottom: 12px; border-bottom: 1px solid #eee; } + .redStyle { + color: red; + } + .iconStyle { + position: absolute; + color: rgba(0, 0, 0, 0.45); + // top: 0; + } diff --git a/src/views/contract/ContractPurPng/index.vue b/src/views/contract/ContractPurPng/index.vue index 2a077a8..c33e106 100644 --- a/src/views/contract/ContractPurPng/index.vue +++ b/src/views/contract/ContractPurPng/index.vue @@ -211,15 +211,27 @@ } function handleEdit(record: Recordable) { - - router.push({ - path: '/form/ContractPurPng/' + record.id + '/updateForm', - query: { + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + query: { formPath: 'contract/ContractPurPng', formName: formName, - formId:currentRoute.value.meta.formId - } - }); + formId:currentRoute.value.meta.formId, + type:'edit', + id: record.id + } + }); + } else { + router.push({ + path: '/form/ContractPurPng/' + record.id + '/updateForm', + query: { + formPath: 'contract/ContractPurPng', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); + } } function handleDelete(record: Recordable) { deleteList([record.id]); diff --git a/src/views/dataconfig/areaManager/components/AreaModal.vue b/src/views/dataconfig/areaManager/components/AreaModal.vue index 4a2b7d3..4d8cadb 100644 --- a/src/views/dataconfig/areaManager/components/AreaModal.vue +++ b/src/views/dataconfig/areaManager/components/AreaModal.vue @@ -65,11 +65,11 @@ const isUpdate = ref(true); const rowId = ref(''); - console.log(filterFormSchemaAuth(accountFormSchema, true), 'ssssssssss'); + // console.log(filterFormSchemaAuth(accountFormSchema, true), 'ssssssssss'); const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ labelWidth: 100, - schemas: filterFormSchemaAuth(accountFormSchema, true), + schemas: accountFormSchema, showActionButtonGroup: false, actionColOptions: { span: 23 diff --git a/src/views/dataconfig/areaManager/index.vue b/src/views/dataconfig/areaManager/index.vue index 3027a44..2987211 100644 --- a/src/views/dataconfig/areaManager/index.vue +++ b/src/views/dataconfig/areaManager/index.vue @@ -118,7 +118,7 @@ const { filterColumnAuth } = usePermission(); - const filterColumns = filterColumnAuth(columns, true); + const filterColumns = filterColumnAuth(columns); const [registerModal, { openModal }] = useModal(); const [registerTable, { reload }] = useTable({ diff --git a/src/views/sales/Customer/components/config.ts b/src/views/sales/Customer/components/config.ts index 26b54e7..747a545 100644 --- a/src/views/sales/Customer/components/config.ts +++ b/src/views/sales/Customer/components/config.ts @@ -101,7 +101,7 @@ export const columns: BasicColumn[] = [ }, { - dataIndex: 'approCode', + dataIndex: 'approName', title: '审批状态', componentType: 'input', align: 'left', diff --git a/src/views/sales/Customer/index.vue b/src/views/sales/Customer/index.vue index 3f3f2ea..74be5ff 100644 --- a/src/views/sales/Customer/index.vue +++ b/src/views/sales/Customer/index.vue @@ -75,9 +75,9 @@ const tableRef = ref(); //所有按钮 - const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true}]); + const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true}]); //展示在列表内的按钮 - const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'startwork','flowRecord']); + const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'startwork','flowRecord', 'update', 'approve']); const buttonConfigs = computed(()=>{ return filterButtonAuth(buttons.value); }) @@ -90,7 +90,7 @@ return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); }); - const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,} + const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update: handleUpdate, approve: handleApprove} const { currentRoute } = useRouter(); const router = useRouter(); @@ -181,31 +181,30 @@ formName: formName, formId:currentRoute.value.meta.formId, id: record.id, - status } }); } else { - if (schemaIdComputedRef.value) { - router.push({ - path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', - query: { - formPath: 'sales/Customer', - formName: formName, - formId:currentRoute.value.meta.formId, - type:'edit', - id: record.id, - disabled: 1, - } - }); - } - // router.push({ - // path: '/form/Customer/' + record.id + '/viewForm', - // query: { - // formPath: 'sales/Customer', - // formName: formName, - // formId:currentRoute.value.meta.formId - // } - // }); + // if (schemaIdComputedRef.value) { + // router.push({ + // path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', + // query: { + // formPath: 'sales/Customer', + // formName: formName, + // formId:currentRoute.value.meta.formId, + // type:'edit', + // id: record.id, + // disabled: 1, + // } + // }); + // } + router.push({ + path: '/form/Customer/' + record.id + '/viewForm', + query: { + formPath: 'sales/Customer', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); } } @@ -237,7 +236,7 @@ } function handleEdit(record: Recordable) { - if (schemaIdComputedRef.value) { + if (schemaIdComputedRef.value) { router.push({ path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', query: { @@ -262,6 +261,36 @@ } } + function handleUpdate(record: Recordable) { + const { processId, taskIds, schemaId, status } = record.workflowData || {}; + if (schemaId && !taskIds && processId) { + router.push({ + path: '/flow/' + schemaId + '/' + processId + '/approveFlow', + query: { + readonly: 1, + taskId: '', + formName: formName, + formId:currentRoute.value.meta.formId, + id: record.id, + status + } + }); + } + } + function handleApprove(record: Recordable) { + 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, + id: record.id + } + }); + } + } function handleDelete(record: Recordable) { deleteList([record.id]); } @@ -380,7 +409,9 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let updateBtn: ActionItem[] = []; + let approveBtn: ActionItem[] = []; + let hasFlowRecord = false; actionButtonConfig.value?.map((button) => { if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) { actionsList.push({ @@ -397,21 +428,48 @@ onClick: btnEvent[button.code].bind(null, record), }); } + if (['update'].includes(button.code)) { + updateBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } + if (['approve'].includes(button.code)) { + approveBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } if (button.code === 'flowRecord') hasFlowRecord = true; }); - if (record.workflowData?.enabled) { - //与工作流有关联的表单 - if (record.workflowData.status) { - // actionsList.unshift(setIndexFlowStatus(record.workflowData)) - } else { - actionsList = actionsList.concat(editAndDelBtn); - } - } else { - if (!record.workflowData?.processId) { - //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 - actionsList = actionsList.concat(editAndDelBtn); - } + // 未提交或已驳回 + if (record.approCode == 'WTJ' || record.approCode == 'YBH' ) { + actionsList = actionsList.concat(editAndDelBtn); } + // 审批中SPZ + if (record.workflowData?.editable) { + actionsList = actionsList.concat(approveBtn); + } + // 已审批 + if (record.approCode == 'YSP') { + actionsList = actionsList.concat(updateBtn); + } + + // if (record.workflowData?.enabled) { + // //与工作流有关联的表单 + // if (record.workflowData.status) { + // actionsList.unshift(setIndexFlowStatus(record.workflowData)) + // } else { + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } else { + // if (!record.workflowData?.processId) { + // //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } return actionsList; } diff --git a/src/views/sales/ScoreCustomer/components/createForm.vue b/src/views/sales/ScoreCustomer/components/createForm.vue index 14a86e8..9793296 100644 --- a/src/views/sales/ScoreCustomer/components/createForm.vue +++ b/src/views/sales/ScoreCustomer/components/createForm.vue @@ -270,6 +270,11 @@ }) formState.score = num } + record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') + record.aEmpCode = userInfo.code + record.aEmpName = userInfo.name + record.aDeptCode = compDep.value?.dept?.code + record.aDeptName = compDep.value?.dept?.name } function close() { tabStore.closeTab(currentRoute.value, router); diff --git a/src/views/secondDev/approveFlowPage.vue b/src/views/secondDev/approveFlowPage.vue index 54fb1cc..e35ffd5 100644 --- a/src/views/secondDev/approveFlowPage.vue +++ b/src/views/secondDev/approveFlowPage.vue @@ -563,7 +563,7 @@ } function setBtnStatus() { - const btnConfigs = approvalData.buttonConfigs; + let btnConfigs = approvalData.buttonConfigs; let draftBtn = btnConfigs.find((item) => item.buttonCode === ApproveCode.DRAFT); if (draftBtn && rDraftsId.value) { btnConfigs.push({ @@ -575,13 +575,13 @@ }); } // 如果审批已完成,且没有保存按钮 - if (rQuery.status=='COMPLETED' && btnConfigs.findIndex(v=>v.buttonCode =='draft') < 0) { - btnConfigs.unshift({ + if (rQuery.status=='COMPLETED') { + btnConfigs =[{ buttonName: t('保存'), buttonCode: 'draft', approveType: ApproveType.DRAFT, buttonType: 0 - }); + }]; } btnConfigs.forEach((btn) => { const index = btn.index; diff --git a/src/views/supplier/ScoreSupplier/components/createForm.vue b/src/views/supplier/ScoreSupplier/components/createForm.vue index 0d8ba63..bdb10a1 100644 --- a/src/views/supplier/ScoreSupplier/components/createForm.vue +++ b/src/views/supplier/ScoreSupplier/components/createForm.vue @@ -271,6 +271,11 @@ }) formState.score = num } + record.aTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') + record.aEmpCode = userInfo.code + record.aEmpName = userInfo.name + record.aDeptCode = compDep.value?.dept?.code + record.aDeptName = compDep.value?.dept?.name } function close() { tabStore.closeTab(currentRoute.value, router); diff --git a/src/views/supplier/Supplier/index.vue b/src/views/supplier/Supplier/index.vue index 5afe824..82441e9 100644 --- a/src/views/supplier/Supplier/index.vue +++ b/src/views/supplier/Supplier/index.vue @@ -74,9 +74,9 @@ const selectedKeys = ref([]); const tableRef = ref(); //所有按钮 - const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]); + const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true}]); //展示在列表内的按钮 - const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']); + const actionButtons = ref(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'update', 'approve']); const buttonConfigs = computed(()=>{ return filterButtonAuth(buttons.value); }) @@ -89,7 +89,7 @@ return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); }); - const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,} + const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update: handleUpdate, approve: handleApprove} const { currentRoute } = useRouter(); const router = useRouter(); @@ -183,27 +183,14 @@ } }); } else { - if (schemaIdComputedRef.value) { - router.push({ - path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow', - query: { - formPath: 'supplier/Supplier', - formName: formName, - formId:currentRoute.value.meta.formId, - type:'edit', - id: record.id, - disabled: 1, - } - }); - } - // router.push({ - // path: '/form/Supplier/' + record.id + '/viewForm', - // query: { - // formPath: 'supplier/Supplier', - // formName: formName, - // formId:currentRoute.value.meta.formId - // } - // }); + router.push({ + path: '/form/Supplier/' + record.id + '/viewForm', + query: { + formPath: 'supplier/Supplier', + formName: formName, + formId:currentRoute.value.meta.formId + } + }); } } @@ -256,6 +243,36 @@ }); } } + function handleUpdate(record: Recordable) { + const { processId, taskIds, schemaId, status } = record.workflowData || {}; + if (schemaId && !taskIds && processId) { + router.push({ + path: '/flow/' + schemaId + '/' + processId + '/approveFlow', + query: { + readonly: 1, + taskId: '', + formName: formName, + formId:currentRoute.value.meta.formId, + id: record.id, + status + } + }); + } + } + function handleApprove(record: Recordable) { + 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, + id: record.id + } + }); + } + } function handleDelete(record: Recordable) { deleteList([record.id]); } @@ -372,9 +389,11 @@ let actionsList: ActionItem[] = []; let editAndDelBtn: ActionItem[] = []; - let hasFlowRecord = false; + let updateBtn: ActionItem[] = []; + let approveBtn: ActionItem[] = []; + let hasFlowRecord = false; actionButtonConfig.value?.map((button) => { - if (['view', 'copyData'].includes(button.code)) { + if (['view', 'copyData', 'enable', 'disable'].includes(button.code)) { actionsList.push({ icon: button?.icon, tooltip: button?.name, @@ -389,21 +408,49 @@ onClick: btnEvent[button.code].bind(null, record), }); } + if (['update'].includes(button.code)) { + updateBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } + if (['approve'].includes(button.code)) { + approveBtn.push({ + icon: button?.icon, + tooltip: button?.name, + onClick: btnEvent[button.code].bind(null, record), + }); + } if (button.code === 'flowRecord') hasFlowRecord = true; }); - if (record.workflowData?.enabled) { - //与工作流有关联的表单 - if (record.workflowData.status) { - // actionsList.unshift(setIndexFlowStatus(record.workflowData)) - } else { - actionsList = actionsList.concat(editAndDelBtn); - } - } else { - if (!record.workflowData?.processId) { - //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 - actionsList = actionsList.concat(editAndDelBtn); - } + // 未提交或已驳回 + if (record.approCode == 'WTJ' || record.approCode == 'YBH' ) { + actionsList = actionsList.concat(editAndDelBtn); } + // 审批中SPZ + if (record.workflowData?.editable) { + actionsList = actionsList.concat(approveBtn); + } + // 已审批 + if (record.approCode == 'YSP') { + actionsList = actionsList.concat(updateBtn); + } + + // if (record.workflowData?.enabled) { + // //与工作流有关联的表单 + // if (record.workflowData.status) { + // actionsList.unshift(setIndexFlowStatus(record.workflowData)) + // } else { + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } else { + // if (!record.workflowData?.processId) { + // //与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上 + // actionsList = actionsList.concat(editAndDelBtn); + // } + // } + return actionsList; } function handleStartwork(record: Recordable) {