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

修改工作流bug

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