Browse Source

开单入库逻辑修改

master
wangfukang 3 years ago
parent
commit
f19ce5b2f7
  1. 14
      pages/index/addHangOrder.vue
  2. 9
      pages/index/index.vue
  3. 3
      pages/index/shareStyle.vue
  4. 2
      pages/inventory/addGoods.vue
  5. 113
      pages/inventory/addinventory.vue
  6. 215
      pages/inventory/goodsList1.vue
  7. 2
      pages/staff/addStaff/addStaff.vue

14
pages/index/addHangOrder.vue

@ -81,7 +81,7 @@
<view class="shop-popup-content">
<view class="shop-popup-title">
<view class="shop-popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
<img :src="goodsDetail.productPicture" alt="">
</view>
<view class="shop-popup-title-right">
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
@ -618,16 +618,21 @@
},
//带参数跳转到开单页
goSaleGoods(item) {
console.log(item)
if(item){
let dataList = []
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1
obj.num = 0
// for(let m = 0; m < obj.saleDetailQueryDTO.length; m++){
// obj.num += obj.saleDetailQueryDTO[m].productCount
// }
obj.id = item.saleDetailDTOList[i].productId
obj.price = 0
obj.lsprice = item.saleDetailDTOList[i].price
obj.num = item.saleDetailDTOList[i].productCount
obj.price = item.saleDetailDTOList[i].discountAmount
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].realPrice / item.saleDetailDTOList[i].num
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
@ -638,6 +643,7 @@
obj.createByName = item.createByName
dataList.push(obj)
}
console.log(dataList)
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('khName', '')
}

9
pages/index/index.vue

@ -3,10 +3,6 @@
<cmd-nav-bar iconOne="menu" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view class="IndexContent">
<view class="contentPadding" style="color:#000;background: #FBFBFF !important;padding: 28rpx 20rpx 0 !important;">
<!-- <view class="title-dianpu">
<img src="../../static/images/dianpu.png" class="dianpu-img" alt="">
<text class="dianpu-text">幸福服饰</text>
</view> -->
<view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<text>待退货</text>
@ -81,7 +77,10 @@
<li v-for="item in inventoryList" :key="item.id">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="'¥'+(item.totalAmount == null ?'暂无':item.totalAmount)" :thumbnail="item.img"
@tap="gotoDetail(item.id)">
<view class="uni-body">{{ item.createByName == null ?'暂无':item.createByName}} - {{ item.createTime }}</view>
<view class="uni-body">{{ item.createByName == null ?'暂无':item.createByName}} - {{ item.createTime }}</view>
<view class="uni-body"> <text class="cardText">
订单状态:</text>{{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 ?'待配货' :'挂单'}}
</view>
</uni-card>
</li>
</ul>

3
pages/index/shareStyle.vue

@ -72,8 +72,7 @@
<view v-for="(item,index) in gwcList" style="position: relative;" :key="index">
<view class="popup-title">
<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 class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>

2
pages/inventory/addGoods.vue

@ -29,7 +29,7 @@
<uni-forms-item label="库存预警" name="tailWarn" required>
<uni-easyinput type="digit" v-model="formData.tailWarn" placeholder="请设置库存预警最低件数" trim="all" />
</uni-forms-item>
<uni-forms-item label="分类" name="categoryId" required>
<uni-forms-item label="分类" name="categoryId" required v-if="dataList == ''">
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择分类" @change="categoryChange"></uni-data-select>
</uni-forms-item>

113
pages/inventory/addinventory.vue

