7140.9107bfc9.js 15 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[7140],{77140:function(e,t,a){a.r(t),a.d(t,{default:function(){return h}});var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){e.dialogFormVisible=!0,e.form.billnodate=new Date}}},[e._v("新 建")]),a("el-drawer",{attrs:{title:"新建核销单","append-to-body":"","show-close":!1,visible:e.dialogFormVisible,size:"60%"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("div",{staticClass:"drawer__panel"},[a("el-row",[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px","label-position":"right",size:"mini"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"经销商:",prop:"sys_enterpriseid"}},[a("selectEnterprise",{ref:"ent",on:{rowClick:e.entRowClick}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"账户类型",prop:"sa_accountclassid"}},[a("el-select",{attrs:{placeholder:"请选择账户类型",size:"small"},on:{change:e.accountChange},model:{value:e.form.sa_accountclassid,callback:function(t){e.$set(e.form,"sa_accountclassid",t)},expression:"form.sa_accountclassid"}},e._l(e.accountType,(function(e){return a("el-option",{key:e.sa_accountclassid,attrs:{label:e.accountname,value:e.sa_accountclassid}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"凭证",prop:"sa_cashbillid"}},[a("selectVoucher",{ref:"voucher",attrs:{sys_enterpriseid:e.form.sys_enterpriseid,sa_accountclassid:e.form.sa_accountclassid},on:{rowClick:e.voucherRowClick},model:{value:e.form.sa_cashbillid,callback:function(t){e.$set(e.form,"sa_cashbillid",t)},expression:"form.sa_cashbillid"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"核销金额",prop:"writeoffamount"}},[a("el-input",{attrs:{size:"small",placeholder:"请输入核销金额"},model:{value:e.form.writeoffamount,callback:function(t){e.$set(e.form,"writeoffamount",e._n(t))},expression:"form.writeoffamount"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"核销日期",prop:"billnodate"}},[a("el-date-picker",{attrs:{type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期"},model:{value:e.form.billnodate,callback:function(t){e.$set(e.form,"billnodate",t)},expression:"form.billnodate"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"订单"}},[a("div",{staticClass:"flex-align-center flex-between mt-10"},[a("el-input",{staticStyle:{width:"200px"},attrs:{size:"small","suffix-icon":"el-icon-search",placeholder:"搜索",clearable:""},on:{clear:function(t){return e.getOrderList(e.params.content.pageNumber=1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getOrderList(e.params.content.pageNumber=1)}},model:{value:e.params.content.where.condition,callback:function(t){e.$set(e.params.content.where,"condition",t)},expression:"params.content.where.condition"}})],1),e.dialogFormVisible?a("selectOrder",{ref:"table",attrs:{idName:"sa_orderitemsid",layout:e.tablecols,data:e.orderList,custom:!0,height:"500px"},scopedSlots:e._u([{key:"customcol",fn:function(t){return[a("div",[e._v(e._s(t.column.data[t.column.columnname]))])]}}],null,!1,635518670)}):e._e(),a("div",{staticClass:"container normal-panel",staticStyle:{"text-align":"right"}},[a("el-pagination",{staticStyle:{"text-align":"right"},attrs:{background:"",small:"","current-page":e.params.content.pageNumber,"page-size":e.params.content.pageSize,layout:"total,sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)],1)],1)],1)],1),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)])],1)},s=[],r=a(23920),l=a(33145),n=a(56200),o={name:"add",components:{selectEnterprise:r.Z,selectVoucher:l.Z,selectOrder:n.Z},data(){return{dialogFormVisible:!1,accountType:[],tablecols:[],total:0,orderList:[],form:{sa_writeoffbillid:0,sys_enterpriseid:"",sa_accountclassid:"",sa_cashbillid:"",remarks:"",writeoffamount:0,billnodate:""},rules:{sys_enterpriseid:[{required:!0,message:"请选择经销商",trigger:"blur"}],sa_accountclassid:[{required:!0,message:"请选择账户类型",trigger:"blur"}],sa_cashbillid:[{required:!0,message:"请选择支出或收入凭证",trigger:"change"}],writeoffamount:[{message:"请填写正确金额",trigger:"blur",type:"number"}]},params:{id:20221124091104,content:{pageNumber:1,pageSize:20,sys_enterpriseid:"",sa_accountclassid:"",sa_writeoffbillid:"",where:{condition:""}}}}},created(){this.getAccountType(),this.tablecols=this.tool.tabelCol(this.$route.name).addOrderTable.tablecols},watch:{dialogFormVisible(e){e||(this.$refs.ent.form.enterprisename="",this.$refs.form.resetFields(),this.$refs.table.allArr=[],this.orderList=[],this.$refs.voucher.form.billno="",this.form.sa_cashbillid="")}},methods:{handleSizeChange(e){this.params.content.pageSize=e,this.getOrderList()},handleCurrentChange(e){this.params.content.pageNumber=e,this.getOrderList()},async getOrderList(){if(!this.form.sa_accountclassid||!this.form.sys_enterpriseid)return;this.$refs.table.allArr=[],this.params.content.sys_enterpriseid=this.form.sys_enterpriseid,this.params.content.sa_accountclassid=this.form.sa_accountclassid;let e=await this.$api.requested(this.params);this.orderList=e.data,this.total=e.total,console.log(e)},onSubmit(){console.log(this.form),this.$refs["form"].validate((async e=>{if(!e)return!1;const t=await this.$api.requested({id:"20221124090204",version:1,content:this.form});this.tool.showMessage(t,(async()=>{let e=this.$refs.table.allArr.map((e=>({sa_writeoffbill_orderid:0,sa_orderid:e.sa_orderid,sa_orderitemsid:e.sa_orderitemsid,writeoffamount:0,remarks:""})));if(e.length>0){await this.$api.requested({id:"20221124090904",version:1,content:{sa_writeoffbillid:t.data[0].sa_writeoffbillid,writeoffbillOrder:e}})}this.$emit("onSuccess"),this.dialogFormVisible=!1,this.$store.dispatch("changeDetailDrawer",!0),this.$router.push({path:"/writeoffbillDetail",query:{id:t.data[0].sa_writeoffbillid,rowindex:t.data[0].rowindex}})}))}))},entRowClick(e){this.$refs.voucher.form.billno="",this.form.sa_cashbillid="",this.form.sys_enterpriseid=e.sys_enterpriseid,this.getOrderList()},voucherRowClick(e){this.form.sa_cashbillid=e.sa_cashbillid},async getAccountType(){let e=await this.$api.requested({id:20221124090604,content:{}});this.accountType=e.data},accountChange(e){this.$refs.voucher.form.billno="",this.form.sa_cashbillid="",this.getOrderList()}}},c=o,u=a(43736),d=(0,u.Z)(c,i,s,!1,null,"07290312",null),h=d.exports},23920:function(e,t,a){a.d(t,{Z:function(){return c}});var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-popover",{attrs:{placement:"bottom",width:"100%"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[a("div",[a("div",{staticClass:"flex-align-center flex-between",staticStyle:{"margin-bottom":"10px"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{"suffix-icon":"el-icon-search",size:"small",placeholder:"输入企业信息",clearable:""},on:{clear:function(t){return e.queryEnterpriseArchives(e.params.content.pageNumber=1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryEnterpriseArchives(e.params.content.pageNumber=1)}},model:{value:e.params.content.where.condition,callback:function(t){e.$set(e.params.content.where,"condition",t)},expression:"params.content.where.condition"}})],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.ENlist,size:"small",stripe:"",height:"300",border:""}},[a("el-table-column",{attrs:{prop:"enterprisename",label:"企业名称",width:"180"}}),a("el-table-column",{attrs:{prop:"contact",label:"联系人",width:"180"}}),a("el-table-column",{attrs:{prop:"phone",label:"联系电话"}}),a("el-table-column",{scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(a){return e.rowClick(t.row)}}},[e._v("选 择")])]}}])})],1),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","current-page":e.currentPage,"page-size":e.params.content.pageSize,layout:"total, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),a("el-input",{attrs:{slot:"reference","validate-event":!1,placeholder:"输入企业名称",readonly:""},on:{focus:e.queryEnterpriseArchives},slot:"reference",model:{value:e.form.enterprisename,callback:function(t){e.$set(e.form,"enterprisename",t)},expression:"form.enterprisename"}})],1)],1)},s=[],r={components:{},data(){return{ENlist:[],total:0,currentPage:0,form:{enterprisename:""},params:{id:20221124090504,content:{pageNumber:1,pageSize:10,where:{condition:""}}},visible:!1}},methods:{async queryEnterpriseArchives(){const e=await this.$api.requested(this.params);this.ENlist=e.data,this.total=e.total,this.currentPage=e.pageNumber},handleSizeChange(e){this.params.content.pageSize=e,this.queryEnterpriseArchives()},handleCurrentChange(e){this.params.content.pageNumber=e,this.queryEnterpriseArchives()},rowClick(e){this.visible=!1,this.form.enterprisename=e.enterprisename,this.$emit("rowClick",e)},onSuccess(){this.queryEnterpriseArchives(),this.form.enterprisename=this.ENlist[0].enterprisename,this.$emit("rowClick",this.ENlist[0])}},mounted(){}},l=r,n=a(43736),o=(0,n.Z)(l,i,s,!1,null,null,null),c=o.exports},33145:function(e,t,a){a.d(t,{Z:function(){return c}});var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-popover",{attrs:{placement:"bottom",width:"100%"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[a("div",[a("div",{staticClass:"flex-align-center flex-between",staticStyle:{"margin-bottom":"10px"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{"suffix-icon":"el-icon-search",size:"small",placeholder:"输入凭证信息",clearable:""},on:{clear:function(t){return e.queryEnterpriseArchives(e.params.content.pageNumber=1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryEnterpriseArchives(e.params.content.pageNumber=1)}},model:{value:e.params.content.where.condition,callback:function(t){e.$set(e.params.content.where,"condition",t)},expression:"params.content.where.condition"}})],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.ENlist,size:"small",stripe:"",height:"300",border:""}},[a("el-table-column",{attrs:{prop:"billno",label:"凭证单号",width:"180"}}),a("el-table-column",{attrs:{prop:"checkdate",label:"审核时间",width:"180"}}),a("el-table-column",{attrs:{prop:"amount",label:"金额"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(e.tool.formatAmount(t.row.amount,2))+" ")]}}])}),a("el-table-column",{attrs:{prop:"class",label:"分类"}}),a("el-table-column",{scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(a){return e.rowClick(t.row)}}},[e._v("选 择")])]}}])})],1),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","current-page":e.currentPage,"page-size":e.params.content.pageSize,layout:"total, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),a("el-input",{attrs:{slot:"reference","validate-event":!1,disabled:!e.sys_enterpriseid||!e.sa_accountclassid,placeholder:"请选择支出或收入凭证"},on:{focus:e.queryEnterpriseArchives},slot:"reference",model:{value:e.form.billno,callback:function(t){e.$set(e.form,"billno",t)},expression:"form.billno"}})],1)],1)},s=[],r=(a(52266),{props:["sys_enterpriseid","sa_accountclassid"],components:{},data(){return{ENlist:[],total:0,currentPage:0,form:{billno:""},params:{id:20221124090704,content:{pageNumber:1,pageSize:20,sys_enterpriseid:1,sa_accountclassid:9,where:{condition:""}}},visible:!1}},watch:{sa_accountclassid(e){this.form.sa_accountclassid!=this.sa_accountclassid&&this.sys_enterpriseid&&this.queryEnterpriseArchives()}},methods:{async queryEnterpriseArchives(){if(!this.sa_accountclassid||!this.sys_enterpriseid)return;if(this.params.content.sa_accountclassid==this.sa_accountclassid&&this.params.content.sys_enterpriseid==this.sys_enterpriseid)return;this.params.content.sa_accountclassid=this.sa_accountclassid,this.params.content.sys_enterpriseid=this.sys_enterpriseid;const e=await this.$api.requested(this.params);this.ENlist=e.data,this.total=e.total,this.currentPage=e.pageNumber},handleSizeChange(e){this.params.content.pageSize=e,this.queryEnterpriseArchives()},handleCurrentChange(e){this.params.content.pageNumber=e,this.queryEnterpriseArchives()},rowClick(e){this.visible=!1,this.form.billno=e.billno,this.$emit("rowClick",e)},onSuccess(){this.queryEnterpriseArchives(),this.form.billno=this.ENlist[0].billno,this.$emit("rowClick",this.ENlist[0])}},mounted(){}}),l=r,n=a(43736),o=(0,n.Z)(l,i,s,!1,null,null,null),c=o.exports},56200:function(e,t,a){a.d(t,{Z:function(){return u}});var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"tables",staticStyle:{width:"100%"},attrs:{"highlight-current-row":"",data:e.data,"header-cell-style":{background:"#EEEEEE",color:"#333"},size:"mini",height:e.height,border:""},on:{select:e.aaaa,"select-all":e.selectAll}},[a("el-table-column",{attrs:{type:"selection",width:"45",align:"center",fixed:""}}),e._l(e.layout,(function(t){return a("el-table-column",{key:t.tablecolid,attrs:{prop:t.columnname,label:t.title,width:t.width,fixed:t.columnname===e.fixedName&&"right"},scopedSlots:e._u([{key:"default",fn:function(i){return[e.custom?e._t("customcol",null,{column:{data:i.row,columnname:t.columnname}}):a("span",[e._v(e._s(i.row[t.columnname]))]),"operation"===t.columnname?e._t("opreation",null,{data:i.row}):e._e()]}}],null,!0)})}))],2)],1)},s=[],r=a(20629),l={props:["layout","data","custom","height","fixedName","idName"],data(){return{list:[],allArr:[]}},computed:{...(0,r.Se)({loading:"loading"})},watch:{data(e){console.log(e),this.data.forEach((e=>{this.allArr.forEach((t=>{e[this.idName]==t[this.idName]&&this.$nextTick((()=>{this.$refs["tables"].toggleRowSelection(e,!0)}))}))}))},allArr(e){this.$emit("upDateData",e)}},methods:{aaaa(e,t){let a=this.allArr.findIndex((e=>e[this.idName]==t[this.idName]));-1==a?this.allArr.push(t):this.allArr.splice(a,1),console.log(this.allArr)},selectAll(e){0==e.length?this.data.forEach((e=>{this.allArr.splice(e,1)})):e.forEach((e=>{let t=this.allArr.every((t=>e[this.idName]!=t[this.idName]));t&&this.allArr.push(e)}))}}},n=l,o=a(43736),c=(0,o.Z)(n,i,s,!1,null,"1f57b18a",null),u=c.exports}}]);