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.
1 lines
18 KiB
1 lines
18 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/index"],{"03da":function(t,e,o){"use strict";var n=o("f46a"),a=o.n(n);a.a},"1bef":function(t,e,o){"use strict";(function(t,e){var n=o("47a9");o("7859");n(o("3240"));var a=n(o("9a86"));t.__webpack_require_UNI_MP_PLUGIN__=o,e(a.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},"64cc":function(t,e,o){"use strict";(function(t,n){var a=o("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(o("7eb4")),s=a(o("ee10")),u=o("8f59"),r={computed:(0,u.mapState)(["userId","shopIndex","avatar"]),data:function(){return{type:"",src:"http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg",inventoryList:[],settingShow:!1,isCancel:!1,showFormula:!1,chartData:{},showDan:"",warehouseKeeperFlag:t.getStorageSync("warehouseKeeperFlag"),storeFlag:t.getStorageSync("storeFlag"),returnList:new Map,shopName:"",waimaiRight:"-70rpx",showDayPrice:!1,shijiPrice:!1,opts:{padding:[15,10,0,15],dataLabel:!0,dataPointShape:!1,enableScroll:!1,legend:{},xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2,data:[{min:0}]},extra:{column:{type:"group",width:30,customColor:["#44fd6d","#91CB74"],activeBgColor:"#000000",activeBgOpacity:.08,seriesGap:10,barBorderCircle:!0,barBorderRadius:[20,20,0,0],linearType:"custom"}}},shopInfo:{totalAmount:0,totalAlreadyEarn:0,totalPayAmount:0,totalCCount:0,totalCount:0,totalJCount:0,totalProfit:0,saleReturnCost:0,returnTotalAmount:0,returnTotalCount:0,totalAlreadyEarnDetail:0},waitCount:{},enDayShow:!1,endDay:"",textArr:[],zongAmount:0}},components:{cmdNavBar:function(){o.e("components/cmd-nav-bar/cmd-nav-bar").then(function(){return resolve(o("3d8f"))}.bind(null,o)).catch(o.oe)}},filters:{spliceMsg:function(t){return t}},onLoad:function(){var e=this;n.getLocation({type:"gcj02",success:function(t){}}),t.getStorage({key:"shopName",success:function(t){e.shopName=t.data}}),t.getStorage({key:"type",success:function(t){e.type=t.data}});var o=new Date,a=o.getDate();t.getStorageSync("publicize")==a||(t.setStorageSync("publicize",a),this.$refs.publicizepopup.open("center")),this.getEndTime()},onShow:function(){this.getSaleInfo()},onTabItemTap:function(e){this.warehouseKeeperFlag=t.getStorageSync("warehouseKeeperFlag"),this.storeFlag=t.getStorageSync("storeFlag")},methods:{getAmount:function(){var t=this,e=new Date,o=e.getFullYear().toString(),n=e.getMonth()+1<10?"0"+(e.getMonth()+1).toString():(e.getMonth()+1).toString(),a=e.getDate()<10?"0"+e.getDate().toString():e.getDate().toString(),i=e.getDate()+1<10?"0"+(e.getDate()+1).toString():(e.getDate()+1).toString(),s=o+"-"+n+"-"+a,u=o+"-"+n+"-"+i;this.tui.request("/app/dealingRecord/getDealingsRecordListByTimeRange","post",{startTime:s,endTime:u},!1,!0).then((function(e){t.zongAmount=0;for(var o=0;o<e.result.length;o++)e.result[o].amount>0&&4==e.result[o].dealingsType&&0==e.result[o].delFlag&&-1!=e.result[o].remark.indexOf("客户充值:")&&(t.zongAmount+=e.result[o].amount,t.shopInfo.totalAlreadyEarn+=e.result[o].amount)}))},goOrder:function(){t.switchTab({url:"/pages/index/order?type=dingdan"})},goOrderDetail:function(){t.switchTab({url:"/pages/index/order?listStatus=8"})},goInventory:function(){t.navigateTo({url:"/package1/index/waitStorage?inStorageStatus=1&storeFlag=1"})},getEndTime:function(){var e=this;this.textArr=[],this.tui.request("/app/shop/getShopInfoById","post",{id:t.getStorageSync("shopId")},!1,!0).then((function(o){t.setStorageSync("endTime",o.result.endTime),e.endTime=o.result.endTime,e.endDay=e.daysUntil(o.result.endTime),e.endDay<7&&(e.enDayShow=!0)})),setTimeout((function(t){if(void 0!=e.endTime){var o="您的店铺有效期至"+e.endTime+",还有"+e.endDay+"天到期,请及时联系管理员续费或开通";e.textArr.push(o),console.log(e.textArr)}}),500)},daysUntil:function(t){var e=new Date(t),o=new Date,n=e-o,a=Math.ceil(n/864e5);return a},changeFormula:function(t){var e=this;console.log(t),this.showFormula=!0,this.showDan=t,setTimeout((function(t){e.showFormula=!1}),2e3)},popClose:function(){this.$refs.publicizepopup.close()},getReturnOrder:function(t){return(0,s.default)(i.default.mark((function t(){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()},copyOrder:function(t){var e=this;return(0,s.default)(i.default.mark((function o(){var n;return i.default.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return n=e,o.next=3,e.tui.request("/app/return/list","post",{remark:3,saleId:t.id},!1,!1).then((function(o){200==o.code&&null!=o.result&&void 0!=o.result?""!=o.result?o.result.forEach((function(o){e.tui.request("/app/return/get/"+o.id,"GET",null,!1,!1).then((function(o){if(200==o.code&&null!=o.result&&void 0!=o.result)for(var a=0;a<o.result.saleDetailDTOList.length;a++){o.result.saleDetailDTOList[a].returnPrice=o.result.saleDetailDTOList[a].discountAmount,o.result.saleDetailDTOList[a].stockLogList=new Map,n.returnList.set(o.result.saleDetailDTOList[a].productId,o.result.saleDetailDTOList[a]);for(var i=0;i<o.result.saleDetailDTOList[a].stockLogList1.length;i++)o.result.saleDetailDTOList[a].stockLogList1[i].productCount=0-o.result.saleDetailDTOList[a].stockLogList1[i].productCount,n.returnList.get(o.result.saleDetailDTOList[a].productId).stockLogList.set(o.result.saleDetailDTOList[a].stockLogList1[i].attributeList,o.result.saleDetailDTOList[a].stockLogList1[i])}e.$nextTick((function(){e.tui.modal("提示","您确定要复制订单并重新开单吗?",!0,(function(o){o?e.goSaleGoods(t,"copy"):n.returnList=new Map}))}))})).catch((function(t){}))})):e.$nextTick((function(){e.tui.modal("提示","您确定要复制订单并重新开单吗?",!0,(function(o){o?e.goSaleGoods(t,"copy"):n.returnList=new Map}))})):e.tui.toast(o.message)}));case 3:case"end":return o.stop()}}),o)})))()},cancelOrder:function(t,e){var o=this;return(0,s.default)(i.default.mark((function n(){var a;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=o,n.next=3,o.tui.request("/app/return/list","post",{remark:3,saleId:t.id},!1,!1).then((function(n){200==n.code&&null!=n.result&&void 0!=n.result?""!=n.result?n.result.forEach((function(n){o.tui.request("/app/return/get/"+n.id,"GET",null,!1,!1).then((function(n){if(200==n.code&&null!=n.result&&void 0!=n.result)for(var i=0;i<n.result.saleDetailDTOList.length;i++){n.result.saleDetailDTOList[i].returnPrice=n.result.saleDetailDTOList[i].discountAmount,n.result.saleDetailDTOList[i].stockLogList=new Map,a.returnList.set(n.result.saleDetailDTOList[i].productId,n.result.saleDetailDTOList[i]);for(var s=0;s<n.result.saleDetailDTOList[i].stockLogList1.length;s++)n.result.saleDetailDTOList[i].stockLogList1[s].productCount=0-n.result.saleDetailDTOList[i].stockLogList1[s].productCount,a.returnList.get(n.result.saleDetailDTOList[i].productId).stockLogList.set(n.result.saleDetailDTOList[i].stockLogList1[s].attributeList,n.result.saleDetailDTOList[i].stockLogList1[s])}o.$nextTick((function(){o.tui.modal("提示","goPay"==e?"您确定要撤销订单并重新开单吗?":"您确定要撤销订单吗?",!0,(function(o){o?a.cancelSale(t,e):a.returnList=new Map}))}))})).catch((function(t){}))})):o.$nextTick((function(){o.tui.modal("提示","goPay"==e?"您确定要撤销订单并重新开单吗?":"您确定要撤销订单吗?",!0,(function(o){o?a.cancelSale(t,e):a.returnList=new Map}))})):o.tui.toast(n.message)}));case 3:case"end":return n.stop()}}),n)})))()},cancelSale:function(t,e){var o=this;this.tui.request("/app/sale/cancelSale","POST",{id:t.id},!0,!0).then((function(n){200==n.code?"goPay"==e?(o.isCancel=!0,o.goSaleGoods(t,"cancel")):o.getSaleInfo():o.tui.toast(res.message)})).catch((function(t){}))},getOrderInfoList:function(t,e){var o=this;0==t.status||1==t.status?this.tui.request("/app/sale/status","POST",{status:4,orderId:t.id},!0,!0).then((function(n){200==n.code?o.cancelSale(t,e):o.tui.toast(res.message)})).catch((function(t){})):this.cancelSale(t,e)},sliceMsg:function(t){var e="";if("string"==typeof t){var o=JSON.parse(t);for(var n in o)e+=o[n]+"/"}return e},goSaleGoods:function(e,o){var n=this,a=[];if(null!=e.saleDetailDTOList&&""!=e.saleDetailDTOList||(e.saleDetailDTOList=[]),this.returnList.forEach((function(t,o){e.saleDetailDTOList.push(t)})),e.saleDetailDTOList)for(var i=0;i<e.saleDetailDTOList.length;i++){for(var s={},u=new Map,r=[],l=0,c=0;c<e.saleDetailDTOList[i].stockLogList1.length;c++)if(1==u.has(e.saleDetailDTOList[i].stockLogList1[c].attributeList)){var d=u.get(e.saleDetailDTOList[i].stockLogList1[c].attributeList);r[d].productCount=Number(r[d].productCount)+Number(e.saleDetailDTOList[i].stockLogList1[c].productCount),1==this.isCancel&&(r[d].stockCount=r[d].stockCount+r[d].productCount)}else e.saleDetailDTOList[i].stockLogList1[c].name=this.sliceMsg(e.saleDetailDTOList[i].stockLogList1[c].attributeList),1==this.isCancel&&(e.saleDetailDTOList[i].stockLogList1[c].stockCount=e.saleDetailDTOList[i].stockLogList1[c].stockCount+e.saleDetailDTOList[i].stockLogList1[c].productCount),r.push(e.saleDetailDTOList[i].stockLogList1[c]),u.set(e.saleDetailDTOList[i].stockLogList1[c].attributeList,l),l++;s.saleDetailQueryDTO=r,s.num=0,s.id=e.saleDetailDTOList[i].productId,s.attrId=e.saleDetailDTOList[i].attrId,s.buyCount=e.saleDetailDTOList[i].buyCount-1,s.price=e.saleDetailDTOList[i].price,s.lsprice=e.saleDetailDTOList[i].price,s.discount=e.saleDetailDTOList[i].discount,s.categoryId=e.saleDetailDTOList[i].categoryId,s.zPrice=e.saleDetailDTOList[i].discountAmount,s.customerCategoryRule=null!=e.saleDetailDTOList[i].customerCategoryRule?JSON.parse(e.saleDetailDTOList[i].customerCategoryRule):null,s.productName=e.saleDetailDTOList[i].productName,null!=e.saleDetailDTOList[i].productPicture&&""!=e.saleDetailDTOList[i].productPicture?s.productPicture=e.saleDetailDTOList[i].productPicture+"?time="+(new Date).getTime():s.productPicture="",s.productSn=e.saleDetailDTOList[i].productSn,s.wholesalePrice=e.saleDetailDTOList[i].wholesalePrice,s.discountAmount=e.saleDetailDTOList[i].discountAmount,s.returnPrice=e.saleDetailDTOList[i].returnPrice,s.saleId="copy"==o?"":e.id,s.remark=e.remark,s.xsyId=e.createBy,s.createByName=e.createByName,s.unitPrice="cancel"==o?this.getUnitPrice(e,e.saleDetailDTOList[i]):e.saleDetailDTOList[i].discountAmount,a.push(s)}else{var p={num:0,price:0};p.saleId="copy"==o?"":e.id,p.remark=e.remark,p.xsyId=e.createBy,p.createByName=e.createByName,a.push(p)}this.$nextTick((function(){n.tui.request("/app/debt/selectByUserId","post",{shopId:t.getStorageSync("shopId"),userId:e.userId},!1,!0).then((function(o){if(200==o.code){n.returnList=new Map,o.result.noEarn=o.result.amountOwed,o.result.name=o.result.userName,o.result.id=e.userId,t.setStorageSync("khName",JSON.stringify(o.result)),t.setStorageSync("carList1",JSON.stringify(a)),t.setStorageSync("discountAll",null!=e.discount?e.discount:10),t.setStorageSync("hangOrder",!0);var i="1";-1!=t.getStorageSync("shopName").indexOf("杰娜世家")&&(i="0"),"1"==i?t.switchTab({url:"/pages/inventory/goodsList1"}):t.navigateTo({url:"/package2/inventory/goodsList1HENG"})}}))}))},getUnitPrice:function(t,e){return 10!=t.discount?null==t.discount||0==t.discount||void 0==t.discount?e.discountAmount:(1e4*e.discountAmount/(100*t.discount)/10).toFixed(2):10!=e.discount?null==e.discount||0==e.discount||void 0==e.discount?e.discountAmount:(1e4*e.discountAmount/(100*e.discount)/10).toFixed(2):e.discountAmount||e.wholesalePrice},getSaleInfo:function(){var t=this;this.shopInfo={totalAmount:0,totalAlreadyEarn:0,totalPayAmount:0,totalCCount:0,totalCount:0,totalJCount:0,totalProfit:0,saleReturnCost:0,returnTotalAmount:0,returnTotalCount:0,totalAlreadyEarnDetail:0},this.inventoryList=[],this.tui.request("/app/sale/getShopAll","POST",{pageVo:{pageSize:5,pageNumber:1}},!1,!1).then((function(e){if(200==e.code){t.shopInfo={totalAmount:e.result.totalAmount,totalAlreadyEarn:e.result.totalAlreadyEarn,totalPayAmount:e.result.totalPayAmount,totalCCount:e.result.totalCCount,totalCount:e.result.totalCount,totalJCount:e.result.totalJCount,totalProfit:e.result.totalProfit,saleReturnCost:e.result.saleReturnCost,returnTotalAmount:e.result.returnTotalAmount,returnTotalCount:e.result.returnTotalCount,notConfirmPurductCount:e.result.notConfirmPurductCount,totalAlreadyEarnDetail:e.result.totalAlreadyEarnDetail},t.getAmount();var o={categories:t.getWeek(),series:[{name:"七天营收统计",linearColor:[[0,"#1890FF"],[.33,"#00B5FF"],[.66,"#00D1ED"],[1,"#00E6BB"],[1,"#90F489"]],setShadow:[3,8,10,"#00E6BB"],data:e.result.weekSale}]};t.chartData=JSON.parse(JSON.stringify(o)),t.waitCount=e.result.countMap;for(var n=0;n<e.result.salePage.records.length;n++)e.result.salePage.records[n].img="/static/images/dingdan/dd"+n+".png",t.inventoryList=e.result.salePage.records}else t.tui.toast(e.message)}))},goToInfo:function(){this.$refs.cePopup.open("left")},tiaozhuanHD:function(){t.navigateToMiniProgram({appId:"wxa0749c7edd4cc96f",path:"pages/index/index",success:function(t){}})},quwaimai:function(){var e=this;"-70rpx"==this.waimaiRight?this.waimaiRight="20rpx":t.openEmbeddedMiniProgram({appId:"wxf5362b6e97ecee2f"}),setTimeout((function(t){e.waimaiRight="-70rpx"}),2e3)},gotoSearchData:function(){t.navigateTo({url:"/package1/index/dataStatistics"})},showPayType:function(){var t=this;this.showDayPrice=!0,setTimeout((function(e){t.showDayPrice=!1}),2e3)},outLogin:function(e){var o=this;t.showModal({title:"提示",content:"确定退出登录吗?",success:function(e){e.confirm&&o.tui.request("/oauth2/logout","POST",{},!1,!1).then((function(e){200==e.code?(o.tui.toast("退出登录成功"),t.removeStorage({key:"hiver_token"}),t.navigateTo({url:"/package2/login/login"})):o.tui.toast(e.message)}))}})},getWeek:function(){var t=["周日","周一","周二","周三","周四","周五","周六"],e=Array.from({length:7},(function(t,e){return e})).map((function(e){var o=new Date;return o.setDate(o.getDate()-e),t[o.getDay()]}));return e.reverse()},gotoDetail:function(e,o){t.navigateTo({url:"/package1/index/orderDetail?id="+e+"&userId="+o})},goSonPage:function(e){if("/package1/index/waitStorage?inStorageStatus=0"==e){if(0!=this.type)return void this.tui.toast("暂无查看权限!")}else"/pages/index/order?listStatus=6"==e?t.switchTab({url:"/pages/index/order?listStatus=6"}):t.navigateTo({url:e})}}};e.default=r}).call(this,o("df3c")["default"],o("3223")["default"])},"9a86":function(t,e,o){"use strict";o.r(e);var n=o("c9fc"),a=o("ee9d");for(var i in a)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return a[t]}))}(i);o("03da");var s=o("828b"),u=Object(s["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=u.exports},c9fc:function(t,e,o){"use strict";o.d(e,"b",(function(){return a})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return n}));var n={cmdNavBar:function(){return o.e("components/cmd-nav-bar/cmd-nav-bar").then(o.bind(null,"3d8f"))},uNoticeBar:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-notice-bar/u-notice-bar")]).then(o.bind(null,"013b"))},uGrid:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-grid/u-grid")]).then(o.bind(null,"7b3c"))},uGridItem:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-grid-item/u-grid-item")]).then(o.bind(null,"cb83"))},uCountTo:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-count-to/u-count-to")]).then(o.bind(null,"1b05"))},uniIcons:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(o.bind(null,"6bbb6"))},qiunDataCharts:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts")]).then(o.bind(null,"55f8"))},uniCard:function(){return o.e("uni_modules/uni-card/components/uni-card/uni-card").then(o.bind(null,"1e6b"))},uEmpty:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-empty/u-empty")]).then(o.bind(null,"6727"))},uniPopup:function(){return o.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(o.bind(null,"2864"))},uCell:function(){return Promise.all([o.e("common/vendor"),o.e("uni_modules/uview-ui/components/u-cell/u-cell")]).then(o.bind(null,"3f6c"))}},a=function(){var t=this,e=t.$createElement,o=(t._self._c,0==t.type?(t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null),n=t.inventoryList.length,a=t.showDayPrice&&0==t.type?t.shopInfo.totalAlreadyEarnDetail.length:null,i=!t.showFormula||0!=t.type||3!=t.showDan||0==t.shopInfo.totalProfit&&0==t.shopInfo.totalAmount?null:(t.shopInfo.totalProfit/t.shopInfo.totalAmount*100).toFixed(2),s=t.showFormula&&0==t.type&&2==t.showDan?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,u=t.showFormula&&0==t.type&&2==t.showDan&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=0?((t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost)/(t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount)*100).toFixed(2):null,r=t.showFormula&&0==t.type&&1==t.showDan?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,l=t.shijiPrice&&0==t.type?(t.shopInfo.totalAmount-t.shopInfo.totalProfit).toFixed(2):null,c=t.shijiPrice&&0==t.type?(t.shopInfo.totalAmount-(t.shopInfo.totalAmount-t.shopInfo.totalProfit)-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost).toFixed(2):null,d=t.shijiPrice&&0==t.type&&0!=t.shopInfo.totalProfit&&null!=t.shopInfo.totalProfit&&0!=t.shopInfo.totalAmount&&null!=t.shopInfo.totalAmount?(t.shopInfo.totalProfit/t.shopInfo.totalAmount*100).toFixed(2):null,p=t.shijiPrice&&0==t.type&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=0&&t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost!=null&&t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount!=0&&t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount!=null?((t.shopInfo.totalProfit-t.shopInfo.returnTotalAmount+t.shopInfo.saleReturnCost)/(t.shopInfo.totalAmount-t.shopInfo.returnTotalAmount)*100).toFixed(2):null;t._isMounted||(t.e0=function(e){t.shijiPrice=!0},t.e1=function(e){t.shijiPrice=!1}),t.$mp.data=Object.assign({},{$root:{g0:o,g1:n,g2:a,g3:i,g4:s,g5:u,g6:r,g7:l,g8:c,g9:d,g10:p}})},i=[]},ee9d:function(t,e,o){"use strict";o.r(e);var n=o("64cc"),a=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=a.a},f46a:function(t,e,o){}},[["1bef","common/runtime","common/vendor"]]]);
|