diff --git a/pages/.DS_Store b/pages/.DS_Store index 0975784..d13ddaa 100644 Binary files a/pages/.DS_Store and b/pages/.DS_Store differ diff --git a/pages/billing/.DS_Store b/pages/billing/.DS_Store index f411168..9e04d90 100644 Binary files a/pages/billing/.DS_Store and b/pages/billing/.DS_Store differ diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue index a038b85..ea6d4e0 100644 --- a/pages/billing/addUser.vue +++ b/pages/billing/addUser.vue @@ -2,15 +2,26 @@ @@ -40,9 +52,12 @@ } from 'vuex'; export default { data() { - return { + return { + showPrice:false, + keyboardNum:'', userInfo: '', - show: false, + show: false, + goodsNum:'', delShow: false, addressObj: {}, type: '', @@ -54,7 +69,8 @@ address: '', province: '', city: '', - area: '' + area: '', + noEarn:"" }, // 单选数据源 sexs: [{ @@ -131,19 +147,22 @@ }, methods: { //获取手机通讯录 - getUserPhone() { - + getUserPhone() { let that = this; wx.chooseContact({ success: function(res) { - that.formData.consigneeMobile = res.phoneNumber that.formData.consigneeName = res.displayName }, - fail(res) { - - } + fail(res) {} }) + }, + keyboardConfirm(){ + if(this.keyboardNum != ''){ + this.formData.noEarn = this.keyboardNum + } + this.showPrice = false + this.keyboardNum = '' }, del() { this.delShow = true; @@ -189,6 +208,20 @@ }, nameBlur() { this.formData.username = this.formData.phone; + }, + keyCancel(){ + this.showFu = false + this.showPrice = false + this.keyboardNum = '' + }, + // 按键被点击(点击退格键不会触发此事件) + valChange(val) { + // 将每次按键的值拼接到value变量中,注意+=写法 + this.keyboardNum += val + }, + // 退格键被点击 + backspace(val) { + this.keyboardNum = val }, authVerification() { uni.getSetting({ @@ -223,12 +256,9 @@ uni.chooseLocation({ latitude:'38.335974', longitude:'116.805783', - success: function(res) { - console.log('11111',res) - if (res.name != '') { - - let aaa = getArea(res.address) - console.log('2222',aaa) + success: function(res) { + if (res.name != '') { + let aaa = getArea(res.address) that.formData.province = aaa.province that.formData.city = aaa.city that.formData.area = aaa.country @@ -285,7 +315,8 @@ province: this.formData.province, city: this.formData.city, area: this.formData.area, - userName: this.formData.consigneeMobile + userName: this.formData.consigneeMobile, + amountOwed:this.formData.noEarn }, false, true).then((res) => { if (res.code == 200) { uni.showToast({ @@ -402,5 +433,8 @@ background: #088FEB; color: #fff; border-radius: 0; + } + .qichu{ + margin-bottom: 0; } \ No newline at end of file diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 07706e2..75909ec 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -1,85 +1,84 @@ @@ -251,26 +269,31 @@ focus:false, pageNum: 1, //分页的页码 shopList: [], - shopList1:[], - info: 0, + shopList1:[], + show:false, categoryId: '', //分类id searchName: '', //搜索框输入值 shopId: '', //店铺id, checkbox: [], //需要分享的商品id temporaryNum: 0, allChangeNum:0, + defaultText:0, oneGoodsSpec:[], goodsDetail: [], - attrNameList: [], + attrNameList: [], + keyboard:'', + oneGoodsName:'', temporaryList: [], isPlusAndMinus:false, carList: [], attributeList: [], - purchasePrice: 0, + purchasePrice: 0, + keyboardIndex:'', zPrice: 0, zNum: 0, goodsNum:'', - storageType: '', + storageType: '', + keyboardNum:"", carNum: 0, carType: 0, type: '', @@ -278,6 +301,7 @@ productNum:null, height:0, pecsList:[], + // status: 'loadmore', pageOldTemList:[], oldTemList:[], goodsList:[], @@ -295,22 +319,15 @@ if (typeof(val) == 'string') { let newObj = JSON.parse(val) for (let as in newObj) { - name += newObj[as] + '/' + name += newObj[as] + ' | ' } } return name; - }, - maxNum(val) { - if (val >= 10) { - return 10 - } else if (val < 0) { - return 0 - } } }, onReachBottom() { if (this.pageNum >= this.pages) return; - this.status = 'loading'; + // this.status = 'loading'; this.pageNum ++; this.getShareList(); }, @@ -340,21 +357,19 @@ } }).catch((res) => {}) }, - combination(arr) { - let result = [ - [] - ] - - arr.map(x => { - var res = [] - result.map(y => { - x.specs.map(z => { - res.push([...y, z]) - }) - }) - result = res - }) - return result; + // 按键被点击(点击退格键不会触发此事件) + valChange(val) { + // 将每次按键的值拼接到value变量中,注意+=写法 + this.keyboardNum += val + if(this.keyboard == 'goodsNum'){ + this.goodsNum = this.keyboardNum + } + }, + // 退格键被点击 + backspace(val) { + this.keyboardNum = val + this.goodsNum = val + console.log(val) }, //保存已选 saveCheck(){ @@ -367,49 +382,17 @@ } }, chenumChange(e,index,index1){ - console.log('1111',this.linshiPrice) - - if(this.linshiPrice == e.target.value){ - this.carList[index].saleDetailQueryDTO[index1].productCount = Number(e.target.value) - }else{ - console.log('buxiangdeng',e.detail.value) - if(e.detail.value == ''){ - this.carList[index].saleDetailQueryDTO[index1].productCount = this.linshiPrice - }else if(e.detail.value == 0){ - this.carList[index].saleDetailQueryDTO[index1].productCount = 0 - }else{ - this.carList[index].saleDetailQueryDTO[index1].productCount = Number(e.detail.value); - } - this.$forceUpdate() - } + this.carList[index].saleDetailQueryDTO[index1].productCount = e + this.$forceUpdate() this.carChange() }, numChange(e,index){ - if(this.linshiPrice == e.target.value){ - this.temporaryList[index].productCount = Number(e.target.value) - }else{ - if(e.detail.value == ''){ - this.temporaryList[index].productCount = this.linshiPrice - }else if(e.detail.value == 0){ - this.temporaryList[index].productCount = 0 - }else{ - this.temporaryList[index].productCount = Number(e.detail.value); - } - this.$forceUpdate() - } + this.temporaryList[index].productCount = e + this.$forceUpdate() this.temporaryChange() }, allChange(e){ - if(this.linshiPrice == e.target.value){ - this.allChangeNum = e.target.value - }else{ - if(e.target.value == ''){ - this.allChangeNum = this.linshiPrice - }else{ - this.allChangeNum = e.target.value - } - - } + this.allChangeNum = e //监听到输入框改变,给所有的都赋值 if(this.isPlusAndMinus == false){ for(var i=0;i 0){ - jishuqi++ - } - } - var resultList = [] - if(jishuqi == this.goodsList.length){ - resultList = this.combination(this.goodsList); - } this.evalue = [] var value = [] - for (var m = 0; m < resultList.length; m++) { - var name = '' - let value1 = "{" - for (var j = 0; j < resultList[m].length; j++) { - if(j != resultList[m].length - 1){ - name += resultList[m][j] + '/' - value1 += '"'+this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '",' - }else{ - name += resultList[m][j] - value1 += '"'+this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '"' + for(let i=0,data=this.goodsDetail.attributeList[0].value;i { if (res1.code == 200) { - if (typeof(res1.result) == 'string') { - let newObj = JSON.parse(res1.result) + if (typeof(res1.result.attributeAndValue) == 'string') { + let newObj = JSON.parse(res1.result.attributeAndValue) let newArr = [] let dataArr = [] for (let val in newObj) { @@ -820,14 +824,20 @@ } this.focus = false if(newArr[0].value.length == 1 && newArr[1].value.length == 1){ - console.log('只有一个',newArr) + // uni.hideKeyboard() + this.keyboard = 'goodsNum' + this.keyboardNum = this.goodsNum + this.show = true + this.oneGoodsName = newArr[0].value[0].value +' | '+ newArr[1].value[0].value this.oneGoodsSpec = newArr // this.oneGoodsToCarList(newArr) this.$refs.goodsNumDialog.open('center') this.$nextTick(() => { this.focus = true }) + this.getKCList(res1.result.stock); }else{ + // newArr[0].value[0].isChecked = true this.$refs.popup.open('bottom') this.goodsDetail.attributeList = newArr; for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { @@ -855,119 +865,121 @@ oldCheck = false oldValue = [] } + this.getKCList(res1.result.stock); + } + if(this.temporaryList == ''){ + this.attrNameChange(0,this.goodsDetail.attributeList[0].value[0].value,0) } - } - + } else { this.tui.toast(res.message) } }).catch((res) => {}) - this.getKCList(item.id); + await uni.hideLoading() }, - oneGoodsToCarList(){ + async oneGoodsToCarList(){ let that = this; // this.oneGoodsSpec //规格 // this.goodsNum //数量 + this.show = false this.evalue = [] var value = [] var name = '' let value1 = "{" - name = this.oneGoodsSpec[0].value[0].value + '/' + this.oneGoodsSpec[1].value[0].value + name = this.oneGoodsSpec[0].value[0].value + ' | ' + this.oneGoodsSpec[1].value[0].value value1 += '"'+this.oneGoodsSpec[0].name + '":"' + this.oneGoodsSpec[0].value[0].value + '",' value1 += '"'+this.oneGoodsSpec[1].name + '":"' + this.oneGoodsSpec[1].value[0].value + '"' value1 += "}" value.push(value1) this.evalue.push(name) - for (var i = 0; i < value.length; i++) { - this.attributeList = { - attributeList: value[i], - productCount: this.goodsNum, - productNum:0, - name: this.evalue[i], - price: this.goodsDetail.purchasePrice + await this.$nextTick(()=>{ + for (var i = 0; i < value.length; i++) { + this.attributeList = { + attributeList: value[i], + productCount: Number(this.goodsNum), + productNum:0, + name: this.evalue[i], + price: this.goodsDetail.purchasePrice + } + this.temporaryList = [] + this.temporaryList.push(this.attributeList); } - this.temporaryList.push(this.attributeList); - } - let data = { - id: this.goodsDetail.id, - price: this.zPrice, - num: this.zNum, - categoryId:this.goodsDetail.categoryId, - productName: this.goodsDetail.productName, - productSn: this.goodsDetail.productSn, - productPicture: this.goodsDetail.productPicture, - supplierName: this.goodsDetail.supplierName, - saleDetailQueryDTO: this.temporaryList, - saleDetailQueryDTO1: [], - wholesalePrice: this.goodsDetail.wholesalePrice, - lsprice: this.goodsDetail.price - } - if (this.carList.length == 0) { - this.carList.push(data) - } else { - let aa = true; - for (let i = 0; i < this.carList.length; i++) { - if (this.carList[i].id == data.id) { - this.carList[i] = data - aa = false + }) + + await this.$nextTick(()=>{ + console.log('pecsList',this.pecsList) + for(var i=0;i{ + let data = { + id: this.goodsDetail.id, + price: this.zPrice, + num: this.zNum, + categoryId:this.goodsDetail.categoryId, + productName: this.goodsDetail.productName, + productSn: this.goodsDetail.productSn, + returnPrice:this.goodsDetail.wholesalePrice, + productPicture: this.goodsDetail.productPicture, + supplierName: this.goodsDetail.supplierName, + saleDetailQueryDTO: this.temporaryList, + saleDetailQueryDTO1: [], + purchasePrice:this.goodsDetail.purchasePrice, + wholesalePrice: this.goodsDetail.wholesalePrice, + lsprice: this.goodsDetail.price + } + if (this.carList.length == 0) { this.carList.push(data) + } else { + let aa = true; + for (let i = 0; i < this.carList.length; i++) { + if (this.carList[i].id == data.id) { + this.carList[i] = data + aa = false + } + } + if (aa) { + this.carList.push(data) + } } - } + }) this.$nextTick(()=>{ that.$refs.goodsNumDialog.close() that.goodsNum = '' }) - + this.$forceUpdate() }, //库存商品详情 - getKCList(id) { + getKCList(list) { + console.log('list',list) this.yanseList = new Map() this.chimaList = new Map() - this.tui.request("/app/stock/productCount", "GET", { - productId: id - }, false, true).then((res) => { - if (res.code == 200) { - this.pecsList = res.result - - for(let i=0;i { - if(key == '颜色'){ - if(this.yanseList.has(attributeList[key]) != true){ - this.yanseList.set(attributeList[key],attributeList[key]) - } - - }else{ - if(this.chimaList.has(attributeList[key]) != true){ - this.chimaList.set(attributeList[key],attributeList[key]) - } - } - }) - } - for(let i=0;i { + if(key == '颜色'){ + if(this.yanseList.has(attributeList[key]) != true){ + this.yanseList.set(attributeList[key],attributeList[key]) } + } - console.log('颜色',this.yanseList) - console.log('尺码',this.chimaList) - console.log('颜色',this.goodsDetail) - } else { - this.tui.toast(res.message) + }) + } + for(let i=0;i {}) - setTimeout(res => { - uni.hideLoading(); - }, 200) + } }, //未入库遮罩 @@ -986,7 +998,11 @@ this.indexList[i].parentId = false } } - this.categoryId = this.indexList[index].id + this.categoryId = this.indexList[index].id + this.pageNum = 1 + this.searchName = "" + this.shopList1 = [] + this.shopList = [] this.getShareList() }, //临时改价 @@ -995,59 +1011,65 @@ }, //弹窗选择规格后,点击弹窗中选好了按钮 temporaryCheck() { - if(this.temporaryList == ''){ - this.tui.toast("请选择规格!") - return; - } - let data = { - id: this.goodsDetail.id, - price: this.zPrice, - num: this.zNum, - categoryId:this.goodsDetail.categoryId, - productName: this.goodsDetail.productName, - productSn: this.goodsDetail.productSn, - productPicture: this.goodsDetail.productPicture, - supplierName: this.goodsDetail.supplierName, - saleDetailQueryDTO: this.temporaryList, - saleDetailQueryDTO1: [], - wholesalePrice: this.goodsDetail.wholesalePrice, - lsprice: this.goodsDetail.price - } - if (this.carList.length == 0) { - this.carList.push(data) - } else { - let aa = true; - for (let i = 0; i < this.carList.length; i++) { - if (this.carList[i].id == data.id) { - this.carList[i] = data - aa = false - } - } - if (aa) { - this.carList.push(data) - } - } - - - for (let i = 0; i < this.carList.length; i++) { - this.carList[i].num = 0 - for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { - this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount - } - } - - this.temporaryList = [] - this.oldTemList = [] - this.purchasePrice = '' - this.zPrice = '' - this.zNum = '' - for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { - this.goodsDetail.attributeList[i].isChecked = false; - for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { - this.goodsDetail.attributeList[i].value[m].isChecked = false - } + let newList = [] + for(let i=0;i{ + let data = { + id: this.goodsDetail.id, + price: this.zPrice, + num: this.zNum, + categoryId:this.goodsDetail.categoryId, + productName: this.goodsDetail.productName, + productSn: this.goodsDetail.productSn, + returnPrice:this.goodsDetail.wholesalePrice, + productPicture: this.goodsDetail.productPicture, + supplierName: this.goodsDetail.supplierName, + saleDetailQueryDTO: newList, + saleDetailQueryDTO1: [], + purchasePrice:this.goodsDetail.purchasePrice, + wholesalePrice: this.goodsDetail.wholesalePrice, + lsprice: this.goodsDetail.price + } + if (this.carList.length == 0) { + this.carList.push(data) + } else { + let aa = true; + for (let i = 0; i < this.carList.length; i++) { + if (this.carList[i].id == data.id) { + this.carList[i] = data + aa = false + } + } + if (aa) { + this.carList.push(data) + } + } + + + for (let i = 0; i < this.carList.length; i++) { + this.carList[i].num = 0 + for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { + this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount + } + } + + this.temporaryList = [] + this.oldTemList = [] + this.purchasePrice = '' + this.zPrice = '' + this.zNum = '' + for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { + this.goodsDetail.attributeList[i].isChecked = false; + for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { + this.goodsDetail.attributeList[i].value[m].isChecked = false + } + } + this.$refs.popup.close() + }) }, //删除整条商品 @@ -1074,24 +1096,6 @@ delCarData(index) { this.temporaryList.splice(index, 1); this.temporaryChange() - // uni.showModal({ - // title: "提示", - // content: "确定删除此条商品吗?", - // success: function(res) { - // if(res.confirm){ - // that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name); - // that.carList.get(id).stockLogList.delete(name) - // that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice - // if(that.carList.get(id).stockLogList.size == 0){ - // that.carList.delete(id) - // } - - // that.getAllPrice() - // } - // that.$forceUpdate() - // } - // }) - }, //删除商品下的某一个规格 delShopSpec(index, index1) { @@ -1128,6 +1132,14 @@ checkPay(price) { this.purchasePrice = price; this.$refs.inputDialog.close() + }, + keyWordChange(e){ + if(e.show == false){ + this.show = false + this.keyboardNum = '' + this.goodsNum = '' + } + } } } @@ -1139,9 +1151,7 @@ } .page1 { - // display: flex; - // flex-direction: column; - height: 92%; + height: 100%; } .uni-tab__dot { @@ -1231,15 +1241,19 @@ color: #646566; } - .title-box { - background: #fff; + .title-box { + background: #fff; + position: fixed; + top: 0; + width: 100%; + z-index: 99; } .bottom-box { width: 100%; height: 120rpx; - position: fixed; - bottom: 0; + // position: fixed; + // bottom: 0; display: flex; background: #fff; z-index: 98; @@ -1277,13 +1291,14 @@ .content-box { background: #fff; flex: 1; - display: flex; + display: flex; + overflow: hidden; } .content-left { width: 170rpx; background: #eee; - height: 100%; + height: auto; overflow: scroll; } @@ -1321,7 +1336,10 @@ .content-right { flex: 1; overflow-y: scroll; - padding-bottom: 100rpx; + height: 100%; + // padding-bottom: 100rpx; + // padding-bottom: 100rpx; + // margin-bottom: 80rpx; } .right-box { @@ -1591,5 +1609,8 @@ flex: 1; text-align: center; background: linear-gradient(90deg, #60F3FF, #088FEB); + } + .right-box:last-child{ + margin-bottom:100rpx; } \ No newline at end of file diff --git a/pages/billing/delivery.vue b/pages/billing/delivery.vue deleted file mode 100644 index 7029285..0000000 --- a/pages/billing/delivery.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - diff --git a/pages/index/.DS_Store b/pages/index/.DS_Store index d2d335c..0c5ba65 100644 Binary files a/pages/index/.DS_Store and b/pages/index/.DS_Store differ diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue deleted file mode 100644 index 4a28ce9..0000000 --- a/pages/index/addHangOrder.vue +++ /dev/null @@ -1,1309 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages/index/checkShop.vue b/pages/index/checkShop.vue index 36e39c6..eaaf860 100644 --- a/pages/index/checkShop.vue +++ b/pages/index/checkShop.vue @@ -87,6 +87,7 @@ uni.setStorageSync('shopAddress', res.result.shopAddress) uni.setStorageSync('shopIcon', res.result.shopIcon) uni.setStorageSync('type', res.result.userType) + uni.setStorageSync('shopId', this.current) this.tui.toast('切换店铺成功', 2000, true) setTimeout(() => { uni.reLaunch({ diff --git a/pages/index/customAndSupplierProductDetail.vue b/pages/index/customAndSupplierProductDetail.vue index 3daa2ba..ca1d992 100644 --- a/pages/index/customAndSupplierProductDetail.vue +++ b/pages/index/customAndSupplierProductDetail.vue @@ -1,34 +1,310 @@ @@ -56,12 +384,22 @@ data() { return { list:[], + range:[], + GDList:[], status: 'loadmore', pages: 1, pageNum: 1, userId:'', + shopId:'', + duizhangRecords:[], + detailList:{}, + duizhangList:{}, type:'', - userType:'' + isDownKH:false, + userType:uni.getStorageSync('type'), + items:['对账单', '拿货(按订单)','拿货(按商品)','退货明细'], + current: 1, + shopName:"" } }, filters: { @@ -74,21 +412,98 @@ } } return name; + }, + removeStr(val) { + if(val == null){ + return ""; + }else{ + var dotIndex = val.indexOf('.'); + if (dotIndex !== -1) { + return val.substring(0, dotIndex); + } + return val; + } } + }, + onShareAppMessage() { + return { + title: '查看对账单详情', + imageUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/b28b3d46c21d4f60a334b25f56175cf3.jpg', + path: '/pages/index/customAndSupplierProductDetail?popleType=khName&id=' + this.userId + '&shopId=' + this.shopId+ '&shopName=' + this.shopName + } }, onLoad(option) { + let that = this; + this.getMonth(); this.userId = option.id - this.userType = uni.getStorageSync('type') - this.type = option.popleType + this.type = option.popleType + this.shopName = option.shopName ?option.shopName : uni.getStorageSync('shopName') + this.shopId = option.shopId ?option.shopId : uni.getStorageSync('shopId') + if(option.shopId && option.shopId != uni.getStorageSync('shopId')){ + this.isDownKH = true + } this.getList() }, onReachBottom() { - if (this.pages >= this.pageNum) return; + if (this.pageNum >= this.pages) return; this.status = 'loading'; - this.pages = ++this.pages; - this.getList(); + this.pageNum++; + if(this.current == 0){ + this.duizhangdan() + }else{ + this.getList(); + } }, - methods: { + methods: { + //获取当月1日到当前时间 + getMonth() { + let date = new Date() + let year = date.getFullYear().toString() //'年' + let month = date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1).toString():(date.getMonth()+1).toString() //'月' + let da = date.getDate() < 10 ? '0'+date.getDate().toString():date.getDate().toString() //'日' + let end = year + '-' + month + '-' + da //当天 + let beg = year + '-' + month + '-01' //当月第一天 + this.range = [beg,end] + }, + duizhangdan(){ + this.tui.request("/app/bill/getCustomerBill", "post", { + customerId:this.userId, + pageNum:this.pageNum, + pageSize:'10', + startDate:this.range[0], + endDate:this.range[1], + shopId:this.shopId + }, false, false).then((res) => { + if (res.code == 200) { + this.status = 'nomore'; + if (this.pages == 1) { + this.duizhangList = res.result + this.duizhangRecords = res.result.customerBillSaleVos.records + } else { + for(let i=0;i {}) + }, + xiaoshouDetail(type,item){ + if(item){ + if(type == '1'){ + this.GDList = item.stockLogList1 + this.$refs.xsdetailPopup.open() + }else if(type == '2'){ + this.GDList = item.customerBuyProductDetailLogVos + this.$refs.xsdetailPopup.open() + }else if(type == '3'){ + this.GDList = item.stockLogList1 + this.$refs.xsdetailPopup.open() + } + } + }, getList(id) { this.status = 'loading'; var url,data @@ -100,11 +515,37 @@ pageNum: this.pageNum } }else{ - url = "/app/sale/getCustomerBuyProductLog" - data = { - userId: this.userId, - pageSize: 10, - pageNum: this.pageNum + if(this.current == 1){ + url = "/app/sale/listPages" + data = { + userId: this.userId, + pageVo: {pageSize: 10, pageNumber: this.pageNum}, + searchStr: "", + startTime:this.range[0], + endTime:this.range[1], + shopId:this.shopId, + fromWhere:1 + } + }else if(this.current == 2){ + url = "/app/sale/getCustomerBuyProductLog" + data = { + userId: this.userId, + pageSize: 10, + startDate:this.range[0], + endDate:this.range[1], + pageNum: this.pageNum, + shopId:this.shopId + } + }else if(this.current == 3){ + url = "/app/return/getReturnSaleListByUserId" + data = { + userId:this.userId, + startDate:this.range[0], + endDate:this.range[1], + pageNum:this.pageNum, + pageSize:"10", + shopId:this.shopId + } } } this.tui.request(url, "post", data, false, false).then((res) => { @@ -117,12 +558,83 @@ this.list = [...this.list, ...res.result.records] } - this.pageNum = res.result.pages + this.pages = res.result.pages + if(this.current == 1){ + for(let i=0;i {}) - } + }, + clickDetail(item){ + this.detailList = item + this.$refs.detailPopup.open() + }, + onClickItem(e) { + if (this.current !== e.currentIndex) { + this.current = e.currentIndex + } + if(e.currentIndex == 0){ + this.duizhangList = [] + this.pageNum = 1 + this.pages = 1 + this.duizhangdan() + }else if(e.currentIndex == 1){ + this.list = [] + this.pageNum = 1 + this.getList() + }else if(e.currentIndex == 2){ + this.list = [] + this.pageNum = 1 + this.getList() + }else if(e.currentIndex == 3){ + this.list = [] + this.pageNum = 1 + this.getList() + } + }, + searchList() { + if(this.current == 0){ + this.duizhangList = [] + this.pageNum = 1 + this.pages = 1 + this.duizhangdan() + }else if(this.current == 1){ + this.list = [] + this.pageNum = 1 + this.getList() + }else if(this.current == 2){ + this.list = [] + this.pageNum = 1 + this.getList() + }else if(this.current == 3){ + this.list = [] + this.pageNum = 1 + this.getList() + } + }, }, } @@ -135,14 +647,10 @@ font-weight: bold; } .container { - padding-bottom: 118rpx; - + .boxbg { padding-top: 10rpx; - background-color: #fff; - margin: 30upx; - border-radius: 10upx; - box-shadow: 0px 1px 10px 2px #e2e2e2; + background-color: #FAF7F7; } .tui-order-item { @@ -235,7 +743,6 @@ margin-right: 30rpx; } .shop-box { - width: 95%; margin: 0 auto; position: relative; } @@ -314,10 +821,102 @@ padding-left: 20rpx; border-bottom: 1px solid #088FEB; } + .shareBtn{ + background: rgba(255, 255, 255, 0); + width: 90rpx; + height: 50; + height: 80rpx; + line-height: 80rpx; + border: 1px solid #f3f4f6; + background-color: rgba(255,255,255,0); + } + .shareBtn::after{ + border: none; + } textarea { margin: 20rpx; border: 1px solid #eee; height: 150rpx; width: 500rpx; } + .uni-table-scroll { + width: 100%; + overflow-x: auto; + border-radius: 10px; + } + .uni-table-th{ + background: #FAE7B5 !important; + color: #000 !important; + } + .top1 { + width: 780rpx; + height: 390rpx; + opacity: 1; + background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%); + } + + .ai-bot { + position: absolute; + top: 200rpx; + right: 40rpx; + width: 90rpx; + height: 110rpx; + background-size: 100% !important; + background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/66dc640d9e8f4749a234d9ef2af1b257.png) no-repeat; + } + + .hello-box { + position: absolute; + left: 42rpx; + top: 205rpx; + width: 220rpx; + height: 56rpx; + + .hello-left { + width: 102rpx; + height: 56rpx; + opacity: 1; + background: #fff; + border-radius: 3px; + text-align: center; + transform: skewX(8deg); + } + + .hello-right { + position: absolute; + left: 5px; + bottom: 0rpx; + width: 220rpx; + height: 2px; + opacity: 1; + background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%); + } + + .hello-name { + position: absolute; + left: 118rpx; + top: 0; + width: 400rpx; + height: 55rpx; + font-size: 32rpx; + line-height: 55rpx; + color: white; + overflow: hidden; + } + } + + .hello-text { + position: absolute; + top: 275rpx; + left: 50rpx; + color: #fff; + font-size: 28rpx; + } + .top { + width: 780rpx; + height: 330rpx; + opacity: 1; + background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); + overflow: hidden; + } \ No newline at end of file diff --git a/pages/index/dataStatistics.vue b/pages/index/dataStatistics.vue index ff17033..79c71f8 100644 --- a/pages/index/dataStatistics.vue +++ b/pages/index/dataStatistics.vue @@ -1,8 +1,8 @@ @@ -58,19 +72,45 @@ return { range:[], shopInfo:{}, - priceList:[], - type:'' + type:uni.getStorageSync('type'), + dataList:[{ + name:'销售金额', + value:'xiaoshou', + icon:'cart', + },{ + name:'实收金额', + value:'shishou', + icon:'auth' + },{ + name:'利润', + value:'lirun', + icon:'wallet' + },{ + name:'进货金额', + value:'jinhuo', + icon:'home' + },{ + name:'退货金额', + value:'tuihuo', + icon:'refreshempty' + },{ + name:'下单客户', + value:'xiadankehu', + icon:'staff' + }] }; }, onShow(){ - this.getMonth(); + if(this.range ==''){ + this.getMonth(); + } this.getSaleInfo(); - this.getList(); - this.type = uni.getStorageSync('type') }, methods: { - maskPrice(){ - this.tui.toast('订单实收:' + this.shopInfo.totalAlreadyEarn +'回款:'+ this.shopInfo.totalPayAmount) + goDetail(item){ + uni.navigateTo({ + url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range) + }) }, getSaleInfo() { this.shopInfo = {} @@ -90,18 +130,6 @@ }) }, - getList() { - this.tui.request("/app/sale/getShopMonthData", "POST", { - startDate:this.range[0], - endDate:this.range[1] - }, false, false).then((res) => { - if (res.code == 200) { - this.priceList = res.result - } else { - this.tui.toast(res.message) - } - }) - }, //获取当月1日到当前时间 getMonth() { let date = new Date() @@ -114,7 +142,6 @@ }, searchList() { this.priceList = []; - this.getList() this.getSaleInfo() }, } @@ -222,4 +249,13 @@ .u-zidingyi:nth-child(4) { background: linear-gradient(#84C1FF, #C4E1FF) !important; } + .box{ + width: 100%; + height: 100rpx; + padding-left: 20rpx; + display: flex; + line-height: 100rpx; + font-size: 34rpx; + border-bottom: 1px solid #eee; + } \ No newline at end of file diff --git a/pages/index/downStearmList.vue b/pages/index/downStearmList.vue deleted file mode 100644 index 5927d46..0000000 --- a/pages/index/downStearmList.vue +++ /dev/null @@ -1,1285 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/index/downarrears.vue b/pages/index/downarrears.vue index 45d0e2f..af6c5c6 100644 --- a/pages/index/downarrears.vue +++ b/pages/index/downarrears.vue @@ -3,7 +3,7 @@
    -
  • +
  • 销售员: {{item.createByName == null ?'暂无':item.createByName}} @@ -14,7 +14,7 @@ 订单状态:{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货' :item.status == 3 ?'待送达' :item.status == 4 ?'已完成' :item.status == 5 ?'下游客户待退货' :item.status == 00 ?'退货待抢单' :item.status == 01 ?'退货待取货' :item.status == 03 ?'退货待送达' :item.status == 04 ?'待确认退货' :item.status == 6 ?'待配货' :'挂单'}} - 回款 +
diff --git a/pages/index/downstream.vue b/pages/index/downstream.vue index 6ddf307..d12833a 100644 --- a/pages/index/downstream.vue +++ b/pages/index/downstream.vue @@ -2,20 +2,48 @@ - - - - {{ item.nickname == null ?'暂无':item.nickname}} - - - 欠款总金额: - - {{ item.no_earn == null ?'暂无':item.no_earn }} - + + + + + {{ item.nickname == null ?'暂无':item.nickname}} + + + 欠款总金额: + + {{ item.no_earn == null ?'暂无':item.no_earn }} + + + + + + 查看详情 + + + 回款 + - + + + + + + + 充值金额 + + + + + + 取消 + 确定 + + + + @@ -28,7 +56,9 @@ computed: mapState(['userId', 'shopIndex']), data() { return { - choose: '1', + choose: '1', + userId:'', + showPrice:false, options1: [{ text: '编辑金额', style: { @@ -37,13 +67,56 @@ }], popupShow: false, shopName: '', - list: [] + list: [], + keyboardNum:'', } }, onShow() { this.getList() }, - methods: { + methods: { + keyboardConfirm(){ + this.showPrice = false + }, + keyCancel(){ + this.showPrice = false + this.keyboardNum = '' + }, + // 按键被点击 + valChange(val) { + this.keyboardNum += val + }, + // 退格键被点击 + backspace(val) { + this.keyboardNum = val + }, + huicancel(){ + this.$refs.inputDialog.close() + this.keyboardNum = '' + }, + //回款按钮 + receivePay(e){ + this.tui.request('/app/debt/saveOrUpdateDebt', "post", { + userId:this.userId, + amountOwed:this.keyboardNum, + userType:'0' + }, false, false).then((res) => { + if (res.code == 200) { + this.getList() + this.tui.toast('操作成功') + this.keyboardNum = '' + this.$refs.inputDialog.close() + }else{ + this.keyboardNum = "" + this.tui.toast(res.message) + } + }) + }, + //打开弹出层 + toggle(item) { + this.userId = item.userId + this.$refs.inputDialog.open() + }, getList() { this.tui.request("/app/customer/debt", "POST", {}, false, true).then((res) => { if (res.code == 200) { diff --git a/pages/index/home.vue b/pages/index/home.vue index d6fabb4..bf55cf6 100644 --- a/pages/index/home.vue +++ b/pages/index/home.vue @@ -29,7 +29,7 @@ } } else if(option.khid){ uni.reLaunch({ - url: '/pages/index/downStearmList?khid='+option.khid + url: '/package1/index/downStearmList?khid='+option.khid }) }else { uni.reLaunch({ diff --git a/pages/index/index.vue b/pages/index/index.vue index 843b04a..47f66e8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,47 +2,51 @@ - + - - + + 待退货 {{waitCount.waitReturnCount > 99 ? '99+' :waitCount.waitReturnCount}} - - + + 待配货 {{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}} - - + + 挂单 {{waitCount.registrationCount > 99 ? '99+' :waitCount.registrationCount}} - - + + 推款 - - - - Ai入库 - - + + - - - + + + 今日营收详情 @@ -52,10 +56,11 @@ 销售总金额 - - - 今日实收 + + + 今日实收 + @@ -101,6 +106,9 @@ 订单状态:{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}} + 撤销 + 撤销并复制 + @@ -121,8 +129,8 @@ - + - + + - - --> + @@ -166,6 +177,18 @@ X + + + 今日收款方式统计 + + + + {{item.payType == 0?'现金收款:':item.payType == 1?'微信收款:':item.payType == 2?'支付宝收款:':item.payType == 3?'银行卡收款:':item.payType == 4?'收款码收款:':''}}{{item.payAmount}}元 + + + @@ -183,8 +206,10 @@ src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', inventoryList: [], settingShow: false, - chartData: {}, + chartData: {}, + returnList:new Map(), shopName: '', + showDayPrice: false, opts: { padding: [15, 10, 0, 15], dataLabel: true, @@ -233,36 +258,38 @@ return val; } }, - onLoad() { - let that = this; - wx.getLocation({ - type: 'gcj02', - success(res) { - - } - }) - uni.getStorage({ - key: 'shopName', - success: function (res) { - that.shopName = res.data - } - }); - uni.getStorage({ - key: 'type', - success: function (res) { - that.type = res.data - } - }); - var today = new Date(); + onShow() { + this.getSaleInfo() + }, + onLoad() { + let that = this; + wx.getLocation({ + type: 'gcj02', + success(res) { + + } + }) + uni.getStorage({ + key: 'shopName', + success: function(res) { + that.shopName = res.data + } + }); + uni.getStorage({ + key: 'type', + success: function(res) { + that.type = res.data + } + }); + var today = new Date(); var day = today.getDate(); //宣传页 - if(uni.getStorageSync('publicize') == day){ - - }else{ + if (uni.getStorageSync('publicize') == day) { + + } else { uni.setStorageSync("publicize", day) this.$refs.publicizepopup.open('center') } - this.getSaleInfo() }, onTabItemTap(e) { this.getSaleInfo() @@ -271,8 +298,174 @@ popClose() { this.$refs.publicizepopup.close() }, - getSaleInfo() { - this.shopInfo = {} + //退款接口 + async getReturnOrder(id) { + let that = this; + await this.tui.request("/app/return/list", "post", { + remark: 3, + saleId: id + }, false, false).then((res) => { + if (res.code == 200 && res.result != null && res.result != undefined) { + if (res.result != '') { + res.result.forEach(item => { + this.tui.request("/app/return/get/" + item.id, "GET", null, false,false).then((res) => { + if (res.code == 200 && res.result != null && res.result != undefined) { + for(let i=0;i {}) + }) + } + } else { + this.tui.toast(res.message) + } + }) + }, + // 取消订单 + async cancelOrder(item, type) { + let that = this; + await this.getReturnOrder(item.id) + await this.tui.modal("提示", "您确定要撤销订单吗?", true, (res) => { + if (res) { + that.cancelSale(item,type) + } + }) + }, + cancelSale(item,type){ + this.tui.request('/app/sale/cancelSale', "POST", { + id:item.id + }, true, true).then((res1) => { + if (res1.code == 200) { + if (type == 'goPay') { + this.goSaleGoods(item) + } else { + this.getSaleInfo() + } + } else { + this.tui.toast(res.message) + } + }).catch((res1) => {}) + }, + // 取消订单 + getOrderInfoList(item,type) { + let that = this; + // if(item.status == 0 || item.status == 1){ + // this.tui.request('/app/sale/status', "POST", { + // status: 4, + // orderId: item.id + // }, true, true).then((res1) => { + // if (res1.code == 200) { + this.cancelSale(item,type) + // } else { + // this.tui.toast(res.message) + // } + // }).catch((res1) => {}) + // }else{ + // this.cancelSale(item,type) + // } + }, + sliceMsg(val) { + var name = '' + if (typeof(val) == 'string') { + let newObj = JSON.parse(val) + for (let as in newObj) { + name += newObj[as] + '/' + } + } + return name; + }, + //带参数跳转到开单页 + goSaleGoods(item) { + let dataList = [] + if(item.saleDetailDTOList == null || item.saleDetailDTOList == ''){ + item.saleDetailDTOList = [] + } + this.returnList.forEach(function(value, key) { + item.saleDetailDTOList.push(value) + }) + if (item.saleDetailDTOList) { + for (let i = 0; i < item.saleDetailDTOList.length; i++) { + + let obj = {} + let attrMap = new Map() + let newSaleDetailDTOList = [] + let num = 0 + + for (let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++) { + if (attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true) { + let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList) + newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount] + .productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount) + } else { + item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i] + .stockLogList1[m].attributeList) + newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m]) + attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList, num) + num++ + } + + } + obj.saleDetailQueryDTO = newSaleDetailDTOList + obj.num = 0 + obj.id = item.saleDetailDTOList[i].productId + obj.price = item.saleDetailDTOList[i].price + obj.lsprice = item.saleDetailDTOList[i].price + obj.categoryId = item.saleDetailDTOList[i].categoryId + obj.zPrice = item.saleDetailDTOList[i].discountAmount + obj.unitPrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i] + .wholesalePrice + obj.productName = item.saleDetailDTOList[i].productName + obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime() + obj.productSn = item.saleDetailDTOList[i].productSn + obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice + obj.returnPrice = item.saleDetailDTOList[i].returnPrice + obj.saleId = item.id + obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName + dataList.push(obj) + } + } else { + let obj = {} + obj.num = 0 + obj.price = 0 + obj.saleId = item.id + obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName + dataList.push(obj) + } + console.log('lastDebtAmount',item.lastDebtAmount) + this.$nextTick(()=>{ + this.tui.request("/app/customer/list", "post", { + notBuyDays: "", + pageNum: 1, + pageSize: 10, + searchStr: item.userName, + sort: "", + }, false, false).then((res) => { + if (res.code == 200) { + this.returnList = new Map() + uni.setStorageSync('khName', JSON.stringify(res.result.records[0])) + uni.setStorageSync('carList1', JSON.stringify(dataList)) + uni.setStorageSync('hangOrder', true) + uni.switchTab({ + url: '/pages/inventory/goodsList1' + }) + } + }) + }) + }, + getSaleInfo() { + this.shopInfo = {} this.inventoryList = [] this.tui.request("/app/sale/getShopAll", "POST", { pageVo: { @@ -291,6 +484,7 @@ totalProfit: res.result.totalProfit, returnTotalAmount: res.result.returnTotalAmount, returnTotalCount: res.result.returnTotalCount, + totalAlreadyEarnDetail: res.result.totalAlreadyEarnDetail } let dataList = { categories: this.getWeek(), @@ -321,18 +515,24 @@ }, goToInfo() { this.settingShow = true - }, - //跳转外卖小程序 - quwaimai(){ - uni.openEmbeddedMiniProgram({ - appId: 'wxf5362b6e97ecee2f' - }) + }, + //跳转外卖小程序 + quwaimai() { + uni.openEmbeddedMiniProgram({ + appId: 'wxf5362b6e97ecee2f' + }) }, gotoSearchData() { uni.navigateTo({ url: '/pages/index/dataStatistics' }) }, + showPayType() { + this.showDayPrice = true + setTimeout(res => { + this.showDayPrice = false + }, 2000) + }, outLogin(e) { let that = this; uni.showModal({ @@ -377,7 +577,7 @@ url: '/package1/index/orderDetail?id=' + id }) }, - //首页头部四个按钮的菜单 + //首页头部五个按钮的菜单 goSonPage(url) { if (url == '/pages/index/waitStorage?inStorageStatus=0') { if (this.type != 0) { @@ -473,12 +673,12 @@ } .title-btn-sbtn { - flex: 1; - line-height: 40rpx; - text-align: center; - position: relative; - display: flex; - flex-direction: column; + flex: 1; + line-height: 40rpx; + text-align: center; + position: relative; + display: flex; + flex-direction: column; font-size: 24rpx; } @@ -572,7 +772,7 @@ .publicize-content img { width: 460rpx; - height: 460rpx; + height: 460rpx; border-radius: 50px; } @@ -595,22 +795,30 @@ .uni-tooltip-popup { width: 180rpx; - } - .waimai{ - position: fixed; - bottom: 0; - right: 20rpx; - background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/cda1b75affd349118081f3880f815a0f.jpg) no-repeat; - background-size: 100%; - width: 130rpx; - height: 130rpx; - margin: 0 auto 10rpx; - z-index: 999; - } - - .title-img{ - width: 60rpx; - height: 60rpx; - margin: 0 auto; + } + + .waimai { + position: fixed; + bottom: 0; + right: 20rpx; + background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/cda1b75affd349118081f3880f815a0f.jpg) no-repeat; + background-size: 100%; + width: 130rpx; + height: 130rpx; + margin: 0 auto 10rpx; + z-index: 999; + } + + .title-img { + width: 60rpx; + height: 60rpx; + margin: 0 auto; + } + + .floatRight { + float: right; + padding: 14rpx; + color: $u-primary; + font-size: 26upx; } \ No newline at end of file diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index d8bf785..55b0fbf 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -1,57 +1,56 @@ @@ -26,7 +56,10 @@ computed: mapState(['userId', 'shopIndex']), data() { return { - choose: '1', + choose: '1', + keyboardNum:'', + userId:'', + showPrice:false, options1: [{ text: '编辑金额', style: { @@ -59,6 +92,48 @@ uni.navigateTo({ url: `/pages/index/uparrears?supplierId=${target.supplierId}&consigneeName=${target.supplierName}` }) + }, + keyboardConfirm(){ + this.showPrice = false + }, + keyCancel(){ + this.showPrice = false + this.keyboardNum = '' + }, + // 按键被点击 + valChange(val) { + this.keyboardNum += val + }, + // 退格键被点击 + backspace(val) { + this.keyboardNum = val + }, + huicancel(){ + this.$refs.inputDialog.close() + this.keyboardNum = '' + }, + //回款按钮 + receivePay(e){ + this.tui.request('/app/debt/saveOrUpdateDebt', "post", { + userId:this.userId, + amountOwed:this.keyboardNum, + userType:'1' + }, false, false).then((res) => { + if (res.code == 200) { + this.getList() + this.tui.toast('操作成功') + this.keyboardNum = '' + this.$refs.inputDialog.close() + }else{ + this.keyboardNum = "" + this.tui.toast(res.message) + } + }) + }, + //打开弹出层 + toggle(item) { + this.userId = item.supplierId + this.$refs.inputDialog.open() } } } diff --git a/pages/index/waitStorage.vue b/pages/index/waitStorage.vue index 58bdde9..0d1e772 100644 --- a/pages/index/waitStorage.vue +++ b/pages/index/waitStorage.vue @@ -1,7 +1,7 @@