You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
9.0 KiB
1 lines
9.0 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/inventory/batchPrint"],{"061a":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("82ca");n(i("3240"));var a=n(i("430d"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(a.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},3624:function(e,t,i){},"3aca":function(e,t,i){"use strict";(function(e,n){var a=i("47a9"),s=i("3b2d");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(i("7eb4")),c=a(i("af34")),o=a(i("ee10")),u=(a(i("3cc2")),function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!==typeof e)return{default:e};var i=l(t);if(i&&i.has(e))return i.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if("default"!==r&&Object.prototype.hasOwnProperty.call(e,r)){var c=a?Object.getOwnPropertyDescriptor(e,r):null;c&&(c.get||c.set)?Object.defineProperty(n,r,c):n[r]=e[r]}n.default=e,i&&i.set(e,n);return n}(i("b37f"))),d=a(i("ec9a"));function l(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(l=function(e){return e?i:t})(e)}var h={data:function(){return{indexList:[],pageNum:1,shopList:[],goodsList:[],categoryId:"",searchName:"",id:"",carList:[],type:"",bufferData:[],typeList:[{value:"0",text:"打印长票"},{value:"1",text:"打印短票"}],printingMethod:"0",checkPayData:"",data:{},height:0,list:[{type:"供应商",checked:!1},{type:"货号",checked:!1},{type:"零售价",checked:!1},{type:"批发价",checked:!1}],multipleList:[],purchase:"",shopId:""}},components:{kkPrinter:function(){Promise.all([i.e("common/vendor"),i.e("components/kk-printer/index")]).then(function(){return resolve(i("6e81"))}.bind(null,i)).catch(i.oe)}},onHide:function(){setTimeout((function(t){e.closeBLEConnection({deviceId:e.getStorageSync("deviceId"),success:function(e){},fail:function(e){}})}),5e3)},onLoad:function(t){n.openBluetoothAdapter({mode:"central"}),this.height=n.getSystemInfoSync().windowHeight,this.shopId=e.getStorageSync("shopId"),void 0!=t.khid?e.redirectTo({url:"/package1/index/downStearmList?khid="+t.khid}):t.purchase?(this.purchase=JSON.parse(t.purchase),this.goodsList=JSON.parse(t.purchaseDetails)):(this.type=e.getStorageSync("type"),this.getGategoryList())},methods:{backPage:function(){e.navigateBack()},getGategoryList:function(){var e=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(t){if(200==t.code){e.indexList=t.result;for(var i=0;i<e.indexList.length;i++)e.indexList[i].parentId=0==i;e.categoryId=e.indexList[0].id,e.pageNum=1,e.searchName="",e.shopList1=[],e.shopList=[],e.getShareList()}else e.tui.toast(t.message)})).catch((function(e){}))},getShareList:function(e){var t=this;return(0,o.default)(r.default.mark((function e(){return r.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t,t.goodsList=[],e.next=4,t.tui.request("/app/product/getShareList","POST",{categoryId:""==t.searchName?t.categoryId:"",searchStr:t.searchName,pageNum:t.pageNum,pageSize:"25"},!1,!1).then((function(e){if(200==e.code){for(var i=0;i<e.result.records.length;i++)""!=e.result.records&&(e.result.records[i].checked=!1);t.$nextTick((function(){t.status="nomore",1==t.pages?t.goodsList=e.result.records:t.goodsList=[].concat((0,c.default)(t.goodsList),(0,c.default)(e.result.records)),t.pages=e.result.pages}))}else t.tui.toast(e.message)})).catch((function(e){}));case 4:return e.next=6,t.getCheck();case 6:case"end":return e.stop()}}),e)})))()},getCheck:function(){if(""!=this.carList)for(var e=0;e<this.carList.length;e++)for(var t=0;t<this.goodsList.length;t++)this.carList[e].id==this.goodsList[t].id&&(this.goodsList[t].checked=!0);this.$forceUpdate()},search:function(e){this.searchName=e.value,this.getGategoryList()},clickMask:function(){e.showToast({title:"请将商品上架或入库后再操作!",icon:"none"})},clickLeftBtn:function(e){for(var t=0;t<this.indexList.length;t++)this.indexList[t].parentId=t==e;this.categoryId=this.indexList[e].id,this.pageNum=1,this.searchName="",this.goodsList=[],this.getShareList(this.indexList[e].id)},goInvPrint:function(e){if(e.checked=!e.checked,""==this.carList)this.carList.push(e);else for(var t=0;t<this.carList.length;t++){if(this.carList[t].productName==e.productName)return void this.carList.splice(t,1);if(t+1==this.carList.length)return void this.carList.push(e)}},checkboxChange:function(e){console.log(this.carList),e.checked=!e.checked,-1!=this.carList.indexOf(e.id)?this.carList.splice(this.carList.indexOf(e.id),1):this.carList.push(e)},clickPrint:function(){this.$refs.payDialog.open("center")},checkPay:function(e){var t=this;this.data.priceType=e,this.tui.request("/app/productShare/save","POST",this.data,!1,!0).then((function(e){200==e.code?t.khid=e.result.id:t.tui.toast(e.message)})).catch((function(e){})),this.checkPayData=e,this.$refs.payDialog.close(),this.$refs.share.open()},addMultipleType:function(e){if(e.checked=!e.checked,""==this.multipleList)this.multipleList.push(e.type);else for(var t=0;t<this.multipleList.length;t++){if(this.multipleList[t]==e.type)return void this.multipleList.splice(t,1);if(t+1==this.multipleList.length)return void this.multipleList.push(e.type)}},goPrint:function(){e.setStorageSync("small",!0);for(var t=this,i=0;i<t.carList.length;i++){var n=t.carList[i];if(t.yNum=10,"0"==this.printingMethod){var a=u.CreatCPCLPage(320,480,1,0);-1!=this.multipleList.indexOf("供应商")&&(a+=u.addCPCLSETMAG(2,2),a+=u.addCPCLLocation(2),a+=u.addCPCLSETBOLD("400"),a+=u.addCPCLText("0",t.yNum+=10,"24","0",0,""!=this.purchase?this.purchase.supplierName:n.supplierName)),a+=u.addCPCLSETMAG(1,1),a+=u.addCPCLLocation(0),a+=u.addCPCLSETBOLD("0"),a+=u.addCPCLText("20",t.yNum+=70,"24","0",0,"品名: "+(null==n.productName?"":n.productName)),-1!=this.multipleList.indexOf("货号")&&(a+=u.addCPCLText("20",t.yNum+=50,"24","0",0,"货号: "+n.productSn)),-1!=this.multipleList.indexOf("批发价")&&(a+=u.addCPCLText("20",t.yNum+=50,"24","0",0,"批发价: "+n.wholesalePrice)),-1!=this.multipleList.indexOf("零售价")&&(a+=u.addCPCLText("20",t.yNum+=50,"24","0",0,"零售价: "+(n.lsprice||n.price))),a+=u.addCPCLLocation(2),a+=u.addCPCLQRCode(0,t.yNum+=70,"H","1",4,[""!=this.purchase?d.default.encode(n.productId):d.default.encode(n.id),d.default.encode(this.shopId)]),a+=u.addCPCLLocation(0),a+=u.addCPCLPrint(),this.bufferData.push(a)}else{var s=u.CreatCPCLPage(410,320,1,0);-1!=this.multipleList.indexOf("供应商")&&(s+=u.addCPCLSETMAG(2,2),s+=u.addCPCLLocation(2),s+=u.addCPCLSETBOLD("400"),s+=u.addCPCLText("0",t.yNum+=10,"24","0",0,""!=this.purchase?this.purchase.supplierName:n.supplierName)),s+=u.addCPCLSETMAG(1,1),s+=u.addCPCLLocation(0),s+=u.addCPCLSETBOLD("0"),s+=u.addCPCLText("30",t.yNum+=60,"24","0",0,"商品名:"+(null==n.productName?"":n.productName)),s+=u.addCPCLSETMAG(2,2),-1!=this.multipleList.indexOf("货号")&&(s+=u.addCPCLText("30",t.yNum+=40,"24","0",0,"货号:"+n.productSn)),s+=u.addCPCLSETMAG(1,1),-1!=this.multipleList.indexOf("批发价")&&(s+=u.addCPCLText("30",t.yNum+=50,"24","0",0,"批发价:"+n.wholesalePrice)),-1!=this.multipleList.indexOf("零售价")&&(s+=u.addCPCLText("30",t.yNum+=50,"24","0",0,"零售价:"+(n.lsprice||n.price))),s+=u.addCPCLQRCode(240,160,"H","1",4,[""!=this.purchase?d.default.encode(n.productId):d.default.encode(n.id),d.default.encode(e.getStorageSync("shopId").substring("10","12"))]),s+=u.addCPCLLocation(0),s+=u.addCPCLPrint(),this.bufferData.push(s)}}t.$nextTick((function(){t.$refs.payDialog.close(),t.bufferData=[],e.navigateBack({delta:1})}))}}};t.default=h}).call(this,i("df3c")["default"],i("3223")["default"])},"430d":function(e,t,i){"use strict";i.r(t);var n=i("7c48"),a=i("cd12");for(var s in a)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(s);i("d825");var r=i("828b"),c=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=c.exports},"7c48":function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){return n}));var n={uniIcons:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(i.bind(null,"d3ec"))},uLoadmore:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-loadmore/u-loadmore")]).then(i.bind(null,"bad7"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"4d18"))},uniFormsItem:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item")]).then(i.bind(null,"ac84"))},uniDataSelect:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(i.bind(null,"c807"))}},a=function(){var e=this.$createElement;this._self._c},s=[]},cd12:function(e,t,i){"use strict";i.r(t);var n=i("3aca"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(s);t["default"]=a.a},d825:function(e,t,i){"use strict";var n=i("3624"),a=i.n(n);a.a}},[["061a","common/runtime","common/vendor"]]]);
|