|
|
@@ -0,0 +1,181 @@
|
|
|
+<template>
|
|
|
+ <a-modal
|
|
|
+ :title="title"
|
|
|
+ :width="width"
|
|
|
+ :visible="visible"
|
|
|
+ :bodyStyle="bodyStyle"
|
|
|
+ :confirmLoading="confirmLoading"
|
|
|
+ @ok="handleOk"
|
|
|
+ :maskClosable="false"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ cancelText="关闭">
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
+ <a-form :form="form">
|
|
|
+
|
|
|
+
|
|
|
+ <a-form-item label="发票抬头" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'invoiceTitle', validatorRules.invoiceTitle]" placeholder="请输入发票抬头"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item label="纳税人识别号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'dutyParagraph', validatorRules.dutyParagraph]" placeholder="请输入纳税人识别号"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item label="开户银行" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'accountBank', validatorRules.accountBank]" placeholder="请输入身份证号"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <a-form-item label="开户账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'account', validatorRules.account]" placeholder="请输入开户账户" ></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'registerAddress', validatorRules.registerAddress]" placeholder="请输入地址"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-decorator="[ 'registerPhone', validatorRules.registerPhone]" placeholder="请输入电话"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ </a-form>
|
|
|
+ </a-spin>
|
|
|
+
|
|
|
+ </a-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+ import { httpAction } from '@/api/manage'
|
|
|
+ import pick from 'lodash.pick'
|
|
|
+ import JDate from '@/components/jeecg/JDate'
|
|
|
+ import Vue from 'vue'
|
|
|
+ import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "HlwComapnyInvoiceInfoModal",
|
|
|
+ components: {
|
|
|
+ JDate,
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ form: this.$form.createForm(this),
|
|
|
+ title:"操作",
|
|
|
+ width:800,
|
|
|
+ bodyStyle: {
|
|
|
+ paddingTop: '20px',
|
|
|
+ paddingBottom:'20px',
|
|
|
+ maxHeight: (window.innerHeight * 0.62) + 'px',
|
|
|
+ 'overflow-y': 'auto'
|
|
|
+ },
|
|
|
+ visible: false,
|
|
|
+ model: {},
|
|
|
+ labelCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 5 },
|
|
|
+ },
|
|
|
+ wrapperCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 16 },
|
|
|
+ },
|
|
|
+ headers: {},
|
|
|
+ uploadLoading: false,
|
|
|
+ confirmLoading: false,
|
|
|
+ validatorRules:{
|
|
|
+ invoiceTitle:{rules: [{ required: true, message: '请输入发票抬头!' }]},
|
|
|
+ dutyParagraph:{rules: [{ required: true, message: '请输入纳税人识别号!' }]},
|
|
|
+ accountBank:{},
|
|
|
+ account:{},
|
|
|
+ registerAddress:{},
|
|
|
+ registerPhone:{},
|
|
|
+ },
|
|
|
+ url: {
|
|
|
+ add: "/wisdom/hwPlatformCompany/companyInvoiceInfoAdd",
|
|
|
+ edit: "/wisdom/hwPlatformCompany/companyInvoiceInfoEdit",
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ add () {
|
|
|
+ this.edit({});
|
|
|
+ },
|
|
|
+ edit (record) {
|
|
|
+ this.form.resetFields();
|
|
|
+ this.model = Object.assign({}, record);
|
|
|
+ this.visible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form.setFieldsValue(pick(this.model,'invoiceTitle','dutyParagraph','accountBank','account','registerAddress','registerPhone'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close () {
|
|
|
+ this.$emit('close');
|
|
|
+ this.visible = false;
|
|
|
+ },
|
|
|
+ handleOk () {
|
|
|
+ const that = this;
|
|
|
+ // 触发表单验证
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
+ if (!err) {
|
|
|
+ that.confirmLoading = true;
|
|
|
+ let httpurl = '';
|
|
|
+ let method = '';
|
|
|
+ if(!this.model.id){
|
|
|
+ httpurl+=this.url.add;
|
|
|
+ method = 'post';
|
|
|
+ }else{
|
|
|
+ httpurl+=this.url.edit;
|
|
|
+ method = 'put';
|
|
|
+ }
|
|
|
+ let formData = Object.assign(this.model, values);
|
|
|
+ console.log("表单提交数据",formData)
|
|
|
+ httpAction(httpurl,formData,method).then((res)=>{
|
|
|
+ if(res.success){
|
|
|
+ that.$message.success(res.message);
|
|
|
+ that.$emit('ok');
|
|
|
+ }else{
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ that.confirmLoading = false;
|
|
|
+ that.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCancel () {
|
|
|
+ this.close()
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .avatar-uploader > .ant-upload {
|
|
|
+ width: 104px;
|
|
|
+ height: 104px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-upload-select-picture-card i {
|
|
|
+ font-size: 49px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-upload-select-picture-card .ant-upload-text {
|
|
|
+ margin-top: 8px;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+</style>
|