|
|
|
@ -13,7 +13,7 @@ |
|
|
|
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> --> |
|
|
|
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} |
|
|
|
* {{val.productCount}} |
|
|
|
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
v-model="val.returnCount"></u-number-box> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
@ -59,20 +59,23 @@ |
|
|
|
<view class="tui-price-flex tui-size32" v-if="editNoPrice"> |
|
|
|
<view class="tui-flex-shrink">还款金额</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<view class="tui-price-large"><uni-easyinput v-model="newEarn" trim="all" @change="getNoPay" /></view> |
|
|
|
<view class="tui-price-large"><uni-easyinput v-model="newEarn" trim="all" @change="getNoPay" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-price-flex tui-size32" v-if="isReturn"> |
|
|
|
<view class="tui-flex-shrink">平台取货</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<uni-data-checkbox v-model="radio1" :localdata="sex" @change="checkBoxChange"></uni-data-checkbox> |
|
|
|
<uni-data-checkbox v-model="radio1" :localdata="sex" |
|
|
|
@change="checkBoxChange"></uni-data-checkbox> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- && orderByWorkerCandidates.length > 0 --> |
|
|
|
<view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0" > |
|
|
|
<!-- && orderByWorkerCandidates.length > 0 --> |
|
|
|
<view class="tui-price-flex tui-size32" v-if="isReturn && radio1 == 0"> |
|
|
|
<view class="tui-flex-shrink">配送人员</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<uni-combox :candidates="orderByWorkerCandidates" placeholder="请选择配送人员" v-model="orderByWorker"></uni-combox> |
|
|
|
<uni-combox :candidates="orderByWorkerCandidates" placeholder="请选择配送人员" |
|
|
|
v-model="orderByWorker"></uni-combox> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -82,19 +85,20 @@ |
|
|
|
退款历史信息 |
|
|
|
</view> |
|
|
|
<view class="tui-order-content"> |
|
|
|
<u-collapse :value="[shopList[0].saleId]"> |
|
|
|
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" :name="item.saleId"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> |
|
|
|
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> |
|
|
|
<u-collapse :value="[shopList[0].saleId]"> |
|
|
|
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" |
|
|
|
:name="item.saleId"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> |
|
|
|
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> |
|
|
|
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> --> |
|
|
|
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} |
|
|
|
* {{val.productCount}} |
|
|
|
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
v-model="val.returnCount"></u-number-box> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
</view> |
|
|
|
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} |
|
|
|
* {{val.productCount}} |
|
|
|
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
v-model="val.returnCount"></u-number-box> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-order-info boxbg"> |
|
|
|
<view class="tui-order-title"> |
|
|
|
@ -106,8 +110,11 @@ |
|
|
|
<view class="tui-item-content">{{ sales.id }}</view> |
|
|
|
</view> |
|
|
|
<view class="tui-order-flex"> |
|
|
|
<view class="tui-item-title">物流单号:</view> |
|
|
|
<view class="tui-item-content">{{ order.kdOrderId }}</view> |
|
|
|
<view class="tui-item-title">物流单:</view> |
|
|
|
<!-- <view class="tui-item-content">{{ order.kdOrderId }}</view> --> |
|
|
|
<image show-menu-by-longpress |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg" |
|
|
|
@tap="showImage"></image> |
|
|
|
</view> |
|
|
|
<view class="tui-order-flex"> |
|
|
|
<view class="tui-item-title">创建时间:</view> |
|
|
|
@ -135,10 +142,12 @@ |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button> |
|
|
|
</view> |
|
|
|
<view class="tui-btn-mr" v-if="sales.status == 5"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="returnGoods" >{{ !isReturn ? '退货' : '确认退货'}}</u-button> |
|
|
|
<u-button type="error" :plain="true" shape="circle" |
|
|
|
@click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</u-button> |
|
|
|
</view> |
|
|
|
<view class="tui-btn-mr"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="editnoEarn" v-if="!editNoPrice">汇款</u-button> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="editnoEarn" |
|
|
|
v-if="!editNoPrice">汇款</u-button> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="sureNpPay" v-else>确认</u-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
@ -161,8 +170,8 @@ |
|
|
|
text: '否', |
|
|
|
value: 1 |
|
|
|
}], |
|
|
|
orderByWorkerCandidates:[], |
|
|
|
orderByWorker:'', |
|
|
|
orderByWorkerCandidates: [], |
|
|
|
orderByWorker: '', |
|
|
|
bufferData: '', |
|
|
|
show: false, |
|
|
|
popupShow: false, |
|
|
|
@ -170,30 +179,30 @@ |
|
|
|
order: {}, |
|
|
|
list: [], |
|
|
|
isReturn: false, |
|
|
|
orderByWorkerList:[], |
|
|
|
inventoryList:[], |
|
|
|
shopList:[], |
|
|
|
orderByWorkerList: [], |
|
|
|
inventoryList: [], |
|
|
|
shopList: [], |
|
|
|
editNoPrice: false, |
|
|
|
newEarn: 0, |
|
|
|
qrcodeData:'' |
|
|
|
newEarn: 0, |
|
|
|
qrcodeData: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
components:{ |
|
|
|
kkPrinter |
|
|
|
components: { |
|
|
|
kkPrinter |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
returnAmount() { |
|
|
|
if (this.changeAmount) { |
|
|
|
console.log(this.changeAmount,'this.changeAmount'); |
|
|
|
if(this.sales.noEarn >= this.changeAmount) { |
|
|
|
console.log(this.changeAmount, 'this.changeAmount'); |
|
|
|
if (this.sales.noEarn >= this.changeAmount) { |
|
|
|
this.sales.newNoEarn = (this.sales.noEarn - this.changeAmount).toFixed(2); |
|
|
|
console.log(this.sales.newNoEarn); |
|
|
|
return 0 |
|
|
|
} else { |
|
|
|
this.sales.newNoEarn = 0 |
|
|
|
return (this.changeAmount - this.sales.noEarn).toFixed(2) |
|
|
|
} |
|
|
|
this.sales.newNoEarn = 0 |
|
|
|
return (this.changeAmount - this.sales.noEarn).toFixed(2) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
changeAmount() { |
|
|
|
if (this.isReturn) { |
|
|
|
@ -230,39 +239,40 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onPrint(opt){ |
|
|
|
/** |
|
|
|
* 打印文字 addCPCLText |
|
|
|
* x: 文字方块左上角X座标,单位dot |
|
|
|
* y: 文字方块左上角Y座标,单位dot |
|
|
|
* fontName,fontSize: 字体,取值: 參考文檔 |
|
|
|
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 |
|
|
|
* content: 文字内容 |
|
|
|
*/ |
|
|
|
onPrint(opt) { |
|
|
|
/** |
|
|
|
* 打印文字 addCPCLText |
|
|
|
* x: 文字方块左上角X座标,单位dot |
|
|
|
* y: 文字方块左上角Y座标,单位dot |
|
|
|
* fontName,fontSize: 字体,取值: 參考文檔 |
|
|
|
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 |
|
|
|
* content: 文字内容 |
|
|
|
*/ |
|
|
|
//快递单600*1040 入库单440*320 |
|
|
|
let strCmd =blesdk.CreatCPCLPage(600,1040,1,1); |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2,2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('40', '30','24', '0',0,'沧州明珠商贸城--快衣店') |
|
|
|
strCmd += blesdk.addCPCLSETMAG(3,3) |
|
|
|
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 1); |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('40', '30', '24', '0', 0, '沧州明珠商贸城--快衣店') |
|
|
|
strCmd += blesdk.addCPCLSETMAG(3, 3) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('50', '120', '24', '0', 0, '收:' + this.order.name) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('50', '250', '24', '0', 0, this.order.phone) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('50', '120','24', '0',0,'收:'+this.order.name) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(1,1) |
|
|
|
strCmd += blesdk.addCPCLText('50', '250','24', '0',0,this.order.phone) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2,2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('50', '330','24', '0',0,this.order.province+'/'+this.order.city+'/'+this.order.area) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(1,1) |
|
|
|
strCmd += blesdk.addCPCLText('50', '410','24', '0',0,this.order.address) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2,2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('0', '490','24', '0',0,'——————————————————————————————') |
|
|
|
strCmd += blesdk.addCPCLText('50', '570','24', '0',0,'发货方式:虚拟物流') |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2,2) |
|
|
|
strCmd += blesdk.addCPCLText('0', '650','24', '0',0,'——————————————————————————————') |
|
|
|
strCmd += blesdk.addCPCLText('50', '730','24', '0',0,'店铺:张三的店') |
|
|
|
strCmd += blesdk.addCPCLText('50', '810','24', '0',0,'13521030702') |
|
|
|
strCmd += blesdk.addCPCLText('50', '890','24', '0',0,'地址:早市10059') |
|
|
|
strCmd += blesdk.addCPCLText('50', '330', '24', '0', 0, this.order.province + '/' + this.order.city + '/' + |
|
|
|
this.order.area) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(1, 1) |
|
|
|
strCmd += blesdk.addCPCLText('50', '410', '24', '0', 0, this.order.address) |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
blesdk.addCPCLSETBOLD('bold') |
|
|
|
strCmd += blesdk.addCPCLText('0', '490', '24', '0', 0, '——————————————————————————————') |
|
|
|
strCmd += blesdk.addCPCLText('50', '570', '24', '0', 0, '发货方式:虚拟物流') |
|
|
|
strCmd += blesdk.addCPCLSETMAG(2, 2) |
|
|
|
strCmd += blesdk.addCPCLText('0', '650', '24', '0', 0, '——————————————————————————————') |
|
|
|
strCmd += blesdk.addCPCLText('50', '730', '24', '0', 0, '店铺:张三的店') |
|
|
|
strCmd += blesdk.addCPCLText('50', '810', '24', '0', 0, '13521030702') |
|
|
|
strCmd += blesdk.addCPCLText('50', '890', '24', '0', 0, '地址:早市10059') |
|
|
|
// strCmd += blesdk.addCPCLText(200,0,'24','5',0,'收件联');// 文字 |
|
|
|
// for (let item in this.list) { |
|
|
|
// console.log(item, this.list,this.list[item] ); |
|
|
|
@ -271,19 +281,25 @@ |
|
|
|
// strCmd += blesdk.addCPCLText('', '', val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") + '*'+ val.productCount, '', '', '') |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '') |
|
|
|
// strCmd += blesdk.addCPCLText('', '', '已付款:',this.sales.alreadyEarn,'', '') |
|
|
|
// strCmd += blesdk.addCPCLQRCode(400,0,'H','1',5,'2348902384932843290') //二维码 |
|
|
|
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中 |
|
|
|
strCmd += blesdk.addCPCLPrint(); |
|
|
|
this.bufferData = strCmd; |
|
|
|
}, |
|
|
|
//点击图片放大 |
|
|
|
showImage() { |
|
|
|
uni.previewImage({ |
|
|
|
urls: ["https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg"], |
|
|
|
current: "https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg" |
|
|
|
}) |
|
|
|
}, |
|
|
|
sureNpPay() { |
|
|
|
this.sales.alreadyEarn =( this.sales.alreadyEarn * 1) + (this.newEarn * 1); |
|
|
|
this.sales.alreadyEarn = (this.sales.alreadyEarn * 1) + (this.newEarn * 1); |
|
|
|
this.tui |
|
|
|
.request( |
|
|
|
'/app/sale/edit', |
|
|
|
'post', |
|
|
|
{ |
|
|
|
'post', { |
|
|
|
sale: this.sales, |
|
|
|
customer: this.order, |
|
|
|
saleDetailDTOList: this.list |
|
|
|
@ -293,8 +309,8 @@ |
|
|
|
) |
|
|
|
.then(res => { |
|
|
|
uni.showToast({ |
|
|
|
title:res.message, |
|
|
|
icon:'none' |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.navigateBack(); |
|
|
|
}) |
|
|
|
@ -306,12 +322,12 @@ |
|
|
|
getNoPay(en) { |
|
|
|
console.log(en, 'en'); |
|
|
|
if (en != undefined) { |
|
|
|
if( 0 < en && en <= this.sales.noEarn) { |
|
|
|
if (0 < en && en <= this.sales.noEarn) { |
|
|
|
this.sales.noEarn = this.sales.newEarn - en; |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: '请输入正确金额', |
|
|
|
icon:"none" |
|
|
|
icon: "none" |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -319,24 +335,26 @@ |
|
|
|
getReturnOrder(id) { |
|
|
|
this.tui.request("/app/return/list", "post", { |
|
|
|
shopId: 1, |
|
|
|
remark:3, |
|
|
|
saleId:id |
|
|
|
remark: 3, |
|
|
|
saleId: id |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
this.inventoryList = res.result |
|
|
|
this.inventoryList.forEach(item => { |
|
|
|
this.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then((res) => { |
|
|
|
if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
this.shopList.push(...res.result.saleDetailDTOList); |
|
|
|
console.log(this.shopList); |
|
|
|
} |
|
|
|
}).catch((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) { |
|
|
|
this.shopList.push(...res.result.saleDetailDTOList); |
|
|
|
console.log(this.shopList); |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
checkBoxChange() { |
|
|
|
if(this.radio1 == 0 && this.orderByWorkerList.length == 0) { |
|
|
|
if (this.radio1 == 0 && this.orderByWorkerList.length == 0) { |
|
|
|
this.transCompanyInput() |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -378,11 +396,12 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
let worderId = '' |
|
|
|
if(this.orderByWorker) { |
|
|
|
if (this.orderByWorker) { |
|
|
|
console.log(this.orderByWorker); |
|
|
|
for (let key in this.orderByWorkerList) { |
|
|
|
console.log(this.orderByWorker,this.orderByWorkerList[key].workerName, this.orderByWorker == this.orderByWorkerList[key].workerName); |
|
|
|
if(this.orderByWorker == this.orderByWorkerList[key].workerName) { |
|
|
|
console.log(this.orderByWorker, this.orderByWorkerList[key].workerName, this.orderByWorker == this |
|
|
|
.orderByWorkerList[key].workerName); |
|
|
|
if (this.orderByWorker == this.orderByWorkerList[key].workerName) { |
|
|
|
worderId = this.orderByWorkerList[key].workerId |
|
|
|
} |
|
|
|
} |
|
|
|
@ -390,7 +409,7 @@ |
|
|
|
this.sales.noEarn = this.sales.newNoEarn; |
|
|
|
this.sales.saleId = this.sales.id; |
|
|
|
this.sales.totalAomount = this.returnAmount; |
|
|
|
console.log(this.sales,this.list ,this.orderByWorker); |
|
|
|
console.log(this.sales, this.list, this.orderByWorker); |
|
|
|
this.tui.request("/app/return/rtg", "post", { |
|
|
|
returnSale: this.sales, |
|
|
|
returnSaleDetailList: this.list, |
|
|
|
@ -400,13 +419,13 @@ |
|
|
|
uni.showToast({ |
|
|
|
title: res.message |
|
|
|
}); |
|
|
|
if(res.code == 200) { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.navigateBack() |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
returnGoods() { |
|
|
|
if(this.isReturn) { |
|
|
|
if (this.isReturn) { |
|
|
|
this.sureReturn() |
|
|
|
} else { |
|
|
|
this.isReturn = true; |
|
|
|
|