|
|
@@ -13,6 +13,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view scroll-y class="shop-list">
|
|
|
+ <view>
|
|
|
+ <button :class="[confirm == -1 ? 'blue' : 'default']" class="admin-button-com middle" @click="showOrderList(-1)">全部</button>
|
|
|
+ <button :class="[confirm == 0 ? 'blue' : 'default']" class="admin-button-com middle" style="margin-left:30upx;" @click="showOrderList(0)">待确认</button>
|
|
|
+ <button :class="[confirm == 1 ? 'blue' : 'default']" class="admin-button-com middle" style="margin-left:30upx;" @click="showOrderList(1)">已确认</button>
|
|
|
+ </view>
|
|
|
<block v-if="!$util.isEmpty(detailsList)">
|
|
|
<DetailsItem v-for="(item, index) in detailsList" :key="index" :info="item" :isEdit="true" :isCheck="item.checked" @click="checkItemEvent" ></DetailsItem>
|
|
|
</block>
|
|
|
@@ -27,13 +32,14 @@
|
|
|
<button class="admin-button-com blue middle" v-if="isAllCheck">全不选</button>
|
|
|
<button class="admin-button-com blue middle" v-else>全选</button>
|
|
|
</view>
|
|
|
- 已选 <text class="price">{{ selectList.length }}</text> 笔,
|
|
|
+ <text class="price">{{ selectList.length }}</text>笔,
|
|
|
<text class="unit">¥</text>
|
|
|
<text class="price">{{ parseFloat(selectTotalAmount) }}</text>
|
|
|
</view>
|
|
|
</template>
|
|
|
<view class="btn-view">
|
|
|
- <button :class="['admin-button-com', 'blue']" @click="clearSelectedOrder" >结账</button>
|
|
|
+ <button class="admin-button-com default middle" @click="confirmOrder()">确认</button>
|
|
|
+ <button class="admin-button-com blue middle" @click="clearSelectedOrder">结账</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -61,6 +67,7 @@
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import DetailsItem from "./detailsItem";
|
|
|
import { getDebtList,clearOrderApi } from "@/api/gys/index";
|
|
|
+import { batchConfirm } from "@/api/purchase";
|
|
|
import ModalModule from "@/components/plugin/modal";
|
|
|
import DateSelect from "@/components/module/dateSelect";
|
|
|
export default {
|
|
|
@@ -80,7 +87,8 @@ export default {
|
|
|
endTime:'',
|
|
|
payWayData:{name:"线下微信",id:0},
|
|
|
payWayList:[{name:"线下微信",id:0},{name:"现金",id:4},{name:"线下支付宝",id:1},{name:"银行卡",id:5}],
|
|
|
- payWay:0
|
|
|
+ payWay:0,
|
|
|
+ confirm:-1
|
|
|
};
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
@@ -106,7 +114,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(list)
|
|
|
return list;
|
|
|
},
|
|
|
selectTotalAmount() {
|
|
|
@@ -133,6 +140,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ showOrderList(status){
|
|
|
+ this.confirm = status
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
init(){
|
|
|
|
|
|
},
|
|
|
@@ -159,7 +170,7 @@ export default {
|
|
|
async initData() {
|
|
|
try {
|
|
|
this.listLoading = true;
|
|
|
- const { data: { ghsInfo, num, totalAmount, list } } = await getDebtList({id:this.option.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime});
|
|
|
+ const { data: { ghsInfo, num, totalAmount, list } } = await getDebtList({id:this.option.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,confirm:this.confirm})
|
|
|
this.ghsInfo = ghsInfo;
|
|
|
this.totalAmount = totalAmount;
|
|
|
this.num = num;
|
|
|
@@ -200,6 +211,26 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ confirmOrder(){
|
|
|
+ if (this.$util.isEmpty(this.selectList)) {
|
|
|
+ this.$msg("请选择订单");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let ids = this.selectList.map(ele => {
|
|
|
+ return {id:ele.id};
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ id:JSON.stringify(ids),
|
|
|
+ ghsId:this.ghsInfo.id
|
|
|
+ }
|
|
|
+ let that = this;
|
|
|
+ this.$util.confirmModal({content:'全部确认?'},() => {
|
|
|
+ batchConfirm(params).then(res=>{
|
|
|
+ that.initData()
|
|
|
+ that.$msg(res.msg)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmClear(val) {
|
|
|
if(val.index == 0){
|
|
|
this.showClearModel = false
|
|
|
@@ -227,6 +258,7 @@ export default {
|
|
|
uni.showLoading({mask:true})
|
|
|
clearOrderApi(params).then(ret=>{
|
|
|
uni.hideLoading()
|
|
|
+ that.showClearModel = false
|
|
|
if(ret.code == 1){
|
|
|
that.$msg('结账成功')
|
|
|
setTimeout(function(){
|
|
|
@@ -252,6 +284,7 @@ export default {
|
|
|
width:100%;
|
|
|
padding: 30upx;
|
|
|
background-color: #fff;
|
|
|
+ z-index:9999;
|
|
|
.top-row {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
@@ -318,7 +351,6 @@ export default {
|
|
|
font-size: 30upx;
|
|
|
}
|
|
|
.unit {
|
|
|
- margin: 0 3upx;
|
|
|
color: $redColor;
|
|
|
font-size: 30upx;
|
|
|
}
|
|
|
@@ -330,9 +362,9 @@ export default {
|
|
|
align-items:center;
|
|
|
justify-content:center;
|
|
|
margin:0 10upx;
|
|
|
- width:200upx;
|
|
|
+ width:140upx;
|
|
|
height:84upx;
|
|
|
- font-size: 32upx;
|
|
|
+ font-size:26upx;
|
|
|
}
|
|
|
}
|
|
|
}
|