|
|
@ -7,14 +7,14 @@ |
|
|
<view class="list-name">客户</view> |
|
|
<view class="list-name">客户</view> |
|
|
<view class="list-val"> |
|
|
<view class="list-val"> |
|
|
<input type="text" placeholder="请选择客户" disabled |
|
|
<input type="text" placeholder="请选择客户" disabled |
|
|
style="border-bottom: 1px solid #fff;text-align: center;" :value="khName.name" |
|
|
style="border-bottom: 1px solid #fff;text-align: center;" v-model="khName.name" |
|
|
@tap.stop="goPopleList('khName')"> |
|
|
@tap.stop="goPopleList('khName')"> |
|
|
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> |
|
|
<uni-icons type="right" size="16" style="margin-left: 80rpx;line-height: 80rpx;"></uni-icons> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="content-list"> |
|
|
<view class="content-list"> |
|
|
<view class="list-name">销售员</view> |
|
|
<view class="list-name">销售员</view> |
|
|
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="valuexsy" |
|
|
<uni-data-select class="uni-data-select" :localdata="categoryList" v-model="xsyId" |
|
|
placeholder="请选择销售员" @change="categoryChange"></uni-data-select> |
|
|
placeholder="请选择销售员" @change="categoryChange"></uni-data-select> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -39,7 +39,8 @@ |
|
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems" |
|
|
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in priceItems" |
|
|
:key="item.value"> |
|
|
:key="item.value"> |
|
|
<view> |
|
|
<view> |
|
|
<radio :value="item.value" @tap.stop="priceChange(item.value)" :checked="index === priceCurrent" /> |
|
|
<radio :value="item.value" @tap.stop="priceChange(item.value)" |
|
|
|
|
|
:checked="index === priceCurrent" /> |
|
|
</view> |
|
|
</view> |
|
|
<view style="width: 100rpx;">{{item.name}}</view> |
|
|
<view style="width: 100rpx;">{{item.name}}</view> |
|
|
</label> |
|
|
</label> |
|
|
@ -61,13 +62,15 @@ |
|
|
</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" @change="change"/> |
|
|
<uni-number-box :min="0.1" :max="10" :value="discountNum" :step="0.1" |
|
|
|
|
|
@change="change" /> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)" :key="key"> |
|
|
<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;"> |
|
|
<view class="shop-name" style="position: relative;"> |
|
|
<img :src="value[1].productPicture" alt="" |
|
|
<img :src="value[1].productPicture" alt="" |
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
@ -76,7 +79,8 @@ |
|
|
<view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view> |
|
|
<view>单价:{{value[1].unitPrice}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}</view> |
|
|
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view> |
|
|
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
<view |
|
|
|
|
|
style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
@tap.stop="clickPrice(value[0])"> |
|
|
@tap.stop="clickPrice(value[0])"> |
|
|
改价 |
|
|
改价 |
|
|
</view> |
|
|
</view> |
|
|
@ -92,7 +96,8 @@ |
|
|
</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' @blur="changeDis($event,value[0])"> |
|
|
<input class="input" type="number" :value='value[1].discount | maxNum' |
|
|
|
|
|
@blur="changeDis($event,value[0])"> |
|
|
</view> |
|
|
</view> |
|
|
<view class="collapse-1"> |
|
|
<view class="collapse-1"> |
|
|
<text>折后价</text> |
|
|
<text>折后价</text> |
|
|
@ -103,13 +108,15 @@ |
|
|
<input class="input" type="number" :value='value[1].productCount'> |
|
|
<input class="input" type="number" :value='value[1].productCount'> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key='keys'> |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" |
|
|
<view style="margin-right:5%;" @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
:key='keys'> |
|
|
|
|
|
<view @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
</view> |
|
|
</view> |
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
<!-- <text style="color: red;">¥100</text> --> |
|
|
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">数量:<uni-number-box |
|
|
<text>数量:{{values[1]}}</text> |
|
|
max="100000" style="margin-top:16rpx;" v-model="values[1]" |
|
|
|
|
|
@change="GoodsNumChange($event,value[0],values[0])" /></view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -176,7 +183,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<view class="content-list" v-if="radioType == '0' || radioType == '1'"> |
|
|
<view class="content-list" v-if="radioType == '0' || radioType == '1'"> |
|
|
<view class="list-name" style="width:150rpx;padding-left: 0;">{{radioType == '0'? '选择物流' :'选择快递'}}</view> |
|
|
<view class="list-name" style="width:150rpx;padding-left: 0;"> |
|
|
|
|
|
{{radioType == '0'? '选择物流' :'选择快递'}}</view> |
|
|
<view class="list-val"> |
|
|
<view class="list-val"> |
|
|
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" |
|
|
<input type="text" placeholder="请选择" disabled :value="wlName.companyName" |
|
|
style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;" |
|
|
style="border-bottom: 1px solid #fff;text-align: center;padding-right: 54rpx;" |
|
|
@ -203,7 +211,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="content-list" v-if="radioType1 != '1' && radioType !=''"> |
|
|
<view class="content-list" v-if="radioType1 != '1' && radioType !=''"> |
|
|
<view class="list-name" style="width:150rpx;padding-left:0;">{{radioType == '1'? '快递员' :'拉包工'}}</view> |
|
|
<view class="list-name" style="width:150rpx;padding-left:0;"> |
|
|
|
|
|
{{radioType == '1'? '快递员' :'拉包工'}}</view> |
|
|
<view class="list-val"> |
|
|
<view class="list-val"> |
|
|
<input type="text" placeholder="可指定人员" disabled |
|
|
<input type="text" placeholder="可指定人员" disabled |
|
|
:value="radioType == '1'? kdyName.workerName : lbgName.workerName" |
|
|
:value="radioType == '1'? kdyName.workerName : lbgName.workerName" |
|
|
@ -246,8 +255,10 @@ |
|
|
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text> |
|
|
<text style="display: inline-block">批发价:¥{{wholesalePrice}}</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;"> |
|
|
<view class="popup-pay-container" style="background: #fff;display: flex;"> |
|
|
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格" @blur="changePay"> |
|
|
<input type="number" style="height: 100rpx;line-height: 100rpx;color:#000;" placeholder="请输入价格" |
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;" @tap.stop="checkPay(customPrice)">确定</view> |
|
|
@blur="changePay"> |
|
|
|
|
|
<view style="flex: 1;color: #fff;background: #088FEB;border-radius: 10px;" |
|
|
|
|
|
@tap.stop="checkPay(customPrice)">确定</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
@ -260,7 +271,8 @@ |
|
|
<img :src="goodsDetail.productPicture" alt=""> |
|
|
<img :src="goodsDetail.productPicture" alt=""> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-popup-title-right"> |
|
|
<view class="shop-popup-title-right"> |
|
|
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}</view> |
|
|
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} |
|
|
|
|
|
</view> |
|
|
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view> |
|
|
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -306,11 +318,14 @@ |
|
|
<view style="text-align: center;line-height: 50px;height: 100rpx;"> |
|
|
<view style="text-align: center;line-height: 50px;height: 100rpx;"> |
|
|
需要打印销售小票吗? |
|
|
需要打印销售小票吗? |
|
|
</view> |
|
|
</view> |
|
|
<view style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;"> |
|
|
<view |
|
|
<view @tap='printChenel' style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;"> |
|
|
style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;"> |
|
|
|
|
|
<view @tap='printChenel' |
|
|
|
|
|
style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;"> |
|
|
暂不需要 |
|
|
暂不需要 |
|
|
</view> |
|
|
</view> |
|
|
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer> |
|
|
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" |
|
|
|
|
|
style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
@ -419,7 +434,7 @@ |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
onShow() { |
|
|
let that = this; |
|
|
let that = this; |
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) |
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) || '' |
|
|
this.gysName = JSON.parse(JSON.stringify(this.gysName)) |
|
|
this.gysName = JSON.parse(JSON.stringify(this.gysName)) |
|
|
this.wlName = JSON.parse(JSON.stringify(this.wlName)) |
|
|
this.wlName = JSON.parse(JSON.stringify(this.wlName)) |
|
|
this.kdyName = JSON.parse(JSON.stringify(this.kdyName)) |
|
|
this.kdyName = JSON.parse(JSON.stringify(this.kdyName)) |
|
|
@ -427,8 +442,11 @@ |
|
|
if (uni.getStorageSync('carList1') != '') { |
|
|
if (uni.getStorageSync('carList1') != '') { |
|
|
this.carList.clear() |
|
|
this.carList.clear() |
|
|
this.carList1 = JSON.parse(uni.getStorageSync('carList1')) |
|
|
this.carList1 = JSON.parse(uni.getStorageSync('carList1')) |
|
|
|
|
|
this.khName = uni.getStorageSync('khName') ? JSON.parse(uni.getStorageSync('khName')) : '' |
|
|
this.remark = this.carList1[0].remark |
|
|
this.remark = this.carList1[0].remark |
|
|
this.saleId = this.carList1[0].saleId |
|
|
this.saleId = this.carList1[0].saleId |
|
|
|
|
|
this.xsyId = this.carList1[0].xsyId |
|
|
|
|
|
this.createByName = this.carList1[0].createByName |
|
|
} else { |
|
|
} else { |
|
|
this.carList1 = this.carList1 |
|
|
this.carList1 = this.carList1 |
|
|
} |
|
|
} |
|
|
@ -436,6 +454,10 @@ |
|
|
this.carList.clear() |
|
|
this.carList.clear() |
|
|
this.remark = '' |
|
|
this.remark = '' |
|
|
this.clearMsg = ''; |
|
|
this.clearMsg = ''; |
|
|
|
|
|
this.createByName = '' |
|
|
|
|
|
this.xsyId = '' |
|
|
|
|
|
this.khName = [] |
|
|
|
|
|
this.saleId = '' |
|
|
} |
|
|
} |
|
|
this.totalAmount = 0; |
|
|
this.totalAmount = 0; |
|
|
this.shouldPay = 0 |
|
|
this.shouldPay = 0 |
|
|
@ -466,18 +488,25 @@ |
|
|
this.carList.set(this.carList1[i].id, obj) |
|
|
this.carList.set(this.carList1[i].id, obj) |
|
|
} |
|
|
} |
|
|
uni.removeStorageSync('carList1') |
|
|
uni.removeStorageSync('carList1') |
|
|
|
|
|
uni.removeStorageSync('khName') |
|
|
this.carList1 = [] |
|
|
this.carList1 = [] |
|
|
} else { //当前页有数据 |
|
|
} else { //当前页有数据 |
|
|
for (let i = 0; i < this.carList1.length; i++) { |
|
|
for (let i = 0; i < this.carList1.length; i++) { |
|
|
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 |
|
|
if (this.carList.has(this.carList1[i].id) == true) { //商品相同 |
|
|
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) { //规格相同 |
|
|
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i].saleDetailQueryDTO[ |
|
|
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) |
|
|
m].attributeList) == true) { //规格相同 |
|
|
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[m].productCount |
|
|
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) |
|
|
|
|
|
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[ |
|
|
|
|
|
m].productCount |
|
|
} else { //规格不同 |
|
|
} else { //规格不同 |
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ |
|
|
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 |
|
|
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[ |
|
|
|
|
|
m].productCount |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { //商品不同 |
|
|
} else { //商品不同 |
|
|
@ -852,13 +881,19 @@ |
|
|
for (let i = 0; i < carList1.length; i++) { |
|
|
for (let i = 0; i < carList1.length; i++) { |
|
|
if (this.carList.has(carList1[i].id) == true) { //商品相同 |
|
|
if (this.carList.has(carList1[i].id) == true) { //商品相同 |
|
|
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i].saleDetailQueryDTO[m].attributeList) == true) { //规格相同 |
|
|
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i].saleDetailQueryDTO[m] |
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, this.carList.get(carList1[i].id).stockLogList.get(carList1[i].saleDetailQueryDTO[m].attributeList) + carList1[i].saleDetailQueryDTO[m].productCount) |
|
|
.attributeList) == true) { //规格相同 |
|
|
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m].productCount |
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[m] |
|
|
|
|
|
.attributeList, this.carList.get(carList1[i].id).stockLogList.get(carList1[i] |
|
|
|
|
|
.saleDetailQueryDTO[m].attributeList) + carList1[i].saleDetailQueryDTO[m] |
|
|
|
|
|
.productCount) |
|
|
|
|
|
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m] |
|
|
|
|
|
.productCount |
|
|
} else { //规格不同 |
|
|
} else { //规格不同 |
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ |
|
|
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 |
|
|
this.carList.get(carList1[i].id).productCount += carList1[i].saleDetailQueryDTO[m] |
|
|
|
|
|
.productCount |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { //商品不同 |
|
|
} else { //商品不同 |
|
|
@ -919,36 +954,35 @@ |
|
|
}, |
|
|
}, |
|
|
//点击底部开单按钮 |
|
|
//点击底部开单按钮 |
|
|
goSell() { |
|
|
goSell() { |
|
|
console.log(this.carList) |
|
|
if (this.khName == '') { |
|
|
this.$refs.printerPopup.open('center') |
|
|
this.tui.toast('请选择客户!') |
|
|
// console.log(this.khName) |
|
|
return |
|
|
// console.log(this.lbgName) |
|
|
} |
|
|
// console.log(this.wlName) |
|
|
if (this.xsyId == '') { |
|
|
// if(this.khName == ''){ |
|
|
this.tui.toast('请选择销售员!') |
|
|
// this.tui.toast('请选择客户!') |
|
|
return |
|
|
// return |
|
|
} |
|
|
// } |
|
|
if (this.shouldPay == 0) { |
|
|
// if(this.xsyId ==''){ |
|
|
this.tui.toast('请维护商品金额!') |
|
|
// this.tui.toast('请选择销售员!') |
|
|
return |
|
|
// return |
|
|
} |
|
|
// } |
|
|
if (this.relPrice == (0 || '')) { |
|
|
// if(this.relPrice == (0 || '')){ |
|
|
this.tui.toast('请输入实收金额!') |
|
|
// this.tui.toast('请输入实收金额!') |
|
|
return |
|
|
// return |
|
|
} else if (this.priceOk == (0 || '')) { |
|
|
// }else if(this.priceOk==(0 || '')){ |
|
|
this.tui.toast('请输入已收金额!') |
|
|
// this.tui.toast('请输入已收金额!') |
|
|
return |
|
|
// return |
|
|
} |
|
|
// } |
|
|
if (this.carList.size == 0) { |
|
|
// if(this.carList.size == 0){ |
|
|
this.tui.toast('请添加商品!') |
|
|
// this.tui.toast('请添加商品!') |
|
|
return |
|
|
// return |
|
|
} |
|
|
// } |
|
|
if (this.radioType != '') { |
|
|
// if(this.radioType != ''){ |
|
|
if (this.radioType == 0 || this.radioType == 1 || this.radioType == 4) { |
|
|
// if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){ |
|
|
if (this.wlName == '') { |
|
|
// if(this.wlName == ''){ |
|
|
this.tui.toast('请选择配送公司!') |
|
|
// this.tui.toast('请选择配送公司!') |
|
|
return |
|
|
// return |
|
|
} |
|
|
// } |
|
|
|
|
|
// if(this.radioType1 == 0){ |
|
|
// if(this.radioType1 == 0){ |
|
|
// if(this.lbgName == ''){ |
|
|
// if(this.lbgName == ''){ |
|
|
// this.tui.toast('请选择配送人员!') |
|
|
// this.tui.toast('请选择配送人员!') |
|
|
@ -956,73 +990,79 @@ |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
// } |
|
|
// } |
|
|
// }else if(this.radioType== 3){ |
|
|
} else if (this.radioType == 3) { |
|
|
// if(this.pbAddress == ''){ |
|
|
if (this.pbAddress == '') { |
|
|
// this.tui.toast('请输入拼包地址!') |
|
|
this.tui.toast('请输入拼包地址!') |
|
|
// return |
|
|
return |
|
|
// } |
|
|
} |
|
|
// } |
|
|
} |
|
|
// }else{ |
|
|
} else { |
|
|
// this.tui.toast('请选择发货方式!') |
|
|
this.tui.toast('请选择发货方式!') |
|
|
// return |
|
|
return |
|
|
// } |
|
|
} |
|
|
// let obj = { |
|
|
let obj = { |
|
|
// orderByWorker: this.lbgName.workerId, |
|
|
orderByWorker: this.lbgName.workerId, |
|
|
// saleId:this.saleId, |
|
|
saleId: this.saleId, |
|
|
// sale: { |
|
|
sale: { |
|
|
// // relPrice:, |
|
|
// relPrice:, |
|
|
// alreadyEarn: this.priceOk, //已付金额 |
|
|
alreadyEarn: this.priceOk, //已付金额 |
|
|
// realAmount: this.relPrice, //实收金额 |
|
|
realAmount: this.relPrice, //实收金额 |
|
|
// noEarn: this.relPrice - this.priceOk, //欠款 |
|
|
noEarn: this.relPrice - this.priceOk, //欠款 |
|
|
// totalAmount: this.shouldPay, //总金额 |
|
|
totalAmount: this.shouldPay, //总金额 |
|
|
// area: this.khName.area, |
|
|
area: this.khName.area, |
|
|
// city: this.khName.city, |
|
|
city: this.khName.city, |
|
|
// province: this.khName.province, |
|
|
province: this.khName.province, |
|
|
// payStatus: 1, |
|
|
payStatus: 1, |
|
|
// receiveAddress: this.khName.address, |
|
|
receiveAddress: this.khName.address, |
|
|
// userId:this.khName.userId, |
|
|
userId: this.khName.userId, |
|
|
// userName:this.khName.name, |
|
|
userName: this.khName.name, |
|
|
// transportType: this.radioType1 == 1?2:this.radioType, //this.radioType |
|
|
transportType: this.radioType1 == 1 ? 2 : this.radioType, //this.radioType |
|
|
// discount: this.discountNum, |
|
|
discount: this.discountNum, |
|
|
// createBy: this.xsyId, |
|
|
createBy: this.xsyId, |
|
|
// createByName:this.createByName, |
|
|
createByName: this.createByName, |
|
|
// remark: this.remark, |
|
|
remark: this.remark, |
|
|
// otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用 |
|
|
otherExpense: this.otherExpense == '' ? 0 : this.otherExpense, //其他费用 |
|
|
// shareAddress:this.pbAddress, |
|
|
shareAddress: this.pbAddress, |
|
|
// transCompany: this.wlName.id, |
|
|
transCompany: this.wlName.id, |
|
|
// companyName:this.wlName.companyName, |
|
|
companyName: this.wlName.companyName, |
|
|
// }, |
|
|
}, |
|
|
// saleDetailList: [] |
|
|
saleDetailList: [] |
|
|
// } |
|
|
} |
|
|
// let purchaseDetails = []; |
|
|
let purchaseDetails = []; |
|
|
// this.carList.forEach(function(value, key) { |
|
|
this.carList.forEach(function(value, key) { |
|
|
// console.log(value.stockLogList) |
|
|
console.log(value.stockLogList) |
|
|
// value.stockLogList.forEach(function(values, keys) { |
|
|
value.stockLogList.forEach(function(values, keys) { |
|
|
// let obj = { |
|
|
let obj = { |
|
|
// productCount: values, |
|
|
productCount: values, |
|
|
// attributeList: keys |
|
|
attributeList: keys |
|
|
// } |
|
|
} |
|
|
// value.stockLogList1.push(obj) |
|
|
value.stockLogList1.push(obj) |
|
|
// }) |
|
|
}) |
|
|
// console.log(value) |
|
|
console.log(value) |
|
|
// purchaseDetails.push(value) |
|
|
purchaseDetails.push(value) |
|
|
// }) |
|
|
}) |
|
|
//this.saleDetailList = purchaseDetails; |
|
|
this.saleDetailList = purchaseDetails; |
|
|
// obj.saleDetailList = purchaseDetails; |
|
|
obj.saleDetailList = purchaseDetails; |
|
|
// this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => { |
|
|
let url = '' |
|
|
// if (res.code == 200) { |
|
|
if (this.saleId != '') { |
|
|
// uni.showToast({ |
|
|
url = '/app/sale/shareToBuyNew' |
|
|
// title: "开单成功", |
|
|
} else { |
|
|
// icon: 'none' |
|
|
url = '/app/sale/buyNew' |
|
|
// }) |
|
|
} |
|
|
// setTimeout(res => { |
|
|
this.tui.request(url, "post", obj, false, false).then((res) => { |
|
|
// this.$refs.printerPopup.open('center') |
|
|
if (res.code == 200) { |
|
|
// }, 1000) |
|
|
uni.showToast({ |
|
|
|
|
|
title: "开单成功", |
|
|
// }else{ |
|
|
icon: 'none' |
|
|
// this.tui.toast(res.message) |
|
|
}) |
|
|
// } |
|
|
setTimeout(res => { |
|
|
// }) |
|
|
this.$refs.printerPopup.open('center') |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.tui.toast(res.message) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
//打印取消按钮 |
|
|
//打印取消按钮 |
|
|
@ -1034,15 +1074,6 @@ |
|
|
//打印小票 |
|
|
//打印小票 |
|
|
onPrint(opt) { |
|
|
onPrint(opt) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
//快递单600*1040 入库单440*320 8像素=1mm |
|
|
|
|
|
/** |
|
|
|
|
|
* 打印文字 |
|
|
|
|
|
* x: 文字方块左上角X座标,单位dot |
|
|
|
|
|
* y: 文字方块左上角Y座标,单位dot |
|
|
|
|
|
* fontName,fontSize: 字体,取值: 參考文檔 |
|
|
|
|
|
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 |
|
|
|
|
|
* content: 文字内容 |
|
|
|
|
|
*/ |
|
|
|
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0); |
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
@ -1053,19 +1084,25 @@ |
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name) |
|
|
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:' + this.khName.name) |
|
|
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName) |
|
|
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:' + this.createByName) |
|
|
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:'+this.formatDate(new Date(), 'YYYY-MM-DD')) //+ |
|
|
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:' + this.formatDate(new Date(), |
|
|
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, '=========================================================') |
|
|
'YYYY-MM-DD')) //+ |
|
|
|
|
|
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, |
|
|
|
|
|
'=========================================================') |
|
|
|
|
|
|
|
|
this.carList.forEach(function(value, key) { |
|
|
this.carList.forEach(function(value, key) { |
|
|
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0, value.productName+'('+value.productSn+')'+'折扣:'+(value.discount<10?value.discount:'无折扣')) |
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, value.productName + '(' + |
|
|
|
|
|
value.productSn + ')' + '折扣:' + (value.discount < 10 ? value.discount : '无折扣')) |
|
|
value.stockLogList.forEach(function(value1, key1) { |
|
|
value.stockLogList.forEach(function(value1, key1) { |
|
|
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0,(that.slicePrint(key1))+'*'+value1) |
|
|
strCmd += blesdk.addCPCLText('0', that.yNum += 30, '24', '0', 0, (that.slicePrint( |
|
|
|
|
|
key1)) + '*' + value1) |
|
|
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:' + value.lsprice) |
|
|
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:' + value.lsprice) |
|
|
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:'+(value.lsprice*value1)) |
|
|
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:' + (value |
|
|
|
|
|
.lsprice * value1)) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
strCmd += blesdk.addCPCLText('0', this.yNum+=20, '24', '0', 0, '===============================================================') |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 20, '24', '0', 0, |
|
|
|
|
|
'===============================================================') |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '总数量:' + this.totalAmount) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay) |
|
|
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额' + this.shouldPay) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) |
|
|
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:' + this.relPrice) |
|
|
@ -1103,7 +1140,8 @@ |
|
|
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); |
|
|
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); |
|
|
for (var k in o) |
|
|
for (var k in o) |
|
|
if (new RegExp('(' + k + ')').test(fmt)) |
|
|
if (new RegExp('(' + k + ')').test(fmt)) |
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))); |
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]) |
|
|
|
|
|
.length))); |
|
|
return fmt; |
|
|
return fmt; |
|
|
}, |
|
|
}, |
|
|
//编辑每一个的单价 |
|
|
//编辑每一个的单价 |
|
|
@ -1194,6 +1232,25 @@ |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
//修改已选规格的数量 |
|
|
|
|
|
GoodsNumChange(e, index, index1) { |
|
|
|
|
|
console.log(this.carList) |
|
|
|
|
|
let that = this; |
|
|
|
|
|
this.carList.get(index).stockLogList.set(index1, e) |
|
|
|
|
|
this.carList.get(index).productCount = 0 |
|
|
|
|
|
this.shouldPay = 0 |
|
|
|
|
|
this.totalAmount = 0 |
|
|
|
|
|
this.carList.get(index).stockLogList.forEach(function(value, key) { |
|
|
|
|
|
console.log(that.carList.get(index)) |
|
|
|
|
|
that.carList.get(index).productCount = that.carList.get(index).productCount + value |
|
|
|
|
|
that.carList.get(index).price = that.carList.get(index).productCount * that.carList.get(index) |
|
|
|
|
|
.unitPrice |
|
|
|
|
|
}) |
|
|
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
|
|
that.shouldPay = that.shouldPay + value.price |
|
|
|
|
|
that.totalAmount = that.totalAmount + value.productCount |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
//清空全部数据 |
|
|
//清空全部数据 |
|
|
clearAll() { |
|
|
clearAll() { |
|
|
let that = this; |
|
|
let that = this; |
|
|
@ -1217,6 +1274,9 @@ |
|
|
that.noPay = 0 |
|
|
that.noPay = 0 |
|
|
that.otherExpense = 0 |
|
|
that.otherExpense = 0 |
|
|
that.totalAmount = 0 |
|
|
that.totalAmount = 0 |
|
|
|
|
|
that.createByName = '' |
|
|
|
|
|
that.xsyId = '' |
|
|
|
|
|
this.saleId = '' |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
@ -1229,6 +1289,7 @@ |
|
|
.page1 { |
|
|
.page1 { |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.popup-pay-content { |
|
|
.popup-pay-content { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
@ -1237,6 +1298,7 @@ |
|
|
height: auto; |
|
|
height: auto; |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.content { |
|
|
.content { |
|
|
border-top: 1px solid #eee; |
|
|
border-top: 1px solid #eee; |
|
|
overflow-y: scroll; |
|
|
overflow-y: scroll; |
|
|
@ -1250,6 +1312,7 @@ |
|
|
margin-bottom: 20rpx; |
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.popup-pay-title { |
|
|
.popup-pay-title { |
|
|
font-size: 36rpx; |
|
|
font-size: 36rpx; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
@ -1345,9 +1408,11 @@ |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
display: flex; |
|
|
display: flex; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.discount-num { |
|
|
.discount-num { |
|
|
width: 200rpx; |
|
|
width: 200rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.shop-productName { |
|
|
.shop-productName { |
|
|
flex: 1; |
|
|
flex: 1; |
|
|
display: flex; |
|
|
display: flex; |
|
|
@ -1358,9 +1423,11 @@ |
|
|
.shop-productName view { |
|
|
.shop-productName view { |
|
|
height: 55rpx; |
|
|
height: 55rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.checklist-group { |
|
|
.checklist-group { |
|
|
height: 80rpx !important; |
|
|
height: 80rpx !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// .shop-name { |
|
|
// .shop-name { |
|
|
// .uni-icons { |
|
|
// .uni-icons { |
|
|
// color: #088FEB !important; |
|
|
// color: #088FEB !important; |
|
|
@ -1375,9 +1442,9 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.shop-collapse text { |
|
|
.shop-collapse text { |
|
|
flex: 1; |
|
|
width: 40%; |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
padding-right: 40rpx; |
|
|
// padding-right: 40rpx; |
|
|
border-right: 1px solid #eee; |
|
|
border-right: 1px solid #eee; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1485,6 +1552,7 @@ |
|
|
height: 150rpx; |
|
|
height: 150rpx; |
|
|
width: 500rpx; |
|
|
width: 500rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.shop-popup-content { |
|
|
.shop-popup-content { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
@ -1602,6 +1670,7 @@ |
|
|
border-radius: 70rpx; |
|
|
border-radius: 70rpx; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// .uni-select__input-text{ |
|
|
// .uni-select__input-text{ |
|
|
// text-align: center !important; |
|
|
// text-align: center !important; |
|
|
// padding-left: 80rpx; |
|
|
// padding-left: 80rpx; |
|
|
|