pages-stock-add_check.0574fd7e.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-stock-add_check"],{"056d":function(t,a,e){var o=e("bd3a");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var s=e("4f06").default;s("ca04a8a2",o,!0,{sourceMap:!1,shadowMode:!1})},5611:function(t,a,e){"use strict";e.d(a,"b",(function(){return o})),e.d(a,"c",(function(){return s})),e.d(a,"a",(function(){}));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.searchGoodsList,(function(a,o){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.searchGoodsList.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,o){return[t.goodsIdArr.includes(a.sku_id)?e("v-uni-view",{key:o+"_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(parseFloat(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)},s=[]},"71db":function(t,a,e){"use strict";e("7a82"),Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0,e("caad"),e("2532"),e("14d9"),e("a434"),e("c975"),e("d3b7"),e("159b"),e("acd8"),e("d9e2"),e("d401"),e("e9c4"),e("498a");var o={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},searchGoodsList:[]}},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()},name:function(){this.getGoodsData()}},methods:{getGoodsData:function(){var t=this;this.$api.sendRequest({url:"/stock/storeapi/manage/getskulist",data:{search:this.name},success:function(a){t.searchGoodsList=[],a.code>=0&&0!=a.data.length?t.searchGoodsList=a.data: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.goodsList.push(t)),this.goodsShow=!1},delGoods:function(t){this.goodsList.splice(this.goodsIdArr.indexOf(t),1),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(o,s){if(t.goodsIdArr.includes(o.sku_id)){if(!parseFloat(o.goods_num||0)){a=!0;var n="请输入"+o.sku_name+"的盘点数量";throw t.$util.showToast({title:n}),new Error("end")}var i={};i.goods_num=o.goods_num,i.goods_sku_id=o.sku_id,e.push(i)}}))}catch(o){if("end"!=o.message)throw o}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:""}},o=t.keyCode||t.which||t.charCode,s=(new Date).getTime();this.scanCode.lastTime>0?s-this.scanCode.lastTime<=100?this.scanCode.code+=String.fromCharCode(o):s-this.scanCode.lastTime>500&&e():this.scanCode.code=String.fromCharCode(o),this.scanCode.lastTime=s,13==o&&(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=o},"89cd":function(t,a,e){"use strict";var o=e("056d"),s=e.n(o);s.a},ac2b:function(t,a,e){"use strict";e.r(a);var o=e("71db"),s=e.n(o);for(var n in o)["default"].indexOf(n)<0&&function(t){e.d(a,t,(function(){return o[t]}))}(n);a["default"]=s.a},bd3a:function(t,a,e){var o=e("24fb");a=o(!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-a37f805a]{display:none}\r\n/* 收银台相关 */uni-text[data-v-a37f805a],\r\nuni-view[data-v-a37f805a]{font-size:.14rem}body[data-v-a37f805a]{min-width:1200px;overflow-x:unset!important;overflow-y:hidden;background:#eff0f4}body[data-v-a37f805a]::-webkit-scrollbar{width:.06rem;height:.06rem}body[data-v-a37f805a]::-webkit-scrollbar-button{display:none}body[data-v-a37f805a]::-webkit-scrollbar-thumb{border-radius:.06rem;box-shadow:inset 0 0 .06rem rgba(45,43,43,.45);background-color:#ddd}body[data-v-a37f805a]::-webkit-scrollbar-track{background-color:initial}.content-wrap[data-v-a37f805a], .content-wrap .table-wrap .table-body[data-v-a37f805a]{height:100%;overflow:auto}.content-wrap[data-v-a37f805a]::-webkit-scrollbar, .content-wrap .table-wrap .table-body[data-v-a37f805a]::-webkit-scrollbar{width:.06rem;height:.06rem}.content-wrap[data-v-a37f805a]::-webkit-scrollbar-button, .content-wrap .table-wrap .table-body[data-v-a37f805a]::-webkit-scrollbar-button{display:none}.content-wrap[data-v-a37f805a]::-webkit-scrollbar-thumb, .content-wrap .table-wrap .table-body[data-v-a37f805a]::-webkit-scrollbar-thumb{border-radius:.06rem;box-shadow:inset 0 0 .06rem rgba(45,43,43,.45);background-color:#ddd}.content-wrap[data-v-a37f805a]::-webkit-scrollbar-track, .content-wrap .table-wrap .table-body[data-v-a37f805a]::-webkit-scrollbar-track{background-color:initial}uni-radio[data-v-a37f805a]{-webkit-transform:scale(.8);transform:scale(.8)}uni-checkbox[data-v-a37f805a]{-webkit-transform:scale(.8);transform:scale(.8)}.content-wrap[data-v-a37f805a]{position:relative;padding:.15rem;background-color:#fff;box-sizing:border-box}.content-wrap .title[data-v-a37f805a]{font-size:.18rem;margin-bottom:.2rem}.content-wrap .table-wrap[data-v-a37f805a]{position:relative;margin-top:%?40?%;border:%?2?% solid #ccc}.content-wrap .table-wrap .table-head[data-v-a37f805a]{background-color:#f7f7f7}.content-wrap .table-wrap .table-body[data-v-a37f805a]{max-height:6rem}.content-wrap .table-wrap .table-body .table-tr[data-v-a37f805a]:nth-child(1){position:absolute;left:0;right:0;background:#fff;z-index:2}.content-wrap .table-wrap .table-body .table-tr[data-v-a37f805a]:nth-child(2){margin-top:.51rem}.content-wrap .table-wrap .table-body .table-tr:last-of-type .table-td[data-v-a37f805a]{border-bottom:0}.content-wrap .table-wrap .table-tr[data-v-a37f805a]{display:flex}.content-wrap .table-wrap .table-th[data-v-a37f805a],\r\n.content-wrap .table-wrap .table-td[data-v-a37f805a]{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-a37f805a]:last-of-type,\r\n.content-wrap .table-wrap .table-td[data-v-a37f805a]:last-of-type{border-right:0;justify-content:flex-end}.content-wrap .table-wrap .table-th.goods-name[data-v-a37f805a],\r\n.content-wrap .table-wrap .table-td.goods-name[data-v-a37f805a]{justify-content:flex-start}.content-wrap .table-wrap .table-th.goods-name uni-image[data-v-a37f805a],\r\n.content-wrap .table-wrap .table-td.goods-name uni-image[data-v-a37f805a]{width:.45rem;height:.45rem;flex-shrink:0}.content-wrap .table-wrap .table-th.goods-name .name[data-v-a37f805a],\r\n.content-wrap .table-wrap .table-td.goods-name .name[data-v-a37f805a]{margin-left:.1rem}.content-wrap .table-wrap .goods-num[data-v-a37f805a]{border:.01rem solid #eee;height:.35rem;line-height:.35rem;border-radius:.05rem}.content-wrap .table-wrap uni-input[data-v-a37f805a]{font-size:.14rem}.content-wrap .table-wrap .delete[data-v-a37f805a]{margin:0;font-size:.14rem;background-color:#8558fa;color:#fff}.content-wrap .table-wrap .table-empty[data-v-a37f805a]{justify-content:center;padding:.3rem;color:#999}.content-wrap .action-wrap[data-v-a37f805a]{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-a37f805a]{display:flex;align-items:center;justify-content:center}.content-wrap .action-wrap .btn-wrap uni-button[data-v-a37f805a]{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-a37f805a]{margin-right:.15rem;background-color:#8558fa;color:#fff}.content-wrap .select-goods-input[data-v-a37f805a]{position:relative}.content-wrap .select-goods-input uni-input[data-v-a37f805a]{flex:1;font-size:.14rem}.content-wrap .select-goods-frame[data-v-a37f805a]{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-a37f805a]{padding:%?10?% %?30?%;line-height:1.5;text-align:left}.content-wrap .select-goods-frame .goods-item.select[data-v-a37f805a]{background-color:#8558fa;color:#fff}.content-wrap .select-goods-frame .goods-item-empty[data-v-a37f805a]{padding:%?10?% %?30?%;line-height:1.5;text-align:center}',""]),t.exports=a},f4fc:function(t,a,e){"use strict";e.r(a);var o=e("5611"),s=e("ac2b");for(var n in s)["default"].indexOf(n)<0&&function(t){e.d(a,t,(function(){return s[t]}))}(n);e("89cd");var i=e("f0c5"),r=Object(i["a"])(s["default"],o["b"],o["c"],!1,null,"a37f805a",null,!1,o["a"],void 0);a["default"]=r.exports}}]);