| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-stock-add_check"],{"0230":function(t,a,e){var s=e("24fb");a=s(!1),a.push([t.i,'@charset "UTF-8";\r\n/**\r\n * 这里是uni-app内置的常用样式变量\r\n *\r\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\r\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\r\n *\r\n */\r\n/**\r\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\r\n *\r\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\r\n */\r\n/* 颜色变量 */\r\n/* 行为相关颜色 */\r\n/* 文字基本颜色 */\r\n/* 背景颜色 */\r\n/* 边框颜色 */\r\n/* 尺寸变量 */\r\n/* 文字尺寸 */\r\n/* 图片尺寸 */\r\n/* Border Radius */\r\n/* 水平间距 */\r\n/* 垂直间距 */\r\n/* 透明度 */\r\n/* 文章场景相关 */.uni-app--showleftwindow + .uni-tabbar-bottom[data-v-09cb04ba]{display:none}\r\n/* 收银台相关 */uni-text[data-v-09cb04ba],\r\nuni-view[data-v-09cb04ba]{font-size:.14rem}body[data-v-09cb04ba]{min-width:1200px;overflow-x:unset!important;overflow-y:hidden;background:#eff0f4}body[data-v-09cb04ba]::-webkit-scrollbar{width:.06rem;height:.06rem}body[data-v-09cb04ba]::-webkit-scrollbar-button{display:none}body[data-v-09cb04ba]::-webkit-scrollbar-thumb{border-radius:.06rem;box-shadow:inset 0 0 .06rem rgba(45,43,43,.45);background-color:#ddd}body[data-v-09cb04ba]::-webkit-scrollbar-track{background-color:initial}uni-radio[data-v-09cb04ba]{-webkit-transform:scale(.8);transform:scale(.8)}uni-checkbox[data-v-09cb04ba]{-webkit-transform:scale(.8);transform:scale(.8)}.content-wrap[data-v-09cb04ba]{position:relative;padding:.15rem;background-color:#fff;min-height:100vh;box-sizing:border-box}.content-wrap .title[data-v-09cb04ba]{font-size:.18rem;margin-bottom:.2rem}.content-wrap .table-wrap[data-v-09cb04ba]{position:relative;margin-top:%?40?%;border:%?2?% solid #ccc}.content-wrap .table-wrap .table-head[data-v-09cb04ba]{background-color:#f7f7f7}.content-wrap .table-wrap .table-body[data-v-09cb04ba]{overflow:auto;max-height:6rem}.content-wrap .table-wrap .table-body .table-tr[data-v-09cb04ba]:nth-child(1){position:absolute;left:0;right:0;background:#fff;z-index:2}.content-wrap .table-wrap .table-body .table-tr[data-v-09cb04ba]:nth-child(2){margin-top:.51rem}.content-wrap .table-wrap .table-body .table-tr:last-of-type .table-td[data-v-09cb04ba]{border-bottom:0}.content-wrap .table-wrap .table-tr[data-v-09cb04ba]{display:flex}.content-wrap .table-wrap .table-th[data-v-09cb04ba], .content-wrap .table-wrap .table-td[data-v-09cb04ba]{display:flex;align-items:center;justify-content:center;padding:.15rem .3rem;border-bottom:.01rem solid #ccc;border-right:.01rem solid #ccc;text-align:center}.content-wrap .table-wrap .table-th[data-v-09cb04ba]:last-of-type, .content-wrap .table-wrap .table-td[data-v-09cb04ba]:last-of-type{border-right:0;justify-content:flex-end}.content-wrap .table-wrap .table-th.goods-name[data-v-09cb04ba], .content-wrap .table-wrap .table-td.goods-name[data-v-09cb04ba]{justify-content:flex-start}.content-wrap .table-wrap .table-th.goods-name uni-image[data-v-09cb04ba], .content-wrap .table-wrap .table-td.goods-name uni-image[data-v-09cb04ba]{width:.45rem;height:.45rem;flex-shrink:0}.content-wrap .table-wrap .table-th.goods-name .name[data-v-09cb04ba], .content-wrap .table-wrap .table-td.goods-name .name[data-v-09cb04ba]{margin-left:.1rem}.content-wrap .table-wrap .goods-num[data-v-09cb04ba]{border:.01rem solid #eee;height:.35rem;line-height:.35rem;border-radius:.05rem}.content-wrap .table-wrap uni-input[data-v-09cb04ba]{font-size:.14rem}.content-wrap .table-wrap .delete[data-v-09cb04ba]{margin:0;font-size:.14rem;background-color:#8558fa;color:#fff}.content-wrap .table-wrap .table-empty[data-v-09cb04ba]{justify-content:center;padding:.3rem;color:#999}.content-wrap .action-wrap[data-v-09cb04ba]{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:0 .15rem .2rem;align-items:center}.content-wrap .action-wrap .btn-wrap[data-v-09cb04ba]{display:flex;align-items:center;justify-content:center}.content-wrap .action-wrap .btn-wrap uni-button[data-v-09cb04ba]{margin:0;min-width:2.75rem;height:.4rem;line-height:.4rem;font-size:.14rem}.content-wrap .action-wrap .btn-wrap uni-button.stockout-btn[data-v-09cb04ba]{margin-right:.15rem;background-color:#8558fa;color:#fff}.content-wrap .select-goods-input[data-v-09cb04ba]{position:relative}.content-wrap .select-goods-input uni-input[data-v-09cb04ba]{flex:1;font-size:.14rem}.content-wrap .select-goods-frame[data-v-09cb04ba]{position:absolute;z-index:2;padding:.05rem 0;top:.45rem;left:0;width:5rem;height:5rem;background-color:#fff;box-shadow:0 0 %?36?% rgba(0,0,0,.4)}.content-wrap .select-goods-frame .goods-item[data-v-09cb04ba]{padding:%?10?% %?30?%;line-height:1.5;text-align:left}.content-wrap .select-goods-frame .goods-item.select[data-v-09cb04ba]{background-color:#8558fa;color:#fff}.content-wrap .select-goods-frame .goods-item-empty[data-v-09cb04ba]{padding:%?10?% %?30?%;line-height:1.5;text-align:center}',""]),t.exports=a},"71db":function(t,a,e){"use strict";e("4160"),e("caad"),e("c975"),e("a434"),e("e25e"),e("2532"),e("498a"),e("159b"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var s={data:function(){return{name:"",goodsList:[],goodsIdArr:[],selectGoodsId:0,goodsShow:!1,totalData:{kindsNum:0,upNum:0,downNum:0,sameNum:0},isSubmit:!1,scanCode:{code:"",lastTime:0}}},onLoad:function(t){uni.hideTabBar()},onHide:function(){window.removeEventListener("keypress",this.listenerScancode,!0)},onShow:function(){this.getGoodsData(),window.addEventListener("keypress",this.listenerScancode,!0)},watch:{goodsIdArr:function(t){this.calcTotalData()}},methods:{getGoodsData:function(){var t=this;this.$api.sendRequest({url:"/stock/storeapi/manage/getskulist",data:{search:this.name},success:function(a){t.goodsList=[],a.code>=0&&0!=a.data.length?(t.goodsList=a.data,t.selectGoodsId=t.goodsList[0].sku_id):t.$util.showToast({title:a.message})}})},selectGoods:function(t){this.selectGoodsId=t.sku_id,this.goodsIdArr.includes(t.sku_id)||this.goodsIdArr.push(t.sku_id),this.goodsShow=!1},delGoods:function(t){this.goodsIdArr.splice(this.goodsIdArr.indexOf(t),1),this.$forceUpdate()},stockOutFn:function(){var t=this;if(!this.goodsIdArr.length)return this.$util.showToast({title:"请选择盘点数据"}),!1;var a=!1,e=[];try{this.goodsList.forEach((function(s,o){if(t.goodsIdArr.includes(s.sku_id)){if(!parseInt(s.goods_num||0)){a=!0;var n="请输入"+s.sku_name+"的盘点数量";throw t.$util.showToast({title:n}),new Error("end")}var i={};i.goods_num=s.goods_num,i.goods_sku_id=s.sku_id,e.push(i)}}))}catch(s){if("end"!=s.message)throw s}return!a&&(!this.isSubmit&&(this.isSubmit=!0,void this.$api.sendRequest({url:"/stock/storeapi/check/add",data:{stock_json:JSON.stringify(e)},success:function(a){t.isSubmit=!1,t.$util.showToast({title:a.message}),a.code>=0&&(setTimeout((function(){t.backFn()}),500),t.resetFn())}})))},backFn:function(){this.$util.redirectTo("/pages/stock/check")},calcTotalData:function(){var t=this;this.totalData.kindsNum=0,this.totalData.upNum=0,this.totalData.downNum=0,this.totalData.sameNum=0,this.goodsList.forEach((function(a,e){t.goodsIdArr.includes(a.sku_id)&&a.goods_num&&(a.goods_num-a.stock==0?t.totalData.sameNum++:a.goods_num-a.stock>0?t.totalData.upNum++:a.goods_num-a.stock<0&&t.totalData.downNum++)})),this.totalData.kindsNum=this.goodsIdArr.length},resetFn:function(){this.goodsIdArr=[],this.selectGoodsId=this.goodsList[0].sku_id,this.goodsShow=!1,this.totalData.kindsNum=0,this.totalData.countNum=0,this.totalData.price=0},listenerScancode:function(t){var a=this,e=function(){a.scanCode={lastTime:0,code:""}},s=t.keyCode||t.which||t.charCode,o=(new Date).getTime();this.scanCode.lastTime>0?o-this.scanCode.lastTime<=100?this.scanCode.code+=String.fromCharCode(s):o-this.scanCode.lastTime>500&&e():this.scanCode.code=String.fromCharCode(s),this.scanCode.lastTime=o,13==s&&(this.scanCode.code&&this.scanCode.code.length>=8&&this.getSkuBycode(this.scanCode.code),e())},getSkuBycode:function(t){var a=this;this.$api.sendRequest({url:"/cashier/storeapi/goods/skuinfo",data:{sku_no:t.trim()},success:function(t){0==t.code?t.data?(t.data.goods_num=0,a.selectGoods(t.data)):a.$util.showToast({title:"未找到该商品!"}):a.$util.showToast({title:t.message})}})}}};a.default=s},a2b7:function(t,a,e){"use strict";var s;e.d(a,"b",(function(){return o})),e.d(a,"c",(function(){return n})),e.d(a,"a",(function(){return s}));var o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("base-page",[e("v-uni-view",{staticClass:"content-wrap",on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.goodsShow=!1}}},[e("v-uni-view",{staticClass:"title"},[t._v("添加盘点单")]),e("v-uni-view",{staticClass:"table-wrap"},[e("v-uni-view",{staticClass:"table-head"},[e("v-uni-view",{staticClass:"table-tr"},[e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"3"}},[t._v("产品名称/规格/编码")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("当前库存")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("销售库存")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("单位")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"2"}},[t._v("实盘数量")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("盈亏数量")]),e("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("操作")])],1)],1),e("v-uni-view",{staticClass:"table-body"},[e("v-uni-view",{staticClass:"table-tr"},[e("v-uni-view",{staticClass:"table-td select-goods-input",staticStyle:{flex:"3"},on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.goodsShow=!0}}},[e("v-uni-input",{attrs:{type:"text",placeholder:"请输入产品名称/规格/编码"},on:{confirm:function(a){arguments[0]=a=t.$handleEvent(a),t.getGoodsData.apply(void 0,arguments)}},model:{value:t.name,callback:function(a){t.name=a},expression:"name"}}),e("v-uni-scroll-view",{directives:[{name:"show",rawName:"v-show",value:t.goodsShow,expression:"goodsShow"}],staticClass:"select-goods-frame",attrs:{"scroll-y":!0}},[t._l(t.goodsList,(function(a,s){return e("v-uni-view",{class:["goods-item",{select:t.selectGoodsId==a.sku_id}],on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.selectGoods(a)}}},[t._v(t._s(a.sku_name))])})),t.goodsList.length?t._e():e("v-uni-view",{staticClass:"goods-item-empty"},[t._v("暂无商品")])],2)],1),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}}),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}})],1),t._l(t.goodsList,(function(a,s){return[t.goodsIdArr.includes(a.sku_id)?e("v-uni-view",{key:s+"_0",staticClass:"table-tr"},[e("v-uni-view",{staticClass:"table-td goods-name",staticStyle:{flex:"3"}},[e("v-uni-image",{attrs:{src:t.$util.img(a.sku_image,{size:"small"}),mode:"aspectFill"}}),e("v-uni-text",{staticClass:"name multi-hidden"},[t._v(t._s(a.sku_name))])],1),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(a.real_stock))]),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(a.stock))]),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(a.unit))]),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}},[e("v-uni-input",{staticClass:"goods-num",attrs:{type:"number",placeholder:"请输入数量"},on:{input:function(a){arguments[0]=a=t.$handleEvent(a),t.calcTotalData.apply(void 0,arguments)}},model:{value:a.goods_num,callback:function(e){t.$set(a,"goods_num",e)},expression:"item.goods_num"}})],1),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(a.goods_num-a.stock||0))]),e("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[e("v-uni-button",{staticClass:"delete",attrs:{type:"default"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.delGoods(a.sku_id)}}},[t._v("删除")])],1)],1):t._e()]})),t.goodsIdArr.length?t._e():e("v-uni-view",{staticClass:"table-tr table-empty"},[t._v("暂无数据,请选择商品数据")])],2)],1),e("v-uni-view",{staticClass:"action-wrap"},[e("v-uni-view",{staticClass:"table-total"},[t._v("合计:共"+t._s(t.totalData.kindsNum)+"种商品,盘盈:"+t._s(t.totalData.upNum)+"种,盘亏:"+t._s(t.totalData.downNum)+"种,持平:"+t._s(t.totalData.sameNum)+"种")]),e("v-uni-view",{staticClass:"btn-wrap"},[e("v-uni-button",{staticClass:"stockout-btn",attrs:{type:"default"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.stockOutFn.apply(void 0,arguments)}}},[t._v("盘点")]),e("v-uni-button",{attrs:{type:"default"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.backFn.apply(void 0,arguments)}}},[t._v("返回")])],1)],1)],1)],1)},n=[]},a82a:function(t,a,e){var s=e("0230");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var o=e("4f06").default;o("bfdf146e",s,!0,{sourceMap:!1,shadowMode:!1})},ac2b:function(t,a,e){"use strict";e.r(a);var s=e("71db"),o=e.n(s);for(var n in s)"default"!==n&&function(t){e.d(a,t,(function(){return s[t]}))}(n);a["default"]=o.a},cd0f:function(t,a,e){"use strict";var s=e("a82a"),o=e.n(s);o.a},f4fc:function(t,a,e){"use strict";e.r(a);var s=e("a2b7"),o=e("ac2b");for(var n in o)"default"!==n&&function(t){e.d(a,t,(function(){return o[t]}))}(n);e("cd0f");var i,c=e("f0c5"),r=Object(c["a"])(o["default"],s["b"],s["c"],!1,null,"09cb04ba",null,!1,s["a"],i);a["default"]=r.exports}}]);
|