1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
![]() |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-nongKe-gather-select_warehouse"],{"33a8":function(t,e,o){"use strict";o("7a82");var i=o("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,o("99af");var n=i(o("c7eb")),a=i(o("1da1")),c=(o("fe63"),o("a126")),r=o("ece0"),s=o("f89e"),d={data:function(){return{goodsData:[{name:"商品名称添加",type:1,src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/mingcheng.png"},{name:"扫码入库",type:2,src:"https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/saoma.png"}],product_id:"",editGoodsCode:"",editGoodsName:"",editGoodsPrice:"",editGoodsStore:"",editGoodsShow:!1,mer_id:0,searchGoodsShow:!1,searchGoodsName:"",goods:[],putGoods:{id:"",price:"",stock:""},item:[],addGoodsShow:!1,stype:""}},onLoad:function(t){this.mer_id=t.mer_id,this.stype=2},onShow:function(){},methods:{addGoods:function(t){this.putGoods.id=t.id,this.addGoodsShow=!0,this.item=t},addGoodsopen:function(){var t=this;this.putGoods.id&&(0,r.micro_product_import)(this.putGoods).then((function(e){200==e.status?((0,s.Toast)(e.data.msg),t.addGoodsShow=!1,t.putGoods={}):((0,s.Toast)(e.message),t.addGoodsShow=!1)})).catch((function(e){"已经导入过该商品了"==e?((0,s.Toast)("已经导入过该商品了"),t.addGoodsShow=!1):((0,s.Toast)("导入出错"),t.addGoodsShow=!1)})),this.item=[]},addGoodsclose:function(){this.addGoodsShow=!1},openSearch:function(){},searchGoodsClose:function(){var t=this;return(0,a.default)((0,n.default)().mark((function e(){var o,i,a;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(""!=t.searchGoodsName){e.next=3;break}return e.abrupt("return",(0,s.Toast)("请输入商品名称"));case 3:return o={mer_id:t.mer_id,name:t.searchGoodsName},e.next=6,(0,r.seachBarCodeAPI)(o).catch((function(t){return(0,s.Toast)(t)}));case 6:if(i=e.sent,a=i.data,!(a.list.length<1)){e.next=13;break}return t.searchGoodsShow=!1,(0,s.Toast)("暂无搜索商品,请添加!"),setTimeout((function(){uni.navigateTo({url:"/pages/product/addGoods/index?mer_id=".concat(o.mer_id)})}),2e3),e.abrupt("return");case 13:t.goods=a.list,t.searchGoodsShow=!1;case 15:case"end":return e.stop()}}),e)})))()},editGoodsClose:function(){var t=this;return(0,a.default)((0,n.default)().mark((function e(){var o;return(0,n.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return o={price:t.editGoodsPrice,stock:t.editGoodsStore,id:t.product_id},e.prev=1,e.next=4,(0,c.microEadtProduct)(o);case 4:e.sent,(0,s.Toast)("更新成功"),t.editGoodsShow=!1,e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](1),(0,s.Toast)("更新失败"),t.editGoodsShow=!1;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})))()},navigato:function(t){if(1===t){if(1==this.stype)return void uni.navigateTo({url:"/pages/product/addGoods/index?mer_id=".concat(this.mer_id)});this.searchGoodsShow=!0}else this.scanCode()},scanCode:function(){var t=this;uni.scanCode({scanType:["qrCode","barCode","datamatrix","pdf417"],success:function(e){1==t.stype?uni.navigateTo({url:"/pages/product/addGoods/index?mer_id=".concat(t.mer_id,"&code=").concat(e.result)}):t.seachBarCode(e.result)},fail:function(t){}})},seachBarCode:function(t){var e=this;return(0,a.default)((0,n.default)().mark((function o(){return(0,n.default)().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,(0,r.seachBarCodeAPI)({code:t,mer_id:e.mer_id}).then((function(o){if(o.data){if(o.data.list.length<1)return void uni.navigateTo({url:"/pages/product/addGoods/index?mer_id=".concat(e.mer_id,"&code=").concat(t)});e.goods=o.data.list}else uni.showToast({title:o.message,duration:3e3,icon:"none"})}));case 2:case"end":return o.stop()}}),o)})))()}},onPullDownRefresh:function(){uni.stopPullDownRefresh()}};e.default=d},"3f5a6":function(t,e,o){"use strict";o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return a})),o.d(e,"a",(function(){return i}));var i={uPopup:o("45c0").default,uButton:o("8226").default},n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o
|