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
14 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/inventory/inventory"],{"15c1":function(t,e,i){"use strict";(function(t,e){var s=i("47a9");i("7859");s(i("3240"));var o=s(i("3631"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},3631:function(t,e,i){"use strict";i.r(e);var s=i("3d3b"),o=i("cdfd");for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);i("dafb");var n=i("828b"),r=Object(n["a"])(o["default"],s["b"],s["c"],!1,null,null,null,!1,s["a"],void 0);e["default"]=r.exports},"3d3b":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return s}));var s={uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"6bbb6"))},uniSearchBar:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar")]).then(i.bind(null,"f56e"))},uLoadmore:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-loadmore/u-loadmore")]).then(i.bind(null,"9fc5"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"2864"))}},o=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){return t.$refs.sharePopup.close()},t.e1=function(e){return t.$refs.sharePopup.close()},t.e2=function(e){return t.$refs.customPopup.close()},t.e3=function(e){return t.$refs.showPopup.close()})},a=[]},a828:function(t,e,i){},bdd7:function(t,e,i){"use strict";(function(t){var s=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=s(i("af34")),a=i("8f59"),n={computed:(0,a.mapState)(["shopIndex","region"]),data:function(){return{canvasshow:!1,size:30,indexList:[],zheng:"0",khName:[],canvasWidth:0,canvasHeight:0,shopOwnerPhone:t.getStorageSync("shopOwnerPhone"),username:t.getStorageSync("username"),fu:"0",bigImg:[],swiperDotIndex:0,pageNum:1,shopList:[],categoryId:"",shopId:"",type:"",orderSort:"",shareSuccess:!1,sort:"",FWHPic:"https://jewel-shop.oss-cn-beijing.aliyuncs.com/f2ba2080aaa54c618c2e47df4f220087.png",mini_program_openid:"",unionid:"",official_account_openid:"",warnMsg:[],goodsData:[],searchName:"",base64:"",categoryIndex:0,windowHeight:0,shopList1:[],picture:"",gateType:"",total:0,customerCategoryList:[]}},onLoad:function(e){void 0!=e.khid&&t.redirectTo({url:"/package1/index/oneGoodsShare?khid="+e.khid});var i=this;this.type=t.getStorageSync("type"),t.getSystemInfo({success:function(t){i.windowHeight=t.windowHeight}}),this.getCustomerCategoryList()},onShareAppMessage:function(){return this.shareSuccess=!0,t.setStorageSync("noReload",!0),{title:t.getStorageSync("shopName")+"给您推荐的商品",imageUrl:this.picture,path:"/package1/index/oneGoodsShare?khid="+this.khid+"&userId="+this.khName.userId+"&mini_program_openid="+this.khName.mini_program_openid+"&unionid="+this.khName.unionid+"&official_account_openid="+this.khName.official_account_openid+"&customId="+this.khName.id}},onReachBottom:function(){this.pageNum>=this.pages||(this.pageNum++,"search"==this.gateType?this.getShareList("search"):this.getShareList())},onShow:function(){var e=this;console.log("shopList",this.khName),this.shopId=t.getStorageSync("shopId"),1==t.getStorageSync("noReload")?(this.searchName="",t.removeStorageSync("noReload")):(this.searchName="",this.getGategoryList()),this.shareSuccess&&(!t.getStorageSync("khName")||null!=this.khName.officialAccountOpenid&&""!=this.khName.officialAccountOpenid&&"null"!=this.khName.officialAccountOpenid&&void 0!=this.khName.officialAccountOpenid||(t.showModal({title:"提示",content:"该客户没有关注公众号,无法接收消息通知,是否邀请用户关注?",success:function(i){i.confirm&&t.previewImage({urls:[e.FWHPic]})}}),t.removeStorageSync("khName")),this.shareSuccess=!1),this.getWarnMsg(),this.getweiruku()},methods:{upNew:function(){var t=this;this.tui.request("/social/wechat/sendWechatTempMessage","post",{tempId:"M45X8AmPi58c16M9YVTMEOhwEVEa9s5md-6i3TwjpRQ",title:"店铺上新",content:JSON.stringify({thing3:"炘钱的店铺上新",time2:"2024-12-25"}),pagePath:"package1/index/downStearmList",upNewType:1,userId:"1739537305905008640",categoryId:""},!1,!1).then((function(e){t.status="nomore",200==e.code||t.tui.toast(e.message)})).catch((function(t){}))},getToken:function(){t.login({provider:"weixin",success:function(t){console.log(t.code),this.getOpenId(t.code)}})},getOpenId:function(t){var e=this;this.tui.request("","post",{appid:"wx6d7d4fb58d1502db",secret:"3a2c8cd00926764bbd12fd7361e01f1d",js_code:t,grant_type:"authorization_code",customId:""},!1,!1).then((function(t){e.status="nomore",200==t.code||e.tui.toast(t.message)})).catch((function(t){}))},goPopleList:function(){t.navigateTo({url:"/package1/index/peopleList?popleType=khName"})},getCustomerCategoryList:function(){var e=this;this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId","POST",{shopId:t.getStorageSync("shopId")},!1,!0).then((function(t){if(200==t.code)if(t.result.length>0){e.customerCategoryList=t.result;for(var i=0;i<e.customerCategoryList.length;i++){var s={categoryName:e.customerCategoryList[i].categoryName,categoryId:e.customerCategoryList[i].id,categoryPrice:""};e.customerCategoryList[i]=s}}else e.customerCategoryList=null;else e.tui.toast(t.message)})).catch((function(t){}))},getUserData:function(){var e=this,i=this;null!=this.goodsData.productPicture&&""!=this.goodsData.productPicture?(t.setStorageSync("noReload",!0),this.tui.request("/order/ow/getWechatQrcode","post",{page:"package1/index/downStearmList",scene:this.khid,envVersion:__wxConfig.envVersion},!1,!0).then((function(s){if(200==s.code){var o=s.result;t.downloadFile({url:o,success:function(s){e.base64=s.tempFilePath,t.showLoading({title:"请求中..."}),setTimeout((function(e){t.hideLoading(),i.getData()}),500)}})}else e.tui.toast(res.message)})).catch((function(t){console.log("报错",t)}))):this.tui.toast("暂无可展示的图片",300)},getData:function(){var e=this;t.showLoading({title:"生成中..."}),this.canvasshow=!0;var i=t.createCanvasContext("myCanvas",this),s=this.goodsData.productPicture;t.getImageInfo({src:s,success:function(s){console.log(s.width),console.log(s.height),e.canvasWidth=s.width,(s.height+200)/s.width>2?(e.canvasHeight=2*s.width,s.height=.8*e.canvasHeight):e.canvasHeight=s.height/.8,console.log(e.canvasWidth),console.log(e.canvasHeight),i.setFillStyle("#fff"),i.fillRect(0,0,e.canvasWidth,e.canvasHeight),i.drawImage(s.path,0,0,s.width,s.height),i.draw(),i.drawImage(e.base64,25,.8*e.canvasHeight+.2*e.canvasHeight*.15,.2*e.canvasHeight*.75,.2*e.canvasHeight*.75),i.draw(!0),i.font="20px 宋体";var o=.2*e.canvasHeight*.75;i.setFontSize((o/6).toFixed(0)),i.fillStyle="#FF5809",i.fillText(t.getStorageSync("shopName"),.2*e.canvasHeight*.75+35,.8*e.canvasHeight+.2*e.canvasHeight*.47),i.setFontSize((o/7).toFixed(0)),i.fillStyle="#000",i.fillText("长按识别查看商品",.2*e.canvasHeight*.75+35,.8*e.canvasHeight+.2*e.canvasHeight*.47+Number((o/5).toFixed(0))),i.draw(!0,function(){setTimeout((function(i){t.canvasToTempFilePath({x:0,y:0,width:e.canvasWidth,height:e.canvasHeight,destWidth:e.canvasWidth,destHeight:e.canvasHeight,canvasId:"myCanvas",success:function(i){e.canvasshow=!1,e.tempFilePath=i.tempFilePath,t.previewImage({urls:[i.tempFilePath]}),t.hideLoading()}})}),500)}())}})},lunbochange:function(t){this.current=t.detail.current},goodsListSort:function(){this.pageNum=1,this.shopList1=[],this.shopList=[],this.sort="stockCount",""==this.orderSort?this.orderSort="asc":"asc"==this.orderSort?this.orderSort="desc":"desc"==this.orderSort&&(this.orderSort="asc"),this.getShareList()},largeImg:function(t){if(null==t.productPicture&&null==t.productPictures||""==t.productPicture&&null==t.productPictures)this.tui.toast("暂无可展示的图片",300);else{if(this.bigImg=[],null!=t.productPicture){var e={productPicture:t.productPicture};this.bigImg.push(e)}if(null!=t.productPictures)for(var i=0;i<t.productPictures.length;i++)this.bigImg.push(t.productPictures[i]);this.$refs.imgPopup.open()}},checkPay:function(e,i){var s=this,o={id:"3"==e?i.categoryId:"",name:"3"==e?i.categoryName:"",userId:this.khName.userId,customId:this.khName.id,mini_program_openid:this.khName.mini_program_openid,unionid:this.khName.unionid,official_account_openid:this.khName.official_account_openid};this.tui.request("/app/productShare/save","POST",{shareType:"2",shareProductId:[this.goodsData.id],priceType:e,scene:JSON.stringify(o)},!1,!0).then((function(t){200==t.code?s.khid=t.result.id+"-":s.tui.toast(t.message)})).catch((function(t){})),this.checkPayData=e,this.$refs.sharePriceDialog.close(),""!=this.khName&&t.setStorageSync("khName",this.khName),this.khName="",this.$refs.sharePopup.open("bottom")},seeStockCount:function(t,e){this.zheng=t,this.fu=e,this.$refs.showPopup.open()},getGategoryList:function(){var t=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(e){if(200==e.code){t.indexList=e.result;for(var i=0;i<t.indexList.length;i++)i==t.categoryIndex?t.indexList[i].parentId=!0:t.indexList[i].parentId=!1;t.categoryId=t.indexList[t.categoryIndex].id,t.pageNum=1,t.searchName="",t.shopList1=[],t.shopList=[],t.getShareList()}else t.tui.toast(e.message)})).catch((function(t){}))},getWarnMsg:function(){var t=this;this.tui.request("/app/stock/getShopStock","POST",{},!1,!1).then((function(e){200==e.code?t.warnMsg=e.result:t.tui.toast(e.message)})).catch((function(t){}))},clickLeftBtn:function(e){t.removeStorageSync("noReload");for(var i=0;i<this.indexList.length;i++)this.indexList[i].parentId=i==e;this.categoryIndex=e,this.categoryId=this.indexList[e].id,this.pageNum=1,this.searchName="",this.orderSort="",this.sort="",this.shopList1=[],this.shopList=[],this.getShareList()},goRuku:function(){t.navigateTo({url:"/package1/index/waitStorage?inStorageStatus=0"})},getweiruku:function(){var t=this;this.tui.request("/app/purchase/list","POST",{inStorageStatus:0},!1,!1).then((function(e){t.status="nomore",200==e.code?t.total=e.result.total:t.tui.toast(e.message)}))},goDetail:function(e){t.setStorageSync("noReload",!0),t.navigateTo({url:"/package1/inventory/inventoryDetail?item="+JSON.stringify(e)})},goWarnList:function(){t.navigateTo({url:"/package1/inventory/inventoryWarn"})},clickModel:function(t){"num"?this.tui.toast("商品规格库存数为负数,则该规格库存数不计入库存总数中"):this.tui.toast("商品规格库存数为负数,则该规格的库存成本不计入总库存成本")},seeCustomCategory:function(t){null==t||""==t?this.tui.toast("暂无客户分类价格",300):(this.customerCategoryList=JSON.parse(t),Array.isArray(this.customerCategoryList)?this.$refs.customPopup.open():this.tui.toast("暂无客户分类价格",300))},getShareList:function(e){var i=this;t.showLoading({title:"加载中...",mask:!0});var s={};"search"==e?(this.gateType="search",s={categoryId:"",searchStr:this.searchName,pageNum:this.pageNum,pageSize:"10",sort:"",order:""}):(this.gateType="",s={categoryId:this.categoryId,searchStr:this.searchName,pageNum:this.pageNum,pageSize:"10",sort:this.sort,order:this.orderSort}),this.status="loading",this.tui.request("/app/product/getShareList","POST",s,!1,!1).then((function(t){200==t.code?"search"==e?(i.shopList=[],i.status="nomore",1==i.pages?i.shopList1=t.result.records:i.shopList1=[].concat((0,o.default)(i.shopList1),(0,o.default)(t.result.records)),i.pages=t.result.pages):(i.shopList1=[],i.status="nomore",1==i.pages?i.shopList=t.result.records:i.shopList=[].concat((0,o.default)(i.shopList),(0,o.default)(t.result.records)),i.pages=t.result.pages):i.tui.toast(t.message)})).catch((function(t){})),t.hideLoading()},oneShare:function(t){this.goodsData=t,this.picture=null==t.productPicture||""==t.productPicture?"https://jewel-shop.oss-cn-beijing.aliyuncs.com/70c3d9a274ff4feeb6df0bcb8be0f733.jpg":t.productPicture,"1960543009070256129"==this.shopId?this.checkPay("1"):this.$refs.sharePriceDialog.open()},upDown:function(e,i){var s=this,o="确定将此款商品"+(0==e?"下架":"上架")+"吗?";t.showModal({title:"提示",content:o,success:function(t){t.confirm&&(s.pageNum=1,s.searchName="",s.shopList1=[],s.shopList=[],0==e?s.tui.request("/app/product/down","POST",{id:i.id},!1,!0).then((function(t){200==t.code?s.tui.toast("下架成功"):s.tui.toast(t.message),s.categoryId=i.categoryId,s.getShareList()})).catch((function(t){})):s.tui.request("/app/product/up","POST",{id:i.id},!1,!0).then((function(t){200==t.code?s.tui.toast("上架成功"):s.tui.toast(t.message),s.categoryId=i.categoryId,s.getShareList()})).catch((function(t){})))}})},search:function(t){""==t?(this.pageNum=1,this.shopList1=[],this.shopList=[],this.searchName="",this.getShareList()):(this.pageNum=1,this.shopList1=[],this.shopList=[],this.searchName=t,this.getShareList("search"))},clearSearch:function(){this.pageNum=1,this.shopList1=[],this.shopList=[],this.orderSort="",this.sort="",this.searchName="",this.getShareList()},onGridClick:function(e){"0"==e?(t.navigateTo({url:"/package1/inventory/gategory"}),this.$refs.payDialog.close()):"1"==e?t.navigateTo({url:"/pages/inventory/addinventory"}):"2"==e?(t.navigateTo({url:"/package1/inventory/addGoods"}),this.$refs.payDialog.close()):"3"==e?this.$refs.payDialog.open("center"):"4"==e?(t.navigateTo({url:"/package1/inventory/batchPrint"}),this.$refs.payDialog.close()):"5"==e?(t.navigateTo({url:"/package1/inventory/goodsDelisting"}),this.$refs.payDialog.close()):"7"==e?(t.navigateTo({url:"/package1/index/labelTemplate"}),this.$refs.payDialog.close()):(t.navigateTo({url:"/package1/inventory/goodsDelete"}),this.$refs.payDialog.close())}}};e.default=n}).call(this,i("df3c")["default"])},cdfd:function(t,e,i){"use strict";i.r(e);var s=i("bdd7"),o=i.n(s);for(var a in s)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(a);e["default"]=o.a},dafb:function(t,e,i){"use strict";var s=i("a828"),o=i.n(s);o.a}},[["15c1","common/runtime","common/vendor"]]]);