Browse Source

修改开单选择商品逻辑

master
wangfukang 3 years ago
parent
commit
cb137cbf88
  1. BIN
      pages/.DS_Store
  2. 68
      pages/billing/addUser.vue
  3. 8
      pages/billing/billing.vue
  4. 224
      pages/billing/changeGoods1.vue
  5. 1
      pages/billing/goodsOutInfo.vue
  6. 4
      pages/billing/outOrder.vue
  7. 26
      pages/billing/saveOrder.vue
  8. 16
      pages/index/addHangOrder.vue
  9. 1
      pages/index/checkShop.vue
  10. 131
      pages/index/downStearmList.vue
  11. 1
      pages/index/downstream.vue
  12. 15
      pages/index/index.vue
  13. 7
      pages/index/order.vue
  14. 45
      pages/index/orderDetail.vue
  15. 7
      pages/index/peopleList.vue
  16. 14
      pages/index/shareStyle.vue
  17. 1
      pages/index/shopInfo.vue
  18. 1
      pages/index/uparrears.vue
  19. 1
      pages/index/upstream.vue
  20. 2
      pages/index/waitStorageDetail.vue
  21. 133
      pages/info/editStore.vue
  22. 48
      pages/info/index.vue
  23. 19
      pages/info/info.vue
  24. 25
      pages/inventory/addGoods.vue
  25. 188
      pages/inventory/changeGoods1.vue
  26. 20
      pages/inventory/gategoryLow.vue
  27. 60
      pages/inventory/goodsList1.vue
  28. 2
      pages/inventory/inventoryDetail.vue

BIN
pages/.DS_Store

Binary file not shown.

68
pages/billing/addUser.vue

@ -103,13 +103,8 @@
this.$refs.form.setRules(this.rules) this.$refs.form.setRules(this.rules)
}, },
onLoad(option) { onLoad(option) {
// if(option.data){
// let data = JSON.parse(option.data)
// }
this.popleType = option.popleType this.popleType = option.popleType
this.type=option.type this.type=option.type
console.log(option.popleType)
console.log(option.type)
if (option.type = "edit") { if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area this.formData.address1 = data.province + data.city + data.area
this.formData.address = data.address this.formData.address = data.address
@ -120,7 +115,6 @@
this.formData.consigneeMobile = data.consigneeMobile this.formData.consigneeMobile = data.consigneeMobile
this.formData.consigneeName = data.consigneeName this.formData.consigneeName = data.consigneeName
} }
console.log(this.formData)
}, },
methods: { methods: {
del() { del() {
@ -144,34 +138,16 @@
}) })
} }
}) })
// this.tui.request("/app/customer/delById", "post", {
// id: this.userInfo.id,
// }, false, true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "删除成功",
// icon: 'none'
// })
// uni.navigateBack()
// } else {
// uni.showToast({
// title: "删除失败",
// icon: 'none'
// })
// }
// })
}, },
nameBlur() { nameBlur() {
this.formData.username = this.formData.phone; this.formData.username = this.formData.phone;
}, },
openPicker() { openPicker() {
console.log('执行打开地址选择器')
this.show = true this.show = true
}, },
onhideShow() { onhideShow() {
this.show = false this.show = false
console.log('执行了关闭地址选择器')
}, },
//选中省市区 //选中省市区
onsetCity(e) { onsetCity(e) {
@ -184,8 +160,6 @@
city: data.city, city: data.city,
area: data.area, area: data.area,
} }
console.log(this.formData, this.addressObj);
}, },
// 触发提交表单 // 触发提交表单
submit() { submit() {
@ -242,50 +216,8 @@
} }
}) })
} }
// if (that.type == 'edit') {
// res.id = that.userInfo.id
// that.tui.request("/app/supplier/edit", "post", this.formData, false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "修改成功",
// icon: 'none'
// })
// uni.navigateBack()
// } else {
// uni.showToast({
// title: "修改失败",
// icon: 'none'
// })
// }
// })
// } else {
// that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "添加成功",
// icon: 'none'
// })
// let pages =
// getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
// let prevPage = pages[pages.length - 2]; //上一页页面实例
// prevPage.$vm.popleType = 'gysName'
// uni.navigateBack({
// delta: 1
// })
// } else {
// uni.showToast({
// title: "添加失败",
// icon: 'none'
// })
// }
// })
// }
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', err);
}) })
} }
} }

8
pages/billing/billing.vue

