<template>
|
<div>
|
<el-dialog :before-close="cancelAuditing" title="工单审核" :visible.sync="auditingOpen" width="1000px" append-to-body>
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<el-form ref="auditingForm" :model="auditingForm" :rules="auditingRules" label-width="80px">
|
<el-form-item label="工单号" prop="workOrderNo">
|
<el-input v-model="auditingForm.workOrderNo" disabled/>
|
</el-form-item>
|
<el-form-item label="故障点位" prop="source">
|
<el-input v-model="auditingForm.source" disabled/>
|
</el-form-item>
|
<el-form-item label="运维单位" prop="unitName">
|
<el-input v-model="auditingForm.unitName" disabled/>
|
</el-form-item>
|
<el-form-item label="审核结果" prop="auditingResult">
|
<el-radio-group v-model="auditingForm.auditingResult">
|
<el-radio label="AUDITING_SUCCESS">通过</el-radio>
|
<el-radio label="AUDITING_FAIL">驳回</el-radio>
|
</el-radio-group>
|
|
</el-form-item>
|
<el-form-item label="审核备注" prop="auditingRemark">
|
<el-input v-model="auditingForm.auditingRemark" type="textarea" maxlength="30" show-word-limit/>
|
</el-form-item>
|
</el-form>
|
</el-col>
|
<el-col :span="14" style="max-height: 500px; overflow-y: auto">
|
<el-timeline v-if="ywConditions && ywConditions.length > 0">
|
<el-timeline-item v-for="(condition, index) in ywConditions" :key="index"
|
:timestamp="condition.unitName + '___' + condition.createTime" placement="top"
|
>
|
<el-card>
|
<div v-html="condition.ywCondition"></div>
|
<el-link type="primary"
|
v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials"
|
:underline="false" :key="item.id" @click="handleDownload(item)"
|
>{{ item.substring(item.lastIndexOf('/') + 1) }}
|
</el-link>
|
</el-card>
|
</el-timeline-item>
|
</el-timeline>
|
<el-empty v-else description="没有处理记录"></el-empty>
|
</el-col>
|
</el-row>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="cancelAuditing">取 消</el-button>
|
<el-button type="primary" @click="submitAuditing">审 核</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { auditing } from '@/api/platform/work-order'
|
export default {
|
name: "WorkOrderAuditing",
|
props: {
|
auditingOpen: {
|
type: Boolean,
|
required: true,
|
default: false
|
},
|
dataForm: {
|
type: Object,
|
required: true,
|
},
|
ywConditions: {
|
type: Array,
|
required: true,
|
},
|
},
|
data() {
|
return {
|
auditingForm: {},
|
auditingRules: {
|
auditingResult: [
|
{ required: true, message: '审核结果不能为空', trigger: 'blur' }
|
]
|
},
|
}
|
},
|
methods: {
|
/** 下载按钮操作 */
|
handleDownload(data) {
|
this.$download.resource(data)
|
},
|
// 提交审核
|
submitAuditing() {
|
this.$refs['auditingForm'].validate(valid => {
|
if (valid) {
|
auditing(this.auditingForm).then(res => {
|
this.$emit('close', false);
|
this.$modal.msgSuccess('操作成功')
|
this.$emit('getList', false);
|
})
|
}
|
})
|
},
|
// 取消审核
|
cancelAuditing() {
|
this.auditingForm = {}
|
this.$emit('close');
|
},
|
},
|
watch: {
|
dataForm: {
|
handler(n, o) {
|
this.auditingForm = n
|
},
|
deep: true
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|