fix: 工单处理相关bug解决

This commit is contained in:
caoqianming 2023-06-22 01:50:19 +08:00
parent 268c512273
commit ec21622c42
4 changed files with 107 additions and 51 deletions

View File

@ -9,8 +9,8 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
#VUE_APP_WS_API = 'ws://localhost:8000' #VUE_APP_WS_API = 'ws://localhost:8000'
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api # VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api #VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api # VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
#VUE_APP_BASEURL = http://127.0.0.1:8000 #VUE_APP_BASEURL = http://127.0.0.1:8000

View File

@ -656,15 +656,25 @@ export default {
ticket.workflow = this.initForm.workflow; ticket.workflow = this.initForm.workflow;
ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name}; ticket.ticket_data = { rpj: this.rpjId ,name:this.rpjform.name};
ticket.transition = id; ticket.transition = id;
this.$API.wf.ticket.create.req(ticket).then((res) => { if(this.rpjform.ticket!= null&&this.rpjform.ticket!= undefined){
this.$message.success("提交成功"); this.$API.wf.ticket.ticketHandle.req(this.rpjform.ticket,ticket).then((res) => {
this.$router.push({ this.tLoading=false
name: "rpj", this.$message.success("提交成功");
query: {}, this.$router.push({
}); name: "rpj",
}).catch(()=>{ query: {},
this.isSaveing = false; });
}); }).catch(e=>{this.tLoading=false});
}else{
this.$API.wf.ticket.create.req(ticket).then((res) => {
this.tLoading=false
this.$message.success("提交成功");
this.$router.push({
name: "rpj",
query: {},
});
}).catch(e=>{this.tLoading=false});
}
}, },
}, },
}; };

View File

