|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: tengmingxue 1473375109@qq.com
|
|
|
* @Date: 2023-08-30 17:25:03
|
|
|
* @LastEditors: tengmingxue 1473375109@qq.com
|
|
|
- * @LastEditTime: 2024-01-25 18:04:00
|
|
|
+ * @LastEditTime: 2024-01-26 10:59:29
|
|
|
* @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\flowStep\index.vue
|
|
|
* @Description: 流程图表
|
|
|
-->
|
|
|
@@ -184,7 +184,7 @@ export default defineComponent({
|
|
|
// i.status = "1";
|
|
|
// i.handlers.map(j => j.status = "1");
|
|
|
// })
|
|
|
- console.log('步骤', step);
|
|
|
+
|
|
|
if (step) data.steps.push(...step);
|
|
|
const length = step.length;
|
|
|
//最后一步默认完成
|
|
|
@@ -193,8 +193,6 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const getFlowNodes = (flowNode, flowNodePerson) => {
|
|
|
- console.log('flowNode',flowNode)
|
|
|
- console.log('flowNodePerson',flowNodePerson)
|
|
|
let index = 1;
|
|
|
let steps = [];
|
|
|
function getNextNode(nodes, id) {
|
|
|
@@ -236,51 +234,76 @@ export default defineComponent({
|
|
|
|
|
|
var itemDate = null;
|
|
|
const pageData = ref([]);
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询审核记录并且设置审核状态
|
|
|
- */
|
|
|
+ */
|
|
|
function getSelectFlowRecord() {
|
|
|
if (itemDate?.bussid) {
|
|
|
selectFlowRecord(itemDate.bussid).then((res) => {
|
|
|
- console.log('上传审核日志:', res);
|
|
|
- var obj = [];
|
|
|
+ var objList = [];
|
|
|
var len = data.steps.length;
|
|
|
var num = 0;
|
|
|
var allType = true;
|
|
|
if (res.resp_code == 0 && res?.datas?.pageData?.length) {
|
|
|
- pageData.value = res.datas.pageData.map((i, index) => {
|
|
|
+ console.log('审核记录', res?.datas?.pageData);
|
|
|
+ res.datas.pageData.map((i, index) => {
|
|
|
+ if (!i.NODEDISCRIPTION) {
|
|
|
+ i.NODEDISCRIPTION =
|
|
|
+ i.CHECKINFO == '起件'
|
|
|
+ ? i.BUSSNAME
|
|
|
+ : i.CHECKINFO == '归档'
|
|
|
+ ? '审核结束'
|
|
|
+ : i.NODEDISCRIPTION;
|
|
|
+ }
|
|
|
+ if (!index) {
|
|
|
+ i.CHECKINFO = '';
|
|
|
+ data.steps[index].handlers.map((j) => (j.handler = i.CHECKUSERNAEM));
|
|
|
+ }
|
|
|
if (i.ISPASS != null && i.ISPASS != undefined) {
|
|
|
- if (!i.NODEDISCRIPTION) {
|
|
|
- i.NODEDISCRIPTION =
|
|
|
- i.CHECKINFO == '起件'
|
|
|
- ? i.BUSSNAME
|
|
|
- : i.CHECKINFO == '归档'
|
|
|
- ? '审核结束'
|
|
|
- : i.NODEDISCRIPTION;
|
|
|
- }
|
|
|
- if (!index) {
|
|
|
- i.CHECKINFO = '';
|
|
|
- data.steps[index].handlers.map((j) => (j.handler = i.CHECKUSERNAEM));
|
|
|
- }
|
|
|
+ // if (!i.NODEDISCRIPTION) {
|
|
|
+ // i.NODEDISCRIPTION =
|
|
|
+ // i.CHECKINFO == '起件'
|
|
|
+ // ? i.BUSSNAME
|
|
|
+ // : i.CHECKINFO == '归档'
|
|
|
+ // ? '审核结束'
|
|
|
+ // : i.NODEDISCRIPTION;
|
|
|
+ // }
|
|
|
+ // if (!index) {
|
|
|
+ // i.CHECKINFO = '';
|
|
|
+ // data.steps[index].handlers.map((j) => (j.handler = i.CHECKUSERNAEM));
|
|
|
+ // }
|
|
|
var type = i.ISPASS == '1' ? '1' : i.ISPASS == '0' ? '1' : '0';
|
|
|
- if (i.CHECKINFO != '归档') {
|
|
|
- data.steps[index].status = type;
|
|
|
- data.steps[index].handlers.map((j) => {
|
|
|
- (j.status = type), (i.handler = j.handler);
|
|
|
- });
|
|
|
- } else if (i.CHECKINFO == '归档' && i.ISPASS == '1') {
|
|
|
+ // if (i.CHECKINFO != '归档') {
|
|
|
+ // data.steps[index].status = type;
|
|
|
+ // data.steps[index].handlers.map((j) => {
|
|
|
+ // (j.status = type), (i.handler = j.handler);
|
|
|
+ // });
|
|
|
+ // } else if (i.CHECKINFO == '归档' && i.ISPASS == '1') {
|
|
|
+ // data.steps[index].status = type;
|
|
|
+ // data.steps[index].handlers.map((j) => {
|
|
|
+ // (j.status = type), (i.handler = j.handler);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // if (i.CHECKINFO != '归档') objList.unshift(i);
|
|
|
+ data.steps[index].status = type;
|
|
|
+ data.steps[index].handlers.map((j) => {
|
|
|
+ (j.status = type), (i.handler = j.handler);
|
|
|
+ });
|
|
|
+ if (i.ISPASS == '1') {
|
|
|
data.steps[index].status = type;
|
|
|
data.steps[index].handlers.map((j) => {
|
|
|
(j.status = type), (i.handler = j.handler);
|
|
|
});
|
|
|
}
|
|
|
- if (i.CHECKINFO != '归档') obj.unshift(i);
|
|
|
+
|
|
|
if (i.ISPASS == '0') {
|
|
|
allType = false;
|
|
|
}
|
|
|
num++;
|
|
|
}
|
|
|
+
|
|
|
+ objList.unshift(i);
|
|
|
});
|
|
|
|
|
|
if (num < len && allType) {
|
|
|
@@ -289,8 +312,58 @@ export default defineComponent({
|
|
|
j.status = '2';
|
|
|
});
|
|
|
}
|
|
|
+ pageData.value = objList;
|
|
|
+
|
|
|
+ //重新更新审核状态
|
|
|
+ data.steps.map((item, index) => {
|
|
|
+ //(1)根据步骤名称获取审核情况
|
|
|
+ const obj = res.datas.pageData.filter((pd) =>
|
|
|
+ pd.NODENAME ? pd.NODENAME === item.stepName : pd.FLOWNAME === item.stepName
|
|
|
+ );
|
|
|
+ if (obj.length > 0) {
|
|
|
+ //存在生审核日志
|
|
|
+ //第一个审核步骤,审核状态设置为已审核
|
|
|
+ if (index === 0) {
|
|
|
+ data.steps[index].status = '1';
|
|
|
+ data.steps[index].handlers.map((h, i) => {
|
|
|
+ data.steps[index].handlers[i].status = '1';
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ //非第一个审核步骤,则根据审核人情况就判断状态
|
|
|
+ //如果当前结点的审核记录数小于结点配置审核人数,则表示当前结点处于审核中状态
|
|
|
+ if (obj.length < data.steps[index].handlers.length) {
|
|
|
+ data.steps[index].status = '2';
|
|
|
+ //设置结点状态
|
|
|
+ data.steps[index].handlers.map((hd, i) => {
|
|
|
+ if (obj.find((o) => o.CHECKUSERID === hd.id))
|
|
|
+ data.steps[index].handlers[i].status = '1';
|
|
|
+ else data.steps[index].handlers[i].status = '2';
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ //否则表示当前步骤结点已经全部审核完成
|
|
|
+ data.steps[index].status = '1';
|
|
|
+ data.steps[index].handlers.map((hd, i) => {
|
|
|
+ data.steps[index].handlers[i].status = '1';
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //没有任何审核,此时状态改为未开始
|
|
|
+ data.steps[index].status = '0';
|
|
|
+ data.steps[index].handlers.map((h, i) => {
|
|
|
+ data.steps[index].handlers[i].status = '0';
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log('步骤', data.steps);
|
|
|
+ //排序
|
|
|
+ data.steps.map((step, i) => {
|
|
|
+ data.steps[i].handlers.sort((a, b) => {
|
|
|
+ return parseInt(a.status) - parseInt(b.status);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
- pageData.value = obj;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -424,8 +497,8 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
.desc-handler {
|
|
|
+ position: absolute;
|
|
|
margin-top: 38px;
|
|
|
-
|
|
|
.handler-name {
|
|
|
display: flex;
|
|
|
float: left;
|