Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
66e31ae4f2
|
|
@ -240,3 +240,10 @@ export function getCodes() {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//工单详情
|
||||||
|
export function getWorkflowInit(id) {
|
||||||
|
return request({
|
||||||
|
url: `/wf/workflow/${id}/init/`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,14 +201,6 @@
|
||||||
width: item.widthMe + 'px',
|
width: item.widthMe + 'px',
|
||||||
top: item.top + 'px'
|
top: item.top + 'px'
|
||||||
}"
|
}"
|
||||||
@mouseover="
|
|
||||||
lineMouseover(
|
|
||||||
`line${item.id}`,
|
|
||||||
$event,
|
|
||||||
item.id,
|
|
||||||
item.parentId,
|
|
||||||
index
|
|
||||||
)"
|
|
||||||
@mouseleave="lineMouseleave"
|
@mouseleave="lineMouseleave"
|
||||||
@mouseenter="
|
@mouseenter="
|
||||||
lineMouseenter(
|
lineMouseenter(
|
||||||
|
|
@ -303,6 +295,8 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
windowWidth:0,
|
||||||
|
windowHeight:0,
|
||||||
leftYear:2021,
|
leftYear:2021,
|
||||||
timeRange: [],
|
timeRange: [],
|
||||||
disable: true,
|
disable: true,
|
||||||
|
|
@ -374,6 +368,13 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
if(window.innerHeight){
|
||||||
|
this.windowWidth = window.innerWidth;
|
||||||
|
this.windowHeight = window.innerHeight;
|
||||||
|
}else{
|
||||||
|
this.windowHeight=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight;
|
||||||
|
this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth;
|
||||||
|
}
|
||||||
let currentYear = new Date().getFullYear();
|
let currentYear = new Date().getFullYear();
|
||||||
this.timeRange = [currentYear+'-01',currentYear+'-12'];
|
this.timeRange = [currentYear+'-01',currentYear+'-12'];
|
||||||
this.list = [...this.proList];
|
this.list = [...this.proList];
|
||||||
|
|
@ -518,10 +519,8 @@
|
||||||
},
|
},
|
||||||
//修改后续高度
|
//修改后续高度
|
||||||
resetTop(zindex, reduce, isexpand) {
|
resetTop(zindex, reduce, isexpand) {
|
||||||
// console.log(zindex, reduce, isexpand);
|
|
||||||
let num = reduce ? -40 : 40;
|
let num = reduce ? -40 : 40;
|
||||||
if (!reduce && !isexpand) {
|
if (!reduce && !isexpand) {
|
||||||
// console.log(2);
|
|
||||||
this.list.forEach((item, index) => {
|
this.list.forEach((item, index) => {
|
||||||
if (index > zindex) {
|
if (index > zindex) {
|
||||||
item.top = item.top + 40;
|
item.top = item.top + 40;
|
||||||
|
|
@ -533,7 +532,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// console.log(1);
|
|
||||||
this.list.forEach((item, index) => {
|
this.list.forEach((item, index) => {
|
||||||
if (index > zindex) {
|
if (index > zindex) {
|
||||||
item.top = item.top + num * this.list[zindex].children.length;
|
item.top = item.top + num * this.list[zindex].children.length;
|
||||||
|
|
@ -584,7 +582,6 @@
|
||||||
let widthMe = width - left;
|
let widthMe = width - left;
|
||||||
parent.widthMe = parent.widthChild = widthMe;
|
parent.widthMe = parent.widthChild = widthMe;
|
||||||
parent.left = left;
|
parent.left = left;
|
||||||
// return parent;
|
|
||||||
},
|
},
|
||||||
// 转为分组
|
// 转为分组
|
||||||
handlerGroup(row) {
|
handlerGroup(row) {
|
||||||
|
|
@ -658,10 +655,8 @@
|
||||||
let index = this.list.findIndex(k => {
|
let index = this.list.findIndex(k => {
|
||||||
return k.id == parentId;
|
return k.id == parentId;
|
||||||
});
|
});
|
||||||
// console.log(parentId);
|
|
||||||
this.list.forEach(item => {
|
this.list.forEach(item => {
|
||||||
if (item.id == parentId) {
|
if (item.id == parentId) {
|
||||||
// console.log(item, this.list);
|
|
||||||
item.children.forEach(k => {
|
item.children.forEach(k => {
|
||||||
if (k.id == id) {
|
if (k.id == id) {
|
||||||
k.per = per;
|
k.per = per;
|
||||||
|
|
@ -813,6 +808,17 @@
|
||||||
Math.round(end / this.currentDaySize.value) *
|
Math.round(end / this.currentDaySize.value) *
|
||||||
this.currentDaySize.value -
|
this.currentDaySize.value -
|
||||||
this.currentDaySize.value;
|
this.currentDaySize.value;
|
||||||
|
let infoDomX=0,infoDomY = 0;
|
||||||
|
if(this.windowWidth-e.clientX>230){
|
||||||
|
infoDomX = e.clientX;
|
||||||
|
}else{
|
||||||
|
infoDomX = this.windowWidth-230;
|
||||||
|
}
|
||||||
|
if(this.windowHeight-e.clientY>200){
|
||||||
|
infoDomY = e.clientY;
|
||||||
|
}else{
|
||||||
|
infoDomY = this.windowHeight-200;
|
||||||
|
}
|
||||||
this.currentProjectMsg = {
|
this.currentProjectMsg = {
|
||||||
name: this.computedList[index].name,
|
name: this.computedList[index].name,
|
||||||
allTime: (end - start) / this.currentDaySize.value + 1,
|
allTime: (end - start) / this.currentDaySize.value + 1,
|
||||||
|
|
@ -820,8 +826,8 @@
|
||||||
per1: this.computedList[index].per1,
|
per1: this.computedList[index].per1,
|
||||||
startTime: this.computedWithTime(start),
|
startTime: this.computedWithTime(start),
|
||||||
endTime: this.computedWithTime(end),
|
endTime: this.computedWithTime(end),
|
||||||
left: e.clientX,
|
left:infoDomX ,
|
||||||
top: e.clientY + 20
|
top: infoDomY
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* left:
|
* left:
|
||||||
|
|
@ -848,7 +854,6 @@
|
||||||
left: 0,
|
left: 0,
|
||||||
top: 0
|
top: 0
|
||||||
};
|
};
|
||||||
// this.handlerSelect();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentLineDay = {
|
this.currentLineDay = {
|
||||||
|
|
@ -1029,7 +1034,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
window.removeEventListener("scroll", this.handleScroll);
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
document.onmousemove = document.onmouseup = null;
|
document.onmousemove = document.onmouseup = null;
|
||||||
|
|
@ -1107,6 +1111,7 @@
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
.lineMsg {
|
.lineMsg {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
|
||||||
|
|
@ -185,14 +185,6 @@ export const asyncRoutes = [
|
||||||
component: () => import('@/views/pm/management'),
|
component: () => import('@/views/pm/management'),
|
||||||
meta: { title: '生产任务管理', icon: 'example', perms: ['pm_resources'] }
|
meta: { title: '生产任务管理', icon: 'example', perms: ['pm_resources'] }
|
||||||
}
|
}
|
||||||
,
|
|
||||||
{
|
|
||||||
path: 'gantt',
|
|
||||||
name: 'gantt',
|
|
||||||
component: () => import('@/views/pm/gantt'),
|
|
||||||
meta: { title: '甘特图', icon: 'example',perms: ['vendor_manage'] },
|
|
||||||
// hidden: true
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,8 @@
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
windowWidth:0,
|
||||||
|
windowHeight:0,
|
||||||
timeRange:[],
|
timeRange:[],
|
||||||
disable: true,
|
disable: true,
|
||||||
//当前项是否是子集
|
//当前项是否是子集
|
||||||
|
|
@ -499,11 +501,6 @@
|
||||||
TableScrollTop(val) {
|
TableScrollTop(val) {
|
||||||
let lineBG = this.$refs.lineBG;
|
let lineBG = this.$refs.lineBG;
|
||||||
lineBG.scrollTo(0, val);
|
lineBG.scrollTo(0, val);
|
||||||
// lineBG.scrollTo({
|
|
||||||
// top: val,
|
|
||||||
// left: 0,
|
|
||||||
// behavior: "smooth"
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
handlerBGScroll(e) {
|
handlerBGScroll(e) {
|
||||||
this.BGScrollTop = this.$refs.chart.scrollTop;
|
this.BGScrollTop = this.$refs.chart.scrollTop;
|
||||||
|
|
@ -862,15 +859,9 @@
|
||||||
) *
|
) *
|
||||||
this.currentDaySize.value +
|
this.currentDaySize.value +
|
||||||
this.currentDaySize.value;
|
this.currentDaySize.value;
|
||||||
let end =
|
let end = parseInt(this.$refs[dom][0].style.left) + parseInt(this.$refs[dom][0].style.width);
|
||||||
parseInt(this.$refs[dom][0].style.left) +
|
end = Math.round(end / this.currentDaySize.value) * this.currentDaySize.value;
|
||||||
parseInt(this.$refs[dom][0].style.width);
|
this.currentLineDay = { start, end };
|
||||||
end =
|
|
||||||
Math.round(end / this.currentDaySize.value) * this.currentDaySize.value;
|
|
||||||
this.currentLineDay = {
|
|
||||||
start,
|
|
||||||
end
|
|
||||||
};
|
|
||||||
this.isHover = true;
|
this.isHover = true;
|
||||||
this.handlerSelect(this.computedList[index]);
|
this.handlerSelect(this.computedList[index]);
|
||||||
this.lineMouseenter(dom, e, id, parentId, index);
|
this.lineMouseenter(dom, e, id, parentId, index);
|
||||||
|
|
@ -888,13 +879,21 @@
|
||||||
Math.round(
|
Math.round(
|
||||||
parseInt(this.$refs[dom][0].style.left) / this.currentDaySize.value
|
parseInt(this.$refs[dom][0].style.left) / this.currentDaySize.value
|
||||||
) * this.currentDaySize.value;
|
) * this.currentDaySize.value;
|
||||||
let end =
|
let end = parseInt(this.$refs[dom][0].style.left) + parseInt(this.$refs[dom][0].style.width);
|
||||||
parseInt(this.$refs[dom][0].style.left) +
|
end = Math.round(end / this.currentDaySize.value) * this.currentDaySize.value - this.currentDaySize.value;
|
||||||
parseInt(this.$refs[dom][0].style.width);
|
debugger;
|
||||||
end =
|
let infoDomX=0,infoDomY = 0;
|
||||||
Math.round(end / this.currentDaySize.value) *
|
if(this.windowWidth-e.clientX>230){
|
||||||
this.currentDaySize.value -
|
infoDomX = e.clientX;
|
||||||
this.currentDaySize.value;
|
}else{
|
||||||
|
infoDomX = this.windowWidth-230;
|
||||||
|
}
|
||||||
|
if(this.windowHeight-e.clientY>200){
|
||||||
|
infoDomY = e.clientY;
|
||||||
|
}else{
|
||||||
|
infoDomY = this.windowHeight-200;
|
||||||
|
}
|
||||||
|
// if(){}else{}
|
||||||
this.currentProjectMsg = {
|
this.currentProjectMsg = {
|
||||||
name: this.computedList[index].name,
|
name: this.computedList[index].name,
|
||||||
allTime: (end - start) / this.currentDaySize.value + 1,
|
allTime: (end - start) / this.currentDaySize.value + 1,
|
||||||
|
|
@ -902,8 +901,8 @@
|
||||||
per1: this.computedList[index].per1,
|
per1: this.computedList[index].per1,
|
||||||
startTime: this.computedWithTime(start),
|
startTime: this.computedWithTime(start),
|
||||||
endTime: this.computedWithTime(end),
|
endTime: this.computedWithTime(end),
|
||||||
left: e.clientX ,
|
left:infoDomX ,
|
||||||
top: e.clientY + 20
|
top: infoDomY
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* left:
|
* left:
|
||||||
|
|
@ -1095,6 +1094,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
detailInfo(e,data) {
|
||||||
|
showDiv.style.left = (event.pageX - 300) + 'px';
|
||||||
|
showDiv.style.top = (event.pageY - 120) + 'px';
|
||||||
|
},
|
||||||
currentDaySize(newValue, oldValue) {
|
currentDaySize(newValue, oldValue) {
|
||||||
this.list.forEach(item => {
|
this.list.forEach(item => {
|
||||||
item.left = (item.left / oldValue.value) * newValue.value;
|
item.left = (item.left / oldValue.value) * newValue.value;
|
||||||
|
|
@ -1111,6 +1114,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if(window.innerHeight){
|
||||||
|
this.windowWidth = window.innerWidth;
|
||||||
|
this.windowHeight = window.innerHeight;
|
||||||
|
}else{
|
||||||
|
this.windowHeight=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight;
|
||||||
|
this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth;
|
||||||
|
}
|
||||||
document.addEventListener("scroll", this.handleScroll);
|
document.addEventListener("scroll", this.handleScroll);
|
||||||
this.getDay();
|
this.getDay();
|
||||||
this.setStoneLine();
|
this.setStoneLine();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-row style="display: flex;flex-wrap: wrap;width:100%;">
|
<el-row style="display: flex;flex-wrap: wrap;width:100%;">
|
||||||
<el-col v-for="item in ticketDetail.ticket_data_" :key="item.id" :span="12">
|
<el-col v-for="item in ticketDetail.ticket_data_" :key="item.id" :span="12" v-show="!item.is_hidden">
|
||||||
<el-form-item :label="item.field_name" v-if="item.field_state==='1'">
|
<el-form-item :label="item.field_name" v-if="item.field_state==='1'">
|
||||||
<span>{{ticketDetail.ticket_data[item.field_key]}}</span>
|
<span>{{ticketDetail.ticket_data[item.field_key]}}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -73,9 +73,9 @@
|
||||||
<el-select style="width: 100%" v-model="ticketDetail.ticket_data[item.field_key]" placeholder="请选择">
|
<el-select style="width: 100%" v-model="ticketDetail.ticket_data[item.field_key]" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item1 in item.field_choice"
|
v-for="item1 in item.field_choice"
|
||||||
:key="item1"
|
:key="item1.id"
|
||||||
:label="item1"
|
:label="item1.name"
|
||||||
:value="item1"
|
:value="item1.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -84,9 +84,9 @@
|
||||||
<el-select style="width: 100%" multiple v-model="ticketDetail.ticket_data[item.field_key]" placeholder="请选择">
|
<el-select style="width: 100%" multiple v-model="ticketDetail.ticket_data[item.field_key]" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item1 in item.field_choice"
|
v-for="item1 in item.field_choice"
|
||||||
:key="item1"
|
:key="item1.id"
|
||||||
:label="item1"
|
:label="item1.name"
|
||||||
:value="item1"
|
:value="item1.id"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -205,6 +205,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script src="https://d3js.org/d3.v4.min.js"></script>
|
<script src="https://d3js.org/d3.v4.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
import { getOrgAll } from "@/api/org";
|
||||||
import { upUrl, upHeaders } from "@/api/file";
|
import { upUrl, upHeaders } from "@/api/file";
|
||||||
import { getUserList } from "@/api/user";
|
import { getUserList } from "@/api/user";
|
||||||
import {getWorkflowList,getWfCustomfieldList,getWfStateList,getWfTransitionList,ticketHandle
|
import {getWorkflowList,getWfCustomfieldList,getWfStateList,getWfTransitionList,ticketHandle
|
||||||
|
|
@ -247,6 +248,7 @@
|
||||||
watchedName:'',
|
watchedName:'',
|
||||||
watchedCreateTime:'',
|
watchedCreateTime:'',
|
||||||
logs:[],
|
logs:[],
|
||||||
|
orgList:[],
|
||||||
staffs:[],
|
staffs:[],
|
||||||
edges: [],
|
edges: [],
|
||||||
nodes: [],
|
nodes: [],
|
||||||
|
|
@ -288,157 +290,173 @@
|
||||||
getTicketTransitions(ticketId).then(res=>{
|
getTicketTransitions(ticketId).then(res=>{
|
||||||
this.operationBtn = res.data;
|
this.operationBtn = res.data;
|
||||||
})
|
})
|
||||||
getWfFlowSteps( ticketId).then((res)=>{
|
getOrgAll().then((orgRes) => {
|
||||||
if(res.data){
|
that.orgList = orgRes.data;
|
||||||
//流程步骤数组
|
getUserList({page:0}).then(userRes=>{
|
||||||
that.flowSteps = res.data;
|
if(userRes.data){
|
||||||
getTicketDetail( ticketId).then((res)=>{
|
that.staffs = userRes.data;
|
||||||
if(res.data){
|
getWfFlowSteps( ticketId).then((res)=>{
|
||||||
that.tooltip = that.createTooltip();
|
if(res.data){
|
||||||
that.ticketDetail = res.data;
|
//流程步骤数组
|
||||||
|
that.flowSteps = res.data;
|
||||||
console.log(that.ticketDetail.state_.enable_retreat);
|
getTicketDetail( ticketId).then((res)=>{
|
||||||
debugger;
|
if(res.data){
|
||||||
let state = res.data.state;
|
that.tooltip = that.createTooltip();
|
||||||
let dat = that.flowSteps.filter((item)=>{
|
that.ticketDetail = res.data;
|
||||||
return item.id==state;
|
for (let i=0;i<that.ticketDetail.ticket_data_.length;i++) {
|
||||||
})
|
if(that.ticketDetail.ticket_data_[i].label==="sys_user"){
|
||||||
that.sort = dat[0].sort;
|
that.ticketDetail.ticket_data_[i].field_choice = that.staffs;
|
||||||
that.actives = that.flowSteps.indexOf(dat[0]);
|
}
|
||||||
if( that.flowSteps.length-that.actives >1){}else{
|
if(that.ticketDetail.ticket_data_[i].label==="deptSelect"){
|
||||||
that.actives =that.flowSteps.length;
|
that.ticketDetail.ticket_data_[i].field_choice = that.orgList;
|
||||||
}
|
}
|
||||||
var g = new dagreD3.graphlib.Graph().setGraph({
|
|
||||||
rankdir: 'DL',
|
|
||||||
nodesep: 100,
|
|
||||||
edgesep: 10,//两条线之间的距离
|
|
||||||
ranksep: 50,//节点之间的距离
|
|
||||||
marginx: 60,
|
|
||||||
marginy: 20,
|
|
||||||
});
|
|
||||||
//获取state得到节点
|
|
||||||
getWfStateList(workflow).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let nodes = response.data;
|
|
||||||
// 添加节点
|
|
||||||
nodes.forEach((item) => {
|
|
||||||
if(item.sort==that.sort){
|
|
||||||
g.setNode(item.id, {
|
|
||||||
// 节点标签
|
|
||||||
label: item.name,
|
|
||||||
// 节点形状
|
|
||||||
shape: 'rect',
|
|
||||||
toolText: item.name,
|
|
||||||
//节点样式
|
|
||||||
style: "fill:#409EFF;stroke:#000",
|
|
||||||
labelStyle: "fill:#000;",
|
|
||||||
rx :5,//矩形节点圆角度
|
|
||||||
ry :5
|
|
||||||
});
|
|
||||||
|
|
||||||
}else{
|
|
||||||
g.setNode(item.id, {
|
|
||||||
// 节点标签
|
|
||||||
label: item.name,
|
|
||||||
// 节点形状
|
|
||||||
shape: 'rect',
|
|
||||||
toolText: item.name,
|
|
||||||
//节点样式
|
|
||||||
style: "fill:#fff;stroke:#000",
|
|
||||||
labelStyle: "fill:#000;",
|
|
||||||
rx :5,//矩形节点圆角度
|
|
||||||
ry :5
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
console.log(that.ticketDetail.state_.enable_retreat);
|
||||||
g.nodes().forEach(function (v) {
|
let state = res.data.state;
|
||||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
let dat = that.flowSteps.filter((item)=>{
|
||||||
});
|
return item.id==state;
|
||||||
//获取流转得到线 链接关系
|
})
|
||||||
getWfTransitionList(workflow).then((res)=>{
|
that.sort = dat[0].sort;
|
||||||
if(res.data){
|
that.actives = that.flowSteps.indexOf(dat[0]);
|
||||||
let transitionList = res.data;
|
if( that.flowSteps.length-that.actives >1){}else{
|
||||||
transitionList.forEach((transitions)=>{
|
that.actives =that.flowSteps.length;
|
||||||
let transition0 = transitions;
|
}
|
||||||
if (transition0.condition_expression.length>0){
|
var g = new dagreD3.graphlib.Graph().setGraph({
|
||||||
g.setNode(transition0.source_state_.id+100000, {label: "条件表达式", style: "fill: #a4d088", shape: "diamond"});
|
rankdir: 'DL',
|
||||||
g.setEdge(transition0.source_state_.id, transition0.source_state_.id+100000, {
|
nodesep: 100,
|
||||||
// 边标签
|
edgesep: 10,//两条线之间的距离
|
||||||
label: transition0.name,
|
ranksep: 50,//节点之间的距离
|
||||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
marginx: 60,
|
||||||
});
|
marginy: 20,
|
||||||
let condition_expression = transition0.condition_expression;
|
});
|
||||||
condition_expression.forEach(condition_expression0=>{
|
//获取state得到节点
|
||||||
g.setEdge(transition0.source_state_.id+100000, condition_expression0.target_state, {
|
getWfStateList(workflow).then((response) => {
|
||||||
label: condition_expression0.label,
|
if (response.data) {
|
||||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
let nodes = response.data;
|
||||||
})
|
// 添加节点
|
||||||
})
|
nodes.forEach((item) => {
|
||||||
}else{
|
if(item.sort==that.sort){
|
||||||
g.setEdge(transition0.source_state_.id, transition0.destination_state_.id, {
|
g.setNode(item.id, {
|
||||||
// 边标签
|
// 节点标签
|
||||||
label: transition0.name,
|
label: item.name,
|
||||||
// 边样式
|
// 节点形状
|
||||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
|
shape: 'rect',
|
||||||
});
|
toolText: item.name,
|
||||||
}
|
//节点样式
|
||||||
})
|
style: "fill:#409EFF;stroke:#000",
|
||||||
g.nodes().length-1
|
labelStyle: "fill:#000;",
|
||||||
g.nodes().forEach(function (v) {
|
rx :5,//矩形节点圆角度
|
||||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
ry :5
|
||||||
});
|
});
|
||||||
// 创建渲染器
|
|
||||||
let render = new dagreD3.render();
|
|
||||||
// 选择 svg 并添加一个g元素作为绘图容器.
|
|
||||||
let svg = d3.select('#mySvg');
|
|
||||||
let svgGroup = svg.append('g');
|
|
||||||
let zoom = d3.zoom()
|
|
||||||
.on("zoom", function() {
|
|
||||||
svgGroup.attr("transform", d3.event.transform);
|
|
||||||
});
|
|
||||||
svg.call(zoom);
|
|
||||||
// 在绘图容器上运行渲染器生成流程图.
|
|
||||||
render(d3.select("svg g"), g);
|
|
||||||
// this.getTicketFlowlogs(ticketId);
|
|
||||||
getTicketFlowlog(ticketId).then(res=>{
|
|
||||||
if(res.data){
|
|
||||||
that.logs = res.data;
|
|
||||||
svgGroup
|
|
||||||
.selectAll('g.node')
|
|
||||||
.on('mouseover', (v) => {
|
|
||||||
// 假如当前toolText为"",则不展示
|
|
||||||
//这里就是自定义tooltip的内容
|
|
||||||
let filList = [], strList = [];
|
|
||||||
filList = nodes.filter((ii) => {
|
|
||||||
return ii.name === g.node(v).label
|
|
||||||
})
|
|
||||||
if (!filList.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
filList.map((k) => {
|
|
||||||
let filte = that.logs.filter(item=>{
|
|
||||||
return item.state == k.id;
|
|
||||||
})
|
|
||||||
//每个
|
|
||||||
let str = '处理人:'+filte[0].participant_.name;
|
|
||||||
strList.push(str)
|
|
||||||
})
|
|
||||||
that.tipVisible(strList)
|
|
||||||
})
|
|
||||||
.on('mouseout', () => {
|
|
||||||
this.tipHidden()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}else{}
|
}else{
|
||||||
});
|
g.setNode(item.id, {
|
||||||
}
|
// 节点标签
|
||||||
});
|
label: item.name,
|
||||||
}
|
// 节点形状
|
||||||
});
|
shape: 'rect',
|
||||||
}
|
toolText: item.name,
|
||||||
|
//节点样式
|
||||||
|
style: "fill:#fff;stroke:#000",
|
||||||
|
labelStyle: "fill:#000;",
|
||||||
|
rx :5,//矩形节点圆角度
|
||||||
|
ry :5
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
g.nodes().forEach(function (v) {
|
||||||
|
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||||
|
});
|
||||||
|
//获取流转得到线 链接关系
|
||||||
|
getWfTransitionList(workflow).then((res)=>{
|
||||||
|
if(res.data){
|
||||||
|
let transitionList = res.data;
|
||||||
|
transitionList.forEach((transitions)=>{
|
||||||
|
let transition0 = transitions;
|
||||||
|
if (transition0.condition_expression.length>0){
|
||||||
|
g.setNode(transition0.source_state_.id+100000, {label: "条件表达式", style: "fill: #a4d088", shape: "diamond"});
|
||||||
|
g.setEdge(transition0.source_state_.id, transition0.source_state_.id+100000, {
|
||||||
|
// 边标签
|
||||||
|
label: transition0.name,
|
||||||
|
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
||||||
|
});
|
||||||
|
let condition_expression = transition0.condition_expression;
|
||||||
|
condition_expression.forEach(condition_expression0=>{
|
||||||
|
g.setEdge(transition0.source_state_.id+100000, condition_expression0.target_state, {
|
||||||
|
label: condition_expression0.label,
|
||||||
|
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
g.setEdge(transition0.source_state_.id, transition0.destination_state_.id, {
|
||||||
|
// 边标签
|
||||||
|
label: transition0.name,
|
||||||
|
// 边样式
|
||||||
|
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
g.nodes().length-1
|
||||||
|
g.nodes().forEach(function (v) {
|
||||||
|
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||||
|
});
|
||||||
|
// 创建渲染器
|
||||||
|
let render = new dagreD3.render();
|
||||||
|
// 选择 svg 并添加一个g元素作为绘图容器.
|
||||||
|
let svg = d3.select('#mySvg');
|
||||||
|
let svgGroup = svg.append('g');
|
||||||
|
let zoom = d3.zoom()
|
||||||
|
.on("zoom", function() {
|
||||||
|
svgGroup.attr("transform", d3.event.transform);
|
||||||
|
});
|
||||||
|
svg.call(zoom);
|
||||||
|
// 在绘图容器上运行渲染器生成流程图.
|
||||||
|
render(d3.select("svg g"), g);
|
||||||
|
// this.getTicketFlowlogs(ticketId);
|
||||||
|
getTicketFlowlog(ticketId).then(res=>{
|
||||||
|
if(res.data){
|
||||||
|
that.logs = res.data;
|
||||||
|
svgGroup
|
||||||
|
.selectAll('g.node')
|
||||||
|
.on('mouseover', (v) => {
|
||||||
|
// 假如当前toolText为"",则不展示
|
||||||
|
//这里就是自定义tooltip的内容
|
||||||
|
let filList = [], strList = [];
|
||||||
|
filList = nodes.filter((ii) => {
|
||||||
|
return ii.name === g.node(v).label
|
||||||
|
})
|
||||||
|
if (!filList.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
filList.map((k) => {
|
||||||
|
let filte = that.logs.filter(item=>{
|
||||||
|
return item.state == k.id;
|
||||||
|
})
|
||||||
|
//每个
|
||||||
|
let str = '处理人:'+filte[0].participant_.name;
|
||||||
|
strList.push(str)
|
||||||
|
})
|
||||||
|
that.tipVisible(strList)
|
||||||
|
})
|
||||||
|
.on('mouseout', () => {
|
||||||
|
this.tipHidden()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}else{}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
activated(){
|
activated(){
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,7 @@
|
||||||
>报废
|
>报废
|
||||||
</el-link>
|
</el-link>
|
||||||
<el-link type="primary"
|
<el-link type="primary"
|
||||||
|
v-if="!scope.row.ticket"
|
||||||
@click="handleRetrial(scope)"
|
@click="handleRetrial(scope)"
|
||||||
>重审
|
>重审
|
||||||
</el-link>
|
</el-link>
|
||||||
|
|
@ -595,7 +596,7 @@
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
import customForm from '@/components/customForm/index';
|
import customForm from '@/components/customForm/index';
|
||||||
import reviewForm from '@/components/customForm/review';
|
import reviewForm from '@/components/customForm/review';
|
||||||
import {getWfCustomfieldList,createTicket} from "@/api/workflow";
|
import {getWfCustomfieldList,createTicket ,getWorkflowInit} from "@/api/workflow";
|
||||||
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
|
||||||
import {getwproductList, wproductTest, wproductPutin, createputins,testInit,scrap,getRetrial} from "@/api/wpm";
|
import {getwproductList, wproductTest, wproductPutin, createputins,testInit,scrap,getRetrial} from "@/api/wpm";
|
||||||
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
|
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
|
||||||
|
|
@ -681,6 +682,7 @@
|
||||||
{ lable: "其他", value: 40 },
|
{ lable: "其他", value: 40 },
|
||||||
],
|
],
|
||||||
recordList: [],
|
recordList: [],
|
||||||
|
transitions: null,
|
||||||
options: [],
|
options: [],
|
||||||
listLoading: true,
|
listLoading: true,
|
||||||
fieldList: [],
|
fieldList: [],
|
||||||
|
|
@ -719,7 +721,7 @@
|
||||||
//复检表单
|
//复检表单
|
||||||
retrialForm: {
|
retrialForm: {
|
||||||
title:'',
|
title:'',
|
||||||
transition:'',
|
transition:null,
|
||||||
workflow:'',
|
workflow:'',
|
||||||
ticket_data:{},
|
ticket_data:{},
|
||||||
},
|
},
|
||||||
|
|
@ -823,9 +825,12 @@
|
||||||
console.log(this.retrialItem);
|
console.log(this.retrialItem);
|
||||||
getRetrial(scope.row.id).then(res=>{
|
getRetrial(scope.row.id).then(res=>{
|
||||||
that.retrialResponse = res.data;
|
that.retrialResponse = res.data;
|
||||||
getWfCustomfieldList(res.data.workflow).then((response) => {
|
getWorkflowInit(res.data.workflow).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
that.customfieldList = response.data;
|
debugger;
|
||||||
|
console.log(response.data);
|
||||||
|
that.retrialForm.transition = response.data.transitions[0].id;
|
||||||
|
that.customfieldList = response.data.field_list;
|
||||||
for (let i=0;i<that.customfieldList.length;i++) {
|
for (let i=0;i<that.customfieldList.length;i++) {
|
||||||
if(that.customfieldList[i].field_key==="wproduct"){
|
if(that.customfieldList[i].field_key==="wproduct"){
|
||||||
that.customfieldList[i].default_value = that.retrialResponse.exist_data.wproduct;
|
that.customfieldList[i].default_value = that.retrialResponse.exist_data.wproduct;
|
||||||
|
|
@ -865,13 +870,10 @@
|
||||||
}
|
}
|
||||||
this.retrialForm.ticket_data = obj;
|
this.retrialForm.ticket_data = obj;
|
||||||
this.retrialForm.workflow = that.retrialResponse.workflow;
|
this.retrialForm.workflow = that.retrialResponse.workflow;
|
||||||
this.retrialForm.transition = 20;
|
|
||||||
this.retrialForm.title = that.retrialResponse.exist_data.wproduct_name+'的重审';
|
this.retrialForm.title = that.retrialResponse.exist_data.wproduct_name+'的重审';
|
||||||
debugger;
|
|
||||||
console.log(this.retrialForm);
|
|
||||||
createTicket(this.retrialForm).then((res) => {
|
createTicket(this.retrialForm).then((res) => {
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
// this.getList();
|
this.getList4();
|
||||||
this.limitedRetrial = false;
|
this.limitedRetrial = false;
|
||||||
this.$message.success("成功");
|
this.$message.success("成功");
|
||||||
}
|
}
|
||||||
|
|
@ -925,7 +927,6 @@
|
||||||
//点击检验:如果有一个直接进入,如果有多个表再进行选择
|
//点击检验:如果有一个直接进入,如果有多个表再进行选择
|
||||||
handleInspection(scope,index) {
|
handleInspection(scope,index) {
|
||||||
//调该物料对应的检查表
|
//调该物料对应的检查表
|
||||||
// debugger;
|
|
||||||
let that = this;
|
let that = this;
|
||||||
this.innerIndex = index;
|
this.innerIndex = index;
|
||||||
// this.outerVisible = true;
|
// this.outerVisible = true;
|
||||||
|
|
@ -935,7 +936,6 @@
|
||||||
this.recordform = null;
|
this.recordform = null;
|
||||||
getrecordformList(this.listQueryrecordform).then((response) => {
|
getrecordformList(this.listQueryrecordform).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
debugger;
|
|
||||||
this.recordformList = response.data;
|
this.recordformList = response.data;
|
||||||
if(response.data.length===1){
|
if(response.data.length===1){
|
||||||
that.recordform = response.data[0].id;
|
that.recordform = response.data[0].id;
|
||||||
|
|
@ -966,7 +966,6 @@
|
||||||
that.limitedCheckRecord = true;
|
that.limitedCheckRecord = true;
|
||||||
getTestRecord({wproduct:scope.row.id}).then(res=>{
|
getTestRecord({wproduct:scope.row.id}).then(res=>{
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
debugger;
|
|
||||||
that.recordList = res.data.results;
|
that.recordList = res.data.results;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(res.msg);
|
this.$message.error(res.msg);
|
||||||
|
|
@ -975,7 +974,6 @@
|
||||||
},
|
},
|
||||||
//点击记录里的检验
|
//点击记录里的检验
|
||||||
handleInspectionRecord(scope){
|
handleInspectionRecord(scope){
|
||||||
// debugger;
|
|
||||||
let that =this;
|
let that =this;
|
||||||
that.recordVisible = false;
|
that.recordVisible = false;
|
||||||
that.recordId = scope.row.id;
|
that.recordId = scope.row.id;
|
||||||
|
|
@ -994,7 +992,6 @@
|
||||||
that.hasPicture = true;
|
that.hasPicture = true;
|
||||||
}
|
}
|
||||||
getTestRecordItem(scope.row.id).then((res) => {
|
getTestRecordItem(scope.row.id).then((res) => {
|
||||||
// debugger;
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
let fieldList = res.data.record_data;
|
let fieldList = res.data.record_data;
|
||||||
for(let i=0;i<that.fieldList.length;i++){
|
for(let i=0;i<that.fieldList.length;i++){
|
||||||
|
|
@ -1017,7 +1014,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else if(that.innerIndex==='2'){//复检
|
}else if(that.innerIndex==='2'){//复检
|
||||||
debugger;
|
|
||||||
getTestRecordItem(scope.row.id).then((res) => {
|
getTestRecordItem(scope.row.id).then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
that.hasPicture = false;
|
that.hasPicture = false;
|
||||||
|
|
@ -1040,8 +1036,6 @@
|
||||||
}
|
}
|
||||||
that.fieldList.push(obj)
|
that.fieldList.push(obj)
|
||||||
}
|
}
|
||||||
debugger;
|
|
||||||
console.log(that.fieldList)
|
|
||||||
// that.fieldList = [...fieldList];
|
// that.fieldList = [...fieldList];
|
||||||
let arr = fieldList.filter(item => {
|
let arr = fieldList.filter(item => {
|
||||||
return item.field_type === 'draw'
|
return item.field_type === 'draw'
|
||||||
|
|
@ -1060,11 +1054,9 @@
|
||||||
},
|
},
|
||||||
//半产品复检
|
//半产品复检
|
||||||
handleReview() {
|
handleReview() {
|
||||||
// debugger;
|
|
||||||
let that = this;
|
let that = this;
|
||||||
testInit({ wproduct: this.wproduct,form: that.recordform}).then((response) => {
|
testInit({ wproduct: this.wproduct,form: that.recordform}).then((response) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
debugger;
|
|
||||||
that.hasPicture = false;
|
that.hasPicture = false;
|
||||||
that.recordId = response.data.id;
|
that.recordId = response.data.id;
|
||||||
that.formName = response.data.form_.name;
|
that.formName = response.data.form_.name;
|
||||||
|
|
@ -1099,7 +1091,6 @@
|
||||||
|
|
||||||
//根据选择的表,渲染检查项目
|
//根据选择的表,渲染检查项目
|
||||||
submitrecordform(index) {
|
submitrecordform(index) {
|
||||||
// debugger;
|
|
||||||
let that = this;
|
let that = this;
|
||||||
this.outerVisible = false;
|
this.outerVisible = false;
|
||||||
if (that.recordform != "") {
|
if (that.recordform != "") {
|
||||||
|
|
@ -1125,7 +1116,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else if(index==='2'){//复检
|
}else if(index==='2'){//复检
|
||||||
// debugger;
|
|
||||||
that.handleReview();
|
that.handleReview();
|
||||||
}
|
}
|
||||||
} else this.$message.error("请选择检查表!");
|
} else this.$message.error("请选择检查表!");
|
||||||
|
|
@ -1190,7 +1180,6 @@
|
||||||
params.record_data = value.record_data;
|
params.record_data = value.record_data;
|
||||||
params.is_testok = value.is_testok;
|
params.is_testok = value.is_testok;
|
||||||
putTestRecordItem(id,params).then((res) => {
|
putTestRecordItem(id,params).then((res) => {
|
||||||
// debugger;
|
|
||||||
if (res.code >= 200) {
|
if (res.code >= 200) {
|
||||||
that.recordVisible = false;
|
that.recordVisible = false;
|
||||||
that.limitedReview = false;
|
that.limitedReview = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue