|
|
@@ -1,4 +1,3 @@
|
|
|
-import { cloudPrintOrder } from "@/api/order";
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
@@ -72,54 +71,40 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
}else if (s.type === "print") {
|
|
|
- uni.showLoading({title: '打印中...'});
|
|
|
- cloudPrintOrder({id:item.id}).then((res) => {
|
|
|
- uni.hideLoading()
|
|
|
- if(res.code == 1){
|
|
|
- if(res.data.hasNoPrint == 1){
|
|
|
- that.$util.confirmModal({content:'请先设置打印机'},() => {
|
|
|
- that.$util.pageTo({url: "/admin/shop/print"})
|
|
|
- })
|
|
|
- return false
|
|
|
- }else{
|
|
|
- item.printNum++
|
|
|
- console.log('aaaa',item)
|
|
|
- }
|
|
|
+
|
|
|
+ }else if(s.type == 'confirm'){
|
|
|
+ let self = this;
|
|
|
+ uni.showActionSheet({
|
|
|
+ itemList: ['请选择结算方式:', '欠款', '已收款'],
|
|
|
+ success: function (res) {
|
|
|
+ if(res.tapIndex == 0){
|
|
|
+ return false
|
|
|
}
|
|
|
- })
|
|
|
- }else if(s.type == 'confirm'){
|
|
|
- let self = this;
|
|
|
- uni.showActionSheet({
|
|
|
- itemList: ['请选择结算方式:', '欠款', '已收款'],
|
|
|
- success: function (res) {
|
|
|
- if(res.tapIndex == 0){
|
|
|
+ let payWay = 0
|
|
|
+ let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
|
|
|
+ //1欠款 2已收款
|
|
|
+ let clearType = res.tapIndex == 1 ? 1 : 2;
|
|
|
+ //选择的已收款,还需要选择收款方式
|
|
|
+ if(clearType == 2){
|
|
|
+ uni.showActionSheet({
|
|
|
+ itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
|
|
|
+ success: function (respond) {
|
|
|
+ let currentIndex = respond.tapIndex
|
|
|
+ let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
|
|
|
+ if(currentIndex == 0){
|
|
|
return false
|
|
|
}
|
|
|
- let payWay = 0
|
|
|
- let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
|
|
|
- //1欠款 2已收款
|
|
|
- let clearType = res.tapIndex == 1 ? 1 : 2;
|
|
|
- //选择的已收款,还需要选择收款方式
|
|
|
- if(clearType == 2){
|
|
|
- uni.showActionSheet({
|
|
|
- itemList: ['请选择收款方式:', '微信', '支付宝','现金','银行卡'],
|
|
|
- success: function (respond) {
|
|
|
- let currentIndex = respond.tapIndex
|
|
|
- let inWay = [{name:"未选择",id:-1},{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}]
|
|
|
- if(currentIndex == 0){
|
|
|
- return false
|
|
|
+ payWay = inWay[currentIndex].id
|
|
|
+ let params = {id:item.id,clearType:clearType,payWay:payWay}
|
|
|
+ self.toConfrim(params,title)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ let params = {id:item.id,clearType:clearType,payWay:payWay}
|
|
|
+ self.toConfrim(params,title)
|
|
|
}
|
|
|
- payWay = inWay[currentIndex].id
|
|
|
- let params = {id:item.id,clearType:clearType,payWay:payWay}
|
|
|
- self.toConfrim(params,title)
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- let params = {id:item.id,clearType:clearType,payWay:payWay}
|
|
|
- self.toConfrim(params,title)
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
}else if(s.type == 'cancel'){
|
|
|
let that = this;
|
|
|
that.$util.confirmModal({content:'确认取消?'},() => {
|