shish 4 жил өмнө
parent
commit
b99c9d7e32

+ 13 - 2
hdApp/src/admin/clear/info.vue

@@ -94,13 +94,13 @@
 
 		</view>
 		<view class="app-footer">
-			<button class="admin-button-com default" v-if="detailInfo.status == 1">取消</button>
+			<button class="admin-button-com default" v-if="detailInfo.status == 1 && detailInfo.clearStyle==1" @click="cancelFn(detailInfo)">取消</button>
 			<button class="admin-button-com default" v-if="detailInfo.status == 1" @click="toClear(detailInfo)">付款结清</button>
 		</view>
 	</view>
 </template>
 <script>
-import { getDetail,detail } from "@/api/clear/index";
+import { getDetail,detail,cancel } from "@/api/clear/index";
 import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
@@ -122,6 +122,17 @@ export default {
 		};
 	},
 	methods: {
+		cancelFn(info){
+			let that = this
+			that.$util.confirmModal({content:'确认取消?'},() => {
+				cancel({id:info.id}).then(res=>{
+					if(res.code == 1){
+						that.$msg('取消成功')
+						that.init()
+					}
+				})
+			})
+		},
 		toClear(info){
 			let that = this
 			detail({ id:info.id }).then(res => {

+ 1 - 1
hdApp/src/admin/clear/orderItem.vue

@@ -5,7 +5,7 @@
 				<image class="icon" :src="info.ghsAvatar"></image>
 				<text class="name"> {{ info.ghsName }} </text>
 			</view>
-			<view class="status">{{info.status == 1 ?'待结账':info.status==2?'已结账':infot.status==3?'已取消':'待结账'}}</view>
+			<view class="status">{{info.status == 1 ?'待结账':info.status==2?'已结账':info.status==3?'已取消':'待结账'}}</view>
 		</view>
 		<view class="item-main" >
 			<view class="item-info">

+ 5 - 0
hdApp/src/api/clear/index.js

@@ -17,4 +17,9 @@ export const getClearList = async data => {
 //订单详情
 export const detail = data => {
 	return https.get('/clear/detail', data)
+}
+
+//取消
+export const cancel = data => {
+	return https.get('/clear/cancel', data)
 }

+ 16 - 10
hdApp/src/pagesPurchase/gathering.vue

@@ -163,6 +163,7 @@ export default {
     //批量收款
     batchConfirm () {
       let arr = []
+      let that = this
       if (this.$util.isEmpty(this.selectList)) {
         this.$msg('请选择订单')
         return false
@@ -171,16 +172,21 @@ export default {
 				uni.showToast({title: '订单太多,点右上角选月份再结',duration: 2000,icon:"none"})
 				return false
 			}
-      this.selectList.forEach(item => {
-        arr.push(item.id)
-      })
-      purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:this.option.id }).then(res => {
-        if(res.code == 1) {
-          this.pageTo({
-            url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond,
-            type: 2
-          })
-        }
+      that.$util.confirmModal({content:'确认提交?'},() => {
+        that.selectList.forEach(item => {
+          arr.push(item.id)
+        })
+        purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:that.option.id }).then(res => {
+          if(res.code == 1) {
+            if(res.data.hasUnComplete && res.data.hasUnComplete == 1){
+              that.$util.confirmModal({content:'还有未完成的结账单',okText:'查看'},() => {
+                that.pageTo({ url: '/admin/clear/list', type: 2})
+              })              
+            }else{
+              that.pageTo({ url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice+'&remainSecond='+res.data.remainSecond, type: 2 })
+            } 
+          }
+        })
       })
     },
     back () {