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