231 lines
7.3 KiB
Vue
231 lines
7.3 KiB
Vue
<template>
|
|
<div >
|
|
<el-form ref="form" :model="form" size="mini" :rules="rules" label-width="80px">
|
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="开票企业代码标识" prop="comCode">
|
|
<el-input v-model="form.comCode" placeholder="请输入开票企业代码标识" />
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="24">
|
|
<el-form-item label="开票抬头" prop="companyName">
|
|
<el-input v-model="form.companyName" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="税号" prop="companyTaxNo">
|
|
<el-input v-model="form.companyTaxNo" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="启用状态" prop="invoiceType">
|
|
<el-radio-group v-model="form.enableStatus">
|
|
<el-radio label="1" >启用</el-radio>
|
|
<el-radio label="0">停用</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="发票电话" prop="companyTel">
|
|
<el-input v-model="form.companyTel" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="发票地址" prop="companyAddress">
|
|
<el-input v-model="form.companyAddress" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="开户行" prop="bankName">
|
|
<el-input v-model="form.bankName" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="开户账号" prop="bankAccNo">
|
|
<el-input v-model="form.bankAccNo" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
<el-col :span="24">
|
|
<el-form-item label="联系人" prop="contact">
|
|
<el-input v-model="form.contact" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="联系电话" prop="phone">
|
|
<el-input v-model="form.phone" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="客户编码" prop="customerCode">
|
|
<el-input v-model="form.customerCode" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="客户名称" prop="customerName">
|
|
<el-input v-model="form.customerName" placeholder="" />
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<!-- <el-col :span="24">
|
|
<el-form-item :label="$t('客户名称')" prop="customerCode" >
|
|
<CustomerSimplePicker v-model="form.customerCode" @onChange="onCustomerSelect" ></CustomerSimplePicker>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="24">
|
|
<el-form-item label="邮寄地址" prop="recieveAddress">
|
|
<el-input v-model="form.recieveAddress" type="textarea" placeholder="请输入纸质发票邮寄地址" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="邮箱" prop="email">
|
|
<el-input v-model="form.email" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input v-model="form.remark" type="textarea" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
</el-form>
|
|
<div style="text-align: center;margin-bottom: 10px;">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisCustomerInvoiceInfo, getEmisCustomerInvoiceInfo, delEmisCustomerInvoiceInfo, addEmisCustomerInvoiceInfo, updateEmisCustomerInvoiceInfo } from "@/api/emis/emisCustomerInvoiceInfo";
|
|
import CustomerSimplePicker from '@/views/emis/EmisBaseTools/CustomerSimplePicker.vue';
|
|
|
|
export default {
|
|
name: "emisCustomerInvoiceInfoForm",
|
|
props:{
|
|
id:{
|
|
type:[Number,Array]
|
|
}
|
|
},
|
|
components: { CustomerSimplePicker },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
emisCustomerInvoiceInfoOptions: [],
|
|
// 遮罩层
|
|
loading: true,
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
companyName: [
|
|
{ required: true, message: "开票名称不能为空", trigger: "blur" }
|
|
],
|
|
companyTaxNo: [
|
|
{ required: true, message: "开票税号不能为空", trigger: "blur" }
|
|
],
|
|
// companyTel: [
|
|
// { required: true, message: "开票电话不能为空", trigger: "blur" }
|
|
// ],
|
|
// companyAddress: [
|
|
// { required: true, message: "开票地址不能为空", trigger: "blur" }
|
|
// ],
|
|
// bankName: [
|
|
// { required: true, message: "开户行不能为空", trigger: "blur" }
|
|
// ],
|
|
// bankAccNo: [
|
|
// { required: true, message: "开户账号不能为空", trigger: "blur" }
|
|
// ],
|
|
}
|
|
};
|
|
},
|
|
watch: {
|
|
"id": {
|
|
handler (newValue, oldValue) {
|
|
this.id = newValue;
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
|
|
methods: {
|
|
initData() {
|
|
|
|
if(this.id !=null) {
|
|
this.loading = true;
|
|
getEmisCustomerInvoiceInfo(this.id).then(response => {
|
|
this.form = response.data;
|
|
this.loading = false;
|
|
});
|
|
}else{
|
|
this.reset();
|
|
}
|
|
},
|
|
onCustomerSelect(item){
|
|
if(item){
|
|
this.form.customerName=item.customerName;
|
|
}
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
this.$emit("on-cancel");
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
companyName: null,
|
|
companyTaxNo: null,
|
|
companyTel: null,
|
|
companyAddress: null,
|
|
bankName: null,
|
|
bankAccNo: null,
|
|
invoiceType: null,
|
|
customerCode: null,
|
|
customerName: null,
|
|
contact: null,
|
|
phone: null,
|
|
recieveAddress: null,
|
|
email: null,
|
|
remark: null,
|
|
delFlag: null,
|
|
createBy: null,
|
|
createTime: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
createSite: null,
|
|
updateSite: null,
|
|
enableStatus: '1',
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
updateEmisCustomerInvoiceInfo(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
} else {
|
|
addEmisCustomerInvoiceInfo(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|