<template>
|
<a-modal
|
:title='title'
|
:width="650"
|
:visible='visible'
|
:maskClosable='false'
|
cancelText='关闭'
|
@cancel='handleCancel'
|
:confirmLoading='confirmLoading'
|
>
|
<!-- @ok='handleOk' -->
|
<a-spin :spinning='confirmLoading'>
|
<a-form :form="form">
|
<a-row :gutter="24">
|
<a-col :span="24">
|
<a-form-item
|
label="统一编号"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
:disabled="true"
|
:placeholder="disableSubmit?'':'请输入统一编号'"
|
v-decorator="['equipmentNum', validatorRules.equipmentNum ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-item
|
label="设备名称"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
:disabled="true"
|
:placeholder="disableSubmit?'':'请输入设备名称'"
|
v-decorator="['equipmentName', validatorRules.equipmentName ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-item
|
label="型号"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
:disabled="true"
|
:placeholder="disableSubmit?'':'请输入型号'"
|
v-decorator="['equipmentModel', validatorRules.equipmentModel ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-item
|
label="规格"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
:disabled="true"
|
:placeholder="disableSubmit?'':'请输入规格'"
|
v-decorator="['equipmentSpecification', validatorRules.equipmentSpecification ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item
|
label="技术状态"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<!-- prop="technologyStatus" -->
|
<j-dict-select-tag
|
allow-clear
|
placeholder="请选择技术状态"
|
:triggerChange="true"
|
dictCode="technology_status"
|
v-decorator="['judgmentResult', validatorRules.judgmentResult ]"
|
/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span='24'>
|
<a-form-item
|
label="审核意见"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-textarea
|
rows='3'
|
placeholder='请输入审核意见'
|
v-decorator="['remark', validatorRules.remark ]"
|
></a-textarea>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</a-spin>
|
<template slot='footer'>
|
<a-popconfirm
|
@confirm="() => handleReject()"
|
title="确认将当前结果驳回?"
|
>
|
<a-button
|
:loading='confirmLoading'
|
:style="{marginRight: '8px'}"
|
>
|
驳回
|
</a-button>
|
</a-popconfirm>
|
<a-popconfirm
|
@confirm="() => handleOk()"
|
title="确认将当前结果审核通过?"
|
>
|
<a-button
|
type='primary'
|
:loading='confirmLoading'
|
:style="{marginRight: '8px'}"
|
>
|
通过
|
</a-button>
|
</a-popconfirm>
|
</template>
|
</a-modal>
|
|
</template>
|
|
<script>
|
import { httpAction, requestPut, postAction } from '@/api/manage'
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
import pick from 'lodash.pick'
|
|
|
export default {
|
name: 'EquipmentTechnologyStatusModal',
|
components: {
|
Tooltip
|
},
|
data() {
|
return {
|
title: '操作',
|
visible: false,
|
disableSubmit: false,
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 }
|
},
|
confirmLoading: false,
|
form: this.$form.createForm(this),
|
validatorRules: {
|
remark: {
|
rules: [
|
{ required: true, message: '请输入审核意见!' },
|
]
|
},
|
judgmentResult: {
|
rules: [
|
{ required: false, message: '请选择技术状态!' },
|
]
|
},
|
},
|
url: {
|
auditApproval: "/eam/calibrationOrderReport/editEquipmentTechnologyStatus",
|
},
|
}
|
},
|
|
|
methods: {
|
close() {
|
this.$emit('close')
|
this.visible = false
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
edit(record) {
|
this.form.resetFields();
|
this.model = Object.assign({}, record);
|
this.visible = true;
|
this.disableSubmit = false;
|
this.$nextTick(() => {
|
this.form.setFieldsValue(pick(this.model, 'equipmentNum', 'equipmentName', 'equipmentModel', 'equipmentSpecification', 'judgmentResult', 'remark'))
|
});
|
if (record.id) {
|
this.codeDisable = true;
|
} else {
|
this.codeDisable = false;
|
}
|
},
|
|
|
|
handleReject() {
|
const that = this;
|
this.form.validateFields((err, values) => {
|
if (!err) {
|
that.confirmLoading = true;
|
let formData = Object.assign(this.model, values);
|
formData.status = '3'
|
requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message);
|
that.$emit('ok');
|
} else {
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
that.close();
|
})
|
}
|
})
|
},
|
|
|
handleOk() {
|
const that = this;
|
that.form.validateFields((err, values) => {
|
if (!err) {
|
this.confirmLoading = true;
|
let formData = Object.assign(this.model, values);
|
formData.status = '4'
|
requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message);
|
that.$emit('ok');
|
} else {
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
that.close();
|
})
|
}
|
})
|
},
|
}
|
|
}
|
</script>
|
|
<style lang='less' scoped>
|
/deep/ .frozenRowClass {
|
color: #c9c9c9;
|
}
|
|
.fontweight {
|
font-weight: bold;
|
}
|
|
.ant-btn {
|
padding: 0 10px;
|
margin-left: 3px;
|
}
|
|
.ant-form-item-control {
|
line-height: 0px;
|
}
|
|
/** 主表单行间距 */
|
.ant-form .ant-form-item {
|
margin-bottom: 10px;
|
}
|
|
/** Tab页面行间距 */
|
.ant-tabs-content .ant-form-item {
|
margin-bottom: 0px;
|
}
|
|
/deep/ .ant-modal-title {
|
text-align: center;
|
}
|
</style>
|