提交 e820c086 authored 作者: kxjia's avatar kxjia

修改工作流bug

上级 1a98d4a5
......@@ -7,9 +7,7 @@ export const listDefinition = async (params) => {
const list = await defHttp.get({
url:"/flowable/definition/list",
params
},{
joinParamsToUrl: true
});
})
return list
};
......@@ -17,8 +15,11 @@ export const listDefinition = async (params) => {
// 部署流程实例
export function definitionStart(procDefId, data) {
return defHttp.post({
url: '/flowable/definition/startByProcDefId/' + procDefId,
data: data
url: '/flowable/definition/startByProcDefId',
data: {
procDefId: procDefId,
...data // 展开 data 中的所有参数
}
})
}
......@@ -27,7 +28,7 @@ export function definitionStart(procDefId, data) {
export function getProcessVariables(taskId) {
return defHttp.get({
url: '/flowable/task/processVariables/' + taskId,
method: 'get'
params: {taskId:taskId}
})
}
......@@ -42,7 +43,6 @@ export const updateState = (params,handleSuccess) => {
export function userList(query) {
return defHttp.get({
url: '/flowable/definition/userList',
method: 'get',
params: query
})
}
......@@ -51,7 +51,6 @@ export function userList(query) {
export function roleList(query) {
return defHttp.get({
url: '/flowable/definition/roleList',
method: 'get',
params: query
})
}
......@@ -60,7 +59,6 @@ export function roleList(query) {
export function expList(query) {
return defHttp.get({
url: '/flowable/definition/expList',
method: 'get',
params: query
})
}
......@@ -101,7 +99,6 @@ export function flowXmlAndNode(query) {
export function saveXml(data) {
return defHttp.post({
url: '/flowable/definition/save',
method: 'post',
data: data
})
}
......@@ -144,8 +141,7 @@ export const batchDelete = (params, handleSuccess) => {
return defHttp.delete(
{
url: "/flowable/definition/batchDelete",
data: params},
{joinParamsToUrl: true}
data: params}
).then(() => {
handleSuccess();
});
......@@ -179,8 +175,7 @@ export function delDeployment(deployId,handleSuccess) {
// 查询流含bpm_status 流程状态字段的 业务表列表
export function selectTableNameList() {
return defHttp.get({
url: '/flowable/definition/selectTableNameList',
method: 'get'
url: '/flowable/definition/selectTableNameList'
})
}
......
......@@ -10,6 +10,7 @@ export function myProcessList(query) {
}
export function flowFormData(query) {
alert(JSON.stringify(query))
return defHttp.get({
url: '/flowable/task/flowFormData',
params: query
......
......@@ -212,9 +212,6 @@ const formValues = ref<FormData[]>([])
const saveBatch = async () => {
try {
formValues.value = []
for (const strKey in formData) {
......@@ -224,13 +221,8 @@ const saveBatch = async () => {
await setFormValues(tmpAry[0],tmpAry[1],valData,1)
}
}
await getAttachTableFormData();
await getAllMultiTableFormData()
if (formValues.value.length > 0) {
await batchSaveOrUpdateBeforeDelete(formValues.value)
VxeUI.modal.message({ content: '保存成功', status: 'success' })
......@@ -238,8 +230,6 @@ const saveBatch = async () => {
} else {
VxeUI.modal.message({ content: '没有需要保存的数据', status: 'warning' })
}
} catch (error) {
VxeUI.modal.message({ content: `保存失败: ${error.message}`, status: 'error' })
} finally {
......@@ -254,7 +244,6 @@ const setMultiColumnTableRef = (el: any, index: string) => {
}
};
const getAllMultiTableFormData = async () => {
for (const pcode in childMultiTableRefs.value) {
const child = childMultiTableRefs.value[pcode];
......@@ -270,23 +259,18 @@ const getAllMultiTableFormData = async () => {
}
}
};
const childAttachTableRefs = ref({})
const setAttachTableRef = (el: any, index: string) => {
if (el) {
childAttachTableRefs.value[index] = el; // 保存子组件实例
}
};
const childExportTableRefs = ref({})
const setExportTableRef = (el: any, index: string) => {
if (el) {
childExportTableRefs.value[index] = el; // 保存子组件实例
}
};
const getAttachTableFormData = async () => {
for (const pcode in childAttachTableRefs.value) {
const child = childAttachTableRefs.value[pcode];
......@@ -298,14 +282,12 @@ const getAttachTableFormData = async () => {
}
}
};
const setFormValues = async (pcode,code,valData,rind) => {
if(!valData) return;
let vals = Array.isArray(valData) ? valData.join(',') : valData
let strKey = pcode+"_"+code
const item = tplItemMap.value[strKey];
const { pid, itemid } = item ?? {};
let tempForm: FormData = {
id: null,
rind:rind,
......@@ -318,17 +300,12 @@ const setFormValues = async (pcode,code,valData,rind) => {
};
formValues.value.push(tempForm)
}
async function setData() {
try {
loading.value = true;
const taskId = queryParam.value.taskId;
const tplid = queryParam.value.tplId;
Object.keys(formData).forEach(key => delete formData[key]);
await setTplItemMap();
const recordData = await queryRecord({ taskid: taskId, tplid: tplid });
const valueObj = {};
......@@ -352,7 +329,6 @@ async function setData() {
} else {
formData[strKey] = dataVal || "";
}
if(cdata.type&&cdata.type=="checkboxAndInput"){
for (const itemField of cdata.optionItemField) {
const strItemKey = `${row.code}_${itemField}`;
......@@ -363,7 +339,6 @@ async function setData() {
formData[strItemKey] = dataVal2 || "";
}
}
}
}
} else if(row.type=="AttachTable"&& row.datas) {
......@@ -388,11 +363,9 @@ async function setData() {
}
});
}
curAttachTable.setFormData(attachTableData);
} else if(row.type=="MultiColumnTable"&& row.content) {
const curMultiTable = childMultiTableRefs.value[row.code];
const rowsMap = {};
for (const cdata of row.content) {
if(cdata.field&&cdata.field.length>0) {
......@@ -403,7 +376,6 @@ async function setData() {
const valKeys = Object.keys(valueObj).filter(k =>
k.startsWith(`${pid}_${itemid}_`)
);
for (const valKey of valKeys) {
const parts = valKey.split('_');
const rind = parts[2];
......@@ -414,7 +386,6 @@ async function setData() {
}
}
}
const tableDatas = Object.values(rowsMap);
curMultiTable.setFormData(tableDatas);
}
......@@ -428,30 +399,23 @@ async function setData() {
} finally {
loading.value = false;
}
}
async function setTplItemMap() {
try {
const tplid = queryParam.value.tplId
const tplItem = await allTplItems({
tplid: tplid,
})
tplItem.forEach(item => {
let strKey = item.pcode + "_" + item.xmlcode;
tplItemMap.value[strKey] = {pid:item.pid,itemid:item.id,formTp:item.formTp,code:item.xmlcode};
})
} catch (error) {
VxeUI.modal.message({ content: `加载数据失败: ${error.message}`, status: 'error' })
} finally {
}
}
const mergeCells = ref<VxeTablePropTypes.MergeCells>([
{ row: 0, col: 1, rowspan: 9, colspan: 1 },
{ row: 9, col: 1, rowspan: 1, colspan: 2 },
......@@ -460,11 +424,9 @@ const mergeCells = ref<VxeTablePropTypes.MergeCells>([
{ row: 11, col: 3, rowspan: 1, colspan: 2 },
{ row: 10, col: 3, rowspan: 1, colspan: 2 },
{ row: 9, col: 3, rowspan: 1, colspan: 2 },
])
</script>
<style lang="less" scoped>
.bank-report-table {
font-family: "SimSun", "宋体", serif;
......@@ -474,27 +436,22 @@ const mergeCells = ref<VxeTablePropTypes.MergeCells>([
width: 60%;
height:80vh;
}
.custom-table {
width: 100%;
border: 1px solid #000;
}
.custom-table .vxe-header--column,
.custom-table .vxe-body--column {
border-right: 1px solid #000;
border-bottom: 1px solid #000;
padding: 5px;
}
.custom-table .vxe-cell {
padding: 5px;
}
.content-cell {
line-height: 1.8;
}
.table-input {
width: 80px;
margin: 0 2px;
......@@ -504,39 +461,32 @@ const mergeCells = ref<VxeTablePropTypes.MergeCells>([
display: inline-block;
margin-right: 10px;
}
.checkbox-group {
display: inline-block;
margin-right: 10px;
}
.vxe-radio,
.vxe-checkbox {
margin-right: 8px;
white-space: nowrap;
}
.vxe-input--inner {
height: 24px;
line-height: 24px;
padding: 0 5px;
}
.vxe-radio--label,
.vxe-checkbox--label {
font-size: 12px;
}
.vxe-radio--icon,
.vxe-checkbox--icon {
font-size: 12px;
}
.vxe-radio-group,
.vxe-checkbox-group {
display: inline-block;
}
.bank-report-table {
font-family: "SimSun", "宋体", serif;
font-size: 12px;
......@@ -544,38 +494,31 @@ const mergeCells = ref<VxeTablePropTypes.MergeCells>([
margin: 5px auto;
width: 90%;
}
.custom-table {
width: 100%;
border: 1px solid #000;
}
.custom-table .vxe-header--column,
.custom-table .vxe-body--column {
border-right: 1px solid #000;
border-bottom: 1px solid #000;
padding: 5px;
}
.content-cell {
line-height: 1.8;
}
.table-input {
width: 80px;
margin: 0 2px;
}
.radio-group {
display: inline-block;
margin-right: 10px;
}
.checkbox-group {
eckbox-group {
display: inline-block;
margin-right: 10px;
}
.vxe-radio,
.vxe-checkbox {
margin-right: 8px;
......
......@@ -116,7 +116,6 @@ const gridOptions = reactive<VxeGridProps<any>>({
loading: loading.value,
showOverflow: true,
border: true,
height: "100%",
rowConfig: {
keyField: 'taskId',
isHover: true
......
......@@ -103,7 +103,7 @@ const gridOptions = reactive<VxeGridProps<ProcessDefinition>>({
columns: [
{
type : 'seq',
width: 40,
width: 50,
fixed: 'left'
},
{
......
......@@ -106,7 +106,7 @@ const srhParams = ref<SrhParam>({
const gridOptions = reactive<VxeGridProps>({
border: true,
height: "100%",
rowConfig: {
keyField: 'id',
isHover: true
......
......@@ -74,12 +74,8 @@ import type { VxeGridProps, VxeGridInstance } from 'vxe-table'
import { todoList, delDeployment } from '/@/components/Process/api/todo'
import XEUtils from 'xe-utils'
import TodoIndex from './components/TodoIndex.vue'
const loading = ref(false)
const isShowDrawer = ref(false)
const refTodoIndex = ref()
const startUser = ref()
const taskName = ref()
......@@ -129,7 +125,7 @@ const gridOptions = reactive<VxeGridProps<any>>({
loading: loading.value,
showOverflow: true,
border: true,
height: "100%",
rowConfig: {
keyField: 'taskId',
isHover: true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论