|
@@ -3,7 +3,7 @@ $(function () {
|
|
|
openWebSocket();
|
|
|
queryAssistantInfo();
|
|
|
|
|
|
-
|
|
|
+ vm.queryGoods();
|
|
|
});
|
|
|
|
|
|
window.onbeforeunload = function(){
|
|
@@ -482,9 +482,15 @@ function calculateGoodsByZhjsp(r){
|
|
|
});
|
|
|
}
|
|
|
console.log(vm.compareCombinationPrice);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+const delay = (function () {
|
|
|
+ let timer = 0;
|
|
|
+ return function (callback, ms) {
|
|
|
+ clearTimeout(timer);
|
|
|
+ timer = setTimeout(callback.ms)
|
|
|
+ }
|
|
|
+});
|
|
|
|
|
|
let vm = new Vue({
|
|
|
el: '#rrapp',
|
|
@@ -567,23 +573,64 @@ let vm = new Vue({
|
|
|
// 支付码
|
|
|
parCode : "",
|
|
|
// 总件数
|
|
|
- totalCount:0
|
|
|
+ totalCount:0,
|
|
|
+
|
|
|
+ searchGoodsList: [],
|
|
|
+ timer: null,
|
|
|
+ searchGoods: []
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ prodBarcode (){
|
|
|
+ if(vm.timer){
|
|
|
+ clearTimeout(vm.timer);
|
|
|
+ }
|
|
|
+ if(!vm.prodBarcode){
|
|
|
+ this.searchGoodsList = [];
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ vm.timer = null;
|
|
|
+ vm.timer = setTimeout(() => {
|
|
|
+ vm.queryGoods();
|
|
|
+ }, 1000*15);
|
|
|
+
|
|
|
+ let result = [];
|
|
|
+ for(let i=0; i<vm.searchGoods.length; i++){
|
|
|
+ if(vm.searchGoods[i].name.indexOf(vm.prodBarcode) > -1){
|
|
|
+ if(result.length <= 9){
|
|
|
+ result.push(vm.searchGoods[i]);
|
|
|
+ }else{
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vm.searchGoodsList = result;
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
myDebounce:debounce(function(){
|
|
|
-
|
|
|
-
|
|
|
toPayOrder();
|
|
|
},2000),
|
|
|
|
|
|
+ queryGoods: function(){
|
|
|
+ $.get("../goods/queryGoodsName?goodsName=", function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ vm.searchGoods = r.goodsList;
|
|
|
+ } else {
|
|
|
+ alert(r.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ searchQuery: function (prodBarcode){
|
|
|
+ vm.prodBarcode = prodBarcode;
|
|
|
+ vm.query();
|
|
|
+ },
|
|
|
queryOrderStatus:function(){
|
|
|
$.get("../order/queryOrderStatus/"+vm.orderSn, function (r) {
|
|
|
alert(r.msg);
|
|
|
});
|
|
|
},
|
|
|
query: function () {
|
|
|
- vm.storeId = sessionStorage.getItem("storeId");;
|
|
|
+ vm.storeId = sessionStorage.getItem("storeId");
|
|
|
var thisGoods = {};
|
|
|
var overflowLi = this.$refs.overflowLi;
|
|
|
$.get("../goods/details/"+vm.prodBarcode+"/"+vm.storeId, function (r) {
|
|
@@ -1291,7 +1338,7 @@ function parsedate(value){
|
|
|
}
|
|
|
|
|
|
function getPrintContentOrder(ticket) {
|
|
|
- var content = "<div style=\"width: 250px;font-family: 微软雅黑;font-size: 8px;\">";
|
|
|
+ var content = "<div style=\"width: 300px;font-family: 微软雅黑;font-size: 8px;\">";
|
|
|
// 打印ogo
|
|
|
content += "<div style=\"text-align: center;width: 100%;height: 260px;\">";
|
|
|
content += "<img src='/statics/img/cw_logo2.png' style='width: 100%;height: 100%;' />";
|