<template>
|
<j-modal :visible="visible" title="指派报修" :width="500" @ok="handleSubmit" @cancel="handleCancel"
|
:confirmLoading="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
<a-form-model ref="form" :model="model" :rules="validateRules" :labelCol="{span:4}" :wrapperCol="{span:18}">
|
<a-form-model-item label="维修工" prop="repairer">
|
<j-search-select-tag v-model="model.repairer" placeholder="请选择维修工"
|
dict="sys_user,realname, username, del_flag=0 and post='PCR0002' and status=1"/>
|
</a-form-model-item>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
import { postAction } from '@/api/manage'
|
|
export default {
|
name: 'AssignRepairReportModal',
|
data() {
|
return {
|
visible: false,
|
confirmLoading: false,
|
model: {},
|
validateRules: {
|
repairer: [
|
{ required: true, message: '请选择维修工' }
|
]
|
},
|
url: {
|
assign: '/eam/eamRepairOrder/assign'
|
}
|
}
|
},
|
methods: {
|
handleSubmit() {
|
const that = this
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = true
|
postAction(that.url.assign, that.model)
|
.then(res => {
|
if (res.success) {
|
that.$message.success(res.message)
|
that.handleCancel()
|
that.$emit('ok')
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
|
handleCancel() {
|
this.visible = false
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.container {
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
align-content: center;
|
}
|
</style>
|