@ -32,14 +32,14 @@
<img :src="value[1].productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{value[1].productName}}</view>
<view>货号:{{value[1].productSn}}</view>
<view>总价:{{value[1].price}} 数量:{{value[1].productCount}}</view>
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view>
<view>单价:{{value[1].purchasePrice || 0}} 数量:{{value[1].productCount}}</view>
<view>总价:{{value[1].price}}</view>
</view>
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="key">
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
@ -64,13 +64,13 @@
<view class="content-list" v-if='storageType==0'>
<view class="list-name">应付金额</view>
<view class="list-val">
<input type="text" v-model="shouldPay">
<input type="text" placeholder="请输入应付金额" v-model="shouldPay">
</view>
</view>
<view class="content-list" v-if='storageType==0'>
<view class="list-name">已付金额</view>
<view class="list-val">
<input type="text" v-model="alreadyPay" @blur="changePay">
<input type="text" placeholder="请输入已付金额" v-model="alreadyPay" @blur="changePay">
</view>
</view>
<view class="content-list" v-if='storageType==0'>
@ -183,11 +183,11 @@
khName: [],
carList: new Map(),
remark: '',
otherPay: 0,
otherPay: '',
noPay: 0,
alreadyPay: 0,
alreadyPay: '',
realAmount: 0,
shouldPay: 0,
shouldPay: '',
totalAmount: 0,
index: '',
index1: '',
@ -214,13 +214,12 @@
onShow() {
let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
this.totalAmount = 0;
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: this.carList1[i].num,
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
@ -230,7 +229,8 @@
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
@ -244,17 +244,21 @@
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(this
.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
.saleDetailQueryDTO[m].productCount)
.saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
}
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
}
} else { //商品不同
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: this.carList1[i].num,
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
@ -266,18 +270,17 @@
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
}
this.carList.get(this.carList1[i].id).price = this.carList.get(this.carList1[i].id).purchasePrice * this.carList.get(this.carList1[i].id).productCount;
}
this.carList1 = []
}
this.carList.forEach(function(value, key) {
that.totalAmount += value.productCount
})
this.noPay = this.shouldPay
this.getAllPrice()
},
onLoad() {
this.storageType = uni.getStorageSync('type')
@ -446,13 +449,12 @@
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
this.totalAmount = 0;
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < carList1.length; i++) {
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: carList1[i].num,
productCount: 0,
productId: carList1[i].id,
productName: carList1[i].productName,
productPicture: carList1[i].productPicture,
@ -462,7 +464,8 @@
}
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, carList1[i]
.saleDetailQueryDTO[m].productCount)
.saleDetailQueryDTO[m].productCount)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(carList1[i].id, obj)
}
@ -478,18 +481,22 @@
.saleDetailQueryDTO[
m].attributeList, this.carList.get(carList1[i].id).stockLogList.get(
carList1[i].saleDetailQueryDTO[m].attributeList) + carList1[i]
.saleDetailQueryDTO[m].productCount)
.saleDetailQueryDTO[m].productCount)
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[
m].productCount
} else { //规格不同
this.carList.get(carList1[i].id).stockLogList.set(carList1[i]
.saleDetailQueryDTO[
m].attributeList, carList1[i].saleDetailQueryDTO[m].productCount)
m].attributeList, carList1[i].saleDetailQueryDTO[m].productCount)
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[
m].productCount
}
}
} else { //商品不同
let obj = {
purchasePrice: "", //进货价
price: 0,
productCount: carList1[i].num,
productCount: 0,
productId: carList1[i].id,
productName: carList1[i].productName,
productPicture: carList1[i].productPicture,
@ -501,17 +508,15 @@
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.name = carList1[i].saleDetailQueryDTO[m].name
obj.name = carList1[i].saleDetailQueryDTO[m].name
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(carList1[i].id, obj)
}
}
carList1 = []
}
this.carList.forEach(function(value, key) {
that.totalAmount += value.productCount
})
this.noPay = this.shouldPay
this.getAllPrice()
this.$refs.shopPopup.close()
},
@ -536,6 +541,7 @@
if(that.carList.has(id) == true){
that.carList.delete(id)
}
that.getAllPrice()
that.$forceUpdate()
}
}
@ -550,10 +556,15 @@
content: "确定删除此条商品吗?",
success: function(res) {
if(res.confirm){
console.log(that.carList.get(id))
that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
that.carList.get(id).stockLogList.delete(name)
that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
if(that.carList.get(id).stockLogList.size == 0){
that.carList.delete(id)
}
that.getAllPrice()
}
that.$forceUpdate()
}
@ -578,11 +589,12 @@
}
let that = this;
let purchase = {
alreadyPay: this.alreadyPay, //已付金额
noPay: this.noPay, //欠款
alreadyPay: this.alreadyPay == ''?0:this.alreadyPay, //已付金额
noPay: this.noPay == ''?0:this.noPay, //欠款
shouldPay: this.shouldPay, //应付金额
totalAmount: this.totalAmount, //总数量
remark: this.remark,
remark: this.remark,
otherPay:this.otherPay == ''?0:this.otherPay,
supplierId: this.khName.id, //供应商id和姓名
supplierName: this.khName.consigneeName
}
@ -620,18 +632,28 @@
//编辑每一个的单价
clickCollapse(index) {
this.index = index
this.$refs.inputDialog.val = ''
this.$refs.inputClose.val = ''
this.$refs.inputDialog.open()
},
//计算价格
changePrice(val) {
let that = this;
that.shouldPay = 0
that.carList.get(that.index).purchasePrice = val
that.carList.get(that.index).price = val * that.carList.get(that.index).productCount;
that.carList.forEach(function(value, key) {
that.shouldPay += value.price
})
this.getAllPrice()
},
//计算总金额和总数量
getAllPrice(){
let that = this;
this.shouldPay = 0
this.totalAmount = 0
this.carList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
this.alreadyPay = this.shouldPay
that.noPay = this.shouldPay - this.alreadyPay
},
//修改已选规格的数量
GoodsNumChange(e,index,index1){
@ -639,17 +661,12 @@
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
})
this.getAllPrice();
}
}
}

