审批流按钮
This commit is contained in:
@ -9,7 +9,7 @@ export const searchFormSchema: FormSchema[] = [
|
||||
|
||||
{
|
||||
field: 'kNo',
|
||||
label: '合同号/合同名称',
|
||||
label: '合同号/名称',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="供应商" name="cpName">
|
||||
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearcSupplier"/>
|
||||
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearchSupplier"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -540,7 +540,7 @@
|
||||
const onSearch = (val)=> {
|
||||
openModalDept(true,{isUpdate: false})
|
||||
}
|
||||
const onSearcSupplier = () => {
|
||||
const onSearchSupplier = () => {
|
||||
openModalSupplier(true,{isUpdate: false})
|
||||
}
|
||||
const onSearchUser = (val)=> {
|
||||
@ -658,9 +658,23 @@
|
||||
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
|
||||
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
|
||||
}
|
||||
let arr1 = []
|
||||
dataListAppro.value.forEach(v=>{
|
||||
v.approId = ''
|
||||
arr1.concat(v.lngContractPurPngPointSalesList || [])
|
||||
})
|
||||
let newArr = arr1.map(v=>v.pointDelyCode)
|
||||
let codeList = dataListPoint.value.map(v =>v.pointUpCode)
|
||||
const isRepeat=codeList.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||
const isRepeatNew=newArr.some((item,index,arr)=>arr.indexOf(item)!=index);
|
||||
if(isRepeat){
|
||||
message.warn('上载点不可重复');
|
||||
return
|
||||
}
|
||||
if(isRepeatNew){
|
||||
message.warn('交割点不可重复');
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
...formState,
|
||||
lngContractPurPngPointList: dataListPoint.value,
|
||||
@ -676,7 +690,8 @@
|
||||
"periodTypeCode": formState.periodTypeCode,
|
||||
"uomCode": formState.uomCode,
|
||||
}
|
||||
]
|
||||
],
|
||||
approCode: pageType.value=='update' ? 'WTJ' : formState.approCode
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
|
||||
@ -74,9 +74,9 @@
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"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":false,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"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":"approve","icon":"ant-design:check-outlined","isDefault":false,"isUse":true},{"name":"变更","code":"update","icon":"ant-design:edit-filled","isDefault":false,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord', 'approve', 'update']);
|
||||
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,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,}
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete, update:handleUpdate, approve:handleApprove}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -157,9 +157,12 @@
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
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/ContractPurPng/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractPurPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractPurPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id,
|
||||
disabled: 1,
|
||||
}
|
||||
});
|
||||
}
|
||||
// router.push({
|
||||
// path: '/form/ContractPurPng/' + record.id + '/viewForm',
|
||||
// query: {
|
||||
// formPath: 'contract/ContractPurPng',
|
||||
// formName: formName,
|
||||
// formId:currentRoute.value.meta.formId
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,6 +250,36 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleUpdate(record: Recordable) {
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractPurPng',
|
||||
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]);
|
||||
}
|
||||
@ -292,9 +339,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,
|
||||
@ -309,21 +358,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) {
|
||||
@ -409,11 +486,11 @@
|
||||
width: 50px;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
|
||||
width: 118px !important;
|
||||
width: 100px !important;
|
||||
}
|
||||
:deep(.ant-col-8:nth-child(1)) {
|
||||
max-width: 330px !important;
|
||||
width: 330px !important;
|
||||
max-width: 300px !important;
|
||||
width: 300px !important;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user