| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f9f9a02"],{"164d":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"shop-list"},[e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"slot-date-select",fn:function(){return[e("el-date-picker",{attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}})]},proxy:!0},{key:"slot-export-due",fn:function(){return[e("el-button",{staticStyle:{"margin-left":"60px"},attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.exportData()}}},[t._v("导出数据")])]},proxy:!0},{key:"slot-total-amount",fn:function(){return[e("div",{staticClass:"cg-total-wrap"},[e("div",{staticClass:"cg-total-nums"},[e("span",{staticStyle:{"font-size":"15px","font-weight":"bold"}},[e("span",{style:t.negStyle(t.totalNum)},[t._v(t._s(t.formatNum(t.totalNum)))]),t._v(" 扎 ¥"),e("span",{style:t.negStyle(t.totalAmount)},[t._v(t._s(t.formatNum(t.totalAmount)))])]),Number(t.nextDayDeduct)>0?e("span",{staticStyle:{"font-size":"15px","font-weight":"bold","margin-left":"15px",color:"#e67e22"}},[t._v("隔天售后扣减:¥"+t._s(t.formatNum(t.nextDayDeduct)))]):t._e()]),e("div",{staticClass:"cg-tip"},[t._v(" 数量、金额已按售后扣减(隔天售后记在通过日,可为负)。入库日不含隔天退货量。 ")])])]},proxy:!0},{key:"table-column-num",fn:function({scope:a}){return[e("span",{style:t.negStyle(a.row.num)},[t._v(t._s(t.formatNum(a.row.num)))])]}},{key:"table-column-amount",fn:function({scope:a}){return[e("span",{style:t.negStyle(a.row.amount)},[t._v(t._s(t.formatNum(a.row.amount)))])]}}])})],1)},n=[],o=(a("8f26"),a("666b"),a("963e"),a("5880")),i={data(){return{crud:null,pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,a=new Date;a.setTime(a.getTime()-6048e5),t.$emit("pick",[a,e])}},{text:"最近一个月",onClick(t){const e=new Date,a=new Date;a.setTime(a.getTime()-2592e6),t.$emit("pick",[a,e])}},{text:"最近三个月",onClick(t){const e=new Date,a=new Date;a.setTime(a.getTime()-7776e6),t.$emit("pick",[a,e])}}]},currentDateList:"",startTime:"",endTime:"",searchTime:"",sort:"num",totalAmount:0,totalNum:0,nextDayDeduct:0}},computed:{...Object(o["mapGetters"])(["shopInfo"])},methods:{formatNum(t){const e=parseFloat(t);return isNaN(e)?0:e},negStyle(t){const e=Number(t);return!isNaN(e)&&e<0?"color:#e74c3c;font-weight:bold;":""},queryParams(t){return{searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,sort:this.sort,...t||{}}},sumListTotals(t){let e=0,a=0;(t||[]).forEach(t=>{e+=this.formatNum(t.num),a+=this.formatNum(t.amount)}),this.totalNum=e,this.totalAmount=Math.round(100*a)/100},exportData(){this.$service.statCg.getProfit(this.queryParams({export:1})).then(t=>{t.file&&(window.location.href=t.file)})},onLoad({ctx:t,app:e}){this.app=e,t.service({page:()=>this.$service.statCg.getProfit(this.queryParams()).then(t=>{this.nextDayDeduct=this.formatNum(t.nextDayDeduct);const e=Array.isArray(t.list)?t.list:Object.keys(t.list||{}).map(e=>t.list[e]);return this.sumListTotals(e),{list:e}})}).set("table",{columns:[{label:"名称",prop:"name",align:"center"},{label:"数量",prop:"num",align:"center"},{label:"金额",prop:"amount",align:"center"}],op:{visible:!1,props:{width:250,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["slot-date-select","slot-order-debt","slot-export-due","flex1"],["data-table"],["slot-total-amount","flex1"]]).done(),e.refresh()},getDate(){this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1],this.app.refresh(this.queryParams())}}},r=i,l=(a("f981"),a("1805")),u=Object(l["a"])(r,s,n,!1,null,"7bf7aeea",null);e["default"]=u.exports},a349:function(t,e,a){},f981:function(t,e,a){"use strict";a("a349")}}]);
|