@ -557,6 +557,7 @@ export default {
that.$message.success("创建成功"); that.$message.success("创建成功");
that.dialogpeople = false; that.dialogpeople = false;
that.isSaveing = false; that.isSaveing = false;
this.getpeoplelistlist();
return res; return res;
}) })
.catch((err) => { .catch((err) => {
@ -574,7 +575,7 @@ export default {
.req(row.id) .req(row.id)
.then((res) => { .then((res) => {
this.$message.success("访客删除成功"); this.$message.success("访客删除成功");
this.getpeoplelistlist();
return res; return res;
}) })
.catch((err) => { .catch((err) => {
@ -589,15 +590,26 @@ export default {
this.ticket.workflow=this.initform.workflow; this.ticket.workflow=this.initform.workflow;
this.ticket.ticket_data={visit:this.visitid,name:this.form.name}; this.ticket.ticket_data={visit:this.visitid,name:this.form.name};
this.ticket.transition=id; this.ticket.transition=id;
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
this.$message.success("提交成功"); if(this.form.ticket!= null&&this.form.ticket!= undefined){
this.$router.push({ this.$API.wf.ticket.ticketHandle.req(this.form.ticket,this.ticket).then((res) => {
name: "visit", this.isSaving=false
query: {}, this.$message.success("提交成功");
}); this.$router.push({
}).catch(()=>{ name: "visit",
this.isSaving = false; query: {},
}); });
}).catch(e=>{this.isSaving=false});
}else{
this.$API.wf.ticket.create.req(this.ticket).then((res) => {
this.isSaving=false
this.$message.success("提交成功");
this.$router.push({
name: "visit",
query: {},
});
}).catch(e=>{this.isSaving=false});
}
} }
}, },
}; };

View File

@ -129,9 +129,9 @@
<el-card style="margin-top: 4px;position:relative" header="处理日志"> <el-card style="margin-top: 4px;position:relative" header="处理日志">
<work-details ref="workDetails" :ticket="ticketId"></work-details> <work-details ref="workDetails" :ticket="ticketId"></work-details>
</el-card> </el-card>
<el-card class="handleWrap" v-if="type!=='show'&&type!=='showMy'"> <el-card class="handleWrap" v-if="isDuty || isOwn">
<scTitle title="处理"></scTitle> <scTitle title="处理"></scTitle>
<el-form :model="form" ref="addForm" label-width="100px" label-position="left"> <el-form :model="form" ref="addForm" label-width="100px" label-position="left" v-if="isDuty">
<el-form-item label="作业情况:" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'"> <el-form-item label="作业情况:" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'">
<el-select v-model="form.close_note" placeholder="选择关闭原因"> <el-select v-model="form.close_note" placeholder="选择关闭原因">
<el-option <el-option
@ -156,23 +156,36 @@
<el-input v-model="form.suggestion" clearable></el-input> <el-input v-model="form.suggestion" clearable></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div v-if="ticketDetail.in_add_node" style="text-align: right"> <div style="text-align: right">
<el-button v-if="ticketDetail.in_add_node" class="filter-item" type="primary" <el-button v-if="ticketDetail.in_add_node && isDuty" class="filter-item" type="primary"
@click="addNodeHandler('2')">加签处理 @click="addNodeHandler('2')">加签处理
</el-button> </el-button>
</div> </div>
<div v-else style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div> <div>
<el-button type="primary" @click="addNode">加签</el-button> <el-button type="primary" @click="addNode" v-if="(!ticketDetail.in_add_node) && isDuty">加签</el-button>
<el-button v-if="ticketDetail.state_&&ticketDetail.state_.enable_deliver" type="primary" plain <el-button v-if="isDuty && ticketDetail.state_&&ticketDetail.state_.enable_deliver" type="primary" plain
@click="deliverNode">转交 @click="deliverNode">转交
</el-button> </el-button>
</div>
<div>
<el-button <el-button
v-if="(itemDetail.ticket_&&itemDetail.ticket_.act_state==2 && itemDetail.ticket_.state && itemDetail.ticket_.state_.type==1) || itemDetail.ticket_&&itemDetail.ticket_.act_state==0 || itemDetail.ticket_&&itemDetail.ticket_.act_state==3" v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.type === 1 && isOwn"
type="danger"
@click="handleClose('2')"
>关闭
</el-button>
<el-button
v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.enable_retreat && isOwn &&itemDetail.ticket_.state_.type !== 1"
type="danger"
@click="handleClose('1')"
>
撤回
</el-button>
</div>
<div v-if="isDuty && !ticketDetail.in_add_node">
<el-button
v-if="itemDetail.ticket_&& itemDetail.ticket_.state && itemDetail.ticket_.state_.type==1"
type="primary" plain type="primary" plain
@click="itemDetailEdtil">编辑许可证 @click="itemDetailEdtil">前往编辑
</el-button> </el-button>
<el-button :loading="submitLoading" :disabled="submitLoading" v-for="item in operationBtn" :key="item.id" class="filter-item" <el-button :loading="submitLoading" :disabled="submitLoading" v-for="item in operationBtn" :key="item.id" class="filter-item"
@ -182,14 +195,13 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card class="handleWrap" v-if="type!=='show'&&type=='showMy'"> <!-- <el-card class="handleWrap" v-if="type!=='show'&&type=='showMy'">
<scTitle title="处理"></scTitle> <scTitle title="处理"></scTitle>
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div> <div>
<el-button <el-button
v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.type === 1 && userId === itemDetail.create_by" v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.type === 1 && userId === itemDetail.create_by"
type="danger" type="danger"
size="small"
@click="handleClose('2')" @click="handleClose('2')"
>关闭 >关闭
</el-button> </el-button>
@ -197,21 +209,20 @@
v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.enable_retreat &&userId ===itemDetail.ticket_.create_by &&itemDetail.ticket_.state_.type !== 1" v-if="itemDetail.ticket_&&itemDetail.ticket_.state_.enable_retreat &&userId ===itemDetail.ticket_.create_by &&itemDetail.ticket_.state_.type !== 1"
type="danger" type="danger"
@click="handleClose('1')" @click="handleClose('1')"
size="small"
> >
撤回 撤回
</el-button> </el-button>
</div> </div>
<div> <div>
<el-button <el-button
v-if="(itemDetail.ticket_&&itemDetail.ticket_.act_state==2 && itemDetail.ticket_.state && itemDetail.ticket_.state_.type==1) || itemDetail.ticket_&&itemDetail.ticket_.act_state==0 || itemDetail.ticket_&&itemDetail.ticket_.act_state==3" v-if="itemDetail.ticket_&& itemDetail.ticket_.state && itemDetail.ticket_.state_.type==1"
type="primary" plain type="primary" plain
@click="itemDetailEdtil">编辑许可证 @click="itemDetailEdtil">前往编辑
</el-button> </el-button>
</div> </div>
</div> </div>
</el-card> </el-card> -->
</el-main> </el-main>
</el-container> </el-container>
<el-dialog v-model="limitedAdd" title="加签"> <el-dialog v-model="limitedAdd" title="加签">
@ -363,6 +374,8 @@
dosOption: [], dosOption: [],
submitLoading: false, submitLoading: false,
userId: this.$TOOL.data.get("USER_INFO").id, userId: this.$TOOL.data.get("USER_INFO").id,
isOwn: false,
isDuty: false
}; };
}, },
created() { created() {
@ -386,10 +399,27 @@
methods: { methods: {
itemDetailEdtil(){ itemDetailEdtil(){
let itemDetail = this.itemDetail; let itemDetail = this.itemDetail;
this.$router.push({ if(this.cateType === 'opl'){
this.$router.push({
name: itemDetail.cate_code, name: itemDetail.cate_code,
query: {oplId:itemDetail.id} query: {oplId:itemDetail.id}
}) })
}else if(this.cateType === 'rpj'){
this.$router.push({
name: "rpjadd",
query: {
rpjid: itemDetail.id, //访id
},
});
}else if(this.cateType === 'visit'){
this.$router.push({
name: "vistoradd",
query: {
visitid: itemDetail.id, //访id
},
});
}
}, },
handleClose(index) { handleClose(index) {
if (index === "1") { if (index === "1") {
@ -400,7 +430,7 @@
this.handleLabel = "关闭原因"; this.handleLabel = "关闭原因";
} }
this.limitedRetreat = true; this.limitedRetreat = true;
this.ticketId = this.itemDetail.id; // this.ticketId = this.itemDetail.id;
}, },
handleCancel() { handleCancel() {
this.limitedRetreat = false; this.limitedRetreat = false;
@ -413,26 +443,21 @@
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(async () => { .then(() => {
if (that.handleTitle === "撤回工单") { if (that.handleTitle === "撤回工单") {
res = that.$API.wf.ticket.ticketRetreat.req( that.$API.wf.ticket.ticketRetreat.req(
that.ticketId, that.ticketId,
that.handleForm that.handleForm
); ).then(res=>{that.limitedRetreat=false;window.location.reload()})
} else { } else {
res = that.$API.wf.ticket.ticketClose.req( that.$API.wf.ticket.ticketClose.req(
that.ticketId, that.ticketId,
that.handleForm that.handleForm
); ).then(res=>{that.limitedRetreat=false;window.location.reload()});
}
if (res.err_msg) {
} else {
that.limitedRetreat = false;
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err); that.limitedRetreat=false
}); });
}, },
// //
@ -464,10 +489,19 @@
this.$API.wf.ticket.ticketItem.req(this.ticketId).then((res) => { this.$API.wf.ticket.ticketItem.req(this.ticketId).then((res) => {
this.mainLoading = false; this.mainLoading = false;
this.ticketDetail = res; this.ticketDetail = res;
if(this.ticketDetail.state_.key == 'opl_close'){ if(this.ticketDetail.state_.key == 'opl_close'){
// , // ,
this.getCloseDos() this.getCloseDos()
} }
//
if(this.ticketDetail.create_by == this.userId){
this.isOwn = true
}
let participant = this.ticketDetail.participant
if(participant==this.userId || participant.indexOf(this.userId)>-1){
this.isDuty = true
}
}).catch(e=>{this.mainLoading = false}); }).catch(e=>{this.mainLoading = false});
}, },
// //