diff --git a/pages/index/addHangOrder.vue b/pages/index/addHangOrder.vue index 8480770..5ee97a0 100644 --- a/pages/index/addHangOrder.vue +++ b/pages/index/addHangOrder.vue @@ -633,9 +633,13 @@ obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice obj.saleId = item.saleDetailDTOList[i].saleId obj.remark = item.remark + obj.xsyId = item.createBy + obj.createByName = item.createByName dataList.push(obj) } + console.log(dataList) uni.setStorageSync('carList1', JSON.stringify(dataList)) + uni.setStorageSync('khName', '') } uni.switchTab({ url: '/pages/inventory/goodsList1' diff --git a/pages/index/downarrears.vue b/pages/index/downarrears.vue index fcfcf16..a888aa8 100644 --- a/pages/index/downarrears.vue +++ b/pages/index/downarrears.vue @@ -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/index.vue b/pages/index/index.vue index 556c625..533e5f3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -49,7 +49,7 @@ 销售笔数 - + 今日利润 @@ -58,7 +58,7 @@ - + 本周营收统计 @@ -257,7 +257,7 @@ this.tui.request("/app/sale/getShopWeek", "POST", {}, false, false).then((res) => { if(res.code == 200){ let dataList = { - categories: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"], + categories: this.getWeek(), series: [{ name: "周销售额", linearColor: [ @@ -277,6 +277,20 @@ } }) }, + getWeek() { + // var date = new Date(); + // var day = date.getDay(); + // var names = ["周日","周一","周二","周三","周四","周五","周六"]; + // return names[day]; + let days = 7 + let week = ["周日","周一","周二","周三","周四","周五","周六"]; + let dateList = Array.from({length:days},(v,i)=> i).map(day =>{ + let date = new Date(); + date.setDate(date.getDate() - day); + return week[date.getDay()] + }) + return dateList.reverse() + }, //跳转订单详情 gotoDetail(id) { uni.navigateTo({ diff --git a/pages/index/order.vue b/pages/index/order.vue index 494444b..8cf2d96 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -8,7 +8,7 @@
  • + :thumbnail="item.saleDetailDTOList[0].productPicture"> 销售员: {{item.createByName == null ?'暂无':item.createByName}} 营业额: {{item.realAmount == null ?'暂无':item.realAmount}} @@ -114,6 +114,8 @@ obj.remark = item.remark dataList.push(obj) } + item.name = item.userName; + uni.setStorageSync('khName',JSON.stringify(item)) uni.setStorageSync('carList1',JSON.stringify(dataList)) uni.switchTab({ url: '/pages/inventory/goodsList1' diff --git a/pages/index/uparrears.vue b/pages/index/uparrears.vue index 4a2ccbd..022dab3 100644 --- a/pages/index/uparrears.vue +++ b/pages/index/uparrears.vue @@ -14,7 +14,7 @@ 订单状态:{{item.inStorageStatus == 0 ?'未入库' :'已入库'}} - 回款 + 回款
diff --git a/pages/index/waitStorage.vue b/pages/index/waitStorage.vue index 881bd97..07a55c2 100644 --- a/pages/index/waitStorage.vue +++ b/pages/index/waitStorage.vue @@ -24,7 +24,7 @@ 订单状态:{{item.inStorageStatus == 0 ?'未入库' :'已入库'}} - 更新 + 更新 diff --git a/pages/index/waitStorageDetail.vue b/pages/index/waitStorageDetail.vue index 9092a0f..30974c9 100644 --- a/pages/index/waitStorageDetail.vue +++ b/pages/index/waitStorageDetail.vue @@ -99,7 +99,7 @@
- 回款 + 回款 确认提交 @@ -156,6 +156,7 @@ }, false, true).then((res) => { if (res.code == 200) { this.sales = res.result.purchase + this.noPay = res.result.purchase.noPay this.supplier = res.result.supplier this.remark = res.result.purchase.remark this.goodsList = res.result.purchaseDetails @@ -194,11 +195,18 @@ }, inventorySubmit() { - if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) { + if(this.shouldPay == 0){ uni.showToast({ - title: "信息填写完成后入库!", + title: "请维护商品价格后入库!", icon: 'none' }) + return + }else if(this.alreadyPay == 0){ + uni.showToast({ + title: "管理员必须维护价格后入库!", + icon: 'none' + }) + return } let that = this; let purchase = { diff --git a/pages/inventory/addGoods.vue b/pages/inventory/addGoods.vue index 4f56294..7f9a83f 100644 --- a/pages/inventory/addGoods.vue +++ b/pages/inventory/addGoods.vue @@ -39,7 +39,7 @@ - 保存 + 保存
@@ -64,7 +64,8 @@ salesWeek: '', tailWarn: '' }, - categoryList: [], + categoryList: [], + productId:'', arrtList: [], arrtChange: [], rules: { @@ -114,12 +115,24 @@ } }, onShow() { - let that = this - uni.$on('classForm', function(data) { - that.formData.classification = data - }) + // let that = this + // uni.$on('classForm', function(data) { + // that.formData.classification = data + // }) }, - onLoad() { + onLoad(option) { + console.log(JSON.parse(option.dataList)) + this.dataList = JSON.parse(option.dataList) + this.formData.productName = this.dataList.productName + this.formData.price = this.dataList.price + this.formData.productSn = this.dataList.productSn + this.formData.wholesalePrice = this.dataList.wholesalePrice + this.formData.productPicture = this.dataList.productPicture + this.formData.productIntro = this.dataList.productIntro + this.formData.categoryId = this.dataList.categoryId + this.formData.salesWeek = this.dataList.salesWeek + this.formData.tailWarn = this.dataList.tailWarn + this.tui.request("/app/productCategory/list", "get", { // shopId: 1, }, false, true).then((res) => { @@ -192,12 +205,19 @@ }, // 触发提交表单 - submit() { - this.$refs.form.validate().then(res => { - this.tui.request("/app/product/save", "post", res, false, false).then((res1) => { + submit() { + let url = '' + this.$refs.form.validate().then(res => { + if(this.dataList.id !=''){ + url = '/app/product/edit' + res.id = this.dataList.id + }else{ + url = '/app/product/save' + } + this.tui.request(url, "post", res, false, false).then((res1) => { if (res1.code == 200) { uni.navigateBack({ - delta: 1 + delta: 2 }) } else { uni.showToast({ diff --git a/pages/inventory/addinventory.vue b/pages/inventory/addinventory.vue index 979b82a..acd6268 100644 --- a/pages/inventory/addinventory.vue +++ b/pages/inventory/addinventory.vue @@ -39,15 +39,21 @@
- + + + + {{values[0] | sliceMsg}} - 数量:{{values[1]}} + 数量: 维护采购价 + + + @@ -133,14 +139,14 @@ - + {{item.name}} - + 数量:{{zNum}} 件 @@ -518,6 +524,41 @@ uni.navigateTo({ url: '/pages/index/peopleList?popleType=' + popleType }) + }, + //删除整条商品 + delShop(id) { + var that = this; + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + if(res.confirm){ + if(that.carList.has(id) == true){ + that.carList.delete(id) + } + that.$forceUpdate() + } + } + }) + + }, + //删除商品下的某一个规格 + delShopSpec(id,name) { + var that = this; + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + if(res.confirm){ + that.carList.get(id).stockLogList.delete(name) + if(that.carList.get(id).stockLogList.size == 0){ + that.carList.delete(id) + } + } + that.$forceUpdate() + } + }) + }, inventorySubmit() { if (this.khName == '' || this.carList == '') { @@ -591,7 +632,24 @@ that.carList.forEach(function(value, key) { that.shouldPay += value.price }) - + }, + //修改已选规格的数量 + GoodsNumChange(e,index,index1){ + console.log(this.carList) + let that = this; + this.carList.get(index).stockLogList.set(index1,e) + this.carList.get(index).productCount = 0 + this.shouldPay = 0 + this.totalAmount = 0 + this.carList.get(index).stockLogList.forEach(function(value, key) { + console.log(that.carList.get(index)) + that.carList.get(index).productCount = that.carList.get(index).productCount + value + that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index).purchasePrice + }) + this.carList.forEach(function(value, key) { + that.shouldPay = that.shouldPay + value.price + that.totalAmount = that.totalAmount+ value.productCount + }) } } } @@ -718,7 +776,7 @@ } .shop-collapse text { - flex: 1; + width: 40%; text-align: center; padding-right: 40rpx; border-right: 1px solid #eee; diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index 4eb5a67..0252d96 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -1,4 +1,4 @@ - +