| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <a-modal
- :title="modalTitle"
- :width="600"
- :visible="visible"
- :confirmLoading="confirmLoading"
- @cancel="handleCancel"
- >
- <a-form :form="form">
- <row-list :col="1">
- <row-item>
- <a-form-item
- label="驳回原因"
- :labelCol="BaseTool.Constant.labelCol2"
- :wrapperCol="BaseTool.Constant.wrapperCol2"
- >
- <a-textarea
- :rows="4"
- v-decorator="['repairDispatchRemark', {rules: [{required: true, message: '驳回原因不能为空'}]}]"
- placeholder="请填写驳回原因"/>
- </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 { transferReject } from '@/api/repair/application-form'
- export default {
- name: 'TransferApproveForm',
- data () {
- return {
- confirmLoading: false,
- modalTitle: null,
- form: this.$form.createForm(this),
- visible: false,
- record: {}
- }
- },
- methods: {
- base (record, type) {
- this.visible = true
- this.modalTitle = '转派审批驳回'
- this.record = record
- this.$nextTick(() => {
- this.form.resetFields()
- })
- },
- save () {
- const { form: { validateFieldsAndScroll } } = this
- this.confirmLoading = true
- validateFieldsAndScroll((errors, values) => {
- if (errors) {
- this.confirmLoading = false
- return
- }
- values.id = this.record.id
- transferReject(values)
- .then(() => {
- this.$message.success('已驳回转派申请')
- 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>
|