| 1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesStorehouse/inventory/update"],{3460:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n("644f")),o=a(n("e350")),i=n("7736"),c=n("9c67"),u=n("8dd4");function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e,n,r,o,i,c){try{var u=t[i](c),a=u.value}catch(s){return void n(s)}u.done?e(a):Promise.resolve(a).then(r,o)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function c(t){s(i,r,o,c,u,"next",t)}function u(t){s(i,r,o,c,u,"throw",t)}c(void 0)}))}}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p=function(){n.e("components/plugin/list-cell").then(function(){return resolve(n("1861"))}.bind(null,n)).catch(n.oe)},h={components:{TuiListCell:p},mixins:[o.default],data:function(){var t=this;return{orderSn:null,infoData:null,autoLoad:!1,shopInfo:null,remark:"",pageType:"inventory",columns:[{name:"名称",custom:"icon"},{name:"库存",custom:"stock",width:120,align:"center"},{name:"盘点数",custom:"inventory",color:"warn",width:120,align:"center"},{name:"盈亏数",color:"success",custom:"profit",width:120,align:"center",render:function(e,n){var r=n.row;n.index;return e("text",{},(function(){return t.getSelectItemProfitPrice(r)}))}}]}},onLoad:function(t){var e=t.orderSn;e&&(this.orderSn=e,this.initInfo()),this.getInfo(),this.getMerchantInfo||this.initMerchantInfo()},computed:d({},(0,i.mapGetters)(["getMerchantInfo"])),methods:d(d({},(0,i.mapActions)(["initMerchantInfo"])),{},{initInfo:function(){var t=f(r.default.mark((function t(){var e,n,o,i;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,c.getCheckOrderDetailApi)(this.orderSn);case 3:e=t.sent,n=e.data,this.infoData=n,o=n.remark,i=n.itemInfo,this.remark=o,this.setSelectInfoByType({type:this.pageType,info:i.map((function(t){return d(d({},t),{},{bigNum:Number(t.bigNumStock),smallNum:Number(t.smallNumStock),bigCount:Number(t.bigNum),smallCount:Number(t.smallNum)})}))}),t.next=13;break;case 11:t.prev=11,t.t0=t["catch"](0);case 13:case"end":return t.stop()}}),t,this,[[0,11]])})));function e(){return t.apply(this,arguments)}return e}(),gotoSelectPage:function(){t.navigateTo({url:"/pagesStorehouse/inventory/select",success:function(t){},fail:function(){},complete:function(){}})},getInfo:function(){var t=this;return(0,u.currentShop)().then((function(e){t.shopInfo=e.data,console.log("getInfo",e)})).catch((function(t){}))},getSelectItemProfitPrice:function(t){var e=t.bigCount,n=t.smallCount,r=t.bigNum,o=t.smallNum,i=(t.bigPrice,t.smallPrice,Number(e)-Number(r)),c=Number(n)-Number(o),u="".concat(i,"/").concat(c);return u},saveToDraft:function(){var t=f(r.default.mark((function t(){var e,n,o,i,u;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e=c.savaCheckOrderDraftApi,this.orderSn&&(e=c.updateCheckOrderToDraftApi),n={remark:this.remark},this.orderSn&&(n.orderSn=this.orderSn),o=this.selectList.map((function(t){return{bigNum:t.bigCount,smallNum:t.smallCount,productId:t.id,classId:t.classId,itemId:t.itemId}})),n.itemInfo=JSON.stringify(o),t.next=9,e(n);case 9:i=t.sent,u=i.data.orderSn,this.orderSn=u,this.$msg("保存成功"),t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](0);case 17:case"end":return t.stop()}}),t,this,[[0,15]])})));function e(){return t.apply(this,arguments)}return e}(),confirmPop:function(e){var n=this;t.showModal({title:"提示",content:"确认盘点?",success:function(t){t.confirm&&n.saveCheckOrder(e)}})},saveCheckOrder:function(){var e=f(r.default.mark((function e(n){var o,i;return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,console.log(n),o={remark:this.remark},this.orderSn&&(o.orderSn=this.orderSn),i=this.selectList.map((function(t){return{bigNum:t.bigCount,smallNum:t.smallCount,productId:t.id}})),o.itemInfo=JSON.stringify(i),1!=n){e.next=11;break}return e.next=9,(0,c.checkOrderApi)(o);case 9:e.next=13;break;case 11:return e.next=13,(0,c.updateCheckOrderApi)(o);case 13:this.$msg("盘点成功"),this.resetSelectInfoByType(this.pageType),t.navigateBack({delta:1}),e.next=20;break;case 18:e.prev=18,e.t0=e["catch"](0);case 20:case"end":return e.stop()}}),e,this,[[0,18]])})));function n(t){return e.apply(this,arguments)}return n}()})};e.default=h}).call(this,n("934e")["default"])},"3a1e":function(t,e,n){"use strict";n.r(e);var r=n("865c"),o=n("fd45");for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);n("e1a2");var c,u=n("8261"),a=Object(u["a"])(o["default"],r["b"],r["c"],!1,null,"b9fe31da",null,!1,r["a"],c);e["default"]=a.exports},6995:function(t,e,n){"use strict";(function(t){n("6cdc");r(n("b5e3"));var e=r(n("3a1e"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("934e")["createPage"])},"865c":function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return r}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,t.$util.isEmpty(t.selectList)),r=n?null:t.__map(t.selectList,(function(e,n){var r=t.__get_orig(e),o=t.__map(t.columns,(function(n,r){var o=t.__get_orig(n),i="icon"!=n.custom&&"stock"!=n.custom&&"inventory"!=n.custom&&"profit"==n.custom?t.getSelectItemProfitPrice(e):null;return{$orig:o,m0:i}}));return{$orig:r,l0:o}}));t.$mp.data=Object.assign({},{$root:{g0:n,l1:r}})},i=[]},b08f:function(t,e,n){},e1a2:function(t,e,n){"use strict";var r=n("b08f"),o=n.n(r);o.a},fd45:function(t,e,n){"use strict";n.r(e);var r=n("3460"),o=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e["default"]=o.a}},[["6995","common/runtime","common/vendor"]]]);
|