工单管理新增图片展示、预计完成时间
This commit is contained in:
@ -12,7 +12,7 @@ const ems = {
|
|||||||
alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态
|
alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态
|
||||||
deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型
|
deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型
|
||||||
ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'},//工单处理状态
|
ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'},//工单处理状态
|
||||||
strategyStatusOptions:{'0':'未启用', 1:'已运行', 2:'已暂停', 3:'禁用', 4:'删除'},//策略状态
|
strategyStatusOptions:{'0':'未启用', '1':'已运行', '2':'已暂停', '3':'禁用', '4':'删除'},//策略状态
|
||||||
chargeStatusOptions:{'1':'充电','2':'待机'},//冲放状态
|
chargeStatusOptions:{'1':'充电','2':'待机'},//冲放状态
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单` " :close-on-click-modal="false" :show-close="false">
|
<el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单` " :close-on-click-modal="false" :show-close="false">
|
||||||
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="120px">
|
||||||
<el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'">
|
<el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'">
|
||||||
<el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}">
|
<el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -28,11 +28,26 @@
|
|||||||
<el-option :label="item.userName" :value="item.userId" v-for="(item,index) in userList" :key="index+'updateUserList'"></el-option>
|
<el-option :label="item.userName" :value="item.userId" v-for="(item,index) in userList" :key="index+'updateUserList'"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="预计完成时间" prop="expectedCompleteTime" >
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedCompleteTime"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择"
|
||||||
|
:style="{width: '100%'}"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="提交时间" prop="createTime" v-if="mode !== 'add'">
|
<el-form-item label="提交时间" prop="createTime" v-if="mode !== 'add'">
|
||||||
<el-input v-model="formData.createTime" disabled :style="{width: '100%'}">
|
<el-input v-model="formData.createTime" disabled :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="图片" v-if="mode !== 'add' && formData.images && formData.images.length>0">
|
||||||
|
<img v-for="item in formData.images" :key="item+'imgs'" :src="item" alt="" srcset="" class="ticket-imgs">
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
<el-button type="primary" @click="saveDialog">确定</el-button>
|
||||||
@ -79,6 +94,8 @@ export default {
|
|||||||
updateBy: '',//处理人
|
updateBy: '',//处理人
|
||||||
workUserId:'',//处理人id
|
workUserId:'',//处理人id
|
||||||
createTime: '',//提交时间
|
createTime: '',//提交时间
|
||||||
|
expectedCompleteTime:'',//预计完成时间
|
||||||
|
images:[],//图片列表
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
title:[
|
title:[
|
||||||
@ -95,7 +112,10 @@ export default {
|
|||||||
],
|
],
|
||||||
workUserId:[
|
workUserId:[
|
||||||
{ required: true, message: '请选择处理人', trigger: ['blur', 'change'] }
|
{ required: true, message: '请选择处理人', trigger: ['blur', 'change'] }
|
||||||
]
|
],
|
||||||
|
expectedCompleteTime:[
|
||||||
|
{ required: true, message: '请选择预计完成时间', trigger: ['blur', 'change'] }
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -118,6 +138,8 @@ export default {
|
|||||||
this.loading+=1
|
this.loading+=1
|
||||||
getTicket(newVal).then(response => {
|
getTicket(newVal).then(response => {
|
||||||
this.formData = JSON.parse(JSON.stringify(response?.data || {}));
|
this.formData = JSON.parse(JSON.stringify(response?.data || {}));
|
||||||
|
const {images=''} = this.formData
|
||||||
|
this.formData.images = JSON.parse(images)
|
||||||
}).finally(() => {this.loading-=1})
|
}).finally(() => {this.loading-=1})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -137,9 +159,9 @@ export default {
|
|||||||
this.$refs.addTempForm.validate(valid => {
|
this.$refs.addTempForm.validate(valid => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
this.loading+=1
|
this.loading+=1
|
||||||
const {title='',content='',status='',userId='',workUserId='',id=''} = this.formData;
|
const {title='',content='',status='',userId='',workUserId='',id='',expectedCompleteTime=''} = this.formData;
|
||||||
if(this.mode === 'add'){
|
if(this.mode === 'add'){
|
||||||
addTicket({title,content,status,userId,workUserId}).then(response => {
|
addTicket({title,content,status,userId,workUserId,expectedCompleteTime}).then(response => {
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
//新增成功
|
//新增成功
|
||||||
// 关闭弹窗 更新表格
|
// 关闭弹窗 更新表格
|
||||||
@ -150,7 +172,7 @@ export default {
|
|||||||
this.loading-=1
|
this.loading-=1
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
updateTicket({title,content,status,userId,workUserId,id}).then(response => {
|
updateTicket({title,content,status,userId,workUserId,id,expectedCompleteTime}).then(response => {
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
//新增成功
|
//新增成功
|
||||||
// 关闭弹窗 更新表格
|
// 关闭弹窗 更新表格
|
||||||
@ -178,6 +200,8 @@ export default {
|
|||||||
workUserId:'',//处理人id
|
workUserId:'',//处理人id
|
||||||
completeTime: '',//提交时间
|
completeTime: '',//提交时间
|
||||||
ticketNo:'',//工单号
|
ticketNo:'',//工单号
|
||||||
|
expectedCompleteTime:'',
|
||||||
|
images: []
|
||||||
}
|
}
|
||||||
this.dialogTableVisible=false
|
this.dialogTableVisible=false
|
||||||
}
|
}
|
||||||
@ -186,9 +210,8 @@ export default {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.ems-dialog{
|
.ticket-imgs{
|
||||||
.el-dialog{
|
width:150px;
|
||||||
max-width: 700px;
|
height: 100px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user