[update] 财务管理模块前端页面,到账开票新增阶段接口对接
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="开票金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入开票金额"
|
||||
v-decorator="['invoicingAmount',validatorRules.invoicingAmount]"
|
||||
:maxLength='50'
|
||||
@change="e => e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim()"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="开票号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入开票号"
|
||||
v-decorator="['invoicingNum',validatorRules.invoicingNum]"
|
||||
:maxLength='50'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="开票日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择开票日期"
|
||||
style="width: 100%;"
|
||||
v-decorator="['invoicingDate',validatorRules.invoicingDate]"
|
||||
:trigger-change="true"
|
||||
date-format="YYYY-MM-DD"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-textarea
|
||||
placeholder="请输入备注"
|
||||
v-decorator="['remarks']"
|
||||
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||
:maxLength='200'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JDate from '../../../../components/tools/JDate'
|
||||
import pick from 'lodash.pick'
|
||||
import { money } from '../../../../utils/validate'
|
||||
|
||||
export default {
|
||||
name: 'InvoicingModule',
|
||||
components: { JDate },
|
||||
data() {
|
||||
return {
|
||||
title: '来款信息',
|
||||
width: 600,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 18 }
|
||||
},
|
||||
validatorRules: {
|
||||
invoicingAmount: {
|
||||
rules: [{ required: true, validator: this.checkMoney }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
invoicingNum: {
|
||||
rules: [{ required: true, message: '请输入开票号' }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
invoicingDate: {
|
||||
rules: [{ required: true, message: '请选择开票日期' }],
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
edit(record) {
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'invoicingAmount', 'invoicingNum', 'invoicingDate', 'remarks'))
|
||||
})
|
||||
},
|
||||
handleOk() {
|
||||
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
},
|
||||
/**
|
||||
* 校验金额格式
|
||||
* @param rules
|
||||
* @param value
|
||||
* @param callback
|
||||
*/
|
||||
checkMoney(rules, value, callback) {
|
||||
if (value) {
|
||||
if (money(value)) {
|
||||
callback()
|
||||
return
|
||||
}
|
||||
callback('请输入正确格式的金额')
|
||||
}
|
||||
callback('请输入到账金额')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user