|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<!-- 销售商品 --> |
|
|
|
<template> |
|
|
|
<view class="page1"> |
|
|
|
<view class="content"> |
|
|
|
<!-- <view class="content"> --> |
|
|
|
<view style="position: fixed;top:0;z-index: 99;width: 100%;"> |
|
|
|
<!-- <view class="notice"> |
|
|
|
<u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="noticeData"></u-notice-bar> |
|
|
|
@ -11,7 +11,8 @@ |
|
|
|
<view class="list-name">客户</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="text" placeholder="请选择客户" disabled |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name"> |
|
|
|
:value="khName.name" |
|
|
|
style="border-bottom: 1px solid #fff;text-align: center;"> |
|
|
|
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -42,8 +43,9 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-box" style="margin-top: 388rpx;"> |
|
|
|
</view> |
|
|
|
<scroll-view class="scroll-content" scroll-y="true" :scroll-into-view="currentAnchor" scroll-top="0"> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)" |
|
|
|
:key="key"> |
|
|
|
<view class="shop-name" style="position: relative;"> |
|
|
|
@ -104,7 +106,7 @@ |
|
|
|
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">数量</view> |
|
|
|
</view> |
|
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" |
|
|
|
:key='keys'> |
|
|
|
:key='keys' :id="values[1].uuid"> |
|
|
|
<view @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
|
</view> |
|
|
|
@ -130,7 +132,7 @@ |
|
|
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems" |
|
|
|
:key="item.value" style="margin-right:0"> |
|
|
|
<view> |
|
|
|
<radio v-model="item.value" @tap.stop="priceChange(item.value)" |
|
|
|
<radio :value="item.value" @tap.stop="priceChange(item.value,index)" |
|
|
|
:checked="index === priceCurrent" /> |
|
|
|
</view> |
|
|
|
<view style="width: 100rpx;">{{item.name}}</view> |
|
|
|
@ -160,11 +162,12 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="content-box"> |
|
|
|
<view class="price-box-list"> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">总金额</view> |
|
|
|
<view class="list-name" id="idss">总金额</view> |
|
|
|
<view class="list-val"> |
|
|
|
<input type="number" v-model="shouldPay" disabled> |
|
|
|
</view> |
|
|
|
@ -277,8 +280,9 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
<!-- </view> --> |
|
|
|
<view class="bottom-box"> |
|
|
|
<view class="bottom-left"> |
|
|
|
<text>合计:{{totalAmount}}</text> |
|
|
|
@ -301,10 +305,10 @@ |
|
|
|
<view class="popup-pay-container" @tap.stop="checkPay(wholesalePrice)"> |
|
|
|
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text> |
|
|
|
</view> |
|
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;"> |
|
|
|
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格" |
|
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;width: 100%;"> |
|
|
|
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;width: 296rpx;" placeholder="请输入价格" |
|
|
|
@input="changePay"> |
|
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;" |
|
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;width: 144rpx;" |
|
|
|
@tap.stop="checkPay(customPrice)">确定</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -356,7 +360,7 @@ |
|
|
|
</view> |
|
|
|
<view class="shop-checkList-box"> |
|
|
|
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text |
|
|
|
style="color:#777;font-size: 12px;">{{item.productNum}}</text> |
|
|
|
style="color:#777;font-size: 12px;">{{item.productNum==null?'无库存':item.productNum}}</text> |
|
|
|
</view> |
|
|
|
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> |
|
|
|
</view> |
|
|
|
@ -453,7 +457,7 @@ |
|
|
|
<view class="popup-pay-container" style="display: flex;"> |
|
|
|
<view @tap='goSell' |
|
|
|
style="width:50%;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;"> |
|
|
|
只开单 |
|
|
|
仅开单 |
|
|
|
</view> |
|
|
|
<view style="position:relative;width:50%;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;"> |
|
|
|
<kk-printer style="width: 100%;color:#fff;position: absolute;top: 0;left: 0;" ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" :defaultText="'开单并打印'"></kk-printer> |
|
|
|
@ -490,6 +494,7 @@ |
|
|
|
import util from '@/components/kk-printer/utils/util.js'; |
|
|
|
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js'; |
|
|
|
import kkPrinter from '@/components/kk-printer/index.vue'; |
|
|
|
import { generateUUID } from '@/utils/global.js' |
|
|
|
var plugin = requirePlugin("WechatSI") |
|
|
|
let manager = plugin.getRecordRecognitionManager() |
|
|
|
export default { |
|
|
|
@ -508,7 +513,8 @@ |
|
|
|
goodsDetail: [], |
|
|
|
noticeData: ['您每发出一个包,使用拉包工和物流公司送货时,我们将从中拿出XX元,捐入快拾帮帮公益基金中,帮助那些贫困儿童!我们的付出将让世界充满爱!'], |
|
|
|
columns: [], |
|
|
|
keyList: [], |
|
|
|
keyList: [], |
|
|
|
index:'', |
|
|
|
temporaryList: [], |
|
|
|
zNum: 0, |
|
|
|
bufferData: [], |
|
|
|
@ -608,7 +614,9 @@ |
|
|
|
pecsList: [], |
|
|
|
dataObj: new Map(), |
|
|
|
allChangeNum:0, |
|
|
|
recordState:false |
|
|
|
recordState:false, |
|
|
|
currentAnchor: '', |
|
|
|
temporaryNum:0 |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -617,6 +625,7 @@ |
|
|
|
onShow() { |
|
|
|
// 初始化蓝牙模块 |
|
|
|
wx.openBluetoothAdapter({mode: 'central'}) |
|
|
|
console.log(Math.floor(Math.random() * 256)) |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中...' |
|
|
|
}) |
|
|
|
@ -629,12 +638,18 @@ |
|
|
|
if (uni.getStorageSync('hangOrder') == true) { |
|
|
|
this.carList.clear() |
|
|
|
this.remark = '' |
|
|
|
this.createByName = '' |
|
|
|
this.xsyId = '' |
|
|
|
this.khName = [] |
|
|
|
this.saleId = '' |
|
|
|
uni.removeStorageSync('hangOrder'); |
|
|
|
} |
|
|
|
this.sex = [{ |
|
|
|
text: '平台配送', |
|
|
|
value: 0 |
|
|
|
}, { |
|
|
|
text: '自送', |
|
|
|
value: 1 |
|
|
|
}] |
|
|
|
if(this.wlName !='' && this.wlName.canToDoor == 1){ |
|
|
|
let data = { |
|
|
|
text: '物流自取', |
|
|
|
@ -660,7 +675,9 @@ |
|
|
|
this.createByName = this.carList1[0].createByName |
|
|
|
} else { |
|
|
|
this.carList1 = this.carList1 |
|
|
|
} |
|
|
|
} |
|
|
|
// const uuid = generateUUID(); |
|
|
|
// console.log('uuid',uuid); |
|
|
|
this.handleData() |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
@ -711,7 +728,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
@ -726,7 +744,9 @@ |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
|
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
@ -747,7 +767,9 @@ |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum || this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -781,7 +803,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
|
|
|
|
@ -840,6 +863,7 @@ |
|
|
|
purchasePrice: this.carList1[i].purchasePrice, //采购价 |
|
|
|
price: 0, //总价 |
|
|
|
discount: 10, //折扣 |
|
|
|
productId:this.carList1[i].productId, |
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
|
@ -858,7 +882,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.carList1[i].stockLogList1[m].name, |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
obj.productCount += this.carList1[i].stockLogList1[m].productCount |
|
|
|
@ -867,13 +892,16 @@ |
|
|
|
} else { //当前页有数据 |
|
|
|
if (this.carList.has(this.carList1[i].productId) == true) { //商品相同 |
|
|
|
for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) { |
|
|
|
console.log('stockLogList1',this.carList1[i].stockLogList1[m]) |
|
|
|
if (this.carList.get(this.carList1[i].productId).stockLogList.has(this.carList1[i] |
|
|
|
.stockLogList1[ |
|
|
|
m].attributeList) == true) { //规格相同 |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: this.carList.get(this.carList1[i].productId).stockLogList.get(this.carList1[i].stockLogList1[m].attributeList).productCount + this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.carList1[i].stockLogList1[m].name |
|
|
|
name: this.carList1[i].stockLogList1[m].name, |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
|
|
|
|
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
@ -881,7 +909,9 @@ |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.carList1[i].stockLogList1[m].name |
|
|
|
name: this.carList1[i].stockLogList1[m].name, |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -895,6 +925,7 @@ |
|
|
|
price: 0, //总价 |
|
|
|
discount: 10, //折扣 |
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
|
productId:this.carList1[i].productId, |
|
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
|
@ -915,7 +946,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.carList1[i].stockLogList1[m].name, |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum |
|
|
|
productNum:this.carList1[i].stockLogList1[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
|
|
|
|
@ -1030,11 +1062,46 @@ |
|
|
|
} |
|
|
|
let data = this.temporary |
|
|
|
let specMap = new Map() //新的临时存放值那个更改过的值的数组 |
|
|
|
let similar = '' |
|
|
|
this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
if(key == data[1]){ |
|
|
|
let stringKey = key.replace(data[3],item) //拿到了更改过的key |
|
|
|
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面 |
|
|
|
that.carList.get(data[0]).stockLogList.delete(data[1]) |
|
|
|
that.tui.request("/app/stock/productCount", "post", { |
|
|
|
productId: that.carList.get(data[0]).productId, |
|
|
|
attributeList: stringKey |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
value.productNum = res.result |
|
|
|
if(specMap.has(stringKey) == true){ //当前的数据中有相同的值 |
|
|
|
similar = specMap.get(stringKey).uuid |
|
|
|
specMap.get(stringKey).productCount += value.productCount |
|
|
|
}else{ |
|
|
|
value.uuid = 'A'+generateUUID(); |
|
|
|
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面 |
|
|
|
} |
|
|
|
that.$forceUpdate() |
|
|
|
that.carList.get(data[0]).stockLogList.delete(data[1]) |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
that.$nextTick(()=>{ |
|
|
|
setTimeout(res => { |
|
|
|
if(similar != ''){ |
|
|
|
that.currentAnchor = '#'+similar; |
|
|
|
}else{ |
|
|
|
that.currentAnchor = '#'+value.uuid; |
|
|
|
} |
|
|
|
console.log(that.currentAnchor) |
|
|
|
}, 200) |
|
|
|
}) |
|
|
|
that.$nextTick(()=>{ |
|
|
|
setTimeout(res => { |
|
|
|
that.currentAnchor = "" |
|
|
|
similar = '' |
|
|
|
console.log(that.currentAnchor) |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(this.carList.get(data[0]).stockLogList.size > 0){ |
|
|
|
@ -1043,8 +1110,12 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
this.carList.get(data[0]).stockLogList = specMap |
|
|
|
this.$forceUpdate() |
|
|
|
this.$refs.getaPopup.close() |
|
|
|
setTimeout(res => { |
|
|
|
|
|
|
|
this.$forceUpdate() |
|
|
|
this.$refs.getaPopup.close() |
|
|
|
}, 200) |
|
|
|
|
|
|
|
}, |
|
|
|
//销售员列表 |
|
|
|
xsyList() { |
|
|
|
@ -1065,7 +1136,18 @@ |
|
|
|
if(this.isPlusAndMinus == false){ |
|
|
|
for(var i=0;i<this.temporaryList.length;i++){ |
|
|
|
this.temporaryList[i].productCount = Number(e.detail.value) |
|
|
|
for(var m=0;m<this.pageOldTemList.length;m++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ |
|
|
|
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
for(var j=0;j<this.oldTemList.length;j++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){ |
|
|
|
this.oldTemList[j].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.isPlusAndMinus == false |
|
|
|
this.temporaryChange() |
|
|
|
@ -1079,6 +1161,17 @@ |
|
|
|
}else{ |
|
|
|
this.temporaryList[i].productCount++ |
|
|
|
} |
|
|
|
|
|
|
|
for(var m=0;m<this.pageOldTemList.length;m++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ |
|
|
|
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
for(var j=0;j<this.oldTemList.length;j++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){ |
|
|
|
this.oldTemList[j].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.temporaryChange() |
|
|
|
}, |
|
|
|
@ -1086,8 +1179,19 @@ |
|
|
|
this.isPlusAndMinus == true |
|
|
|
//监听到点击-的操作,给所有的都-1 |
|
|
|
for(var i=0;i<this.temporaryList.length;i++){ |
|
|
|
this.temporaryList[i].productCount-- |
|
|
|
this.temporaryList[i].productCount -- |
|
|
|
for(var m=0;m<this.pageOldTemList.length;m++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList){ |
|
|
|
this.pageOldTemList[m].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
for(var j=0;j<this.oldTemList.length;j++){ |
|
|
|
if(this.temporaryList[i].attributeList == this.oldTemList[j].attributeList){ |
|
|
|
this.oldTemList[j].productCount = this.temporaryList[i].productCount |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.temporaryChange() |
|
|
|
}, |
|
|
|
attrNameChange(index, data1, index1) { |
|
|
|
@ -1141,7 +1245,7 @@ |
|
|
|
this.attributeList = { |
|
|
|
attributeList: value[i], |
|
|
|
productCount: this.temporaryNum, |
|
|
|
productNum: this.productNum, |
|
|
|
productNum: null, |
|
|
|
name: evalue[i], |
|
|
|
price: this.purchasePrice |
|
|
|
} |
|
|
|
@ -1159,7 +1263,7 @@ |
|
|
|
this.attributeList = { |
|
|
|
attributeList: value[i], |
|
|
|
productCount: newProductCount, |
|
|
|
productNum: this.productNum, |
|
|
|
productNum: null, |
|
|
|
name: evalue[i], |
|
|
|
price: this.purchasePrice |
|
|
|
} |
|
|
|
@ -1375,16 +1479,19 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
//整体选择是批发价还是零售价 |
|
|
|
priceChange(e) { |
|
|
|
priceChange(e,index) { |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中...', |
|
|
|
mask:true |
|
|
|
}) |
|
|
|
let that = this; |
|
|
|
this.priceType = e |
|
|
|
this.priceType = e |
|
|
|
that.priceCurrent = index |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
console.log('麻烦',value) |
|
|
|
that.index = value.productId || value.id |
|
|
|
console.log('麻烦',value) |
|
|
|
|
|
|
|
that.index = value.productId || value.id |
|
|
|
|
|
|
|
if (e == 0) { //零售 |
|
|
|
that.checkPay(value.lsprice) |
|
|
|
} else { //批发 |
|
|
|
@ -1396,7 +1503,7 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
}, 500) |
|
|
|
}) |
|
|
|
|
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
//商品上选择是零售价还是批发价 |
|
|
|
checkPay(price) { |
|
|
|
@ -1422,14 +1529,19 @@ |
|
|
|
getAmountAndWho() { |
|
|
|
let that = this; |
|
|
|
let price = 0 |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
if (that.priceType == '') { |
|
|
|
price = value.unitPrice |
|
|
|
} else if (that.priceType == 0) { //零售 |
|
|
|
price = value.lsprice |
|
|
|
} else if (that.priceType == 1) { //批发 |
|
|
|
price = value.wholesalePrice |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
if(value.discountAmount > 0){ |
|
|
|
price = value.discountAmount |
|
|
|
}else{ |
|
|
|
if (that.priceType == '') { |
|
|
|
price = value.unitPrice |
|
|
|
} else 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 |
|
|
|
@ -1472,7 +1584,7 @@ |
|
|
|
productCount: values.productCount, |
|
|
|
name: values.name, |
|
|
|
attributeList: keys, |
|
|
|
productNum: that.productNum |
|
|
|
productNum: values.productNum |
|
|
|
} |
|
|
|
value.stockLogList1.push(obj) |
|
|
|
}else{ |
|
|
|
@ -1483,7 +1595,7 @@ |
|
|
|
productCount: values.productCount, |
|
|
|
name: values.name, |
|
|
|
attributeList: keys, |
|
|
|
productNum: that.productNum |
|
|
|
productNum: values.productNum |
|
|
|
} |
|
|
|
value.stockLogList1.push(obj) |
|
|
|
} |
|
|
|
@ -1717,6 +1829,7 @@ |
|
|
|
id: this.goodsDetail.id, |
|
|
|
price: this.zPrice, |
|
|
|
num: this.zNum, |
|
|
|
categoryId:this.goodsDetail.categoryId, |
|
|
|
productName: this.goodsDetail.productName, |
|
|
|
productSn: this.goodsDetail.productSn, |
|
|
|
productPicture: this.goodsDetail.productPicture, |
|
|
|
@ -1762,7 +1875,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
@ -1790,7 +1904,9 @@ |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -1803,7 +1919,9 @@ |
|
|
|
} else { //规格不同 |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -1837,7 +1955,8 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID() |
|
|
|
} |
|
|
|
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
@ -2064,9 +2183,9 @@ |
|
|
|
onPrint(opt) { |
|
|
|
let that = this; |
|
|
|
this.goSell('print') |
|
|
|
|
|
|
|
let strCmd = '' |
|
|
|
that.yNum = 150 |
|
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
|
strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLLocation(2); |
|
|
|
@ -2210,7 +2329,8 @@ |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.showPopup.close() |
|
|
|
that.$refs.showPopup.close() |
|
|
|
that.bufferData = [] |
|
|
|
that.clearAll1() |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
@ -2384,14 +2504,17 @@ |
|
|
|
let that = this; |
|
|
|
that.carList.clear() |
|
|
|
that.remark = '' |
|
|
|
that.index = '' |
|
|
|
that.priceCurrent = '' |
|
|
|
that.current = '' |
|
|
|
that.discountType = '' |
|
|
|
that.discountCurrent = '' |
|
|
|
that.temporaryList = [] |
|
|
|
that.purchasePrice = 0 |
|
|
|
that.zPrice = 0 |
|
|
|
that.zNum = 0 |
|
|
|
that.shouldPay = 0 |
|
|
|
that.khName = [] |
|
|
|
that.gysName = [] |
|
|
|
that.wlName = [] |
|
|
|
that.kdyName = [] |
|
|
|
@ -2401,9 +2524,8 @@ |
|
|
|
that.noPay = 0 |
|
|
|
that.otherExpense = 0 |
|
|
|
that.totalAmount = 0 |
|
|
|
that.createByName = '' |
|
|
|
that.xsyId = '' |
|
|
|
this.saleId = '' |
|
|
|
that.saleId = '' |
|
|
|
that.$forceUpdate() |
|
|
|
}, |
|
|
|
//清空全部数据 |
|
|
|
clearAll() { |
|
|
|
@ -2412,17 +2534,21 @@ |
|
|
|
title: "提示", |
|
|
|
content: "确定清空全部已选商品吗?", |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
if (res.confirm) { |
|
|
|
console.log(that.priceCurrent) |
|
|
|
that.carList.clear() |
|
|
|
that.remark = '' |
|
|
|
that.priceCurrent = '' |
|
|
|
that.current = '' |
|
|
|
that.discountCurrent = '' |
|
|
|
that.index = '' |
|
|
|
that.priceType = '' |
|
|
|
that.current = null |
|
|
|
that.discountType = '' |
|
|
|
that.discountCurrent = null |
|
|
|
that.temporaryList = [] |
|
|
|
that.purchasePrice = 0 |
|
|
|
that.zPrice = 0 |
|
|
|
that.zNum = 0 |
|
|
|
that.shouldPay = 0 |
|
|
|
that.shouldPay = 0 |
|
|
|
that.khName = [] |
|
|
|
that.gysName = [] |
|
|
|
that.wlName = [] |
|
|
|
that.kdyName = [] |
|
|
|
@ -2432,9 +2558,9 @@ |
|
|
|
that.noPay = 0 |
|
|
|
that.otherExpense = 0 |
|
|
|
that.totalAmount = 0 |
|
|
|
that.createByName = '' |
|
|
|
that.xsyId = '' |
|
|
|
this.saleId = '' |
|
|
|
that.saleId = '' |
|
|
|
that.priceCurrent = null |
|
|
|
that.$forceUpdate() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -3037,5 +3163,9 @@ |
|
|
|
text-align: center; |
|
|
|
color: #777; |
|
|
|
margin: 20rpx 0 0 20rpx; |
|
|
|
} |
|
|
|
.scroll-content{ |
|
|
|
margin: 388rpx 0 120rpx 0; |
|
|
|
height: 90%; |
|
|
|
} |
|
|
|
</style> |