opl 页面调整
This commit is contained in:
parent
b1eaf35a69
commit
4375778c3b
|
|
@ -45,6 +45,7 @@ const install = (Vue, vm) => {
|
|||
let getTicketLog = (id) => vm.$u.get(`/wf/ticket/${id}/flowlogs/`); //工单日志
|
||||
let getTicketTransitions = (id) => vm.$u.get(`/wf/ticket/${id}/transitions/`); //工单按钮查询
|
||||
let workflowInit = (key) => vm.$u.get(`/wf/workflow/${key}/init_key/`); //工单按钮查询
|
||||
let workflowInitId = (id) => vm.$u.get(`/wf/workflow/${id}/init/`); //工单按钮查询
|
||||
let ticketDutyAgg = (data = {}) => vm.$u.get(`/wf/ticket/duty_agg/`,data); //工单待办聚合
|
||||
|
||||
let addNode = (id, data = {}) => vm.$u.get(`/wf/ticket/${id}/add_node/`, data); //加签
|
||||
|
|
@ -137,6 +138,7 @@ const install = (Vue, vm) => {
|
|||
getTickets,
|
||||
getTicketItem,
|
||||
workflowInit,
|
||||
workflowInitId,
|
||||
getTicketTransitions,
|
||||
getTicketLog,
|
||||
ticketRetry,
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
|
||||
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;">{{item.name}}
|
||||
</button>
|
||||
<button plain="true" style="width: 25%;" @click="nexStep">退出</button>
|
||||
<button plain="true" style="width: 25%;" @click="goOut">退出</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -102,6 +102,8 @@
|
|||
name: "gasList",
|
||||
data() {
|
||||
return {
|
||||
oplId: null,
|
||||
oplCateCode: null,
|
||||
limitedDialog: false,
|
||||
formData: {
|
||||
opl: '',
|
||||
|
|
@ -122,6 +124,7 @@
|
|||
},
|
||||
onLoad(params) {
|
||||
this.oplId = params.oplId;
|
||||
this.oplCateCode = params.oplCateCode;
|
||||
},
|
||||
onShow() {
|
||||
this.gasCheckList = [];
|
||||
|
|
@ -210,14 +213,14 @@
|
|||
},
|
||||
edit(row) {},
|
||||
|
||||
nexStep() {
|
||||
goOut() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/workSpace/operation/operationList'
|
||||
})
|
||||
},
|
||||
|
||||
getInit() {
|
||||
this.$u.api.workflowInit('opl_fire').then((res) => {
|
||||
this.$u.api.workflowInit('opl_'+ this.oplCateCode).then((res) => {
|
||||
this.initform = res;
|
||||
|
||||
});
|
||||
|
|
@ -231,7 +234,7 @@
|
|||
opl: that.oplId
|
||||
};
|
||||
ticket.transition = id;
|
||||
ticket.title = that.oplDetail.operation_.name + that.oplDetail.cate_name + '申请';
|
||||
ticket.title = that.oplDetail.operation_.name + '-' + that.oplDetail.cate_name + '-申请';
|
||||
that.$u.api.ticketCreate(ticket).then((res) => {
|
||||
if (res.err_msg) {} else {
|
||||
uni.reLaunch({
|
||||
|
|
|
|||
|
|
@ -56,9 +56,10 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="apply-info" style="min-height: fit-content;display: flex;">
|
||||
|
||||
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
|
||||
<button type="primary" style="width: 25%;" @click="nexStep">下一步</button>
|
||||
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;" v-if="!showN">{{item.name}}
|
||||
</button>
|
||||
<button type="primary" style="width: 25%;" @click="nexStep" v-if="showN">下一步</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -69,7 +70,10 @@
|
|||
name: "workerList",
|
||||
data() {
|
||||
return {
|
||||
oplId: null,
|
||||
oplCateCode: null,
|
||||
limitedPeople: false,
|
||||
showN: false,
|
||||
formData: {
|
||||
opl: '',
|
||||
worker: '',
|
||||
|
|
@ -105,6 +109,9 @@
|
|||
},
|
||||
onLoad(params) {
|
||||
this.oplId = params.oplId;
|
||||
this.oplCateCode = params.oplCateCode;
|
||||
this.showNext()
|
||||
this.getInit()
|
||||
},
|
||||
onShow() {
|
||||
this.workerList = [];
|
||||
|
|
@ -113,6 +120,11 @@
|
|||
// this.getVpeopleList();
|
||||
},
|
||||
methods: {
|
||||
showNext(){
|
||||
if(["fire", "space", "cooler"].indexOf(this.oplCateCode)!=-1){
|
||||
this.showN = true
|
||||
}
|
||||
},
|
||||
formSubmit(val) {
|
||||
let that = this;
|
||||
that.formData.opl = that.oplId;
|
||||
|
|
@ -204,12 +216,18 @@
|
|||
edit(row) {},
|
||||
|
||||
nexStep(){
|
||||
let params = `?oplId=${this.oplId}`;
|
||||
let params = `?oplId=${this.oplId}&oplCateCode=${this.oplCateCode}`;
|
||||
uni.navigateTo({
|
||||
url: '/pages/workSpace/operation/gasList'+params
|
||||
})
|
||||
},
|
||||
|
||||
getInit() {
|
||||
this.$u.api.workflowInit('opl_'+ this.oplCateCode).then((res) => {
|
||||
this.initform = res;
|
||||
|
||||
});
|
||||
},
|
||||
//提交工单
|
||||
submitticket(id) {
|
||||
let that = this;
|
||||
|
|
@ -219,14 +237,15 @@
|
|||
opl: that.oplId
|
||||
};
|
||||
ticket.transition = id;
|
||||
ticket.title = that.oplDetail.operation_.name + '-' + that.oplDetail.cate_name + '申请';
|
||||
that.$u.api.ticketCreate(ticket).then((res) => {
|
||||
if (res.err_msg) {} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/workSpace/workSpace'
|
||||
url: '/pages/workSpace/operation/operationList'
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@
|
|||
},
|
||||
header: {},
|
||||
oplId: null,
|
||||
oplCateCode: null,
|
||||
operationName: '',
|
||||
oplCateName: '',
|
||||
fileList: [],
|
||||
|
|
@ -207,17 +208,18 @@
|
|||
if (params.oplId) {
|
||||
this.oplId = params.oplId;
|
||||
this.formData.id = params.oplId;
|
||||
this.getOplDetail()
|
||||
}else{
|
||||
console.log('s', this.vuex_user.belong_dept)
|
||||
this.formData.dept_do = this.vuex_user.belong_dept
|
||||
this.formData.cate = this.oplcateId;
|
||||
this.formData.operation = this.operationId;
|
||||
this.getOperation();
|
||||
}
|
||||
this.formData.cate = this.oplcateId;
|
||||
this.formData.operation = this.operationId;
|
||||
|
||||
},
|
||||
onShow() {
|
||||
debugger;
|
||||
this.getOperation();
|
||||
this.getOplcates();
|
||||
this.getdept();
|
||||
this.getRange();
|
||||
this.getUserRange();
|
||||
|
|
@ -236,17 +238,18 @@
|
|||
that.formData.start_time = res.start_time; //作业开始时间
|
||||
that.formData.end_time = res.end_time; //作业结束时间
|
||||
that.operationName = res.name; //作业
|
||||
console.log(res);
|
||||
this.getOplcates()
|
||||
});
|
||||
},
|
||||
// getOplDetail(){
|
||||
// let that = this;
|
||||
// that.$u.api.oplItem(that.oplId).then((res) => {
|
||||
// that.formData = res; //作业开始时间
|
||||
// debugger;
|
||||
// console.log(res);
|
||||
// });
|
||||
// },
|
||||
getOplDetail(){
|
||||
let that = this;
|
||||
that.$u.api.oplItem(that.oplId).then((res) => {
|
||||
that.formData = res; //作业开始时间
|
||||
that.operationName = res.operation_.name
|
||||
this.getOplcates()
|
||||
});
|
||||
|
||||
},
|
||||
//根据作业许可证类别ID获取,风险、措施===>作业许可证类别详情
|
||||
getOplcates() {
|
||||
let that = this;
|
||||
|
|
@ -255,57 +258,42 @@
|
|||
that.risklist = [];
|
||||
that.measurelist = [];
|
||||
that.oplCateName = res.name;
|
||||
that.oplcateCode = res.code;
|
||||
that.oplCateCode = res.code;
|
||||
let risklist = res.risk_options_;
|
||||
let measurelist = res.measure_options_;
|
||||
if (that.oplId !== null) {
|
||||
that.editCheckShow(risklist, measurelist);
|
||||
} else {
|
||||
risklist.forEach(item => {
|
||||
let obj = {};
|
||||
obj = item;
|
||||
obj.checked = false;
|
||||
that.risklist.push(obj)
|
||||
})
|
||||
measurelist.forEach(item => {
|
||||
let obj = {};
|
||||
obj = item;
|
||||
obj.checked = false;
|
||||
that.measurelist.push(obj)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
editCheckShow(risklist, measurelist) {
|
||||
debugger;
|
||||
let that = this;
|
||||
that.$u.api.oplItem(that.oplId).then((res) => {
|
||||
that.formData = res; //作业开始时间
|
||||
risklist.forEach(item => {
|
||||
let obj = {};
|
||||
obj = item;
|
||||
if (res.risks_checked.indexOf(item.id) > -1) {
|
||||
obj.checked = true;
|
||||
} else {
|
||||
obj.checked = false;
|
||||
}
|
||||
obj.checked = false;
|
||||
that.risklist.push(obj)
|
||||
})
|
||||
|
||||
measurelist.forEach(item => {
|
||||
let obj = {};
|
||||
obj = item;
|
||||
if (res.measures_checked.indexOf(item.id) > -1) {
|
||||
obj.checked = true;
|
||||
} else {
|
||||
obj.checked = false;
|
||||
}
|
||||
obj.checked = false;
|
||||
that.measurelist.push(obj)
|
||||
})
|
||||
debugger;
|
||||
console.log(res);
|
||||
this.editCheckShow()
|
||||
});
|
||||
|
||||
},
|
||||
editCheckShow() {
|
||||
debugger;
|
||||
let that = this;
|
||||
that.risklist.forEach(item => {
|
||||
if (this.formData.risks_checked.indexOf(item.id) > -1) {
|
||||
item.checked = true;
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
})
|
||||
|
||||
that.measurelist.forEach(item => {
|
||||
if (this.formData.measures_checked.indexOf(item.id) > -1) {
|
||||
item.checked = true;
|
||||
} else {
|
||||
item.checked = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取作业区域
|
||||
getRange() {
|
||||
|
|
@ -412,7 +400,7 @@
|
|||
if (that.oplId !== null) {
|
||||
that.$u.api.oplUpdate(that.oplId, that.formData).then(res => {
|
||||
uni.hideLoading();
|
||||
params = `?oplId=${that.oplId}`;
|
||||
params = `?oplId=${that.oplId}&oplCateCode=${that.oplCateCode}`;
|
||||
uni.navigateTo({
|
||||
url: '/pages/workSpace/operation/workerList' + params
|
||||
})
|
||||
|
|
@ -421,7 +409,7 @@
|
|||
} else {
|
||||
that.$u.api.oplCreate(that.formData).then(res => {
|
||||
uni.hideLoading();
|
||||
params = `?oplId=${res.id}`;
|
||||
params = `?oplId=${res.id}&oplCateCode=${that.oplCateCode}`;
|
||||
uni.navigateTo({
|
||||
url: '/pages/workSpace/operation/workerList' + params
|
||||
})
|
||||
|
|
|
|||
|
|
@ -184,16 +184,20 @@
|
|||
//部门
|
||||
depRange: [],
|
||||
leveloptions: [{
|
||||
value: "特殊动火",
|
||||
text: "特殊动火"
|
||||
value: "特级",
|
||||
text: "特级:>30米"
|
||||
},
|
||||
{
|
||||
value: "一级动火",
|
||||
text: "一级动火"
|
||||
value: "三级",
|
||||
text: "三级:15-30米"
|
||||
},
|
||||
{
|
||||
value: "二级动火",
|
||||
text: "二级动火"
|
||||
value: "二级",
|
||||
text: "二级:>5-15米"
|
||||
},
|
||||
{
|
||||
value: "一级",
|
||||
text: "一级:1.8-5米"
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue