|
@@ -0,0 +1,161 @@
|
|
|
+<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-input v-decorator="['category']" type="hidden"/>
|
|
|
+
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <row-list :col="1">
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="审核"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-select v-model="check" style="width: 120px" >
|
|
|
+ <a-select-option :value="1">
|
|
|
+ 通过
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option :value="0">
|
|
|
+ 拒绝
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ </row-list>
|
|
|
+ <row-list :col="1">
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="备注"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-textarea
|
|
|
+ :rows="4"
|
|
|
+ v-decorator="['remark']"/>
|
|
|
+ </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 {
|
|
|
+ approve,
|
|
|
+ returnRepair,
|
|
|
+ verifyPassRepair,
|
|
|
+ verifyRefusedRepair,
|
|
|
+ verifyProduceRefusedRepair,
|
|
|
+ verifyProduceRepair
|
|
|
+} from '@/api/repair/application-form'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'BaseRepairApplicationForm',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ confirmLoading: false,
|
|
|
+ modalTitle: '审核',
|
|
|
+ form: this.$form.createForm(this),
|
|
|
+ visible: false,
|
|
|
+ check: 1,
|
|
|
+ type: null,
|
|
|
+ // 下拉框map
|
|
|
+ model: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ // 下拉框map
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ base (record, type) {
|
|
|
+ this.visible = true
|
|
|
+ this.model = record
|
|
|
+ this.type = type
|
|
|
+ const { form: { setFieldsValue } } = this
|
|
|
+ // 日期处理
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setFieldsValue(Object.assign(pick(record, [
|
|
|
+ 'id',
|
|
|
+ 'category'
|
|
|
+ ])))
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ save () {
|
|
|
+ const { form: { validateFieldsAndScroll } } = this
|
|
|
+ this.confirmLoading = true
|
|
|
+ validateFieldsAndScroll((errors, values) => {
|
|
|
+ if (errors) {
|
|
|
+ this.confirmLoading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ switch (true) {
|
|
|
+ case this.type === 15 && this.check === 1:
|
|
|
+ approve(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case this.type === 15 && this.check === 0:
|
|
|
+ returnRepair(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case this.type === 17 && this.check === 1:
|
|
|
+ verifyPassRepair(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case this.type === 17 && this.check === 0:
|
|
|
+ verifyRefusedRepair(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case this.type === 19 && this.check === 1:
|
|
|
+ verifyProduceRepair(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case this.type === 19 && this.check === 0:
|
|
|
+ verifyProduceRefusedRepair(values).then(res => {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.handleCancel()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCancel () {
|
|
|
+ this.visible = false
|
|
|
+ this.check = 1
|
|
|
+ this.type = null
|
|
|
+ this.confirmLoading = false
|
|
|
+ this.form.resetFields()
|
|
|
+ this.$emit('ok')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|