|
|
@ -3,37 +3,42 @@ |
|
|
|
:title="!dataForm.ticketsId ? '新增' : '修改'" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:visible.sync="visible"> |
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> |
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px"> |
|
|
|
<el-form-item label="小车类型" prop="carType"> |
|
|
|
<el-input v-model="dataForm.carType" placeholder="小车类型"></el-input> |
|
|
|
<el-select v-model="dataForm.carType" placeholder="小车类型"> |
|
|
|
<el-option |
|
|
|
v-for="item in carTypeOpt" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="异常类型" prop="errorType"> |
|
|
|
<el-input v-model="dataForm.errorType" placeholder="异常类型"></el-input> |
|
|
|
<el-select v-model="dataForm.carType" placeholder="小车类型"> |
|
|
|
<el-option |
|
|
|
v-for="item in errorTypeOpt" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="合同编号" prop="contractNumber"> |
|
|
|
<el-input v-model="dataForm.contractNumber" placeholder="合同编号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="客户id" prop="clientId"> |
|
|
|
<el-form-item label="客户" prop="clientId"> |
|
|
|
<el-input v-model="dataForm.clientId" placeholder="客户id"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="故障描述" prop="description"> |
|
|
|
<el-input v-model="dataForm.description" placeholder="故障描述"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="部门对接人" prop="deptPeople"> |
|
|
|
<el-input v-model="dataForm.deptPeople" placeholder="部门对接人"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="客户联系电话" prop="deptPhone"> |
|
|
|
<el-input v-model="dataForm.deptPhone" placeholder="客户联系电话"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否验收" prop="isCheck"> |
|
|
|
<el-form-item v-show="dataForm.ticketsId" label="是否验收" prop="isCheck"> |
|
|
|
<el-input v-model="dataForm.isCheck" placeholder="是否验收"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="工单状态" prop="status"> |
|
|
|
<el-input v-model="dataForm.status" placeholder="工单状态"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="工单关闭时间" prop="updateTime"> |
|
|
|
<el-input v-model="dataForm.updateTime" placeholder="工单关闭时间"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="visible = false">取消</el-button> |
|
|
@ -47,6 +52,8 @@ |
|
|
|
data () { |
|
|
|
return { |
|
|
|
visible: false, |
|
|
|
carTypeOpt: [], |
|
|
|
errorTypeOpt: [], |
|
|
|
dataForm: { |
|
|
|
ticketsId: null, |
|
|
|
carType: '', |
|
|
@ -54,11 +61,8 @@ |
|
|
|
contractNumber: '', |
|
|
|
clientId: '', |
|
|
|
description: '', |
|
|
|
deptPeople: '', |
|
|
|
deptPhone: '', |
|
|
|
isCheck: '', |
|
|
|
status: '', |
|
|
|
updateTime: '' |
|
|
|
isCheck: '' |
|
|
|
}, |
|
|
|
dataRule: { |
|
|
|
carType: [ |
|
|
@ -67,29 +71,11 @@ |
|
|
|
errorType: [ |
|
|
|
{ required: true, message: '异常类型不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
contractNumber: [ |
|
|
|
{ required: true, message: '合同编号不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
clientId: [ |
|
|
|
{ required: true, message: '客户id不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
description: [ |
|
|
|
{ required: true, message: '故障描述不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
deptPeople: [ |
|
|
|
{ required: true, message: '部门对接人不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
deptPhone: [ |
|
|
|
{ required: true, message: '客户联系电话不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
isCheck: [ |
|
|
|
{ required: true, message: '是否验收不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
status: [ |
|
|
|
{ required: true, message: '工单状态不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
updateTime: [ |
|
|
|
{ required: true, message: '工单关闭时间不能为空', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
@ -100,10 +86,16 @@ |
|
|
|
methods: { |
|
|
|
getDictDetail () { |
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl('/api/dict/dictDetail?code=DEMAND_TYPE'), |
|
|
|
url: this.$http.adornUrl('/api/dict/dictDetail?code=car_type&page=0&size=9999'), |
|
|
|
method: 'get' |
|
|
|
}).then(({data}) => { |
|
|
|
console.log(data) |
|
|
|
this.carTypeOpt = [...data.content] |
|
|
|
}) |
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl('/api/dict/dictDetail?code=error_type&page=0&size=9999'), |
|
|
|
method: 'get' |
|
|
|
}).then(({data}) => { |
|
|
|
this.errorTypeOpt = [...data.content] |
|
|
|
}) |
|
|
|
}, |
|
|
|
init (id) { |
|
|
@ -123,11 +115,8 @@ |
|
|
|
this.dataForm.contractNumber = data.tickets.contractNumber |
|
|
|
this.dataForm.clientId = data.tickets.clientId |
|
|
|
this.dataForm.description = data.tickets.description |
|
|
|
this.dataForm.deptPeople = data.tickets.deptPeople |
|
|
|
this.dataForm.deptPhone = data.tickets.deptPhone |
|
|
|
this.dataForm.isCheck = data.tickets.isCheck |
|
|
|
this.dataForm.status = data.tickets.status |
|
|
|
this.dataForm.updateTime = data.tickets.updateTime |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -140,19 +129,7 @@ |
|
|
|
this.$http({ |
|
|
|
url: this.$http.adornUrl(`/tickets/tickets/${!this.dataForm.ticketsId ? 'save' : 'update'}`), |
|
|
|
method: 'post', |
|
|
|
data: this.$http.adornData({ |
|
|
|
'ticketsId': this.dataForm.ticketsId || undefined, |
|
|
|
'carType': this.dataForm.carType, |
|
|
|
'errorType': this.dataForm.errorType, |
|
|
|
'contractNumber': this.dataForm.contractNumber, |
|
|
|
'clientId': this.dataForm.clientId, |
|
|
|
'description': this.dataForm.description, |
|
|
|
'deptPeople': this.dataForm.deptPeople, |
|
|
|
'deptPhone': this.dataForm.deptPhone, |
|
|
|
'isCheck': this.dataForm.isCheck, |
|
|
|
'status': this.dataForm.status, |
|
|
|
'updateTime': this.dataForm.updateTime |
|
|
|
}) |
|
|
|
data: this.$http.adornData(this.dataForm) |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message({ |
|
|
|