@ -26,13 +26,6 @@
totalPages: 1, totalPages: 1,
} }
}, },
onShow() {
// this.tui.request("/app/sale/list", "post", {
// pageNumber: this.pageIndex,
// pageSize: this.pageSize,
// }, false, false).then((res) => {
// })
},
methods: { methods: {
scanCodeAdd() { scanCodeAdd() {
@ -52,7 +45,6 @@
}) })
}, },
goodsAdd() { goodsAdd() {
// &purchaseDetails=" + encodeURIComponent(JSON.stringify(this.saleDetailList))
uni.navigateTo({ uni.navigateTo({
url: "/pages/inventory/goodsList?type=billing" url: "/pages/inventory/goodsList?type=billing"
}) })

224
pages/billing/changeGoods1.vue

@ -63,23 +63,16 @@
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" <img :src="goodsDetail.productPicture"
alt=""> alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} <view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view> </view>
<view class="popup-title-right-box">{{goodsDetail.productSn}}</view> <view class="popup-title-right-box">{{goodsDetail.productSn}}</view>
<!-- <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">修改价格</text>
</view> -->
</view> </view>
</view> </view>
<view class="popup-container"> <view class="popup-container">
<!-- <view class="purchase-price" v-if="storageType == 0">
<view style="margin-right: 20rpx;">实际价格</view>
<uni-easyinput type="text" v-model="purchasePrice" placeholder="请输入实际价格" />
</view> -->
<ul style="border-top:20rpx;"> <ul style="border-top:20rpx;">
<li v-for="(items,index) in goodsDetail.attributeList" :key="index"> <li v-for="(items,index) in goodsDetail.attributeList" :key="index">
<view class="title-fur"> <view class="title-fur">
@ -104,7 +97,7 @@
<view class="popup-bottom" v-for="(item,index) in temporaryList" :key="index"> <view class="popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="popup-bottom-left"> <view class="popup-bottom-left">
<text>{{zNum}} 件</text> <text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text> <!-- <text>¥{{zPrice}}</text> -->
</view> </view>
<view class="popup-bottom-right"> <view class="popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view> <view class="bottom-btn" @tap="temporaryCheck">选好了</view>
@ -113,51 +106,36 @@
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
<!-- 弹出输入框 -->
<uni-popup ref="inputDialog" background-color="#fff" @change="change">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择商品价格</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.price)">
<text style="display: inline-block">零售价:¥{{goodsDetail.price}}</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.wholesalePrice)">
<text style="display: inline-block">批发价:¥{{goodsDetail.wholesalePrice}}</text>
</view>
</view>
</uni-popup>
<!-- 购物车弹出层 --> <!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change"> <uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content"> <view class="popup-content">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;"> <view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" <img :src="item.productPicture"
alt=""> alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view> <view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view> <view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> <view class="popup-title-right-box">
<text style="margin-right:20rpx;">¥{{value[1].price}}</text> <text style="margin-right:20rpx;">供应商:{{item.supplierName}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> --> <view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)">
<uni-icons color="red" type="trash" size="26"></uni-icons> <uni-icons color="red" type="trash" size="26"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys"> <view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="checkList"> <view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])"> <view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<view class="checkList-box"> <view class="checkList-box">
{{values[0] | sliceMsg}} {{item1.attributeList | sliceMsg}}
</view> </view>
<uni-number-box max="100000" v-model="values[1]" @change="change" /> <uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view> </view>
</view> </view>
</view> </view>
@ -204,9 +182,7 @@
storageType: '', storageType: '',
carNum: 0, carNum: 0,
carType: 0, carType: 0,
type: '', type: ''
oldList: [],
newList: new Map()
} }
}, },
filters: { filters: {
@ -235,9 +211,7 @@
methods: { methods: {
//初始化获取分类列表 //初始化获取分类列表
getGategoryList() { getGategoryList() {
this.tui.request("/app/productCategory/list", "get", { this.tui.request("/app/productCategory/list", "get", {}, false, true).then((res) => {
// shopId: 1,
}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.indexList = res.result; this.indexList = res.result;
for (var i = 0; i < this.indexList.length; i++) { for (var i = 0; i < this.indexList.length; i++) {
@ -299,8 +273,8 @@
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
} else { } else {
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
console.log(this.temporaryList[i].name.indexOf(this.attributeList.name))
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList
return return
}else{ }else{
if (this.temporaryList.length == (i + 1)) { if (this.temporaryList.length == (i + 1)) {
@ -316,9 +290,7 @@
}, },
temporaryChange(val) { temporaryChange(val) {
console.log(val)
this.zNum = 0 this.zNum = 0
console.log(this.temporaryList)
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount this.zNum += this.temporaryList[i].productCount
} }
@ -343,24 +315,36 @@
pageSize: '10' pageSize: '10'
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records)
this.shopList = res.result.records this.shopList = res.result.records
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
//获取弹出层状态 change(){
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show); },
//
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
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.carNum += this.carList[i].num
}
}, },
//弹出购物车或者商品规格选择弹窗 //弹出购物车或者商品规格选择弹窗
toggle(type, item) { toggle(type, item) {
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') { if (type == 'carPopup') {
console.log(this.carList)
this.oldList = this.carList this.oldList = this.carList
this.newFun() console.log(this.carList)
// this.newFun()
this.carNum = 0 this.carNum = 0
for (let i = 0; i < this.carList.length; i++) { for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num this.carNum += this.carList[i].num
@ -373,78 +357,24 @@
} }
}, },
newFun() { //选择商品查询商品规格
//newList 已经是map格式了 新数组 初始为空 checkGoods(item) {
//carList 旧数组 this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){ for(let i=0;i<this.carList.length;i++){
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同 if(item.id == this.carList[i].id){
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { this.zNum = this.carList[i].num
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i] this.temporaryList = this.carList[i].saleDetailQueryDTO
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
} }
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
} }
} }
}
},
//选择商品查询商品规格
checkGoods(item) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => { }, false, true).then((res1) => {
@ -476,11 +406,6 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
@ -513,9 +438,9 @@
this.categoryId = this.indexList[index].id this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList(this.indexList[index].id)
}, },
inputDialogToggle() { // inputDialogToggle() {
this.$refs.inputDialog.open() // this.$refs.inputDialog.open()
}, // },
//临时改价 //临时改价
changePrice(val) { changePrice(val) {
this.goodsDetail.price = this.temporaryList[0].price = val this.goodsDetail.price = this.temporaryList[0].price = val
@ -535,15 +460,29 @@
wholesalePrice: this.goodsDetail.wholesalePrice, wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price lsprice: this.goodsDetail.price
} }
if(this.carList.length == 0){
this.carList.push(data) 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++) { for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0 this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
} }
} }
console.log(this.carList)
this.temporaryList = [] this.temporaryList = []
this.purchasePrice = '' this.purchasePrice = ''
this.zPrice = '' this.zPrice = ''
@ -558,33 +497,50 @@
}, },
//删除整条商品 //删除整条商品
delShop(id) { delShop(item) {
var that = this; var that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (that.newList.has(id) == true) { for(let i=0;i<that.carList.length;i++){
that.newList.delete(id) if(that.carList[i].id == item.id){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
}
} }
that.carType = that.carList.length
} }
that.$forceUpdate() that.$forceUpdate()
} }
}) })
}, },
//删除商品下的某一个规格 //删除商品下的某一个规格
delShopSpec(name) { delShopSpec(index,index1) {
var that = this; var that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.newList.get(id).stockLogList.delete(name) for(let i=0;i<that.carList.length;i++){
if (that.newList.get(id).stockLogList.size == 0) { for(let m=0;m<that.carList[i].saleDetailQueryDTO.length;m++){
that.newList.delete(id) if(that.carList[i].id == index){
if(that.carList[i].saleDetailQueryDTO[m].attributeList == index1){
that.carList[i].num -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carNum -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carList[i].saleDetailQueryDTO.splice(m, 1)
continue;
}
}
}
if(that.carList[i].saleDetailQueryDTO.length == 0){
that.carList.splice(i, 1)
}
} }
that.carType = that.carList.length
} }
that.$forceUpdate() that.$forceUpdate()
} }

1
pages/billing/goodsOutInfo.vue

@ -103,7 +103,6 @@ export default {
}, },
async getAttributeList() { async getAttributeList() {
const res = await this.tui.request('/app/attribute/list','get',{type:2,categoryId:2},false,false,false) const res = await this.tui.request('/app/attribute/list','get',{type:2,categoryId:2},false,false,false)
console.log(res)
} }
} }
} }

4
pages/billing/outOrder.vue

@ -118,9 +118,9 @@ export default {
// 触发提交表单 // 触发提交表单
submit() { submit() {
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', err);
}) })
} }
} }

26
pages/billing/saveOrder.vue

@ -86,7 +86,6 @@
if (res.code == 200) { if (res.code == 200) {
this.categoryList = res.result; this.categoryList = res.result;
this.candidates = res.result.map(item =>{ return item.name}) this.candidates = res.result.map(item =>{ return item.name})
// this.formData.name = "";
this.formData.address1 = ""; this.formData.address1 = "";
this.formData.address = ""; this.formData.address = "";
@ -98,18 +97,13 @@
if (res.code !== 200) return if (res.code !== 200) return
this.staffList = res.result; this.staffList = res.result;
this.createCandidates = res.result.map(item =>{ return item.nickname}) this.createCandidates = res.result.map(item =>{ return item.nickname})
console.log(this.createCandidates,'this.createCandidates');
}) })
}, },
onLoad(options) { onLoad(options) {
this.purchase = JSON.parse(decodeURIComponent(options.purchase)) this.purchase = JSON.parse(decodeURIComponent(options.purchase))
this.saleDetailList = JSON.parse(decodeURIComponent(options.saleDetailList)) this.saleDetailList = JSON.parse(decodeURIComponent(options.saleDetailList))
}, },
// computed:{
// payStatus() {
// }
// }
methods:{ methods:{
addUser( type ) { addUser( type ) {
if(type == 'add') { if(type == 'add') {
@ -133,7 +127,6 @@
if(obj.length > 0) { if(obj.length > 0) {
this.userObj = obj[0] this.userObj = obj[0]
this.userObj.address1 = obj[0].province + obj[0].city + obj[0].area; this.userObj.address1 = obj[0].province + obj[0].city + obj[0].area;
// this.formData = Object.assign(this.formData, this.userObj)
this.formData.address1 = this.userObj.address1 this.formData.address1 = this.userObj.address1
this.formData.address = this.userObj.address this.formData.address = this.userObj.address
this.formData.area = this.userObj.area this.formData.area = this.userObj.area
@ -196,15 +189,6 @@
} }
}) })
}, },
/**
* 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
* @param {String} name 字段名称
* @param {String} value 表单域的值
*/
// binddata(name,value){
// 通过 input 事件设置表单指定 name 的值
// this.$refs.form.setValue(name, value)
// },
// 触发提交表单 // 触发提交表单
submit() { submit() {
let companyId let companyId
@ -235,7 +219,7 @@
} else { } else {
payStatus = 0 payStatus = 0
} }
console.log(this.purchase,'this.purchase');
let obj = { let obj = {
orderByWorker: workerId, orderByWorker: workerId,
sale: { sale: {
@ -257,9 +241,9 @@
saleDetailList: this.saleDetailList, saleDetailList: this.saleDetailList,
transCompany: companyId, transCompany: companyId,
} }
console.log(this.formData,this.saleDetailList, workerId, companyId ,this.company,this.orderByWorkerList, obj);
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
console.log('表单数据信息:', res);
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => { this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
@ -277,7 +261,7 @@
} }
}) })
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', err);
}) })
} }
} }

16
pages/index/addHangOrder.vue

