From 46d1ff2d7b6a41baf2e6ac10700a660772c58145 Mon Sep 17 00:00:00 2001 From: "tianyi@bogon" Date: Mon, 13 Nov 2023 19:59:43 +0800 Subject: [PATCH] =?UTF-8?q?11.13=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/billing/addUser.vue | 5 - pages/billing/changeGoods1.vue | 6 +- pages/index/addHangOrder.vue | 125 ++-- pages/index/downStearmList.vue | 961 ++++++++++++++++--------------- pages/index/index.vue | 12 +- pages/index/orderDetail.vue | 4 +- pages/index/shareStyle.vue | 39 +- pages/inventory/changeGoods1.vue | 68 ++- pages/inventory/goodsList1.vue | 12 +- pages/inventory/inventory.vue | 8 +- pages/login/login.vue | 19 +- pages/other/custom.vue | 19 +- 12 files changed, 656 insertions(+), 622 deletions(-) diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue index 75a99cc..c8ecace 100644 --- a/pages/billing/addUser.vue +++ b/pages/billing/addUser.vue @@ -70,11 +70,6 @@ rules: [{ required: true, errorMessage: '请输入姓名', - }, - { - minLength: 2, - maxLength: 5, - errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', } ] }, diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 68c2bc2..4e5edb9 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -8,7 +8,7 @@ - {{item.categoryName}} + {{item.categoryName}} @@ -94,7 +94,7 @@ {{item.name}} - + @@ -152,7 +152,7 @@ {{items.name}} - + diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index c952c15..ee54672 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -28,7 +28,7 @@ 备注: - {{item.remark}} + {{item.remark==null?'暂无':item.remark}} @@ -116,7 +116,7 @@ {{item.name}} - + @@ -152,7 +152,7 @@ - @@ -410,7 +410,8 @@ } this.carList.push(data) // this.temporaryList = [] - this.purchasePrice = '' + this.purchasePrice = '' + this.temporaryList = [] this.zPrice = '' this.zNum = '' for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { @@ -432,7 +433,8 @@ saleId: this.hangId }, false, false).then((res) => { if (res.code == 200) { - this.getRegList() + this.getRegList() + this.carList = [] } else { this.tui.toast(res.message) } @@ -470,33 +472,45 @@ this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => { if (res.code == 200) { this.goodsDetail = res.result; - if (typeof(this.goodsDetail.attributeList) == 'string') { - let newObj = JSON.parse(this.goodsDetail.attributeList) - let newArr = [] - for (let val in newObj) { - let valueObj = []; - for (var i = 0; i < newObj[val].length; i++) { - valueObj.push({ - value: newObj[val][i], - isChecked: false - }) - this.attrNameList.push({ - value: newObj[val][i], - name: val, - isChecked: false + this.tui.request("/app/productAttribute/selectByCategoryId", "POST", { + categoryId: this.goodsDetail.categoryId + }, false, true).then((res1) => { + if (res1.code == 200) { + this.attrList = res1.result; + if (res1.result.length > 0) { + let newArr = [] + this.attrList.forEach((items) => { + this.tui.request("/app/productAttributeValue/selectByAttributeId","get", { + id: items.id + }, false, true).then((res2) => { + if (res2.code == 200) { + let valueObj = []; + for (var i = 0; i < res2.result.length; i++) { + valueObj.push({ + value: res2.result[i].value, + isChecked: false + }) + } + newArr.push({ + name: items.attributeName, + value: valueObj + }) + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } else { + this.tui.toast(res.message) + } + console.log(this.goodsDetail) + }).catch((res) => {}) }) } - newArr.push({ - name: val, - value: valueObj - }) + } else { + this.tui.toast(res.message) } - this.goodsDetail.attributeList = newArr; - this.goodsDetail.attributeList.forEach((item, index) => { - this.columns[index] = item.value; - this.keyList[index] = item.name; - }) - } + }).catch((res) => {}) } else { this.tui.toast(res.message) } @@ -510,8 +524,8 @@ //新增挂单 addReg(e) { this.tui.request("/app/sale/saveOrder", "POST", { - saleName: e, - status:7 + saleName: e, + status: 7 }, false, false).then((res) => { if (res.code == 200) { this.tui.toast("新增成功") @@ -581,15 +595,18 @@ }) }, //编辑挂单信息 - setDetail() { + setDetail(e) { this.tui.request("/app/sale/updateOrder", "POST", { - saleName: this.value, + saleName: e.detail?'':e, id: this.list.id, remark: this.voiceText }, false, false).then((res) => { - if (res.code == 200) { + if (res.code == 200) { + this.value = '' + this.voiceText = '' this.tui.toast("编辑成功") - this.getRegList(); + this.getRegList(); + this.$refs.popup.close() } else { this.tui.toast(res.message) } @@ -604,23 +621,25 @@ }, //带参数跳转到开单页 goSaleGoods(item) { - let dataList = [] - for (let i=0;i开单 - - - - - - - - - - {{goodsDetail.productName}} - - {{goodsDetail.productSn}} - - - - - - -
    -
  • - - {{items.name}} - - - - {{itemTag.value}} - -
  • -
- - - {{item.name}} - - - -
- - - {{zNum}} 件 - ¥{{zPrice}} - - - 选好了 - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - 开单 - - - - - - - - - - - - {{item.productName}} - {{item.productSn}} - - ¥{{item.price}} - - - - - - - - - - - - - - - {{items.name}} - - - - - - - - - {{carType}} 款 {{carNum}} 件 - - - 选好了 - - - + + + + + + + + + + {{goodsDetail.productName}} + + {{goodsDetail.productSn}} + + + + + + +
    +
  • + + {{items.name}} + + + + {{itemTag.value}} + +
  • +
+ + + {{item.name}} + + + +
+ + + {{zNum}} 件 + ¥{{zPrice}} + + + 选好了 + + +
+
+
+ + + + + + + 填写信息 + + + + + + + + + + + + + + + + + + 开单 + + + + + + + + + + + + {{item.productName}} + {{item.productSn}} + + ¥{{item.price}} + + + + + + + + + + + + + + + {{items.name}} + + + + + + + + + {{carType}} 款 {{carNum}} 件 + + + 选好了 + + + @@ -188,340 +190,338 @@ goodsDetail: [], attrNameList: [], temporaryList: [], - carList: [], - columns: [], - keyList: [], - specsList:[], - evalue:[], - attributeList:[], - zNum:0, - addressObj:{}, - show:false, - zPrice:0, - carType:0, - carNum:0, - formData: { - consigneeMobile: '', - consigneeName: '', - address1: '', - address: '', - province: '', - city: '', - area: '', - id: '' - }, - rules: { - consigneeName: { - rules: [{ - required: true, - errorMessage: '请输入姓名', - }, - { - minLength: 2, - maxLength: 5, - errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符', - } - ] - }, - consigneeMobile: { - rules: [{ - required: true, - errorMessage: '请输入手机号', - }, { - minLength: 11, - maxLength: 11, - errorMessage: '手机号为11个字符', - }] - }, - address1: { - rules: [{ - required: true, - errorMessage: '请选择地址', - }] - }, - address: { - rules: [{ - required: true, - errorMessage: '请输入详细地址', - }] - }, + carList: [], + columns: [], + keyList: [], + specsList: [], + evalue: [], + attributeList: [], + zNum: 0, + addressObj: {}, + show: false, + zPrice: 0, + carType: 0, + carNum: 0, + formData: { + consigneeMobile: '', + consigneeName: '', + address1: '', + address: '', + province: '', + city: '', + area: '', + id: '' + }, + rules: { + consigneeName: { + rules: [{ + required: true, + errorMessage: '请输入姓名', + }] + }, + consigneeMobile: { + rules: [{ + required: true, + errorMessage: '请输入手机号', + }, { + minLength: 11, + maxLength: 11, + errorMessage: '手机号为11个字符', + }] + }, + address1: { + rules: [{ + required: true, + errorMessage: '请选择地址', + }] + }, + address: { + rules: [{ + required: true, + errorMessage: '请输入详细地址', + }] + }, }, } - }, - created() { - uni.hideHomeButton() //左上角HOME按钮 }, - onLoad(options) { - this.khid = options.khid; + created() { + uni.hideHomeButton() //左上角HOME按钮 + }, + onLoad(options) { + this.khid = options.khid; this.getShareList(options.khid); }, - methods: { - attrNameChange(index, index1) { - this.goodsDetail.attributeList[index].value.forEach(item => { - item.isChecked = false; - }) - this.goodsDetail.attributeList[index].isChecked = true; - this.goodsDetail.attributeList[index].value[index1].isChecked = true; - var name = '', - evalue = [], - obj = {} - for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { - for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { - if (Ien[m].isChecked == true) { - evalue.push(Ien[m].value) - name += Ien[m].value + '/' - } - } - } - this.keyList.map((item, index) => { - obj[item] = evalue[index] - }) - let jishuqi = 0; - for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { - if (this.goodsDetail.attributeList[i].isChecked == true) { - jishuqi++ - } - } - if (this.goodsDetail.attributeList.length == jishuqi) { - let data = {} - this.attributeList = { - attributeList: JSON.stringify(obj), - productCount: this.temporaryNum, - name:name, - price:this.purchasePrice - } - - for(let i=0;i { - this.columns[index] = item.value; - this.keyList[index] = item.name; - }) - } - - }, - //顶部搜索框 - search(res) { - this.searchName = res.value - uni.showToast({ - title: '搜索:' + res.value, - icon: 'none' - }) - }, - inputDialogToggle() { - this.$refs.inputDialog.open() - }, - //弹窗选择规格后,点击弹窗中选好了按钮 - temporaryCheck() { - let data = { - productId: this.goodsDetail.id, - price: this.zPrice, - num: this.zNum, - productName: this.goodsDetail.productName, - productSn: this.goodsDetail.productSn, - productPicture: this.goodsDetail.productPicture, - supplierName: this.goodsDetail.supplierName, - stockLogList1:this.temporaryList, - wholesalePrice:this.goodsDetail.wholesalePrice, - lsprice:this.goodsDetail.price - } - this.carList.push(data) - this.temporaryList = [] - this.purchasePrice = '' - this.zPrice = '' - this.zNum = '' - for(let i=0;i { - let obj = { - mobile:that.formData.consigneeMobile, - username:that.formData.consigneeName, - sale: { - area: this.addressObj.area, - city: this.addressObj.city, - province: this.addressObj.province, - receiveAddress: that.formData.address, - totalAmount: that.zPrice ,//应付金额 - shopId:this.shopId - }, - saleDetailList: this.carList - } - this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => { - if (res.code == 200) { - - - }else{ - this.tui.toast(res.message) - } - }) - }).catch(err => { - console.log('表单错误信息:', err); - }) - - }, - openPicker() { - console.log('执行打开地址选择器') - this.show = true - }, - - onhideShow() { - this.show = false - console.log('执行了关闭地址选择器') - }, - //选中省市区 - onsetCity(e) { - let data = e.detail.target.dataset; - let address = data.province + data.city + data.area; - this.show = false - this.formData.address1 = address; - this.addressObj = { - province: data.province, - city: data.city, - area: data.area, - } - - console.log(this.formData, this.addressObj); + methods: { + attrNameChange(index, index1) { + this.goodsDetail.attributeList[index].value.forEach(item => { + item.isChecked = false; + }) + this.goodsDetail.attributeList[index].isChecked = true; + this.goodsDetail.attributeList[index].value[index1].isChecked = true; + var name = '', + evalue = [], + obj = {} + for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { + for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { + if (Ien[m].isChecked == true) { + evalue.push(Ien[m].value) + name += Ien[m].value + '/' + } + } + } + this.keyList.map((item, index) => { + obj[item] = evalue[index] + }) + let jishuqi = 0; + for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { + if (this.goodsDetail.attributeList[i].isChecked == true) { + jishuqi++ + } + } + if (this.goodsDetail.attributeList.length == jishuqi) { + let data = {} + this.attributeList = { + attributeList: JSON.stringify(obj), + productCount: this.temporaryNum, + name: name, + price: this.purchasePrice + } + + 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 + } + } + if (this.temporaryList.length == 0) { + this.temporaryList.push(this.attributeList); + } else { + for (var i = 0; i < this.temporaryList.length; i++) { + if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { + this.temporaryList[i] = this.attributeList + return + } else { + if (this.temporaryList.length == (i + 1)) { + this.temporaryList.push(this.attributeList); + return + } + } + } + } + } + }, + temporaryChange(val) { + this.zNum = 0 + for (var i = 0; i < this.temporaryList.length; i++) { + this.zNum += this.temporaryList[i].productCount + } + this.zPrice = this.zNum * this.purchasePrice + }, + //编辑每一个的单价 + clickPrice() { + this.$refs.inputDialog.open() + }, + //获取弹出层状态 + change(e) { + console.log('当前模式:' + e.type + ',状态:' + e.show); + }, + //弹出购物车或者商品规格选择弹窗 + toggle(type, item) { + + this.type = type + // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 + if (type == 'carPopup') { + this.$refs.carPopup.open('bottom') + for (let i = 0; i < this.carList.length; i++) { + this.carNum += this.carList[i].num + } + this.carType = this.carList.length + } else { + this.checkGoods(item); + this.$refs.popup.open('bottom') + } + + }, + //选择商品查询商品规格 + checkGoods(item) { + this.goodsDetail = item + this.purchasePrice = item.price; + if (typeof(this.goodsDetail.attributeList) == 'string') { + let newObj = JSON.parse(this.goodsDetail.attributeList) + let newArr = [] + for (let val in newObj) { + let valueObj = []; + for (var i = 0; i < newObj[val].length; i++) { + valueObj.push({ + value: newObj[val][i], + isChecked: false + }) + this.attrNameList.push({ + value: newObj[val][i], + name: val, + isChecked: false + }) + } + newArr.push({ + name: val, + value: valueObj + }) + } + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } + + }, + //顶部搜索框 + search(res) { + this.searchName = res.value + uni.showToast({ + title: '搜索:' + res.value, + icon: 'none' + }) + }, + inputDialogToggle() { + this.$refs.inputDialog.open() + }, + //弹窗选择规格后,点击弹窗中选好了按钮 + temporaryCheck() { + let data = { + productId: this.goodsDetail.id, + price: this.zPrice, + num: this.zNum, + productName: this.goodsDetail.productName, + productSn: this.goodsDetail.productSn, + productPicture: this.goodsDetail.productPicture, + supplierName: this.goodsDetail.supplierName, + stockLogList1: this.temporaryList, + wholesalePrice: this.goodsDetail.wholesalePrice, + lsprice: this.goodsDetail.price + } + this.carList.push(data) + this.temporaryList = [] + 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() + + }, + //删除整条商品 + delShop(id) { + var that = this; + console.log(this.carList) + for (let i = 0; i < this.carList.length; i++) { + if (this.carList[i].id == id) { + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + that.carList.splice(i, 1) + } + }) + } + } + }, + //删除商品下的某一个规格 + delShopSpec(name) { + var that = this; + console.log(this.carList) + for (let i = 0; i < this.carList.length; i++) { + for (let m = 0; m < this.carList[i].stockLogList1.length; m++) { + if (this.carList[i].stockLogList1[m].name == name) { + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + that.carList[i].stockLogList1.splice(m, 1) + if (that.carList[i].stockLogList1.length == 0) { + that.carList.splice(i, 1) + } + } + }) + } + } + } + }, + //点击底部下单按钮 + backPrevPage() { + let that = this; + this.$refs.form.validate().then(res => { + let obj = { + mobile: that.formData.consigneeMobile, + username: that.formData.consigneeName, + sale: { + area: this.addressObj.area, + city: this.addressObj.city, + province: this.addressObj.province, + receiveAddress: that.formData.address, + totalAmount: that.zPrice, //应付金额 + shopId: this.shopId + }, + saleDetailList: this.carList + } + this.tui.request("/app/sale/savePresale", "post", obj, false, false).then((res) => { + if (res.code == 200) { + this.tui.toast("下单成功,待商家配货") + setTimeout(() => { + uni.reLaunch({ + url:`/pages/login/login` + }) + },2000) + } else { + this.tui.toast(res.message) + } + }) + }).catch(err => { + console.log('表单错误信息:', err); + }) + + }, + openPicker() { + console.log('执行打开地址选择器') + this.show = true + }, + + onhideShow() { + this.show = false + console.log('执行了关闭地址选择器') + }, + //选中省市区 + onsetCity(e) { + let data = e.detail.target.dataset; + let address = data.province + data.city + data.area; + this.show = false + this.formData.address1 = address; + this.addressObj = { + province: data.province, + city: data.city, + area: data.area, + } + + console.log(this.formData, this.addressObj); }, //点击分类获取商品列表 getShareList(id) { this.tui.request("/app/productShare/getShareList", "POST", { - keywords:this.keywords, - id:id, - // id:'1717828137930330112', - pageNum: this.pageNum, + keywords: this.keywords, + id: id, + // id:'1717828137930330112', + pageNum: this.pageNum, pageSize: '10' }, false, true).then((res) => { if (res.code == 200) { - this.shopList = res.result.records + this.shopList = res.result.records this.shopId = res.result.records[0].shopId - } else { - this.tui.toast(res.message) + } else { + this.tui.toast(res.message) } }).catch((res) => {}) } @@ -550,6 +550,17 @@ border-radius: 15px; } + .address-btn { + width: 100%; + height: 80rpx; + background: #088FEB; + color: #fff; + font-size: 36rpx; + text-align: center; + line-height: 80rpx; + border-radius: 10px; + } + .popup-content { align-items: center; justify-content: center; @@ -597,17 +608,27 @@ color: #646566; } + .popup-pay-title { + height: 100rpx; + line-height: 100rpx; + text-align: center; + font-weight: bold; + font-size: 32rpx; + } + .title-box { background: #fff; } - .popup-pay-content{ - align-items: center; - justify-content: center; - padding: 15px; - width: 500rpx; - height: auto; - background-color: #fff; + + .popup-pay-content { + align-items: center; + justify-content: center; + padding: 0 15px 15px 15px; + width: 500rpx; + height: auto; + background-color: #fff; } + .bottom-box { width: 100%; position: fixed; @@ -684,19 +705,19 @@ } .right-box { - width: 100%; - height: 220rpx; - display: flex; - border-bottom: 1px solid #eee; - position: relative; + width: 100%; + height: 220rpx; + display: flex; + border-bottom: 1px solid #eee; + position: relative; } .box-left { - width: 170rpx; - height: 170rpx; - background-size: 100%; - margin: 25rpx; - border-radius: 20rpx; + width: 170rpx; + height: 170rpx; + background-size: 100%; + margin: 25rpx; + border-radius: 20rpx; } .box-left img { @@ -706,23 +727,23 @@ } .box-right { - margin-top: 17rpx; - flex: 1; - display: flex; - flex-direction: column; + margin-top: 17rpx; + flex: 1; + display: flex; + flex-direction: column; } .box-right-name { font-size: 30rpx; - font-weight: bold; - padding-left: 20rpx; + font-weight: bold; + padding-left: 20rpx; height: 30%; } .box-right-num { padding: 5rpx 0; - color: #777; - padding-left: 20rpx; + color: #777; + padding-left: 20rpx; height: 30%; } @@ -740,11 +761,11 @@ } .price-box { - flex: 1; - text-align: left; - display: flex; - flex-direction: column; - margin-right: 20rpx; + flex: 1; + text-align: left; + display: flex; + flex-direction: column; + margin-right: 20rpx; } .price-box text:first-child { diff --git a/pages/index/index.vue b/pages/index/index.vue index fb0309a..11ec2d2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -20,7 +20,7 @@ 推款 - + 待入库 @@ -102,15 +102,13 @@ arrow-direction="left"> - - - - - diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 3f71b9f..4001cd3 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -8,7 +8,7 @@ + :value="'单价:'+ item.wholesalePrice + ' 折扣: ' + sales.discount + '折'"> @@ -346,7 +346,7 @@ this.tui.request('/app/purchase/editPayPrice','post', { id:this.sales.id, price:e - },false,false).then(res => { + },false,true).then(res => { uni.showToast({ title: res.message, icon: 'none' diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index 079009e..4242b10 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -7,7 +7,7 @@ - {{item.categoryName}} + {{item.categoryName}} @@ -150,33 +150,18 @@ }, //点击分类获取商品列表 getShareList(id) { - var that = this; - // this.shopList = [] - this.tui.request("/app/product/getShareList", "POST", { - categoryId: id, - supplierName: this.searchName, - pageNum: this.pageNum, - pageSize: '10' - }, false, false).then((res) => { + this.tui.request("/app/product/getShareList", "POST", { + categoryId: id, + supplierName: this.searchName, + pageNum: this.pageNum, + pageSize: '10' + }, false, false).then((res) => { if (res.code == 200) { - if(this.shopList == ''){ - for (var i = 0; i < res.result.records.length; i++) { - this.shopList=res.result.records; - } - }else{ - for (var i = 0; i < that.shopList.length; i++) { - if(this.shopList[i].id !=res.result.records[0].id && i==this.shopList.length){ - for (var i = 0; i < res.result.records.length; i++) { - this.shopList.push(res.result.records[i]); - } - } - } - } - - console.log(this.shopList) - } else { - this.tui.toast(res.message) - } + console.log(res.result.records) + this.shopList = res.result.records + } else { + this.tui.toast(res.message) + } }).catch((res) => {}) }, //顶部搜索框 diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue index 6a31927..1a581d4 100644 --- a/pages/inventory/changeGoods1.vue +++ b/pages/inventory/changeGoods1.vue @@ -8,7 +8,7 @@ - {{item.categoryName}} + {{item.categoryName}} @@ -94,7 +94,7 @@ {{item.name}} - + @@ -137,7 +137,7 @@ {{items.name}} - + @@ -328,34 +328,46 @@ checkGoods(item) { this.tui.request("/app/product/getById/"+item.id, "POST", {}, false, true).then((res) => { if (res.code == 200) { - this.goodsDetail = res.result - if (typeof(this.goodsDetail.attributeList) == 'string') { - let newObj = JSON.parse(this.goodsDetail.attributeList) - let newArr = [] - for (let val in newObj) { - let valueObj = []; - for (var i = 0; i < newObj[val].length; i++) { - valueObj.push({ - value: newObj[val][i], - isChecked: false - }) - this.attrNameList.push({ - value: newObj[val][i], - name: val, - isChecked: false + this.goodsDetail = res.result; + this.tui.request("/app/productAttribute/selectByCategoryId", "POST", { + categoryId: this.goodsDetail.categoryId + }, false, true).then((res1) => { + if (res1.code == 200) { + this.attrList = res1.result; + if (res1.result.length > 0) { + let newArr = [] + this.attrList.forEach((items) => { + this.tui.request("/app/productAttributeValue/selectByAttributeId","get", { + id: items.id + }, false, true).then((res2) => { + if (res2.code == 200) { + let valueObj = []; + for (var i = 0; i < res2.result.length; i++) { + valueObj.push({ + value: res2.result[i].value, + isChecked: false + }) + } + newArr.push({ + name: items.attributeName, + value: valueObj + }) + this.goodsDetail.attributeList = newArr; + this.goodsDetail.attributeList.forEach((item, index) => { + this.columns[index] = item.value; + this.keyList[index] = item.name; + }) + } else { + this.tui.toast(res.message) + } + console.log(this.goodsDetail) + }).catch((res) => {}) }) } - newArr.push({ - name: val, - value: valueObj - }) + } else { + this.tui.toast(res.message) } - this.goodsDetail.attributeList = newArr; - this.goodsDetail.attributeList.forEach((item, index) => { - this.columns[index] = item.value; - this.keyList[index] = item.name; - }) - } + }).catch((res) => {}) } else { this.tui.toast(res.message) } diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index d8cd577..357e87a 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -190,9 +190,9 @@ - 配送方式 - - 配送方式 + + @@ -261,7 +261,7 @@ discountNum:10, //整体折扣 priceCurrent:'', priceOk:'', //已收金额 - value: '', + value: 0, sex: [{ text: '平台配送', value: 0 @@ -826,7 +826,9 @@ .shop-productName view { height: 55rpx; } - + .checklist-group{ + height: 80rpx !important; + } // .shop-name { // .uni-icons { // color: #088FEB !important; diff --git a/pages/inventory/inventory.vue b/pages/inventory/inventory.vue index b468560..8d12638 100644 --- a/pages/inventory/inventory.vue +++ b/pages/inventory/inventory.vue @@ -27,11 +27,11 @@ - + 分类管理 - + 新增入库 @@ -40,7 +40,7 @@ + @tap.stop="onGridClick('2')"> 新增商品 @@ -48,7 +48,7 @@ - {{item.categoryName}} + {{item.categoryName}} diff --git a/pages/login/login.vue b/pages/login/login.vue index 85d44f4..17613d5 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -130,7 +130,8 @@ } }).catch((res) => {}) }, - sectionChange(index) { + sectionChange(index) { + console.log('给他赋值',index) this.wayValue = index; }, //登录 @@ -159,15 +160,12 @@ this.tui.request(loginUrl, "POST", data, true, true).then((res) => { if (res.code == 200) { uni.setStorageSync("hiver_token", res.result.accessToken) - let state = { - token: res.result.accessToken - } - this.login(state) + // let state = { + // token: res.result.accessToken + // } + // this.login(state) //多店铺的时候,在这里加上打开店铺选择弹窗 - if (res.result.shopList.length > 1 && this.wayValue == 0) { - this.shopList = res.result.shopList; - this.toggle("center"); - } else if (this.wayValue == 1) { //物流公司登录 + if (this.wayValue == 1) { //物流公司登录 setTimeout(() => { uni.reLaunch({ url: '/pages/index/logistics' @@ -181,6 +179,9 @@ }) }, 200) this.tui.toast('登录成功', 2000, true) + }else if (res.result.shopList.length > 1 && this.wayValue == 0) { + this.shopList = res.result.shopList; + this.toggle("center"); }else{ uni.setStorageSync('shopName',res.result.shopList[0].shopName) uni.setStorageSync('type',res.result.shopList[0].type) diff --git a/pages/other/custom.vue b/pages/other/custom.vue index 16915e0..e6db6ea 100644 --- a/pages/other/custom.vue +++ b/pages/other/custom.vue @@ -55,10 +55,11 @@ range: ['2023-10-1', '2023-10-2'], name: '', shopList: [], - list: ['全部', '采购单', '退货单'], + list: ['采购单', '退货单'], // 或者如下,也可以配置keyName参数修改对象键名 // list: [{name: '未付款'}, {name: '待评价'}, {name: '已付款'}], - current: 0, + current: 0, + userId:'', shopId: '', bList: [], query: { @@ -92,7 +93,7 @@ } }, getShopList() { - this.tui.request('/app/shop/getAll', 'get', {}, false, true, false).then(res => { + this.tui.request('/app/shop/getAllShopByCustomer', 'get', {}, false, true, false).then(res => { if (res.code !== 200) return this.shopList = res.result.map((v) => { return { @@ -103,8 +104,8 @@ }) }, getList() { - this.tui.request('/app/sale/list', 'post', { - userId: this.userId, + this.tui.request('/app/sale/listAll', 'post', { + remarkSR:2, shopId: this.shopId, searchDateVo: this.query }, false, false, false).then(res => { @@ -113,8 +114,8 @@ }) }, getAllList() { - this.tui.request('/app/sale/listAll', 'post', { - userId: this.userId, + this.tui.request('/app/sale/listAll', 'post', { + remarkSR:2, shopId: this.shopId, searchDateVo: this.query }, false, false, false).then(res => { @@ -123,8 +124,8 @@ }) }, getReturnList() { - this.tui.request('/app/sale/listAll', 'post', { - userId: this.userId, + this.tui.request('/app/sale/listAll', 'post', { + remarkSR:3, shopId: this.shopId, searchDateVo: this.query }, false, false, false).then(res => {