| 状态 |
草稿
diff --git a/src/views/formTable/page/flowAndLog.vue b/src/views/formTable/page/flowAndLog.vue
index cb3e259..f00f34d 100644
--- a/src/views/formTable/page/flowAndLog.vue
+++ b/src/views/formTable/page/flowAndLog.vue
@@ -4,8 +4,11 @@
@ 备注: 流程和历史记录
-->
- {{flowMap}}
+
-
+
+
{{ item.nodeName }} ● 依次审批 ● 会签 ● 或签
([]);
const emits = defineEmits(["update:isShow","searchData"])
const openPage =computed({
get() {
@@ -57,7 +60,9 @@ const formDesign = ref();
const flowLogPage = ref(); //流程与历史记录
const pageLog = ref([]); //历史记录
const loadPage = ref(false)
-
+const gainFlowChart = reactive({
+ id: "0",
+});
/**
@@ -187,6 +192,195 @@ onMounted(()=>{
console.log("挺挺挺挺下")
console.log(props)
})
+const flowFactor = reactive([]); //表单组件
+//组件解析
+const changeKeyVal = (key: any, val: any, type: any, attribute: any) => {
+ console.log("改变表单值--key--->",key)
+ console.log("改变表单值--val--->",val,Array.isArray(val))
+ console.log("改变表单值--type--->",type)
+ console.log("改变表单值--attribute--->",attribute)
+
+ let unitsVal = val;
+ let isUpdateFlowChart = false;
+
+
+ //单选,多选,下拉菜单
+ if (notAsA_BasisForJudgment.indexOf(type) === -1) {
+ let isWrite = true;
+ flowFactor.forEach((item: any) => {
+ if (item.factorid == key) {
+ isWrite = false;
+
+ item.type = 3;
+ if (type == "checkbox") {
+ item.isCheckbox = true;
+ item.answers = val.map(String);
+ } else {
+ item.isCheckbox = false;
+ item.oneanswer = val.toString();
+ }
+ if (notAsA_BasisForJudgment.indexOf(type) === -1) {
+ isUpdateFlowChart = true;
+ }
+ }
+ });
+ if (isWrite) {
+ if (type == "checkbox") {
+ flowFactor.push({
+ factorid: key,
+ type: 3,
+ isCheckbox: true,
+ answers: val.map(String),
+ });
+ } else {
+ flowFactor.push({
+ factorid: key,
+ type: 3,
+ isCheckbox: false,
+ oneanswer: val.toString(),
+ });
+ }
+ isUpdateFlowChart = true;
+ }
+ // console.log("改变表单值--flowFactor--->",flowFactor)
+
+ }
+ //时间类空间附加判断条件
+ if (
+ timeControl.indexOf(type) > -1 ||
+ fixedValueControl.indexOf(type) > -1 ||
+ type == "input"
+ ) {
+ // console.log("改变表单值--flowFactor--3->",unitsVal)
+ let addNewTime = true; //判断是否新增
+ flowFactor.forEach((item: any) => {
+ // console.log("改变表单值--flowFactor--5->",item.type)
+ if (item.type == 2) {
+ addNewTime = false;
+ // console.log("改变表单值--flowFactor--5====1->",item.type)
+ // console.log("改变表单值--flowFactor--5====3->",item.customFields,item.customFields.length)
+ if (item.customFields && item.customFields.length > 0) {
+ // console.log("改变表单值--flowFactor--5====2->",item.customFields)
+ let sunNewAdd = true;
+ item.customFields.forEach((sunItem: any) => {
+ // console.log("改变表单值--flowFactor-4->",sunItem.wordfield , key,sunItem.wordfield == key)
+ if (sunItem.wordfield == key) {
+ sunNewAdd = false;
+ isUpdateFlowChart = true;
+ if (timeEquation.indexOf(attribute) === -1) {
+ //非区间性时间
+ sunItem.leftval = val.toString();
+ } else {
+ //区间性时间
+ if (Array.isArray(val)) {
+ if (val.length >= 2) {
+ sunItem.leftval = val[0].toString();
+ sunItem.rightval = val[val.length - 1].toString();
+ }
+ }
+ }
+ }
+ });
+ if (sunNewAdd) {
+ isUpdateFlowChart = true;
+ if (timeEquation.indexOf(attribute) === -1) {
+ //非区间性时间
+ let customFieldInfo = {
+ wordfield: key,
+ optType: "1",
+ leftval: val.toString(),
+ };
+ item.customFields.push(customFieldInfo);
+ } else {
+ //区间性时间
+ if (Array.isArray(val)) {
+ if (val.length >= 2) {
+ let customFieldInfo = {
+ wordfield: key,
+ optType: "6",
+ leftval: val[0].toString(),
+ leftoptType: "3",
+ rightoptType: "3",
+ rightval: val[val.length - 1].toString(),
+ };
+ item.customFields.push(customFieldInfo);
+ }
+ }
+ }
+ }
+ }
+ }
+ });
+
+ if (addNewTime) {
+ //新增自定义类数据判断
+ isUpdateFlowChart = true;
+ if (timeEquation.indexOf(attribute) === -1) {
+ //非区间性时间
+ let customFieldInfo = {
+ wordfield: key,
+ optType: "1",
+ leftval: val.toString(),
+ };
+ let condInfo = {
+ factorid: "customFields",
+ type: 2,
+ isCheckbox: false,
+ customFields: [customFieldInfo],
+ };
+ flowFactor.push(condInfo);
+ } else {
+ //区间性时间
+ if (Array.isArray(val)) {
+ if (val.length >= 2) {
+ let customFieldInfo = {
+ wordfield: key,
+ optType: "6",
+ leftval: val[0].toString(),
+ leftoptType: "3",
+ rightoptType: "3",
+ rightval: val[val.length - 1].toString(),
+ };
+ let condInfo = {
+ factorid: "customFields",
+ type: 2,
+ isCheckbox: false,
+ customFields: [customFieldInfo],
+ };
+ flowFactor.push(condInfo);
+ }
+ }
+ }
+ }
+ }
+ //操作人
+ if (asAnApprovalActionControl.indexOf(type) > -1) {
+ isUpdateFlowChart = true;
+ let isWriteUs = true;
+ nodelUserList.forEach((item: any) => {
+ if (item.factorid == key) {
+ isWriteUs = false;
+ item.userList = val;
+ }
+ });
+ if (isWriteUs) {
+ nodelUserList.push({
+ factorid: key,
+ userList: val,
+ });
+ }
+ }
+
+ console.log("改变表单值--flowFactor--->", isUpdateFlowChart);
+//更新工作流图
+ if (isUpdateFlowChart&&props.stateForm.taskKey&&props.stateForm.taskKey!="") {
+ // gainFlowChart.conditionList = flowFactor;
+ // gainFlowChart.nodelPeople = nodelUserList;
+ // gainFlowChart.id = flowMap;
+ console.log("获取工作流不进图--gainFlowChart--->",props.stateForm)
+ flowLogPage.value.refreshWorkFlow(props.stateForm.taskKey,flowFactor,nodelUserList)
+ }
+}
@@ -205,6 +399,7 @@ onMounted(()=>{
:is-work-flow="stateForm.flowIsTrue"
:app-info="props.appInfo"
:after-submit="afterSubmit"
+ :change-key-val="changeKeyVal"
/>
|