@ -50,7 +50,7 @@
</view> </view>
<!-- 语音识别弹出层 --> <!-- 语音识别弹出层 -->
<view> <view>
<uni-popup ref="popup" background-color="#fff" @change="change"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view class="popup-title">
<text>语音录入</text> <text>语音录入</text>
@ -77,7 +77,7 @@
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
<view> <view>
<uni-popup ref="shopPopup" background-color="#fff" @change="change"> <uni-popup ref="shopPopup" background-color="#fff">
<view class="shop-popup-content"> <view class="shop-popup-content">
<view class="shop-popup-title"> <view class="shop-popup-title">
<view class="shop-popup-title-left"> <view class="shop-popup-title-left">
@ -105,7 +105,7 @@
</view> </view>
<view class="shop-attrs"> <view class="shop-attrs">
<uni-data-checkbox v-model="value" :localdata="range" <uni-data-checkbox v-model="value" :localdata="range"
@change="change"></uni-data-checkbox> ></uni-data-checkbox>
<text v-for="(itemTag, index1) in items.value" :key="index1" <text v-for="(itemTag, index1) in items.value" :key="index1"
@tap.stop="attrNameChange(index,index1) " @tap.stop="attrNameChange(index,index1) "
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text> :class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
@ -132,7 +132,7 @@
</uni-popup> </uni-popup>
</view> </view>
<!-- 弹出输入框 --> <!-- 弹出输入框 -->
<uni-popup ref="payDialog" background-color="#fff" @change="change"> <uni-popup ref="payDialog" background-color="#fff">
<view class="popup-pay-content"> <view class="popup-pay-content">
<view class="popup-pay-title"> <view class="popup-pay-title">
<text>选择商品价格</text> <text>选择商品价格</text>
@ -156,7 +156,7 @@
@confirm="setDetail"></uni-popup-dialog> @confirm="setDetail"></uni-popup-dialog>
</uni-popup> </uni-popup>
<!-- 查看大图弹出层 --> <!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change"> <uni-popup ref="imgPopup" background-color="#fff">
<view class="img-popup-content"> <view class="img-popup-content">
<img :src="bigImg" alt="" style="width: 100%;height: 100%;"> <img :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view> </view>
@ -244,9 +244,6 @@
clickCollapse(item) { clickCollapse(item) {
item.isCollapse = !item.isCollapse item.isCollapse = !item.isCollapse
}, },
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//关闭弹出层 //关闭弹出层
close() { close() {
this.$refs.popup.close() this.$refs.popup.close()
@ -561,7 +558,6 @@
delGoods(item, productId) { delGoods(item, productId) {
let that = this; let that = this;
this.hangId = item.id; this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
@ -582,7 +578,6 @@
delGoodsPrecs(item, index, index1) { delGoodsPrecs(item, index, index1) {
let that = this; let that = this;
this.hangId = item.id; this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条规格吗?", content: "确定删除此条规格吗?",
@ -643,7 +638,6 @@
obj.createByName = item.createByName obj.createByName = item.createByName
dataList.push(obj) dataList.push(obj)
} }
console.log(dataList)
uni.setStorageSync('carList1', JSON.stringify(dataList)) uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('khName', '') uni.setStorageSync('khName', '')
} }

1
pages/index/checkShop.vue

@ -145,7 +145,6 @@ export default {
}else{ }else{
this.tui.toast(res.message) this.tui.toast(res.message)
} }
console.log(res)
}) })
} }
} }

131
pages/index/downStearmList.vue

@ -54,7 +54,7 @@
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> <img :src="goodsDetail.productPicture" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} <view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
@ -129,10 +129,10 @@
<!-- 购物车弹出层 --> <!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change"> <uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content"> <view class="popup-content">
<view v-for="item in carList" style="position: relative;"> <view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> <img :src="item.productPicture" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view> <view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
@ -140,22 +140,22 @@
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{item.price}}</text> <text style="margin-right:20rpx;">¥{{item.price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> --> <!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item.id)"> <view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<uni-icons color="red" type="trash" size="26"></uni-icons> <uni-icons color="red" type="trash" size="26"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="popup-container" v-for="items in item.stockLogList1"> <view class="popup-container" v-for="(item1,index1) in item.stockLogList1">
<view class="checkList"> <view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(items.name)"> <view style="margin-right:5%;" @tap="delShopSpec(item.productId,item1.attributeList)" :key="index1">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<view class="checkList-box"> <view class="checkList-box">
{{items.name}} {{item1.name}}
</view> </view>
<uni-number-box max="100000" v-model="items.productCount" @change="change" /> <uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view> </view>
</view> </view>
</view> </view>
@ -165,7 +165,7 @@
<text>{{carType}} 款 {{carNum}} 件</text> <text>{{carType}} 款 {{carNum}} 件</text>
</view> </view>
<view class="popup-bottom-right"> <view class="popup-bottom-right">
<view class="bottom-btn" @tap="">选好了</view> <view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view> </view>
</view> </view>
</view> </view>
@ -272,6 +272,7 @@
this.keyList.map((item, index) => { this.keyList.map((item, index) => {
obj[item] = evalue[index] obj[item] = evalue[index]
}) })
let jishuqi = 0; let jishuqi = 0;
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
if (this.goodsDetail.attributeList[i].isChecked == true) { if (this.goodsDetail.attributeList[i].isChecked == true) {
@ -297,17 +298,20 @@
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
} else { } else {
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
console.log(this.temporaryList[i].name.indexOf(this.attributeList.name))
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList console.log(this.temporaryList)
return return
}else{ }else{
if (this.temporaryList.length == (i + 1)) { if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
console.log(this.temporaryList)
return return
} }
} }
} }
} }
} }
}, },
temporaryChange(val) { temporaryChange(val) {
@ -323,7 +327,7 @@
}, },
//获取弹出层状态 //获取弹出层状态
change(e) { change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
}, },
//弹出购物车或者商品规格选择弹窗 //弹出购物车或者商品规格选择弹窗
toggle(type, item) { toggle(type, item) {
@ -331,10 +335,11 @@
this.type = type this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') { if (type == 'carPopup') {
this.$refs.carPopup.open('bottom') this.carNum = 0
for (let i = 0; i < this.carList.length; i++) { for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num this.carNum += this.carList[i].num
} }
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length this.carType = this.carList.length
} else { } else {
this.checkGoods(item); this.checkGoods(item);
@ -345,9 +350,22 @@
//选择商品查询商品规格 //选择商品查询商品规格
checkGoods(item) { checkGoods(item) {
this.purchasePrice = item.price; this.purchasePrice = item.price;
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => { this.goodsDetail = item;
if (res.code == 200) { this.temporaryList = []
this.goodsDetail = res.result; this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){
if(item.id == this.carList[i].productId){
this.zNum = this.carList[i].num
this.temporaryList = this.carList[i].stockLogList1
}
}
}
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => { }, false, true).then((res1) => {
@ -379,11 +397,6 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
@ -393,6 +406,17 @@
inputDialogToggle() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
this.carNum += this.carList[i].num
}
},
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
let data = { let data = {
@ -407,7 +431,29 @@
wholesalePrice: this.goodsDetail.wholesalePrice, wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price 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].productId == data.productId){
this.carList[i] = data
aa = false
}
}
if(aa){
this.carList.push(data) 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].stockLogList1.length; m++) {
this.carList[i].num += this.carList[i].stockLogList1[m].productCount
}
}
this.temporaryList = [] this.temporaryList = []
this.purchasePrice = '' this.purchasePrice = ''
this.zPrice = '' this.zPrice = ''
@ -422,45 +468,56 @@
}, },
//删除整条商品 //删除整条商品
delShop(id) { delShop(item) {
var that = this; var that = this;
console.log(this.carList)
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].id == id) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == item.productId){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1) that.carList.splice(i, 1)
} }
} }
}) that.carType = that.carList.length
} }
that.$forceUpdate()
} }
})
}, },
//删除商品下的某一个规格 //删除商品下的某一个规格
delShopSpec(name) { delShopSpec(index,index1) {
var that = this; 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({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
for(let i=0;i<that.carList.length;i++){
if(that.carList[i].productId == index){
for(let m=0;m<that.carList[i].stockLogList1.length;m++){
if(that.carList[i].stockLogList1[m].attributeList == index1){
that.carList[i].num -= that.carList[i].stockLogList1[m].productCount
that.carNum -= that.carList[i].stockLogList1[m].productCount
that.carList[i].stockLogList1.splice(m, 1) that.carList[i].stockLogList1.splice(m, 1)
if (that.carList[i].stockLogList1.length == 0) { continue;
that.carList.splice(i, 1)
} }
} }
} }
}) if(that.carList[i].stockLogList1.length == 0){
that.carList.splice(i, 1)
}
} }
that.carType = that.carList.length
} }
that.$forceUpdate()
} }
})
}, },
//点击底部下单按钮 //点击底部下单按钮
backPrevPage() { backPrevPage() {
@ -492,18 +549,18 @@
} }
}) })
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', err);
}) })
}, },
openPicker() { openPicker() {
console.log('执行打开地址选择器')
this.show = true this.show = true
}, },
onhideShow() { onhideShow() {
this.show = false this.show = false
console.log('执行了关闭地址选择器')
}, },
//选中省市区 //选中省市区
onsetCity(e) { onsetCity(e) {
@ -517,7 +574,7 @@
area: data.area, area: data.area,
} }
console.log(this.formData, this.addressObj);
}, },
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {

1
pages/index/downstream.vue

@ -48,7 +48,6 @@ export default {
}, false, true).then((res) => { }, false, true).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.list = res.result this.list = res.result
console.log(res)
}else{ }else{
this.tui.toast(res.message) this.tui.toast(res.message)
} }

