123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <a-modal
- v-model="opened"
- :title="title"
- centered
- :maskClosable="false"
- :footer="null"
- @cancel="cancel"
- width="550px">
- <a-spin :spinning="spinning" tip="Loading...">
- <a-form-model
- id="chooseCustom-form"
- ref="ruleForm"
- :model="form"
- :label-col="formItemLayout.labelCol"
- :wrapper-col="formItemLayout.wrapperCol">
- <a-form-model-item label="收款单号:" prop="no"> <span>{{ form.no }}</span>
- </a-form-model-item>
- <a-form-model-item label="付款方:" prop="payerName"> <span>{{ form.payerName }}</span>
- </a-form-model-item>
- <a-form-model-item label="备注:" prop="remarks">
- <a-textarea
- v-model="form.remarks"
- placeholder="请输入备注(最多100字符)"
- :auto-size="{ minRows: 3, maxRows: 5 }"
- :maxLength="100"
- />
- </a-form-model-item>
- <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
- <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
- <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定
- </a-button>
- </a-form-model-item>
- </a-form-model>
- </a-spin>
- </a-modal>
- </template>
- <script>
- import {
- updateDetailInvoiceDate
- } from '@/api/financeBook.js'
- export default {
- name: 'NoteModal',
- props: {
- show: [Boolean]
- },
- data () {
- return {
- opened: this.show,
- spinning: false,
- title: '备注',
- confirmLoading: false,
- formItemLayout: {
- labelCol: {
- span: 4
- },
- wrapperCol: {
- span: 17
- }
- },
- form: {
- no: undefined,
- payerName: undefined,
- remarks: '',
- bookDetailSn: ''
- }
- }
- },
- methods: {
- // 保存
- handleSubmit () {
- const _this = this
- const ajax_form = {
- bookDetailSn: this.form.bookDetailSn,
- remarks: this.form.remarks
- }
- _this.spinning = true
- _this.confirmLoading = true
- updateDetailInvoiceDate(ajax_form).then(res => {
- if (res.status == 200) {
- _this.$message.success(res.message)
- _this.cancel(1)
- _this.spinning = false
- } else {
- _this.spinning = false
- }
- _this.confirmLoading = false
- })
- },
- cancel (flag) {
- this.opened = false
- this.$emit('cancel', flag)
- this.$refs.ruleForm.resetFields()
- },
- setData (data) {
- this.form = JSON.parse(data)
- }
- },
- watch: {
- show (newValue, oldValue) {
- this.opened = newValue
- if (!newValue) {
- this.$refs.ruleForm.resetFields()
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .ant-form-item{
- margin-bottom:0 !important;
- }
- </style>
|