| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e179404"],{"25f7":function(t,e,a){"use strict";a.r(e);var n=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:"sale-total-wrap"},[e("div",{staticClass:"sale-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)))]),t._v(" 总毛利 "),e("span",{style:t.negStyle(t.totalMl)},[t._v(t._s(t.formatNum(t.totalMl)))])]),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:"sale-tip"},[t._v(" 数量、金额、毛利已按售后扣减(隔天售后记在通过日,可为负)。仅退款只扣金额不扣扎数。 ")])])]},proxy:!0},{key:"table-column-mll",fn:function({scope:a}){return[e("span",[t._v(t._s(t.formatNum(a.row.mll))+"%")])]}},{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)))])]}},{key:"table-column-gross",fn:function({scope:a}){return[e("span",{style:t.negStyle(a.row.gross)},[t._v(t._s(t.formatNum(a.row.gross)))])]}}])})],1)},s=[],o=(a("8f26"),a("963e"),a("5880")),r={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:"",totalAmount:0,totalNum:0,totalMl: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,...t||{}}},exportData(){this.$service.statItem.getShow(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.statItem.getShow(this.queryParams()).then(t=>{this.totalAmount=this.formatNum(t.totalAmount),this.totalMl=this.formatNum(t.totalMl),this.totalNum=this.formatNum(t.totalNum),this.nextDayDeduct=this.formatNum(t.nextDayDeduct);const e=Array.isArray(t.list)?t.list:Object.keys(t.list||{}).map(e=>t.list[e]);return{list:e}})}).set("table",{columns:[{label:"名称",prop:"name",align:"center"},{label:"总数量",prop:"num",align:"center"},{label:"总金额",prop:"amount",align:"center"},{label:"毛利",prop:"gross",align:"center"},{label:"毛利率",prop:"mll",align:"center"}],op:{visible:!1,props:{width:250,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["slot-date-select","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())}}},l=r,i=(a("ae9c"),a("1805")),u=Object(i["a"])(l,n,s,!1,null,"f7326c7c",null);e["default"]=u.exports},"4f05":function(t,e,a){},ae9c:function(t,e,a){"use strict";a("4f05")}}]);
|