管输 加工
This commit is contained in:
@ -29,9 +29,7 @@
|
||||
const logId = ref('')
|
||||
const logPath = ref('/contract/contractTransPng/datalog');
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode, } from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
@ -59,6 +57,9 @@
|
||||
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -110,7 +111,7 @@
|
||||
const taskIdRef = ref('');
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='管输合同';
|
||||
const formName=currentRoute.value.meta?.title;
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngContractPage,
|
||||
@ -121,8 +122,8 @@
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
fieldMapToTime: [['dateFrom', ['startDate', 'endDate'], 'YYYY-MM-DD']],
|
||||
showResetButton: true,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page:params.limit };
|
||||
@ -159,7 +160,9 @@
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
readonly: 1,
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
@ -169,18 +172,32 @@
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/ContractTransPng/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractTransPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractTransPng',
|
||||
formName: "查看"+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id,
|
||||
disabled: 1,
|
||||
}
|
||||
});
|
||||
}
|
||||
// router.push({
|
||||
// path: '/form/ContractTransPng/' + record.id + '/viewForm',
|
||||
// query: {
|
||||
// formPath: 'contract/ContractTransPng',
|
||||
// formName: formName,
|
||||
// formId:currentRoute.value.meta.formId
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +213,11 @@
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractSalesLng',
|
||||
formName: "新建"+formName,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
@ -211,21 +232,57 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/ContractTransPng/' + record.id + '/updateForm',
|
||||
query: {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractTransPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
formName: "编辑"+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/ContractTransPng/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractTransPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleUpdate(record: Recordable) {
|
||||
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractTransPng',
|
||||
formName: "变更"+formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'update',
|
||||
id: record.id,
|
||||
processId: processId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
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]);
|
||||
@ -286,9 +343,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','datalog'].includes(button.code)) {
|
||||
actionsList.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
@ -303,21 +362,52 @@
|
||||
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);
|
||||
|
||||
if (record.createUserId !== userInfo.id) {
|
||||
let idx = actionsList.findIndex(v =>v.tooltip == '删除')
|
||||
idx > -1 && actionsList.splice(idx, 1)
|
||||
}
|
||||
}
|
||||
// 审批中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) {
|
||||
|
||||
Reference in New Issue
Block a user