You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2 lines
4.7 KiB

"use strict";(self["webpackChunkshiweisuzhou"]=self["webpackChunkshiweisuzhou"]||[]).push([[179],{179:function(e,t,i){i.r(t),i.d(t,{default:function(){return c}});var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"bg"},[t("el-card",{staticStyle:{width:"100%"}},[t("div",{staticClass:"clearfix flex-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("我的发票")]),t("div",{staticClass:"flex-between"},[t("span",{staticStyle:{color:"#666","font-size":"12px"}},[e._v("您已保存了"+e._s(e.invoiceList.length)+"个发票抬头信息,做多可创建5个。")]),t("el-button",{staticStyle:{float:"right"},attrs:{size:"small",type:"primary"},on:{click:function(t){return e.openDialog("add",{})}}},[e._v("新增")])],1)]),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.invoiceList,border:""}},[t("el-table-column",{attrs:{prop:"invoice_head",label:"发票抬头",width:"120"}}),t("el-table-column",{attrs:{prop:"tax_number",label:"纳税人识别号",width:"200"}}),t("el-table-column",{attrs:{prop:"opening_bank",label:"开户银行","min-width":"180"}}),t("el-table-column",{attrs:{prop:"bank_account",label:"银行账号","min-width":"180"}}),t("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(i){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.openDialog("edit",i.row)}}},[e._v("编辑")]),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDelete(i.row)}}},[e._v("删除")])]}}])})],1)],1),t("el-dialog",{attrs:{title:"发票抬头",visible:e.dialogVisible,width:"700px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px",size:"small",rules:e.titleRules}},[t("el-form-item",{attrs:{label:"发票抬头",prop:"invoice_head"}},[t("el-input",{attrs:{placeholder:"请填写发票抬头"},model:{value:e.form.invoice_head,callback:function(t){e.$set(e.form,"invoice_head",t)},expression:"form.invoice_head"}})],1),t("el-form-item",{attrs:{label:"纳税人识别号",prop:"tax_number"}},[t("el-input",{attrs:{placeholder:"请填写纳税人识别号"},model:{value:e.form.tax_number,callback:function(t){e.$set(e.form,"tax_number",t)},expression:"form.tax_number"}})],1),t("el-form-item",{attrs:{label:"开户银行",prop:"opening_bank"}},[t("el-input",{attrs:{placeholder:"请填写开户银行"},model:{value:e.form.opening_bank,callback:function(t){e.$set(e.form,"opening_bank",t)},expression:"form.opening_bank"}})],1),t("el-form-item",{attrs:{label:"银行账号",prop:"bank_account"}},[t("el-input",{attrs:{placeholder:"请填写银行账号"},model:{value:e.form.bank_account,callback:function(t){e.$set(e.form,"bank_account",t)},expression:"form.bank_account"}})],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.saveInvoiceTitle}},[e._v("保存")])],1)],1)],1)},n=[],l={name:"UserInfo",data(){return{user:{},searchParam:{pageSize:5,currentPage:1,total:10},dialogVisible:!1,invoiceList:[],form:{type:"add",invoice_head:"",tax_number:"",opening_bank:"",bank_account:""},titleRules:{invoice_head:[{required:!0,message:"请输入发票抬头",trigger:"blur"}],tax_number:[{required:!0,message:"请输入纳税人识别号",trigger:"blur"},{pattern:/^[A-Z0-9]{15,20}$/,message:"纳税人识别号格式不正确",trigger:"blur"}],opening_bank:[{required:!0,message:"请输入开户银行",trigger:"blur"}],bank_account:[{required:!0,message:"请输入银行账号",trigger:"blur"}]}}},mounted(){this.getList()},methods:{getList(){this.post({offset:0,limit:5},"/api/enterprise_invoice/index").then(e=>{this.invoiceList=e.data})},handleSizeChange(e){this.searchParam.pageSize=e},handleCurrentChange(e){this.searchParam.currentPage=e},openDialog(e,t){this.form={type:e,id:t.id||"",bank_account:t.bank_account||"",invoice_head:t.invoice_head||"",opening_bank:t.opening_bank||"",tax_number:t.tax_number||""},this.dialogVisible=!0},saveInvoiceTitle(){this.$refs.form.validate(e=>{if(e){let e="add"==this.form.type?"/api/enterprise_invoice/create":"/api/enterprise_invoice/edit";this.post(this.form,e).then(e=>{1==e.code&&(this.getList(),this.$message.success("操作成功"),this.dialogVisible=!1)})}})},handleDelete(e){this.$confirm("此操作将永久删除该发票, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.post({id:e.id},"/api/enterprise_invoice/delete").then(e=>{1==e.code&&(this.getList(),this.$message({type:"success",message:"删除成功!"}))})})}}},r=l,o=i(1656),s=(0,o.A)(r,a,n,!1,null,"89376790",null),c=s.exports}}]);
//# sourceMappingURL=179.67a63611.js.map