|
|
|
@ -8,7 +8,7 @@ import { submitButton, afreshSubmitButton,editFormCont,draftSubmitButton,editLoo |
|
|
|
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' |
|
|
|
import { gainTaskFormInfo,generateFlow,gainEditDataLog,draftsInitiateApproval,afreshRunWorkflow } from '@/api/taskapi/management' |
|
|
|
import { Close } from '@element-plus/icons-vue' |
|
|
|
import { judgeSubmitCancel,startRunFlow } from '@/api/DesignForm/requestapi' |
|
|
|
import { judgeSubmitCancel,startRunFlow,getFieldRecord } from '@/api/DesignForm/requestapi' |
|
|
|
import { submitButtonEs } from '@/api/DesignForm/tableButton' |
|
|
|
import { |
|
|
|
constFormBtnEvent, |
|
|
|
@ -16,6 +16,8 @@ import { |
|
|
|
} from '@/api/DesignForm/utils' |
|
|
|
|
|
|
|
import RunFlowStep from '@/views/taskplatform/taskmanagement/runFlowStep.vue' |
|
|
|
import { customerFormVersionCont } from "@/api/taskapi/types"; |
|
|
|
import { stringify } from "uuid"; |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
@ -43,7 +45,7 @@ const props = defineProps({ |
|
|
|
} |
|
|
|
}); |
|
|
|
const formEl = ref<any>(); |
|
|
|
const emits = defineEmits(["update:isShow","getPageData"]); |
|
|
|
const emits = defineEmits(["update:isShow","getPageData","optionsValue4Get4"]); |
|
|
|
const formLoading = ref(false); |
|
|
|
const flowAry = ref<any[]>(); //流程列表 |
|
|
|
const currentProgress = ref<number>(1); //当前步进值 |
|
|
|
@ -58,6 +60,9 @@ const openOfClose = computed({ |
|
|
|
} |
|
|
|
}); |
|
|
|
const formProps = inject(constFormProps, {}) as any |
|
|
|
|
|
|
|
let getFieldRecordPromises: any[] = [] |
|
|
|
let objMastesform: any |
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ 时间: 2024-04-03 14:09:24 |
|
|
|
@ -68,6 +73,107 @@ watch(()=>props.isShow,(val:bool)=>{ |
|
|
|
if(val){ |
|
|
|
formLoading.value = true; |
|
|
|
getCustomrrFormInfo(); |
|
|
|
Promise.all(gainTaskFormInfoPromise).then(() => { |
|
|
|
//console.log(gainTaskFormInfoData) |
|
|
|
if(gainTaskFormInfoData.structure&&gainTaskFormInfoData.tableData){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
objMastesform = stringToObj(gainTaskFormInfoData.structure.mastesform) |
|
|
|
for (const element of objMastesform.list) { |
|
|
|
if(element.type == "table"){ |
|
|
|
//console.log(element); |
|
|
|
for (const item of element.list){ |
|
|
|
|
|
|
|
if(item.options){ |
|
|
|
if(item.type=="radio"||item.type=="select"||item.type=="checkbox"){ |
|
|
|
console.log(item.config.optionsType); |
|
|
|
if(item.config.optionsType==3){ |
|
|
|
let paramx:string = ""+item.control.optionsValue3Field |
|
|
|
getFieldRecordPromises.push(getFieldRecord(paramx).then(({ data }) => { |
|
|
|
//console.log(data) |
|
|
|
item.options = data |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Promise.all(getFieldRecordPromises).then(()=>{ |
|
|
|
//console.log(objMastesform) |
|
|
|
|
|
|
|
formState.formData = objMastesform |
|
|
|
//console.log(formState.formData) |
|
|
|
let stringObjMastesform = JSON.stringify(objMastesform); |
|
|
|
//console.log(stringObjMastesform) |
|
|
|
//console.log(gainTaskFormInfoData.structure.mastesformjson) |
|
|
|
|
|
|
|
formState.dict = string2json(gainTaskFormInfoData.structure.dict) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(props.tablePageClass != 4){ |
|
|
|
judgeSubmitCancel({"name":stringObjMastesform}) |
|
|
|
.then((data:any) =>{ |
|
|
|
if(data.code == 0){ |
|
|
|
if (data.data == 3 || data.data == 4){ |
|
|
|
// formState.formData.list.push(submitButtonEs) |
|
|
|
if(props.operState == 2){ |
|
|
|
formState.formData.list.push(afreshSubmitButton) |
|
|
|
}else if(props.operState == 3){ |
|
|
|
formState.formData.list.push(editFormCont) |
|
|
|
}else if(props.operState == 4){ |
|
|
|
formState.formData.list.push(draftSubmitButton) |
|
|
|
}else if(props.operState == 5){ |
|
|
|
formState.formData.list.push(submitButtonEs) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
nextTick(()=>{ |
|
|
|
// console.log("获取自定义表单内容-1111-->",data.tableData) |
|
|
|
formEl.value.setValue(gainTaskFormInfoData.tableData) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
formLoading.value = false; |
|
|
|
//alert(props.pageInfo.masters_key) |
|
|
|
gainEditDataLog({id:props.pageInfo.masters_key}) |
|
|
|
.then(({data})=>{ |
|
|
|
// console.log("获取修改记录-1111-->",data) |
|
|
|
pageLog.value = data |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
/** |
|
|
|
@ -92,15 +198,19 @@ const formState = reactive({ |
|
|
|
loading: true |
|
|
|
}) |
|
|
|
const pageLog = ref<any[]>([]) |
|
|
|
let gainTaskFormInfoData: customerFormVersionCont |
|
|
|
let gainTaskFormInfoPromise: any[] = [] |
|
|
|
|
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ 时间: 2024-04-03 14:33:15 |
|
|
|
@ 功能: 获取自定义表单内容 |
|
|
|
*/ |
|
|
|
const getCustomrrFormInfo = () => { |
|
|
|
gainTaskFormInfo({id:props.pageInfo.masters_key}) |
|
|
|
gainTaskFormInfoPromise.push(gainTaskFormInfo({id:props.pageInfo.masters_key}) |
|
|
|
.then(({data})=>{ |
|
|
|
// console.log("获取自定义表单内容",data,data.structure) |
|
|
|
gainTaskFormInfoData = data |
|
|
|
/* // console.log("获取自定义表单内容",data,data.structure) |
|
|
|
formState.formData = stringToObj(data.structure.mastesform) |
|
|
|
// console.log("获取自定义表单内容--->",formState) |
|
|
|
formState.dict = string2json(data.structure.dict) |
|
|
|
@ -129,17 +239,17 @@ const getCustomrrFormInfo = () => { |
|
|
|
nextTick(()=>{ |
|
|
|
// console.log("获取自定义表单内容-1111-->",data.tableData) |
|
|
|
formEl.value.setValue(data.tableData) |
|
|
|
}) |
|
|
|
}) */ |
|
|
|
}) |
|
|
|
.finally(()=>{ |
|
|
|
formLoading.value = false; |
|
|
|
/* formLoading.value = false; |
|
|
|
//alert(props.pageInfo.masters_key) |
|
|
|
gainEditDataLog({id:props.pageInfo.masters_key}) |
|
|
|
.then(({data})=>{ |
|
|
|
// console.log("获取修改记录-1111-->",data) |
|
|
|
pageLog.value = data |
|
|
|
}); |
|
|
|
}) |
|
|
|
}); */ |
|
|
|
})); |
|
|
|
} |
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ -239,8 +349,17 @@ const jsuanKuandu = () => { |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function optionsValue3Get3(data:any,fieldName:any){ |
|
|
|
//console.log("formPageCont","optionsValue3Get3") |
|
|
|
emits('optionsValue4Get4',data,fieldName) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
<template> |
|
|
|
|
|
|
|
<el-drawer |
|
|
|
v-model="openOfClose" |
|
|
|
title="查看表单内容" |
|
|
|
@ -336,6 +455,7 @@ const jsuanKuandu = () => { |
|
|
|
:save-edit-form-info="saveEditFormInfo" |
|
|
|
:send-draft-submit= "sendDraftSubmit" |
|
|
|
:submit-edit="submitEdit" |
|
|
|
@optionsValue3Get3 = "optionsValue3Get3" |
|
|
|
/> |
|
|
|
<el-divider v-if="pageLog&&pageLog.length > 0" content-position="left">历史记录</el-divider> |
|
|
|
<el-timeline style="width: 100%"> |
|
|
|
|