215
pages/inventory/goodsList1.vue

@ -75,7 +75,7 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view>
<view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view>
<view>单价:{{value[1].discountAmount}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view>
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view>
<view
@ -95,12 +95,12 @@
</view>
<view class="collapse-1">
<text>折扣(0-10)</text>
<input class="input" type="digit" :value='value[1].discount | maxNum'
<input class="input" type="digit" :value='value[1].discount'
@blur="changeDis($event,value[0])">
</view>
<view class="collapse-1">
<text>折后价</text>
<input class="input" type="text" :value='value[1].discountAmount' disabled>
<input class="input" type="text" :value='value[1].price' disabled>
</view>
<view class="collapse-1">
<text>数量</text>
@ -426,7 +426,8 @@
saleId: '',
saleDetailList: [],
yNum: 150,
clearMsg:''
clearMsg:'',
priceType:''
}
},
components: {
@ -450,7 +451,7 @@
} else {
this.carList1 = this.carList1
}
if (this.carList1 == '' && this.clearMsg != '1') {
if (this.carList1 == '' && this.clearMsg != '1' && !uni.getStorageSync('saoma')) {
this.carList.clear()
this.remark = ''
this.clearMsg = '';
@ -458,9 +459,7 @@
this.xsyId = ''
this.khName = []
this.saleId = ''
}
this.totalAmount = 0;
this.shouldPay = 0
}
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.size == 0) { //当前页没有数据
@ -537,6 +536,7 @@
}
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
uni.removeStorageSync('saoma')
this.carList1 = []
this.carList.forEach(function(value, key) {
if (that.priceType == 0) { //零售
@ -547,9 +547,9 @@
if (that.discountType == 1) { //整体折扣
value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
}
that.totalAmount += value.productCount
that.shouldPay += value.price
})
})
this.getAllPrice()
this.getAmountAndWho()
this.noPay = this.shouldPay
},
filters: {
@ -562,13 +562,6 @@
}
}
return name;
},
maxNum(val) {
if (val >= 10) {
return 10
} else if (val < 0) {
return 0
}
}
},
onLoad(option) {
@ -656,7 +649,8 @@
},
changessPrice(e) {
this.relPrice = e.target.value
this.relPrice = e.target.value
this.noPay = this.relPrice - this.priceOk;
},
changePrice(e) {
this.priceOk = e.target.value
@ -679,9 +673,11 @@
},
//扫一扫功能
scanCodeAdd() {
// this.clearMsg = '1'
// this.clearMsg = '1'
uni.setStorageSync('saoma','1')
uni.scanCode({
success: (res) => {
success: (res) => {
this.toggle('bottom', res.result);
},
fail: (res) => {
@ -699,7 +695,58 @@
if (type == 'bottom') {
this.getById(id);
}
},
},
//整体选择是批发价还是零售价
priceChange(e) {
let that = this;
// if(this.carList.size == 0){
// this.tui.toast("请先选择商品")
// return
// }
this.priceType = e
this.carList.forEach(function(value, key) {
that.index = value.productId
if (e == 0) { //零售
that.checkPay(value.lsprice)
} else { //批发
that.checkPay(value.wholesalePrice)
}
})
},
//商品上选择是零售价还是批发价
checkPay(price) {
let that = this;
this.carList.get(this.index).discountAmount = price
this.carList.get(this.index).unitPrice = price;
that.carList.get(that.index).price = price * that.carList.get(that.index).productCount;
this.$refs.inputDialog.close()
this.getAllPrice()
that.relPrice = that.shouldPay
},
//整体选择时使用批发价、零售价,选择整体折扣的方法
getAmountAndWho(){
let that = this;
let price = 0
this.carList.forEach(function(value, key) {
if(that.priceType == 0){ //零售
price = value.lsprice
}else if(that.priceType == 1){ //批发
price = value.wholesalePrice
}
value.unitPrice = price;
if (that.discountType == 1) { //整体折扣
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000
value.price = value.discountAmount * value.productCount
}
})
this.getAllPrice();
if(this.relPrice == '' || this.relPrice == 0){
that.noPay = that.shouldPay
}else if(this.relPrice != '' && this.priceOk != ''){
that.noPay = this.relPrice - this.priceOk
}
},
//通过商品id查询商品详细信息
getById(id) {
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
@ -792,9 +839,9 @@
this.discountNum = 0
}else{
this.discountNum = e.detail.value
}
}
this.getAmountAndWho()
this.shouldPay = this.price * 10000 * e / 10 / 10000
},
//点击发货方式按钮
radioChange(e) {
@ -854,8 +901,6 @@
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
this.totalAmount = 0;
this.shouldPay = 0
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < carList1.length; i++) {
let obj = {
@ -941,9 +986,9 @@
if (that.discountType == 1) { //整体折扣
value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
}
that.totalAmount += value.productCount
that.shouldPay += value.price
})
})
this.getAllPrice()
this.getAmountAndWho();
this.noPay = this.shouldPay
this.$refs.shopPopup.close()
@ -1007,10 +1052,10 @@
return
}
let obj = {
orderByWorker: this.lbgName.workerId,
orderByWorker: this.lbgName.workerId,
oldSaleId: this.saleId,
sale: {
// relPrice:,
saleId: this.saleId,
// relPrice:,
alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款
@ -1120,7 +1165,10 @@
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
this.bufferData = strCmd;
uni.redirectTo({
url: "/pages/index/order"
})
},
//截取
slicePrint(val) {
@ -1165,43 +1213,19 @@
//更改单品折扣
changeDis(e, id) {
let that = this;
this.shouldPay = 0
let carlist = this.carList.get(id)
carlist.discount = e.detail.value;
carlist.discountAmount = carlist.unitPrice * e.detail.value / 10
carlist.price = carlist.unitPrice * e.detail.value / 10 * carlist.productCount
that.carList.forEach(function(value, key) {
that.shouldPay += value.price
})
},
//整体选择是批发价还是零售价
priceChange(e) {
let that = this;
// if(this.carList.size == 0){
// this.tui.toast("请先选择商品")
// return
// }
this.priceType = e
this.carList.forEach(function(value, key) {
that.index = value.productId
if (e == 0) { //零售
that.checkPay(value.lsprice)
} else { //批发
that.checkPay(value.wholesalePrice)
}
})
},
//商品上选择是零售价还是批发价
checkPay(price) {
let that = this;
this.shouldPay = 0
this.carList.get(this.index).discountAmount = price
this.carList.get(this.index).unitPrice = price;
that.carList.get(that.index).price = price * that.carList.get(that.index).productCount;
this.$refs.inputDialog.close()
that.carList.forEach(function(value, key) {
that.shouldPay += value.price
})
let carlist = this.carList.get(id)
if(e.detail.value > 10){
carlist.discount = 10;
}else if(e.detail.value < 0){
carlist.discount = 0;
}else{
carlist.discount = e.detail.value;
}
console.log(carlist.discount)
carlist.discountAmount = carlist.unitPrice * carlist.discount / 10
carlist.price = carlist.unitPrice * carlist.discount / 10 * carlist.productCount
this.getAllPrice()
},
//删除整条商品
delShop(id) {
@ -1214,7 +1238,9 @@
if (that.carList.has(id) == true) {
that.carList.delete(id)
}
that.$forceUpdate()
that.$forceUpdate()
that.getAllPrice()
that.getAmountAndWho()
}
}
})
@ -1227,35 +1253,52 @@
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.carList.get(id).stockLogList.delete(name)
if (res.confirm) {
console.log(that.carList.get(id))
that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
that.carList.get(id).stockLogList.delete(name);
that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).unitPrice
if (that.carList.get(id).stockLogList.size == 0) {
that.carList.delete(id)
}
}
that.getAllPrice()
that.getAmountAndWho()
}
that.$forceUpdate()
}
})
},
//计算总金额和总数量
getAllPrice(){
let that = this;
this.shouldPay = 0
this.totalAmount = 0
this.carList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
this.relPrice = this.shouldPay
that.noPay = this.relPrice - this.priceOk
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
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) {
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)
.unitPrice
})
this.carList.forEach(function(value, key) {
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
that.carList.get(index).productCount = that.carList.get(index).productCount + value
if (that.discountType == 0) { //单品折扣
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index)
.unitPrice * that.carList.get(index).discount / 10
}else{
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index)
.unitPrice
}
})
that.getAllPrice()
that.getAmountAndWho();
},
//清空全部数据
clearAll() {
@ -1418,7 +1461,7 @@
}
.discount-num {
width: 200rpx;
width: 160rpx;
}
.shop-productName {

2
pages/staff/addStaff/addStaff.vue

@ -68,7 +68,7 @@
if (type === 'edit') {
this.addForm.nickname = item.nickname
this.addForm.mobile = item.mobile
this.addForm.type = item.type
this.addForm.type = Number(item.type)
this.id = item.id
}
uni.setNavigationBarTitle({

Loading…
Cancel
Save