| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-stock-stockin"],{1003:function(t,e,a){var s=a("38e4");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var o=a("4f06").default;o("61cb5852",s,!0,{sourceMap:!1,shadowMode:!1})},"38e4":function(t,e,a){var s=a("24fb");e=s(!1),e.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-53f6d538]{display:none}\r\n/* 收银台相关 */uni-text[data-v-53f6d538],\r\nuni-view[data-v-53f6d538]{font-size:.14rem}body[data-v-53f6d538]{min-width:1200px;overflow-x:unset!important;overflow-y:hidden;background:#eff0f4}body[data-v-53f6d538]::-webkit-scrollbar{width:.06rem;height:.06rem}body[data-v-53f6d538]::-webkit-scrollbar-button{display:none}body[data-v-53f6d538]::-webkit-scrollbar-thumb{border-radius:.06rem;box-shadow:inset 0 0 .06rem rgba(45,43,43,.45);background-color:#ddd}body[data-v-53f6d538]::-webkit-scrollbar-track{background-color:initial}uni-radio[data-v-53f6d538]{-webkit-transform:scale(.8);transform:scale(.8)}uni-checkbox[data-v-53f6d538]{-webkit-transform:scale(.8);transform:scale(.8)}.content-wrap[data-v-53f6d538]{position:relative;padding:.15rem;background-color:#fff;min-height:100vh;box-sizing:border-box}.content-wrap .title[data-v-53f6d538]{font-size:.18rem;margin-bottom:.2rem;text-align:center}.content-wrap .table-wrap[data-v-53f6d538]{position:relative;margin-top:%?40?%;border:%?1?% solid #ccc}.content-wrap .table-wrap .table-head[data-v-53f6d538]{background-color:#f7f7f7}.content-wrap .table-wrap .table-body[data-v-53f6d538]{overflow:auto;max-height:6rem}.content-wrap .table-wrap .table-body .table-tr[data-v-53f6d538]:nth-child(1){position:absolute;left:0;right:0;background:#fff;z-index:2}.content-wrap .table-wrap .table-body .table-tr[data-v-53f6d538]:nth-child(2){margin-top:.51rem}.content-wrap .table-wrap .table-body .table-tr:last-of-type .table-td[data-v-53f6d538]{border-bottom:0}.content-wrap .table-wrap .table-tr[data-v-53f6d538]{display:flex}.content-wrap .table-wrap .table-th[data-v-53f6d538], .content-wrap .table-wrap .table-td[data-v-53f6d538]{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-53f6d538]:last-of-type, .content-wrap .table-wrap .table-td[data-v-53f6d538]:last-of-type{border-right:0;justify-content:flex-end}.content-wrap .table-wrap .table-th.goods-name[data-v-53f6d538], .content-wrap .table-wrap .table-td.goods-name[data-v-53f6d538]{justify-content:flex-start}.content-wrap .table-wrap .table-th.goods-name uni-image[data-v-53f6d538], .content-wrap .table-wrap .table-td.goods-name uni-image[data-v-53f6d538]{width:.45rem;height:.45rem;flex-shrink:0}.content-wrap .table-wrap .table-th.goods-name .name[data-v-53f6d538], .content-wrap .table-wrap .table-td.goods-name .name[data-v-53f6d538]{margin-left:.1rem}.content-wrap .table-wrap .goods-num[data-v-53f6d538]{border:.01rem solid #eee;height:.35rem;line-height:.35rem;border-radius:.05rem}.content-wrap .table-wrap uni-input[data-v-53f6d538]{font-size:.14rem}.content-wrap .table-wrap .delete[data-v-53f6d538]{margin:0;font-size:.14rem;background-color:#8558fa;color:#fff}.content-wrap .table-wrap .table-empty[data-v-53f6d538]{justify-content:center;padding:.3rem;color:#999}.content-wrap .action-wrap[data-v-53f6d538]{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:.1rem .15rem .2rem;align-items:center;border-top:.01rem solid #ccc}.content-wrap .action-wrap .btn-wrap[data-v-53f6d538]{display:flex;align-items:center;justify-content:center}.content-wrap .action-wrap .btn-wrap uni-button[data-v-53f6d538]{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-53f6d538]{margin-right:.15rem;background-color:#8558fa;color:#fff}.content-wrap .select-goods-input[data-v-53f6d538]{position:relative}.content-wrap .select-goods-input uni-input[data-v-53f6d538]{flex:1;font-size:.14rem}.content-wrap .select-goods-frame[data-v-53f6d538]{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-53f6d538]{padding:%?10?% %?30?%;line-height:1.5;text-align:left}.content-wrap .select-goods-frame .goods-item.select[data-v-53f6d538]{background-color:#8558fa;color:#fff}.content-wrap .select-goods-frame .goods-item-empty[data-v-53f6d538]{padding:%?10?% %?30?%;line-height:1.5;text-align:center}',""]),t.exports=e},5067:function(t,e,a){"use strict";var s=a("1003"),o=a.n(s);o.a},"54ab":function(t,e,a){"use strict";var s;a.d(e,"b",(function(){return o})),a.d(e,"c",(function(){return i})),a.d(e,"a",(function(){return s}));var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("base-page",[a("v-uni-view",{staticClass:"content-wrap",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goodsShow=!1}}},[a("v-uni-view",{staticClass:"title"},[t._v("添加入库单")]),a("v-uni-view",{staticClass:"table-wrap"},[a("v-uni-view",{staticClass:"table-head"},[a("v-uni-view",{staticClass:"table-tr"},[a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"3"}},[t._v("产品名称/规格/编码")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("当前库存")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("单位")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"2"}},[t._v("成本价")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"2"}},[t._v("数量")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("总金额")]),a("v-uni-view",{staticClass:"table-th",staticStyle:{flex:"1"}},[t._v("操作")])],1)],1),a("v-uni-view",{staticClass:"table-body"},[a("v-uni-view",{staticClass:"table-tr"},[a("v-uni-view",{staticClass:"table-td select-goods-input",staticStyle:{flex:"3"},on:{click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.goodsShow=!0}}},[a("v-uni-input",{attrs:{type:"text",placeholder:"请输入产品名称/规格/编码"},on:{confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.getGoodsData.apply(void 0,arguments)}},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),a("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(e,s){return a("v-uni-view",{class:["goods-item",{select:t.selectGoodsId==e.sku_id}],on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.selectGoods(e)}}},[t._v(t._s(e.sku_name))])})),t.goodsList.length?t._e():a("v-uni-view",{staticClass:"goods-item-empty"},[t._v("暂无商品")])],2)],1),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}}),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}}),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}}),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}})],1),t._l(t.goodsList,(function(e,s){return[t.goodsIdArr.includes(e.sku_id)?a("v-uni-view",{key:s+"_0",staticClass:"table-tr"},[a("v-uni-view",{staticClass:"table-td goods-name",staticStyle:{flex:"3"}},[a("v-uni-image",{attrs:{src:t.$util.img(e.sku_image,{size:"small"}),mode:"aspectFill"}}),a("v-uni-text",{staticClass:"name multi-hidden"},[t._v(t._s(e.sku_name))])],1),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(e.real_stock))]),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s(e.unit))]),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}},[a("v-uni-input",{staticClass:"goods-num",attrs:{type:"number",placeholder:"请输入成本价"},on:{input:function(e){arguments[0]=e=t.$handleEvent(e),t.calcTotalData.apply(void 0,arguments)}},model:{value:e.cost_price,callback:function(a){t.$set(e,"cost_price",a)},expression:"item.cost_price"}})],1),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"2"}},[a("v-uni-input",{staticClass:"goods-num",attrs:{type:"number",placeholder:"请输入数量"},on:{input:function(e){arguments[0]=e=t.$handleEvent(e),t.calcTotalData.apply(void 0,arguments)}},model:{value:e.goods_num,callback:function(a){t.$set(e,"goods_num",a)},expression:"item.goods_num"}})],1),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[t._v(t._s((e.goods_num*e.cost_price||0).toFixed(2)))]),a("v-uni-view",{staticClass:"table-td",staticStyle:{flex:"1"}},[a("v-uni-button",{staticClass:"delete",attrs:{type:"default"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.delGoods(e.sku_id)}}},[t._v("删除")])],1)],1):t._e()]})),t.goodsIdArr.length?t._e():a("v-uni-view",{staticClass:"table-tr table-empty"},[t._v("暂无数据,请选择商品数据")])],2)],1),a("v-uni-view",{staticClass:"action-wrap"},[a("v-uni-view",{staticClass:"table-total"},[t._v("合计:共"+t._s(t.totalData.kindsNum)+"种"+t._s(t.totalData.countNum)+"件产品,合计金额"+t._s(t.totalData.price.toFixed(2)))]),a("v-uni-view",{staticClass:"btn-wrap"},[a("v-uni-button",{staticClass:"stockout-btn",attrs:{type:"default"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.stockOutFn.apply(void 0,arguments)}}},[t._v("入库")]),a("v-uni-button",{attrs:{type:"default"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.backFn.apply(void 0,arguments)}}},[t._v("返回")])],1)],1)],1)],1)},i=[]},b06a:function(t,e,a){"use strict";a("4160"),a("caad"),a("c975"),a("a434"),a("acd8"),a("e25e"),a("2532"),a("498a"),a("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s={data:function(){return{name:"",goodsList:[],goodsIdArr:[],selectGoodsId:0,goodsShow:!1,totalData:{kindsNum:0,countNum:0,price:0},isSubmit:!1,scanCode:{code:"",lastTime:0}}},onLoad:function(t){uni.hideTabBar()},onShow:function(){this.getGoodsData(),window.addEventListener("keypress",this.listenerScancode,!0)},onHide:function(){window.removeEventListener("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(e){t.goodsList=[],e.code>=0&&0!=e.data.length?(t.goodsList=e.data,t.selectGoodsId=t.goodsList[0].sku_id):t.$util.showToast({title:e.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 e=!1,a=[];try{this.goodsList.forEach((function(s,o){if(t.goodsIdArr.includes(s.sku_id)){if(!parseInt(s.goods_num||0)){e=!0;var i="请输入"+s.sku_name+"的入库数量";throw t.$util.showToast({title:i}),new Error("end")}var n={};n.goods_num=s.goods_num,n.goods_price=s.cost_price,n.goods_sku_id=s.sku_id,a.push(n)}}))}catch(s){if("end"!=s.message)throw s}return!e&&(!this.isSubmit&&(this.isSubmit=!0,void this.$api.sendRequest({url:"/stock/storeapi/storage/stockin",data:{stock_json:JSON.stringify(a)},success:function(e){t.isSubmit=!1,t.$util.showToast({title:e.message}),e.code>=0&&(setTimeout((function(){t.backFn()}),500),t.resetFn())}})))},backFn:function(){this.$util.redirectTo("/pages/stock/storage")},calcTotalData:function(){var t=this;this.totalData.price=0,this.totalData.countNum=0,this.totalData.kindsNum=0,this.goodsList.forEach((function(e,a){t.goodsIdArr.includes(e.sku_id)&&(t.totalData.price+=parseFloat(e.cost_price)*parseInt(e.goods_num||1),t.totalData.countNum+=parseInt(e.goods_num||0))})),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 e=this,a=function(){e.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&&a():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),a())},getSkuBycode:function(t){var e=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,e.selectGoods(t.data)):e.$util.showToast({title:"未找到该商品!"}):e.$util.showToast({title:t.message})}})}}};e.default=s},bbf1:function(t,e,a){"use strict";a.r(e);var s=a("b06a"),o=a.n(s);for(var i in s)"default"!==i&&function(t){a.d(e,t,(function(){return s[t]}))}(i);e["default"]=o.a},ddad:function(t,e,a){"use strict";a.r(e);var s=a("54ab"),o=a("bbf1");for(var i in o)"default"!==i&&function(t){a.d(e,t,(function(){return o[t]}))}(i);a("5067");var n,d=a("f0c5"),r=Object(d["a"])(o["default"],s["b"],s["c"],!1,null,"53f6d538",null,!1,s["a"],n);e["default"]=r.exports}}]);
|