chunk-0145da7a.0b32e872.js 13.5 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0145da7a"],{"350b":function(t,e,a){},"9d50":function(t,e,a){"use strict";a.d(e,"c",(function(){return r})),a.d(e,"l",(function(){return o})),a.d(e,"g",(function(){return i})),a.d(e,"f",(function(){return s})),a.d(e,"d",(function(){return c})),a.d(e,"b",(function(){return l})),a.d(e,"h",(function(){return u})),a.d(e,"a",(function(){return d})),a.d(e,"k",(function(){return f})),a.d(e,"e",(function(){return h})),a.d(e,"i",(function(){return p})),a.d(e,"j",(function(){return m}));a("6b54");var n=a("b775");function r(t){return Object(n["a"])({url:"/api/Extend/LqInventory/Create",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/api/Extend/LqInventory/Update",method:"put",data:t})}function i(t){return Object(n["a"])({url:"/api/Extend/LqInventory/GetList",method:"get",data:t})}function s(t){return Object(n["a"])({url:"/api/Extend/LqInventory/GetInfo",method:"get",data:{id:t}})}function c(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/Create",method:"post",data:t})}function l(t,e){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/Cancel?id="+t+"&remarks="+e,method:"put"})}function u(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/GetList",method:"get",data:t})}function d(t,e,a){var r=new URLSearchParams;r.append("result",e),a&&r.append("opinion",a);var o=r.toString();return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/Approve/".concat(t).concat(o?"?"+o:""),method:"post"})}function f(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/MarkReceived/".concat(t),method:"put"})}function h(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/GetBatchInfo",method:"get",data:{batchId:t}})}function p(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/GetStoreReceiveStatistics",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/api/Extend/LqInventoryUsage/GetWarehousePendingDelivery",method:"post",data:t})}},b526:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"NCC-common-layout"},[a("div",{staticClass:"NCC-common-layout-center"},[a("div",{staticClass:"search-section"},[a("el-form",{staticClass:"search-form",attrs:{"label-position":"right","label-width":"90px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-row",{attrs:{gutter:16,align:"middle"}},[a("el-col",{attrs:{xs:24,sm:12,md:6,lg:5}},[a("el-form-item",{attrs:{label:"统计年份"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"year",placeholder:"选择年份","value-format":"yyyy",format:"yyyy"},model:{value:t.query.Year,callback:function(e){t.$set(t.query,"Year",e)},expression:"query.Year"}})],1)],1),a("el-col",{attrs:{xs:24,sm:12,md:6,lg:5}},[a("el-form-item",{attrs:{label:"统计月份"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择月份"},model:{value:t.query.Month,callback:function(e){t.$set(t.query,"Month",e)},expression:"query.Month"}},t._l(12,(function(t){return a("el-option",{key:t,attrs:{label:t+"月",value:t}})})),1)],1)],1),a("el-col",{attrs:{xs:24,sm:12,md:6,lg:5}},[a("el-form-item",{attrs:{label:"门店"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择门店(不选则统计所有门店)",clearable:"",filterable:""},model:{value:t.query.StoreId,callback:function(e){t.$set(t.query,"StoreId",e)},expression:"query.StoreId"}},t._l(t.storeOptions,(function(t){return a("el-option",{key:t.id,attrs:{label:t.dm,value:t.id}})})),1)],1)],1),a("el-col",{attrs:{xs:24,sm:12,md:6,lg:5}},[a("el-form-item",{attrs:{label:"仓库"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择仓库(不选则统计所有仓库)",clearable:"",filterable:""},model:{value:t.query.Warehouse,callback:function(e){t.$set(t.query,"Warehouse",e)},expression:"query.Warehouse"}},t._l(t.warehouseOptions,(function(t){return a("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1)],1),a("el-col",{staticClass:"search-actions",attrs:{xs:24,sm:24,md:24,lg:4}},[a("el-form-item",{attrs:{"label-width":"0"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.search()}}},[t._v("查询")]),a("el-button",{attrs:{icon:"el-icon-refresh-right"},on:{click:function(e){return t.reset()}}},[t._v("重置")])],1)],1)],1)],1)],1),a("div",{staticClass:"NCC-common-layout-main NCC-flex-main"},[a("div",{staticClass:"NCC-common-head"},[a("div",[a("span",{staticClass:"statistics-title"},[t._v("\n\t\t\t\t\t\t"+t._s(t.query.Year)+"年"+t._s(t.query.Month)+"月门店领取统计\n\t\t\t\t\t")])]),a("div",{staticClass:"NCC-common-head-right head-actions"},[a("el-tooltip",{attrs:{effect:"dark",content:"刷新",placement:"top"}},[a("el-button",{staticClass:"btn-refresh",attrs:{type:"default",size:"mini",icon:"el-icon-refresh"},on:{click:function(e){return t.initData()}}},[t._v("\n\t\t\t\t\t\t\t刷新\n\t\t\t\t\t\t")])],1),a("el-button",{staticClass:"btn-export",attrs:{type:"primary",size:"mini",icon:"el-icon-download"},on:{click:t.exportData}},[t._v("\n\t\t\t\t\t\t导出\n\t\t\t\t\t")]),a("screenfull",{attrs:{isContainer:""}})],1)]),a("el-row",{staticClass:"statistics-cards",attrs:{gutter:16}},[a("el-col",{attrs:{span:8}},[a("el-card",{staticClass:"statistics-card statistics-card-store",attrs:{shadow:"never"}},[a("div",{staticClass:"card-content"},[a("div",{staticClass:"card-icon"},[a("i",{staticClass:"el-icon-s-shop"})]),a("div",{staticClass:"card-info"},[a("div",{staticClass:"card-label"},[t._v("门店数量")]),a("div",{staticClass:"card-value"},[t._v(t._s(t.storeCount))])])])])],1),a("el-col",{attrs:{span:8}},[a("el-card",{staticClass:"statistics-card statistics-card-count",attrs:{shadow:"never"}},[a("div",{staticClass:"card-content"},[a("div",{staticClass:"card-icon"},[a("i",{staticClass:"el-icon-document"})]),a("div",{staticClass:"card-info"},[a("div",{staticClass:"card-label"},[t._v("领取总数量")]),a("div",{staticClass:"card-value"},[t._v(t._s(t.totalApplicationCount))])])])])],1),a("el-col",{attrs:{span:8}},[a("el-card",{staticClass:"statistics-card statistics-card-amount",attrs:{shadow:"never"}},[a("div",{staticClass:"card-content"},[a("div",{staticClass:"card-icon"},[a("i",{staticClass:"el-icon-coin"})]),a("div",{staticClass:"card-info"},[a("div",{staticClass:"card-label"},[t._v("领取总金额")]),a("div",{staticClass:"card-value"},[t._v("¥"+t._s(t.formatMoney(t.totalAmount)))])])])])],1)],1),a("NCC-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.list,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{label:"序号",align:"center",type:"index",width:"60"}}),a("el-table-column",{attrs:{label:"门店名称",align:"center",prop:"StoreName","min-width":"120","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell-with-icon store-info"},[a("i",{staticClass:"el-icon-s-shop store-icon"}),a("span",[t._v(t._s(e.row.StoreName||"无"))])])]}}])}),a("el-table-column",{attrs:{label:"批次号",align:"center",prop:"BatchId","min-width":"140","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.BatchId||"无"))])]}}])}),a("el-table-column",{attrs:{label:"产品名称",align:"center",prop:"ProductName","min-width":"140","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.ProductName||"无"))])]}}])}),a("el-table-column",{attrs:{label:"仓库",align:"center",prop:"Warehouse",width:"120","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"cell-with-icon warehouse-info"},[a("i",{staticClass:"el-icon-office-building warehouse-icon"}),a("span",[t._v(t._s(e.row.Warehouse||"无"))])])]}}])}),a("el-table-column",{attrs:{label:"数量",align:"center",prop:"Quantity",width:"90","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(null!=e.row.Quantity?e.row.Quantity:0))])]}}])}),a("el-table-column",{attrs:{label:"单价",align:"center",prop:"UnitPrice",width:"100","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v("¥"+t._s(t.formatMoney(e.row.UnitPrice)))])]}}])}),a("el-table-column",{attrs:{label:"金额",align:"center",prop:"Amount",width:"110","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"amount-text"},[t._v("¥"+t._s(t.formatMoney(e.row.Amount)))])]}}])}),a("el-table-column",{attrs:{label:"领取时间",align:"center",prop:"ReceiveTime",width:"170","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.formatDateTime(e.row.ReceiveTime)))])]}}])}),a("el-table-column",{attrs:{label:"操作",align:"left",width:"120",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return t.handleCancelReceive(e.row)}}},[t._v("\n\t\t\t\t\t\t\t作废领取\n\t\t\t\t\t\t")])]}}])})],1)],1)])])},r=[],o=(a("f576"),a("a481"),a("75fc")),i=(a("55dd"),a("c5f6"),a("ac6a"),a("5df3"),a("4f7f"),a("b775")),s=a("9d50"),c={data:function(){var t=new Date;return{loading:!1,list:[],query:{Year:String(t.getFullYear()),Month:t.getMonth()+1,StoreId:void 0,Warehouse:void 0},storeOptions:[],warehouseOptions:[]}},computed:{totalApplicationCount:function(){return this.list.reduce((function(t,e){return t+(e.Quantity||0)}),0)},totalAmount:function(){return this.list.reduce((function(t,e){return t+(e.Amount||0)}),0)},storeCount:function(){var t=this.list.map((function(t){return t.StoreName})).filter((function(t){return t&&""!==t.trim()}));return new Set(t).size}},created:function(){this.initStoreOptions(),this.initWarehouseOptions(),this.initData()},methods:{initData:function(){var t=this;if(this.query.Year&&this.query.Month){this.loading=!0;var e={Year:Number(this.query.Year),Month:this.query.Month};this.query.StoreId&&(e.StoreId=this.query.StoreId),this.query.Warehouse&&(e.Warehouse=this.query.Warehouse),Object(s["i"])(e).then((function(e){t.loading=!1,200==e.code&&e.data&&e.data.success?t.list=e.data.data||[]:(t.list=[],e.data&&e.data.message&&t.$message({type:"info",message:e.data.message}))})).catch((function(){t.loading=!1,t.list=[]}))}else this.$message({type:"warning",message:"请选择统计年份和月份"})},initStoreOptions:function(){var t=this;Object(i["a"])({url:"/api/Extend/LqMdxx",method:"GET",data:{currentPage:1,pageSize:1e3}}).then((function(e){e.data&&e.data.list&&(t.storeOptions=e.data.list)})).catch((function(){t.storeOptions=[]}))},initWarehouseOptions:function(){var t=this;Object(i["a"])({url:"/api/Extend/LqProduct/GetList",method:"GET",data:{currentPage:1,pageSize:1e4}}).then((function(e){if(200==e.code&&e.data&&e.data.list){var a=e.data.list.map((function(t){return t.warehouse})).filter((function(t){return t&&""!==t.trim()}));t.warehouseOptions=Object(o["a"])(new Set(a)).sort()}})).catch((function(){t.warehouseOptions=[]}))},exportData:function(){var t=this;if(this.list&&this.list.length){var e=["序号","门店名称","批次号","产品名称","仓库","数量","单价(元)","金额(元)","领取时间"],a=this.list.map((function(e,a){return[a+1,e.StoreName||"",e.BatchId||"",e.ProductName||"",e.Warehouse||"",e.Quantity||0,t.formatMoney(e.UnitPrice),t.formatMoney(e.Amount),t.formatDateTime(e.ReceiveTime)]})),n=[e].concat(Object(o["a"])(a)).map((function(t){return t.map((function(t){return'"'.concat(String(t).replace(/"/g,'""'),'"')})).join(",")})).join("\r\n"),r=new Blob(["\ufeff"+n],{type:"text/csv;charset=utf-8;"}),i="".concat(this.query.Year||"","年").concat(this.query.Month||"","月门店领取统计.csv");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(r,i);else{var s=document.createElement("a");s.href=URL.createObjectURL(r),s.download=i,s.click(),URL.revokeObjectURL(s.href)}}else this.$message({type:"warning",message:"暂无数据可导出"})},handleCancelReceive:function(t){var e=this,a=t&&(t.id||t.Id);a?this.$confirm("确定要作废该领取记录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){return e.$confirm("作废后将无法恢复,是否继续?","二次确认",{confirmButtonText:"确定作废",cancelButtonText:"取消",type:"error"})})).then((function(){e.loading=!0;var t="门店领取统计页面作废领取记录";return Object(s["b"])(a,t).then((function(t){e.loading=!1,200===t.code?(e.$message({type:"success",message:"作废成功"}),e.initData()):e.$message({type:"error",message:t.data&&t.data.message||"作废失败"})})).catch((function(){e.loading=!1}))})).catch((function(){})):this.$message({type:"warning",message:"当前记录缺少标识(id),无法作废,请联系管理员检查数据。"})},search:function(){this.initData()},reset:function(){var t=new Date;this.query={Year:String(t.getFullYear()),Month:t.getMonth()+1,StoreId:void 0,Warehouse:void 0},this.initData()},formatMoney:function(t){return t||0===t?Number(t).toFixed(2):"0.00"},formatDateTime:function(t){if(!t)return"无";var e=new Date(t>1e12?t:1e3*t);if(isNaN(e.getTime()))return"无";var a=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(n,"-").concat(r," ").concat(o,":").concat(i,":").concat(s)}}},l=c,u=(a("d33e"),a("2877")),d=Object(u["a"])(l,n,r,!1,null,"bc57cfb0",null);e["default"]=d.exports},d33e:function(t,e,a){"use strict";a("350b")}}]);