wangfukang 3 years ago
parent
commit
12a2ea1add
  1. 1
      pages/index/order.vue
  2. 60
      pages/index/orderDetail.vue
  3. 83
      pages/index/returnList.vue
  4. 23
      pages/inventory/goodsList1.vue
  5. 1
      pages/inventory/inventoryDetail.vue

1
pages/index/order.vue

@ -109,6 +109,7 @@
dataList.push(obj) dataList.push(obj)
} }
item.name = item.userName; item.name = item.userName;
item.id = item.userId
uni.setStorageSync('khName',JSON.stringify(item)) uni.setStorageSync('khName',JSON.stringify(item))
uni.setStorageSync('carList1',JSON.stringify(dataList)) uni.setStorageSync('carList1',JSON.stringify(dataList))
uni.switchTab({ uni.switchTab({

60
pages/index/orderDetail.vue

@ -73,25 +73,25 @@
<view class="tui-price-flex tui-size32" v-if="isReturn"> <view class="tui-price-flex tui-size32" v-if="isReturn">
<view class="tui-flex-shrink">已选金额</view> <view class="tui-flex-shrink">已选金额</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
<input type="digit" style="width: 150rpx;text-align: right;border-bottom: 1px solid #eee;" v-model='changeAmount'> <view class="tui-price-large">{{ changeAmount}}</view>
<!-- <view class="tui-price-large">{{ changeAmount}}</view> -->
</view> </view>
</view> </view>
<view class="tui-price-flex tui-size32" v-if="isReturn"> <view class="tui-price-flex tui-size32" v-if="isReturn">
<view class="tui-flex-shrink">退货金额</view> <view class="tui-flex-shrink">退货金额</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ returnAmount}}</view> <input type="digit" style="width: 150rpx;text-align: right;border-bottom: 1px solid #eee;" v-model='returnAmount' @input="getReturnA">
<!-- <view class="tui-price-large">{{ returnAmount}}</view> -->
</view> </view>
</view> </view>
<view class="tui-price-flex tui-size32" v-if="isReturn"> <!-- <view class="tui-price-flex tui-size32" v-if="isReturn">
<view class="tui-flex-shrink">欠款抵扣</view> <view class="tui-flex-shrink">欠款抵扣</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<view class="tui-size-24">¥</view> <view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ qkdk}}</view> <view class="tui-price-large">{{ qkdk}}</view>
</view> </view>
</view> </view> -->
<view class="tui-price-flex tui-size32" v-if="editNoPrice"> <view class="tui-price-flex tui-size32" v-if="editNoPrice">
<view class="tui-flex-shrink">还款金额</view> <view class="tui-flex-shrink">还款金额</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
@ -110,7 +110,7 @@
<view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0"> <view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0">
<view class="tui-flex-shrink">配送人员</view> <view class="tui-flex-shrink">配送人员</view>
<view class="tui-goods-price"> <view class="tui-goods-price">
<input type="text" v-model="lbgName.workerName" @tap.stop="goPopleList('lbgName')" placeholder="请选择拉包工" disabled style="height:75rpx;line-height:84rpx;border-bottom: 1px solid #088fe0;text-align: center;"> <input type="text" v-model="lbgName.workerName" @tap.stop="goPopleList('lbgName')" placeholder="可指定拉包工" disabled style="height:75rpx;line-height:84rpx;border-bottom: 1px solid #088fe0;text-align: center;">
<uni-icons type="right" size="16" style="line-height: 80rpx;"></uni-icons> <uni-icons type="right" size="16" style="line-height: 80rpx;"></uni-icons>
</view> </view>
</view> </view>
@ -256,27 +256,27 @@
type: '', type: '',
orderXd:[], orderXd:[],
collection:[], collection:[],
qkdk:0, lbgName:[],
lbgName:[] returnAmount:0
} }
}, },
components: { components: {
kkPrinter kkPrinter
}, },
computed: { computed: {
returnAmount() { // returnAmount() {
if (this.changeAmount) { // // if (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);
this.qkdk = this.changeAmount // // return 0
return 0 // // } else {
} else { // // this.sales.newNoEarn = 0
this.sales.newNoEarn = 0 // // return (this.changeAmount - this.sales.noEarn).toFixed(2)
this.qkdk = this.sales.noEarn // // }
return (this.changeAmount - this.sales.noEarn).toFixed(2) // // }
} // console.log()
} // return this.changeAmount
}, // },
changeAmount() { changeAmount() {
if (this.isReturn) { if (this.isReturn) {
let sum = 0 let sum = 0
@ -286,7 +286,8 @@
sum = v.returnCount * item1.wholesalePrice + sum sum = v.returnCount * item1.wholesalePrice + sum
} }
}); });
}) })
this.returnAmount = (sum * this.sales.discount * 0.1).toFixed(2)
return (sum * this.sales.discount * 0.1).toFixed(2) return (sum * this.sales.discount * 0.1).toFixed(2)
} else { } else {
return 0 return 0
@ -425,6 +426,9 @@
//回款按钮 this.type==gys时,是上游客户欠款接口。否则为销售单欠款接口 //回款按钮 this.type==gys时,是上游客户欠款接口。否则为销售单欠款接口
editnoEarn() { editnoEarn() {
this.editNoPrice = true; this.editNoPrice = true;
},
getReturnA(e){
this.returnAmount = e.detail.value
}, },
getNoPay(en) { getNoPay(en) {
if (en != undefined) { if (en != undefined) {
@ -476,13 +480,7 @@
close() { close() {
this.popupShow = false this.popupShow = false
}, },
sureReturn() { sureReturn() {
if(this.radio1 == 0){
if(this.lbgName == []){
this.tui.toast("请选择配送人员")
return;
}
}
this.list.forEach(item1 => { this.list.forEach(item1 => {
item1.stockLogList1.forEach(item2 => { item1.stockLogList1.forEach(item2 => {
if (item2.returnCount) { if (item2.returnCount) {
@ -493,7 +491,7 @@
}) })
}) })
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;
this.tui.request("/app/return/rtg", "post", { this.tui.request("/app/return/rtg", "post", {

83
pages/index/returnList.vue

@ -1,23 +1,31 @@
<template> <template>
<view> <view>
<ul> <view class="ulList" v-if="inventoryList.length > 0">
<li v-for="item in inventoryList" :key="item.id" @click="toggle(item)"> <ul>
<view class="">{{item.id}}</view> <li v-for="item in inventoryList" @tap="toggle(item)">
<view class="floatRight"> <uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime"
¥{{item.realAmount}} :thumbnail="item.saleDetailDTOList[0].productPicture">
</view> <view class="uni-body"><text class="cardText">配送人员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view>
<view class="fontB3">{{item.createTime}}</view> <view class="uni-body"> <text class="cardText"> 退款金额:</text> <text class="priceText">
</li> {{item.alreadyEarn == null ?'暂无':item.alreadyEarn}} </text> <text decode class="cardText">
</ul> {{'&nbsp;&nbsp;&nbsp;&nbsp; 数量: '}} </text> <text class="priceText">{{item.productCount == null ?'暂无':item.productCount}}
</text></view>
<view class="uni-body">订单状态:已送达</view>
</uni-card>
</li>
</ul>
<u-loadmore :status="status" />
</view>
<u-empty v-else mode="order" margin-top="200"></u-empty>
<uni-popup ref="popup" background-color="#fff"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"> <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
<view class="popup-content-title"> <view class="popup-content-title">
<view class="title-box">客户名称:张三</view> <view class="title-box">客户名称:{{shopList.returnSale.userName}}</view>
<view class="title-box two">创建时间:2023-10-22</view> <view class="title-box two">退货时间:{{shopList.returnSale.createTime}}</view>
<view class="title-box two">退款金额:200 数量:20件</view> <view class="title-box two">退款金额:{{shopList.returnSale.alreadyEarn}} 数量:{{shopList.returnSale.productCount}}件</view>
</view> </view>
<u-collapse :value="[shopList[0].saleId]"> <u-collapse :value="[shopList.saleDetailDTOList[0].saleId]">
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" :name="item.saleId"> <u-collapse-item v-for="(item,index) in shopList.saleDetailDTOList" :key="index" :title="item.productName" :name="item.saleId">
<view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :key="index2"> <view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :key="index2">
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} {{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}} * {{val.productCount}}
@ -27,7 +35,7 @@
</u-collapse-item> </u-collapse-item>
</u-collapse> </u-collapse>
<view class="popup-content-bottom"> <view class="popup-content-bottom">
<view class="bottom-btn">拒绝</view> <!-- <view class="bottom-btn">拒绝</view> -->
<view class="bottom-btn" @tap="returnGoods">确认收货</view> <view class="bottom-btn" @tap="returnGoods">确认收货</view>
</view> </view>
</view> </view>
@ -64,7 +72,7 @@
toggle(item) { toggle(item) {
this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then((res) => { this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) { if (res.code == 200 && res.result != null && res.result != undefined) {
this.shopList = res.result.saleDetailDTOList; this.shopList = res.result;
this.returnId = item.id this.returnId = item.id
this.$refs.popup.open('center') this.$refs.popup.open('center')
}else{ }else{
@ -92,27 +100,28 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
ul { ul {
margin: 20rpx; li {
font-size: 12px;
li {
background-color: #fff; .floatRight {
padding: 20rpx; float: right;
border-radius: 4px; padding: 14rpx;
font-size: 14px; color: $u-primary;
line-height: 20px; font-size: 26upx;
}
.fontB3 {
color: #b3b3b3; .cardText {
font-size: 12px; font-size: 12px;
} }
.floatRight { .priceText {
float: right; color: $u-primary;
} font-size: 14px;
} }
} }
}
.popup-content-title{ .popup-content-title{
padding: 0 30rpx; padding: 0 30rpx;
} }

23
pages/inventory/goodsList1.vue

@ -737,6 +737,9 @@
if (that.discountType == 1) { //整体折扣 if (that.discountType == 1) { //整体折扣
value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000 value.discountAmount = value.unitPrice * 10000 * that.discountNum / 10 / 10000
value.price = value.discountAmount * value.productCount value.price = value.discountAmount * value.productCount
}else if(that.discountType == 0){//单品折扣
value.discountAmount = value.unitPrice * value.discount / 10
value.price = value.unitPrice * value.discount / 10 * value.productCount
} }
}) })
this.getAllPrice(); this.getAllPrice();
@ -1124,7 +1127,8 @@
}, },
//打印小票 //打印小票
onPrint(opt) { onPrint(opt) {
let that = this; let that = this;
that.yNum = 150
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')
@ -1151,23 +1155,22 @@
.lsprice * value1)) .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)
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '实收:' + this.priceOk) strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '实收:' + this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + this.noPay) strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:' + (this.relPrice - this.priceOk))
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + this.otherExpense) strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:' + (this.otherExpense == '' ? 0 : this.otherExpense))
strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '备注:' + this.remark) strCmd += blesdk.addCPCLText('0', this.yNum += 30, '24', '0', 0, '备注:' + (this.remark == '' ? '无' : this.remark))
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd; this.bufferData = strCmd;
uni.redirectTo({ this.$nextTick(()=>{
url: "/pages/index/order" uni.redirectTo({
url: "/pages/index/order"
})
}) })
}, },
//截取 //截取

1
pages/inventory/inventoryDetail.vue

@ -128,6 +128,7 @@
strCmd += blesdk.addCPCLQRCode(260, 170, 'H', '1', 6, this.dataList.id) //二维码 strCmd += blesdk.addCPCLQRCode(260, 170, 'H', '1', 6, this.dataList.id) //二维码
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint(); strCmd += blesdk.addCPCLPrint();
console.log('这是是数据',strCmd)
this.bufferData = strCmd; this.bufferData = strCmd;
}, },
} }

Loading…
Cancel
Save