|
@@ -0,0 +1,132 @@
|
|
|
+<template>
|
|
|
+ <a-modal
|
|
|
+ :title="modalTitle"
|
|
|
+ :width="800"
|
|
|
+ :visible="visible"
|
|
|
+ :confirmLoading="confirmLoading"
|
|
|
+ class="ant-modal2"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ >
|
|
|
+ <a-form :form="form">
|
|
|
+
|
|
|
+ <a-form-item v-show="false" >
|
|
|
+ <a-input v-decorator="['id']" type="hidden"/>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <row-list :col="1">
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="备注"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-radio-group v-model="value" @change="onChange">
|
|
|
+ <a-radio-button :value="1">
|
|
|
+ 通过
|
|
|
+ </a-radio-button>
|
|
|
+ <a-radio-button :value="0">
|
|
|
+ 拒绝
|
|
|
+ </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="备注"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-textarea
|
|
|
+ :rows="4"
|
|
|
+ v-decorator="['checkContent']"/>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ </row-list>
|
|
|
+ </a-form>
|
|
|
+ <template slot="footer">
|
|
|
+ <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
|
+ </template>
|
|
|
+ </a-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import pick from 'lodash.pick'
|
|
|
+import { examineOk } from '@/api/repair/application-form'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'BaseRepairApplicationForm',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ confirmLoading: false,
|
|
|
+ modalTitle: null,
|
|
|
+ form: this.$form.createForm(this),
|
|
|
+ visible: false,
|
|
|
+ // 下拉框map
|
|
|
+ sourceMap: {},
|
|
|
+ levelMap: {},
|
|
|
+ needStopMap: {},
|
|
|
+ descripitionMap: {},
|
|
|
+ statusMap: {},
|
|
|
+ model: null,
|
|
|
+ userList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ // 下拉框map
|
|
|
+ this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
|
|
|
+ this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
|
|
|
+ this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
|
|
|
+ this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ base (record) {
|
|
|
+ this.visible = true
|
|
|
+ this.model = record
|
|
|
+ // 如果是空标识添加
|
|
|
+ if (this.BaseTool.Object.isBlank(record)) {
|
|
|
+ this.modalTitle = '添加'
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.modalTitle = '驳回'
|
|
|
+ const { form: { setFieldsValue } } = this
|
|
|
+ // 日期处理
|
|
|
+ record.applyTime = this.BaseTool.Moment(record.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setFieldsValue(Object.assign(pick(record, [
|
|
|
+ 'id'
|
|
|
+ ])))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ save () {
|
|
|
+ const { form: { validateFieldsAndScroll } } = this
|
|
|
+ this.confirmLoading = true
|
|
|
+ validateFieldsAndScroll((errors, values) => {
|
|
|
+ if (errors) {
|
|
|
+ this.confirmLoading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 日期处理
|
|
|
+ examineOk(0, values)
|
|
|
+ .then(() => {
|
|
|
+ this.handleCancel(values)
|
|
|
+ }).catch(() => {
|
|
|
+ this.confirmLoading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCancel (values) {
|
|
|
+ this.visible = false
|
|
|
+ this.confirmLoading = false
|
|
|
+ this.form.resetFields()
|
|
|
+ if (this.BaseTool.Object.isNotBlank(values)) {
|
|
|
+ this.$emit('ok')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|