15
pages/index/index.vue

@ -140,7 +140,6 @@
settingShow: false, settingShow: false,
chartData: {}, chartData: {},
shopName:'', shopName:'',
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: { opts: {
// color: ["#1890FF", "#73C0DE"], // color: ["#1890FF", "#73C0DE"],
padding: [15, 10, 0, 15], padding: [15, 10, 0, 15],
@ -208,7 +207,6 @@
}, false, false).then((res) => { }, false, false).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.shopInfo = res.result this.shopInfo = res.result
console.log(res)
}else{ }else{
this.tui.toast(res.message) this.tui.toast(res.message)
} }
@ -217,9 +215,6 @@
}, },
goToInfo() { goToInfo() {
this.settingShow = true this.settingShow = true
// uni.navigateTo({
// url: '/pages/info/index'
// })
}, },
gotoSearchData() { gotoSearchData() {
uni.navigateTo({ uni.navigateTo({
@ -259,7 +254,7 @@
let dataList = { let dataList = {
categories: this.getWeek(), categories: this.getWeek(),
series: [{ series: [{
name: "周销售额", name: "七天营收统计",
linearColor: [ linearColor: [
[0,"#1890FF"], [0,"#1890FF"],
[0.33,"#00B5FF"], [0.33,"#00B5FF"],
@ -278,10 +273,6 @@
}) })
}, },
getWeek() { getWeek() {
// var date = new Date();
// var day = date.getDay();
// var names = ["周日","周一","周二","周三","周四","周五","周六"];
// return names[day];
let days = 7 let days = 7
let week = ["周日","周一","周二","周三","周四","周五","周六"]; let week = ["周日","周一","周二","周三","周四","周五","周六"];
let dateList = Array.from({length:days},(v,i)=> i).map(day =>{ let dateList = Array.from({length:days},(v,i)=> i).map(day =>{
@ -320,12 +311,8 @@
top: var(--status-bar-height); top: var(--status-bar-height);
.contentPadding { .contentPadding {
// margin: 24upx;
padding: 28upx 20upx; padding: 28upx 20upx;
// text-align: center;
background-color: #fff; background-color: #fff;
// border-radius: 14rpx;
// box-shadow: 0px 1px 10px 2px #e2e2e2;
color: #909399; color: #909399;
.title { .title {

7
pages/index/order.vue

@ -43,7 +43,6 @@
}; };
}, },
onLoad(options) { onLoad(options) {
console.log('options', options);
this.type = options.type; this.type = options.type;
this.listStatus = options.listStatus this.listStatus = options.listStatus
@ -59,15 +58,9 @@
}, },
methods: { methods: {
gotoDetail(id) { gotoDetail(id) {
// if(this.type =='order') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/orderDetail?id=' + id url: '/pages/index/orderDetail?id=' + id
}) })
// } else {
// uni.navigateTo({
// url: '/pages/index/returnList?id=' + id
// })
// }
}, },
searchList() { searchList() {
this.page = 1; this.page = 1;

45
pages/index/orderDetail.vue

@ -5,18 +5,6 @@
</uni-card> </uni-card>
<view class="tui-order-item boxbg"> <view class="tui-order-item boxbg">
<!-- <u-collapse>
<u-collapse-item :open="isReturn" v-for="(item,index) in list" :key="index" :title="item.productName"
:name="item.saleId"
:value="'单价:'+ (item.wholesalePrice == null ?'暂无':item.wholesalePrice) + ' 折扣: ' + (item.discount == null ?'暂无':item.discount + '折')">
<view class="u-collapse-content" v-if="item.stockLogList1 != ''" v-for="(val, index2) in item.stockLogList1" :key="index2">
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}}
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0"
v-model="val.returnCount"></u-number-box>
</view>
</u-collapse-item>
</u-collapse> -->
<view class="content-box"> <view class="content-box">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in list" :key="index"> <view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in list" :key="index">
<view class="shop-name" style="position: relative;"> <view class="shop-name" style="position: relative;">
@ -267,10 +255,8 @@
computed: { computed: {
returnAmount() { returnAmount() {
if (this.changeAmount) { if (this.changeAmount) {
console.log(this.changeAmount, 'this.changeAmount');
if (this.sales.noEarn >= this.changeAmount) { if (this.sales.noEarn >= this.changeAmount) {
this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2); this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2);
console.log(this.sales.newNoEarn);
return 0 return 0
} else { } else {
this.sales.newNoEarn = 0 this.sales.newNoEarn = 0
@ -282,9 +268,7 @@
if (this.isReturn) { if (this.isReturn) {
let sum = 0 let sum = 0
this.list.forEach(item1 => { this.list.forEach(item1 => {
console.log(item1);
item1.stockLogList1.forEach(v => { item1.stockLogList1.forEach(v => {
console.log(v);
if (v.returnCount) { if (v.returnCount) {
sum = v.returnCount * item1.wholesalePrice + sum sum = v.returnCount * item1.wholesalePrice + sum
} }
@ -342,10 +326,6 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
// this.tui.request("/app/return/get/" + option.id, "GET", null, false, false).then((res) => {
// if (res.code == 200 && res.result != null && res.result != undefined) {
// }
// }).catch((res) => {})
this.getReturnOrder(option.id) this.getReturnOrder(option.id)
this.collectionList(option.id) this.collectionList(option.id)
} }
@ -385,17 +365,7 @@
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:'+this.sales.shopName) strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:'+this.sales.shopName)
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702') strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702')
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059') strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059')
// strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字 strCmd += blesdk.addCPCLLocation(0);
// for (let item in this.list) {
// console.log(item, this.list,this.list[item] );
// strCmd += blesdk.addCPCLText('50', '', this.list[item].productName + ' ¥' + this.list[item].wholesalePrice + ' * ' + (this.sales.discount < 10 ? this.sales.discount : this.list[item].discount),'', '', '')
// this.list[item].saleDetailQueryDTO.forEach(val => {
// strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '')
// })
// }
// strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '')
// strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd; this.bufferData = strCmd;
}, },
@ -441,7 +411,6 @@
this.editNoPrice = true; this.editNoPrice = true;
}, },
getNoPay(en) { getNoPay(en) {
console.log(en, 'en');
if (en != undefined) { if (en != undefined) {
if (0 < en && en <= this.sales.noEarn) { if (0 < en && en <= this.sales.noEarn) {
this.sales.noEarn = this.sales.newEarn - en; this.sales.noEarn = this.sales.newEarn - en;
@ -467,7 +436,6 @@
if (res.code == 200 && res.result != null && res.result != if (res.code == 200 && res.result != null && res.result !=
undefined) { undefined) {
this.shopList.push(...res.result.saleDetailDTOList); this.shopList.push(...res.result.saleDetailDTOList);
console.log(this.shopList);
} }
}).catch((res) => {}) }).catch((res) => {})
}) })
@ -493,19 +461,13 @@
} }
}) })
}, },
valChange() {
console.log(this.list);
},
open() { open() {
this.popupShow = true this.popupShow = true
// console.log('open');
}, },
close() { close() {
this.popupShow = false this.popupShow = false
// console.log('close');
}, },
sureReturn() { sureReturn() {
console.log(this.list);
this.list.forEach(item1 => { this.list.forEach(item1 => {
item1.stockLogList1.forEach(item2 => { item1.stockLogList1.forEach(item2 => {
if (item2.returnCount) { if (item2.returnCount) {
@ -518,10 +480,7 @@
}) })
let worderId = '' let worderId = ''
if (this.orderByWorker) { if (this.orderByWorker) {
console.log(this.orderByWorker);
for (let key in this.orderByWorkerList) { for (let key in this.orderByWorkerList) {
console.log(this.orderByWorker, this.orderByWorkerList[key].workerName, this.orderByWorker == this
.orderByWorkerList[key].workerName);
if (this.orderByWorker == this.orderByWorkerList[key].workerName) { if (this.orderByWorker == this.orderByWorkerList[key].workerName) {
worderId = this.orderByWorkerList[key].workerId worderId = this.orderByWorkerList[key].workerId
} }
@ -530,7 +489,6 @@
this.sales.noEarn = this.sales.newNoEarn; this.sales.noEarn = this.sales.newNoEarn;
this.sales.saleId = this.sales.id; this.sales.saleId = this.sales.id;
this.sales.totalAomount = this.returnAmount; this.sales.totalAomount = this.returnAmount;
console.log(this.sales, this.list, this.orderByWorker);
this.tui.request("/app/return/rtg", "post", { this.tui.request("/app/return/rtg", "post", {
returnSale: this.sales, returnSale: this.sales,
returnSaleDetailList: this.list, returnSaleDetailList: this.list,
@ -571,7 +529,6 @@
status: 3 status: 3
}, true, true).then((res1) => { }, true, true).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
console.log(res1)
this.tui.toast("取消订单成功") this.tui.toast("取消订单成功")
uni.navigateBack() uni.navigateBack()
} else { } else {

7
pages/index/peopleList.vue

@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view> <view>
<uni-popup ref="popup" background-color="#fff" @change="change"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content" v-for="item in popleList" :key="item"> <view class="popup-content" v-for="item in popleList" :key="item">
<view class="popup-title"> <view class="popup-title">
<text>收费标准</text> <text>收费标准</text>
@ -78,7 +78,6 @@
onLoad(options) { onLoad(options) {
this.popleType = options.popleType this.popleType = options.popleType
this.companyType = options.companyType || '' this.companyType = options.companyType || ''
console.log(options.companyType)
// this.radioType = options.radioType // this.radioType = options.radioType
if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户 if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户
this.khOrGysList(); this.khOrGysList();
@ -152,7 +151,6 @@
}, },
//拨打电话 //拨打电话
clickPhone(phone) { clickPhone(phone) {
console.log(phone);
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
}); });
@ -182,9 +180,6 @@
this.type = type this.type = type
this.$refs.popup.open(type) this.$refs.popup.open(type)
}, },
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
//关闭弹出层 //关闭弹出层
close() { close() {
this.$refs.popup.close() this.$refs.popup.close()

14
pages/index/shareStyle.vue

@ -126,7 +126,7 @@
uni.hideHomeButton() //左上角HOME按钮 uni.hideHomeButton() //左上角HOME按钮
}, },
onLoad(options) { onLoad(options) {
console.log(options.khid)
if (options.khid != undefined) { if (options.khid != undefined) {
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/downStearmList?khid=" + options.khid url: "/pages/index/downStearmList?khid=" + options.khid
@ -167,7 +167,7 @@
pageSize: '100' pageSize: '100'
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records)
this.shopList.push(res.result.records) this.shopList.push(res.result.records)
this.goodsList = this.shopList[0] this.goodsList = this.shopList[0]
} else { } else {
@ -209,7 +209,7 @@
}, },
//选中商品 //选中商品
checkboxChange(item) { checkboxChange(item) {
console.log(item)
item.checked = !item.checked item.checked = !item.checked
if (this.carList.indexOf(item.id) != -1) { if (this.carList.indexOf(item.id) != -1) {
this.carList.splice(this.carList.indexOf(item.id), 1) this.carList.splice(this.carList.indexOf(item.id), 1)
@ -221,11 +221,11 @@
} else { } else {
for (let i = 0; i < this.gwcList.length; i++) { for (let i = 0; i < this.gwcList.length; i++) {
if (this.gwcList[i].id == item.id) { if (this.gwcList[i].id == item.id) {
console.log('这里')
this.gwcList.splice(i, 1) this.gwcList.splice(i, 1)
} else { } else {
if (this.gwcList.length == (i + 1)) { if (this.gwcList.length == (i + 1)) {
console.log('是不是那里')
this.gwcList.push(item) this.gwcList.push(item)
return return
} }
@ -234,7 +234,7 @@
} }
} }
console.log('gwcList', this.gwcList)
}, },
//点击分享按钮 //点击分享按钮
clickShareBtn(e) { clickShareBtn(e) {
@ -302,7 +302,7 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
for (let i = 0; i < that.gwcList.length; i++) { for (let i = 0; i < that.gwcList.length; i++) {
console.log('匹配吗?',that.goodsList)
if (that.gwcList[i].id == id) { if (that.gwcList[i].id == id) {
that.carList.splice(that.carList.indexOf(id), 1) that.carList.splice(that.carList.indexOf(id), 1)
that.carType = that.carList.length that.carType = that.carList.length

1
pages/index/shopInfo.vue

@ -52,7 +52,6 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
console.log(this.mobile)
this.addForm.mobile = this.mobile this.addForm.mobile = this.mobile
}, },
methods:{ methods:{

1
pages/index/uparrears.vue

@ -63,7 +63,6 @@
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.list = res.result this.list = res.result
console.log(res)
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

1
pages/index/upstream.vue

@ -51,7 +51,6 @@
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.list = res.result this.list = res.result
console.log(res)
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

2
pages/index/waitStorageDetail.vue

@ -249,8 +249,6 @@
changePrice(val) { changePrice(val) {
let that = this; let that = this;
that.shouldPay = 0 that.shouldPay = 0
console.log(that.goodsList)
console.log(this.index)
that.goodsList[that.index].purchasePrice = val that.goodsList[that.index].purchasePrice = val
that.goodsList[that.index].price = val * that.goodsList[that.index].productCount; that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;
that.goodsList.forEach(function(value, key) { that.goodsList.forEach(function(value, key) {

133
pages/info/editStore.vue

@ -1,133 +0,0 @@
<template>
<view class="edit-store-page">
<view class="edit-form-wrapper">
<uni-forms :modelValue="editForm" ref="editForm" label-width="150">
<uni-forms-item label="店铺名称" required>
<uni-easyinput v-model="editForm.shopName" placeholder="请输入店铺名称" />
</uni-forms-item>
<uni-forms-item label="店铺员工" required>
<uni-data-checkbox v-model="editForm.clerks" :multiple="true" :localdata="hobbys" />
</uni-forms-item>
</uni-forms>
</view>
<view class="button-wrapper">
<u-button type="primary" @click="onAddButtonClick">添加员工</u-button>
</view>
<view class="button-wrapper">
<u-button type="success">保存</u-button>
</view>
<view>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog" class="popup-wrap">
<uni-card title="添加员工">
<uni-forms :modelValue="addForm" ref="addForm" label-width="160rpx" label-align="right">
<uni-forms-item label="员工姓名" required>
<uni-easyinput v-model="addForm.name" placeholder="请输入员工姓名" />
</uni-forms-item>
<uni-forms-item label="手机号" required>
<uni-easyinput v-model="addForm.name" placeholder="请输入员工手机号" />
</uni-forms-item>
<uni-forms-item label="是否店长" required>
<uni-data-checkbox v-model="addForm.sex" :localdata="sexs" />
</uni-forms-item>
</uni-forms>
<view class="action-area">
<u-button type="info" plain>取消</u-button>
<u-button type="info" plain>保存</u-button>
</view>
</uni-card>
</uni-popup>
</view>
</view>
</template>
<script>
export default {
data() {
return {
editForm: {
shopName: '',
clerks: [],
},
addForm: {
},
hobbys: [{
text: '张三',
value: 0
}, {
text: '李四',
value: 1
}, {
text: '王五',
value: 2
}, {
text: '赵六',
value: 3
}, {
text: '田七',
value: 4
}, {
text: '钱八',
value: 5
}],
sexs: [{
text: '是',
value: 0
}, {
text: '不是',
value: 1
}, {
text: '其他',
value: 2
}],
customStyle: {
margin: '15px',
}
}
},
methods: {
// 选中某个复选框时,由checkbox时触发
checkboxChange(e) {
console.log(e);
},
// 选中任一checkbox时,由checkbox-group触发
checkboxGroupChange(e) {
console.log(e);
},
// 对话框
dialogInputConfirm(e) {
console.log(e)
},
onAddButtonClick() {
this.$refs.inputDialog.open()
}
}
}
</script>
<style scoped lang="scss">
.edit-store-page {
padding: 15rpx;
}
.edit-form-wrapper {
min-height: 800rpx;
}
.button-wrapper {
margin: 15rpx 0;
}
.popup-wrap {
background-color: #fff;
}
.action-area {
display: flex;
.action-area-button {
margin: 0 15rpx;
}
}
</style>

48
pages/info/index.vue

@ -1,48 +0,0 @@
<template>
<view>
<view class="container u-skeleton">
<view class="userinfo">
<block>
<!--u-skeleton-circle 绘制圆形-->
<u-avatar :src="src"></u-avatar>
<!--u-skeleton-fillet 绘制圆角矩形-->
<text class="u-skeleton-fillet">{{nickName || '超级管理员'}}</text>
</block>
</view>
<view style="margin: 20px 0">
<view v-for="(item,index) in lists" :key="index" class="lists">
<!--u-skeleton-rect 绘制矩形-->
<text class="u-skeleton-rect">{{item}}</text>
</view>
</view>
</view>
<!--引用组件-->
<u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>
</view>
</template>
<script>
import {
mapState
} from 'vuex';
export default {
computed: mapState(['avatar', 'nickname', 'type']),
data() {
return {
loading: false, // 是否显示骨架屏组件 修改一下 提交
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
};
},
created() {
console.log(mapState, 'mapState', this.avatar)
},
onLoad() {
console.log(mapState, 'mapState', this.avatar)
}
}
</script>
<style lang="scss">
</style>

19
pages/info/info.vue

@ -1,19 +0,0 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>

25
pages/inventory/addGoods.vue

@ -68,6 +68,7 @@
productId:'', productId:'',
arrtList: [], arrtList: [],
arrtChange: [], arrtChange: [],
dataList:[],
rules: { rules: {
categoryId: { categoryId: {
rules: [{ rules: [{
@ -121,7 +122,8 @@
// }) // })
}, },
onLoad(option) { onLoad(option) {
console.log(JSON.parse(option.dataList)) console.log('option',option)
if(option.dataList){
this.dataList = JSON.parse(option.dataList) this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName this.formData.productName = this.dataList.productName
this.formData.price = this.dataList.price this.formData.price = this.dataList.price
@ -132,7 +134,7 @@
this.formData.categoryId = this.dataList.categoryId this.formData.categoryId = this.dataList.categoryId
this.formData.salesWeek = this.dataList.salesWeek this.formData.salesWeek = this.dataList.salesWeek
this.formData.tailWarn = this.dataList.tailWarn this.formData.tailWarn = this.dataList.tailWarn
}
this.tui.request("/app/productCategory/list", "get", { this.tui.request("/app/productCategory/list", "get", {
// shopId: 1, // shopId: 1,
}, false, true).then((res) => { }, false, true).then((res) => {
@ -155,12 +157,12 @@
}, },
// 新增图片 // 新增图片
async afterRead(event) { async afterRead(event) {
console.log(event);
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file) let lists = [].concat(event.file)
if (this.formData.productPicture == undefined) this.formData.productPicture = []; if (this.formData.productPicture == undefined) this.formData.productPicture = [];
let fileListLen = this[`fileList${event.name}`].length let fileListLen = this[`fileList${event.name}`].length
console.log(lists, 'lists');
lists.map((item) => { lists.map((item) => {
this[`fileList${event.name}`].push({ this[`fileList${event.name}`].push({
...item, ...item,
@ -168,7 +170,7 @@
message: '上传中' message: '上传中'
}) })
}) })
console.log(this.formData.productPicture);
for (let i = 0; i < lists.length; i++) { for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url) const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen] let item = this[`fileList${event.name}`][fileListLen]
@ -181,7 +183,7 @@
} }
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
console.log(url);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'https://storage.xenjoyou.com/hiver/upload/file', url: 'https://storage.xenjoyou.com/hiver/upload/file',
@ -193,7 +195,7 @@
}, },
formData: {}, formData: {},
success: (uploadFileRes) => { success: (uploadFileRes) => {
console.log("这里", uploadFileRes)
let path = JSON.parse(uploadFileRes.data) let path = JSON.parse(uploadFileRes.data)
//后端返回的地址,存入图片地址 //后端返回的地址,存入图片地址
this.formData.productPicture = path.result this.formData.productPicture = path.result
@ -206,15 +208,16 @@
}, },
// 触发提交表单 // 触发提交表单
submit() { submit() {
let that = this;
let url = '' let url = ''
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if(this.dataList.id !=''){ if(that.dataList !=''){
url = '/app/product/edit' url = '/app/product/edit'
res.id = this.dataList.id res.id = that.dataList.id
}else{ }else{
url = '/app/product/save' url = '/app/product/save'
} }
this.tui.request(url, "post", res, false, false).then((res1) => { that.tui.request(url, "post", res, false, false).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
uni.navigateBack({ uni.navigateBack({
delta: 2 delta: 2
@ -227,7 +230,7 @@
} }
}) })
}).catch(err => { }).catch(err => {
console.log('表单错误信息:', err);
}) })
} }
} }

188
pages/inventory/changeGoods1.vue

@ -62,7 +62,7 @@
<view class="popup-content"> <view class="popup-content">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> <img :src="goodsDetail.productPicture" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} <view class="popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
@ -114,32 +114,32 @@
<!-- 购物车弹出层 --> <!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change"> <uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content"> <view class="popup-content">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;"> <view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view class="popup-title"> <view class="popup-title">
<view class="popup-title-left"> <view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> <img :src="item.productPicture" alt="">
</view> </view>
<view class="popup-title-right"> <view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view> <view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view> <view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle"> <view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{value[1].price}}</text> <text style="margin-right:20rpx;">¥{{item.price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> --> <!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)"> <view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item)">
<uni-icons color="red" type="trash" size="26"></uni-icons> <uni-icons color="red" type="trash" size="26"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys"> <view class="popup-container" v-for="(item1,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="checkList"> <view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])"> <view style="margin-right:5%;" @tap="delShopSpec(item.id,item1.attributeList)">
<uni-icons color="red" type="minus" size="26"></uni-icons> <uni-icons color="red" type="minus" size="26"></uni-icons>
</view> </view>
<view class="checkList-box"> <view class="checkList-box">
{{values[0] | sliceMsg}} {{item1.attributeList | sliceMsg}}
</view> </view>
<uni-number-box max="100000" v-model="values[1]" @change="change" /> <uni-number-box max="100000" v-model="item1.productCount" @change="carChange($event,index,index1)" />
</view> </view>
</view> </view>
</view> </view>
@ -149,7 +149,7 @@
<text>{{carType}} 款 {{carNum}} 件</text> <text>{{carType}} 款 {{carNum}} 件</text>
</view> </view>
<view class="popup-bottom-right"> <view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()">选好了</view> <view class="bottom-btn" @tap="this.$refs.carPopup.close()">关闭</view>
</view> </view>
</view> </view>
</view> </view>
@ -184,9 +184,7 @@
zNum:0, zNum:0,
storageType:0, storageType:0,
carNum:0, carNum:0,
carType:0, carType:0
oldList: [],
newList: new Map()
} }
}, },
filters: { filters: {
@ -280,7 +278,7 @@
} else { } else {
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) { if (this.temporaryList[i].name.indexOf(this.attributeList.name) != -1) {
this.temporaryList[i] = this.attributeList
return return
} else { } else {
if (this.temporaryList.length == (i+1)) { if (this.temporaryList.length == (i+1)) {
@ -330,15 +328,23 @@
change(e) { change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show); console.log('当前模式:' + e.type + ',状态:' + e.show);
}, },
carChange(e,index,index1) {
console.log(this.carList)
this.carNum = 0
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.carNum += this.carList[i].num
}
},
//弹出购物车或者商品规格选择弹窗 //弹出购物车或者商品规格选择弹窗
toggle(type, item) { toggle(type, item) {
this.type = type this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') { if (type == 'carPopup') {
this.oldList = this.carList
this.newFun()
this.carNum = 0 this.carNum = 0
for (let i=0;i<this.carList.length;i++) { for (let i=0;i<this.carList.length;i++) {
this.carNum += this.carList[i].num this.carNum += this.carList[i].num
@ -351,78 +357,24 @@
} }
}, },
newFun() { //选择商品查询商品规格
//newList 已经是map格式了 新数组 初始为空 checkGoods(item) {
//carList 旧数组 this.goodsDetail = item;
this.temporaryList = []
this.columns = []
this.keyList = []
console.log(this.temporaryList)
console.log(this.carList)
if(this.carList != ''){
this.zNum = 0
for(let i=0;i<this.carList.length;i++){ for(let i=0;i<this.carList.length;i++){
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同 if(item.id == this.carList[i].id){
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) { this.zNum = this.carList[i].num
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i] this.temporaryList = this.carList[i].saleDetailQueryDTO
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
} }
} }
} }
},
//选择商品查询商品规格
checkGoods(item) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", { this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => { }, false, true).then((res1) => {
@ -454,10 +406,6 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}, },
@ -501,12 +449,6 @@
}, },
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
// if(this.storageType == 0 && this.purchasePrice == 0){
// uni.showToast({
// title: "请输入采购价!",
// icon: 'none'
// })
// }else{
let data = { let data = {
id: this.goodsDetail.id, id: this.goodsDetail.id,
price: this.zPrice, price: this.zPrice,
@ -517,8 +459,28 @@
supplierName: this.goodsDetail.supplierName, supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO:this.temporaryList saleDetailQueryDTO:this.temporaryList
} }
if(this.carList.length == 0){
this.carList.push(data) this.carList.push(data)
console.log(this.carList) }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.temporaryList = []
this.purchasePrice = "" this.purchasePrice = ""
this.zPrice = '' this.zPrice = ''
@ -530,38 +492,54 @@
} }
} }
this.$refs.popup.close() this.$refs.popup.close()
// }
console.log(this.carList) console.log(this.carList)
}, },
//删除整条商品 //删除整条商品
delShop(id){ delShop(item){
var that = this; var that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
if (that.newList.has(id) == true) { for(let i=0;i<that.carList.length;i++){
that.newList.delete(id) if(that.carList[i].id == item.id){
that.carNum -= that.carList[i].num
that.carList.splice(i, 1)
} }
} }
that.carType = that.carList.length
}
that.$forceUpdate() that.$forceUpdate()
} }
}) })
}, },
//删除商品下的某一个规格 //删除商品下的某一个规格
delShopSpec(name){ delShopSpec(index,index1){
var that = this; var that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条商品吗?",
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.newList.get(id).stockLogList.delete(name) for(let i=0;i<that.carList.length;i++){
if (that.newList.get(id).stockLogList.size == 0) { for(let m=0;m<that.carList[i].saleDetailQueryDTO.length;m++){
that.newList.delete(id) if(that.carList[i].id == index){
if(that.carList[i].saleDetailQueryDTO[m].attributeList == index1){
that.carList[i].num -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carNum -= that.carList[i].saleDetailQueryDTO[m].productCount
that.carList[i].saleDetailQueryDTO.splice(m, 1)
continue;
}
}
}
if(that.carList[i].saleDetailQueryDTO.length == 0){
that.carList.splice(i, 1)
}
} }
that.carType = that.carList.length
} }
that.$forceUpdate() that.$forceUpdate()
} }

20
pages/inventory/gategoryLow.vue

@ -73,7 +73,7 @@
this.attrList = res1.result; this.attrList = res1.result;
if (res1.result.length > 0) { if (res1.result.length > 0) {
this.attrList.forEach((items) => { this.attrList.forEach((items) => {
console.log(items.id)
this.tui.request( this.tui.request(
"/app/productAttributeValue/selectByAttributeId", "/app/productAttributeValue/selectByAttributeId",
"get", { "get", {
@ -81,11 +81,11 @@
}, false, true).then((res2) => { }, false, true).then((res2) => {
if (res2.code == 200) { if (res2.code == 200) {
items.attributeValue = res2.result; items.attributeValue = res2.result;
// console.log(items.attributeValue); //
}else{ }else{
this.tui.toast(res.message) this.tui.toast(res.message)
} }
console.log(this.attrList)
}).catch((res) => {}) }).catch((res) => {})
}) })
} }
@ -129,7 +129,7 @@
}, },
// 获取属性值 // 获取属性值
getProductAttributeValue(index) { getProductAttributeValue(index) {
console.log(index, this.indexList, this.indexList[index].attrName);
this.attrList.forEach((item) => { this.attrList.forEach((item) => {
this.tui.request("/app/productAttributeValue/selectByAttributeId", "get", { this.tui.request("/app/productAttributeValue/selectByAttributeId", "get", {
id: item.id id: item.id
@ -143,7 +143,7 @@
}).catch((res) => {}) }).catch((res) => {})
}) })
this.showList = JSON.parse(JSON.stringify(this.attrList)) this.showList = JSON.parse(JSON.stringify(this.attrList))
console.log(this.showList, 'shoeList', index);
}, },
inputDialogToggle(type, item, parent) { inputDialogToggle(type, item, parent) {
this.typeModel = type; this.typeModel = type;
@ -172,7 +172,7 @@
this.tui.request("/app/productCategory/save", "post", { this.tui.request("/app/productCategory/save", "post", {
categoryName: e categoryName: e
}, false, true).then((res) => { }, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.getGategoryList() this.getGategoryList()
uni.showToast({ uni.showToast({
@ -251,7 +251,7 @@
categoryId: this.editItem.categoryId, categoryId: this.editItem.categoryId,
id: this.editItem.id id: this.editItem.id
}, false, true).then((res) => { }, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.getGategoryList() this.getGategoryList()
uni.showToast({ uni.showToast({
@ -283,7 +283,7 @@
this.tui.request("/app/productCategory/delById", "post", { this.tui.request("/app/productCategory/delById", "post", {
id: this.delItems.id, id: this.delItems.id,
}, false, true).then((res) => { }, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.getGategoryList() this.getGategoryList()
uni.showToast({ uni.showToast({
@ -303,7 +303,7 @@
attributeName: this.delItems.attributeName, attributeName: this.delItems.attributeName,
id: this.delItems.id, id: this.delItems.id,
}, false, true).then((res) => { }, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.getGategoryList() this.getGategoryList()
uni.showToast({ uni.showToast({
@ -323,7 +323,7 @@
value: this.delItems.value, value: this.delItems.value,
id: this.delItems.id, id: this.delItems.id,
}, false, true).then((res) => { }, false, true).then((res) => {
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.getGategoryList() this.getGategoryList()
uni.showToast({ uni.showToast({

60
pages/inventory/goodsList1.vue

@ -62,8 +62,7 @@
</label> </label>
</radio-group> </radio-group>
<view class="discount-num" v-if="discountType == '1'"> <view class="discount-num" v-if="discountType == '1'">
<uni-number-box :min="0.1" :max="10" :value="discountNum" :step="0.1" <input type="digit" style="width:150rpx;" v-model="discountNum" @blur="change($event)">
@change="change" />
</view> </view>
</view> </view>
@ -96,7 +95,7 @@
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
<text>折扣(0-10)</text> <text>折扣(0-10)</text>
<input class="input" type="number" :value='value[1].discount | maxNum' <input class="input" type="digit" :value='value[1].discount | maxNum'
@blur="changeDis($event,value[0])"> @blur="changeDis($event,value[0])">
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
@ -105,7 +104,7 @@
</view> </view>
<view class="collapse-1"> <view class="collapse-1">
<text>数量</text> <text>数量</text>
<input class="input" type="number" :value='value[1].productCount'> <input class="input" type="number" :value='value[1].productCount' disabled>
</view> </view>
</view> </view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" <view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
@ -235,7 +234,7 @@
<view class="bottom-box"> <view class="bottom-box">
<view class="bottom-left"> <view class="bottom-left">
<text>合计:{{totalAmount}}</text> <text>合计:{{totalAmount}}</text>
<text style="color: #ffa200;">¥{{shouldPay}}</text> <text style="color: #ffa200;">¥{{shouldPay == null ?0:shouldPay}}</text>
</view> </view>
<view class="bottom-right"> <view class="bottom-right">
<button class="bottom-btn" @tap.stop="clearAll">清空商品</button> <button class="bottom-btn" @tap.stop="clearAll">清空商品</button>
@ -300,7 +299,7 @@
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index"> <view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-popup-bottom-left"> <view class="shop-popup-bottom-left">
<text>{{zNum}} 件</text> <text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text> <!-- <text>¥{{zPrice}}</text> -->
</view> </view>
<view class="shop-popup-bottom-right"> <view class="shop-popup-bottom-right">
<view class="bottom-btn" @tap.stop="temporaryCheck">选好了</view> <view class="bottom-btn" @tap.stop="temporaryCheck">选好了</view>
@ -426,7 +425,8 @@
radioType1: 0, radioType1: 0,
saleId: '', saleId: '',
saleDetailList: [], saleDetailList: [],
yNum: 150 yNum: 150,
clearMsg:''
} }
}, },
components: { components: {
@ -489,9 +489,6 @@
} }
this.carList.set(this.carList1[i].id, obj) this.carList.set(this.carList1[i].id, obj)
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
} else { //当前页有数据 } else { //当前页有数据
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 if (this.carList.has(this.carList1[i].id) == true) { //商品相同
@ -536,12 +533,11 @@
} }
this.carList.set(this.carList1[i].id, obj) this.carList.set(this.carList1[i].id, obj)
} }
uni.removeStorageSync('carList1')
this.carList1 = []
} }
} }
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
if (that.priceType == 0) { //零售 if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice value.unitPrice = value.lsprice
@ -627,7 +623,7 @@
if (this.goodsDetail.attributeList.length == jishuqi) { if (this.goodsDetail.attributeList.length == jishuqi) {
this.attributeList = { this.attributeList = {
attributeList: JSON.stringify(obj), attributeList: JSON.stringify(obj),
productCount: this.temporaryNum, productCount: 0,
name: name, name: name,
price: this.purchasePrice price: this.purchasePrice
} }
@ -659,7 +655,7 @@
}, },
changessPrice(e) { changessPrice(e) {
console.log(e.target.value)
this.relPrice = e.target.value this.relPrice = e.target.value
}, },
changePrice(e) { changePrice(e) {
@ -667,8 +663,8 @@
this.noPay = this.relPrice - e.target.value; this.noPay = this.relPrice - e.target.value;
}, },
getImg(key) { getImg(key) {
console.log(key)
console.log('图片看这里', this.carList.get(key))
return this.carList.get(key).productPicture return this.carList.get(key).productPicture
// value[1].productPicture // value[1].productPicture
}, },
@ -683,11 +679,13 @@
}, },
//扫一扫功能 //扫一扫功能
scanCodeAdd() { scanCodeAdd() {
// this.clearMsg = '1'
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
this.toggle('bottom', res.result); this.toggle('bottom', res.result);
}, },
fail: (res) => { fail: (res) => {
// this.clearMsg = '1'
uni.showToast({ uni.showToast({
title: '扫描失败', title: '扫描失败',
icon: 'none' icon: 'none'
@ -749,11 +747,11 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
temporaryChange(val) { temporaryChange(val) {
console.log('扫一扫',this.temporaryList)
this.zNum = 0 this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) { for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount this.zNum += this.temporaryList[i].productCount
} }
this.zPrice = this.zNum * this.purchasePrice
}, },
//折扣种类选择 //折扣种类选择
discountChange(e) { discountChange(e) {
@ -788,8 +786,14 @@
}, },
//整体折扣数字框改变 //整体折扣数字框改变
change(e) { change(e) {
console.log(e) if(e.detail.value > 10){
this.discountNum = e this.discountNum = 10
}else if(e.detail.value < 0){
this.discountNum = 0
}else{
this.discountNum = e.detail.value
}
this.shouldPay = this.price * 10000 * e / 10 / 10000 this.shouldPay = this.price * 10000 * e / 10 / 10000
}, },
//点击发货方式按钮 //点击发货方式按钮
@ -817,7 +821,7 @@
return return
} }
let companyType = this.radioType == 1 ? this.wlName.id : '' let companyType = this.radioType == 1 ? this.wlName.id : ''
console.log(companyType)
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType
}) })
@ -1004,9 +1008,9 @@
} }
let obj = { let obj = {
orderByWorker: this.lbgName.workerId, orderByWorker: this.lbgName.workerId,
saleId: this.saleId,
sale: { sale: {
// relPrice:, // relPrice:,
saleId: this.saleId,
alreadyEarn: this.priceOk, //已付金额 alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额 realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款 noEarn: this.relPrice - this.priceOk, //欠款
@ -1032,7 +1036,7 @@
} }
let purchaseDetails = []; let purchaseDetails = [];
this.carList.forEach(function(value, key) { this.carList.forEach(function(value, key) {
console.log(value.stockLogList)
value.stockLogList.forEach(function(values, keys) { value.stockLogList.forEach(function(values, keys) {
let obj = { let obj = {
productCount: values, productCount: values,
@ -1040,7 +1044,7 @@
} }
value.stockLogList1.push(obj) value.stockLogList1.push(obj)
}) })
console.log(value)
purchaseDetails.push(value) purchaseDetails.push(value)
}) })
this.saleDetailList = purchaseDetails; this.saleDetailList = purchaseDetails;
@ -1148,7 +1152,7 @@
}, },
//编辑每一个的单价 //编辑每一个的单价
clickPrice(index) { clickPrice(index) {
console.log(index)
this.index = index this.index = index
this.wholesalePrice = this.carList.get(this.index).wholesalePrice this.wholesalePrice = this.carList.get(this.index).wholesalePrice
this.lsprice = this.carList.get(this.index).lsprice this.lsprice = this.carList.get(this.index).lsprice
@ -1236,14 +1240,14 @@
}, },
//修改已选规格的数量 //修改已选规格的数量
GoodsNumChange(e, index, index1) { GoodsNumChange(e, index, index1) {
console.log(this.carList)
let that = this; let that = this;
this.carList.get(index).stockLogList.set(index1, e) this.carList.get(index).stockLogList.set(index1, e)
this.carList.get(index).productCount = 0 this.carList.get(index).productCount = 0
this.shouldPay = 0 this.shouldPay = 0
this.totalAmount = 0 this.totalAmount = 0
this.carList.get(index).stockLogList.forEach(function(value, key) { 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).productCount = that.carList.get(index).productCount + value
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index) that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index)
.unitPrice .unitPrice

2
pages/inventory/inventoryDetail.vue

@ -3,7 +3,7 @@
<view class="content-box"> <view class="content-box">
<view class="right-box"> <view class="right-box">
<view class="box-left"> <view class="box-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt=""> <img :src="dataList.productPicture" alt="">
</view> </view>
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})</view> <view class="box-right-name">{{dataList.productName == null ? '暂无':dataList.productName}} ({{dataList.productSn == null ? '暂无':dataList.productSn}})</view>

Loading…
Cancel
Save