shish 5 سال پیش
والد
کامیت
e0d2172e7b

+ 21 - 19
ghsApp/src/admin/billing/affirm.vue

@@ -54,7 +54,7 @@
           </view>
 
 					<view class="" v-if="isBilling">
-          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({ url: '/admin/custom/selectCustom',query: {style:2}})">
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectCustom">
             <view class="tui-title">客户</view>
             <view class="tui-input" v-if="form.customId" >{{ form.customName }}</view>
             <view class="tui-placeholder" style="width: 100%" v-else >请选择客户</view>
@@ -62,26 +62,20 @@
 
           <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">送货</view>
-            <button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">
-              自取
-            </button>
-            <button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">
-              配送
-            </button>
+            <button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">自取</button>
+            <button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">配送</button>
           </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
+            <view class="tui-title">结算类型</view>
+            <button v-if="form.sendType == 2" @tap="form.debt = 1" class="admin-button-com mini-btn" :class="form.debt == 1 ? 'blue' : 'default'">欠款</button>
+            <button v-if="form.sendType == 2" @click="form.debt = 0" class="admin-button-com mini-btn" :class="form.debt == 0 ? 'blue' : 'default'">已收款</button>
+            <button v-if="form.sendType == 1" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">待收款</button>
+          </tui-list-cell>
+
           <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1" >
             <view class="tui-title">运费</view>
             <input @blur="sendCostBlur" type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
           </tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
-            <view class="tui-title">结算类型</view>
-            <button @tap="form.debt = 1" class="admin-button-com mini-btn" :class="form.debt == 1 ? 'blue' : 'default'">
-              欠款
-            </button>
-            <button @click="form.debt = 0" class="admin-button-com mini-btn" :class="form.debt == 0 ? 'blue' : 'default'">
-              已收款
-            </button>
-          </tui-list-cell>
 
           <tui-list-cell class="line-cell" :arrow="true" v-if="form.debt == 0">
             <div class="tui-title">付款方式</div>
@@ -175,6 +169,7 @@ export default {
 			payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayindex:0,
       form: {
+        id:0,
         debt: 1, //付款方式 1欠款订单 0正常订单
         shopId: "",
         shopName: "",
@@ -214,7 +209,6 @@ export default {
     }
     this.modifyPrice = this.allPrice.toFixed(2);
     this.courier(2);
-
     if(option.customId){
       this.form.customId = option.customId
     }
@@ -238,6 +232,13 @@ export default {
     ...mapActions(["initMerchantInfo"]),
     init () {
       this._getDet();
+    },
+    selectCustom(){
+      if (!this.$util.isEmpty(this.option.orderId)){
+        this.$msg('客户不能修改');
+      }else{
+        this.$util.pageTo({ url: '/admin/custom/selectCustom',query: {style:2}})
+      }
     },
 		payWayChange(e){
 			let index = e.detail.value
@@ -256,7 +257,7 @@ export default {
       this.form.sendType = type;
       if (type === 2) {
         this.form.sendCost = "";
-      } else {
+      } else if(type == 1){
         this.form.sendCost = this.money;
       }
     },
@@ -332,10 +333,11 @@ export default {
           title: "提示",
           content: "确认打印订单?",
           cancelText: "不需要",
-          confirmText: "确认",
+          confirmText: "打印",
           confirmColor: '#39B54A',
           cancelColor: '#777777',
           success: function (res) {
+            self.form.id = self.option.orderId
             if (res.confirm) {
               self.form.needPrint = 1
               self.formSubmit();

+ 4 - 5
ghsApp/src/admin/billing/index.vue

@@ -65,10 +65,7 @@
 						<input v-model="customData.bigCount" @input="countPrice" :focus="isFocus" type="number" />扎
 						<input v-model="customData.smallCount" @input="countPrice" type="number" style="margin-left:24upx" />支
 					</view>
-					<view class="num_bx">
-						<input style="width: 495rpx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="金额" />
-						<text>元</text>
-					</view>
+					<view><input v-model="customData.userPrice" type="digit" disabled placeholder="金额" style="display:inline-block;margin-bottom:10rpx;" /></view>
 				</view>
 			</template>
 		</modal-module>
@@ -259,7 +256,9 @@ export default {
 				}
 				let customName = this.option.customName ? this.option.customName : '';
 
-				uni.navigateTo({url: "/admin/billing/affirm?customId="+this.option.customId+"&customName="+customName});
+				let orderId = this.option.orderId  ? this.option.orderId : 0 
+
+				uni.navigateTo({url: "/admin/billing/affirm?customId="+this.option.customId+"&customName="+customName+"&orderId="+orderId});
 			} else {
 				this.$msg("请选择花材");
 			}

+ 35 - 13
ghsApp/src/admin/home/order.vue

@@ -83,12 +83,9 @@
           <div class="list-bottom">
             <div class="list-button">
               <view v-for="s in item.buttonList" :key="s.type">
-                <button @click.stop="openBt(s, item)" v-if="s.show == 1&&s.type!='print'" :disabled="s.disable === 1" class="admin-button-com bule" :class="s.disable === 1 ? 'active' : ''">
-																	{{ s.type === "item" ? "改花材" : s.type === "selfGet" ? "自取" :s.type === "print" ? "打印" :s.type === "debtPay" ? "延期收款" :s.type === "hasPay" ? "已收款" : "发货" }}
-																</button>
-															<button @click.stop="openBt(s, item)" v-if="s.show == 1&&s.type=='print'" :disabled="s.disable === 1" class="admin-button-com bule" :class="s.disable === 1 ? 'active' : ''">
-																打印{{item.printNum>0?`(${item.printNum})`:''}}
-															</button>
+                <button @click.stop="clickBtn(s, item)" v-if="s.show == 1" :disabled="s.disable === 1" class="admin-button-com bule" :class="s.disable === 1 ? 'active' : ''">
+									{{ s.type === "print" ? s.name+`(${item.printNum})` : s.name}}
+                </button>
               </view>
             </div>
           </div>
@@ -129,7 +126,7 @@ import { getCategory, getUsage } from "@/utils/config";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
 import { cloudPrintOrder } from "@/api/order";
-import { getListB, freeShipping } from "@/api/order";
+import { getListB, freeShipping,confirmFinish } from "@/api/order";
 import AppSearchModule from "@/components/module/app-search";
 import DorpdownSelect from "@/components/module/dorpdownSelect";
 import AppAvatarModule from "@/components/module/app-avatar";
@@ -167,7 +164,7 @@ export default {
           id: 0,
         },
         {
-          name: "待付款",
+          name: "待确认",
           value: 0,
           id: 1,
         },
@@ -255,7 +252,7 @@ export default {
     statusFormat(status) {
       switch (status) {
         case "1":
-          return "待付款";
+          return "待确认";
           break;
         case "2":
           return "待配送";
@@ -276,9 +273,8 @@ export default {
           return "";
       }
     }, // 操作按钮
-  openBt(s, item) {
-      console.log(item);
-						this.orderId=item.id;
+  clickBtn(s, item) {
+      this.orderId=item.id;
       // 花材
       if (s.type === "item") {
         uni.navigateTo({ url: `/pagesOrder/select?id=${item.id}` });
@@ -326,7 +322,33 @@ export default {
               break;
           }
         }
-			}
+			}else if(s.type == 'confirm'){
+        let that = this
+        uni.showActionSheet({
+            itemList: ['请选择结算方式:', '欠款', '已收款'],
+            success: function (res) {
+              let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
+              let clearType = res.tapIndex == 1 ? 1 : 2;
+              uni.showModal({
+                  title: '完成订单提示',
+                  content: title,
+                  success: function (res) {
+                      if (res.confirm) {
+                        confirmFinish({id:item.id,clearType:clearType}).then((res) => {
+                         that._list();
+                         that.$msg(res.msg);
+                        })
+                      } else if (res.cancel) {
+                          console.log('用户点击取消');
+                      }
+                  }
+              });
+            },
+            fail: function (res) {
+                console.log(res.errMsg);
+            }
+        });
+      }
 		},
     selectSussess(val) {
       console.log(val);

+ 6 - 0
ghsApp/src/api/order-item/index.js

@@ -0,0 +1,6 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+//获取订单的花材
+export const getOrderProduct = data => {
+	return https.get("/order-item/get-order-product", data);
+};

+ 2 - 0
ghsApp/src/api/order/index.js

@@ -176,3 +176,5 @@ export const addPrintNum = data => https.get("/order/add-print-num", data);
 
 //云打印 shish 20210714
 export const cloudPrintOrder = data => https.get("/order/cloud-print-order", data);
+
+export const confirmFinish = data => https.get("/order/confirm-finish", data);

+ 12 - 5
ghsApp/src/mixins/product.js

@@ -27,9 +27,15 @@ export default {
 		}
 	},
 	onShow(){
-
-		if(uni.getStorageSync('selectList'+this.pageType)){
-			this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) });
+		if(this.option.modifyProductKey){
+			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
+				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
+				uni.removeStorageSync('selectList'+this.option.modifyProductKey)
+			}
+		}else{
+			if(uni.getStorageSync('selectList'+this.pageType)){
+				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
+			}
 		}
 
 		if (this.autoLoad) {
@@ -93,8 +99,8 @@ export default {
 			let smallLength = 0;
 			if (this.selectList) {
 				for (const item of this.selectList) {
-					bigLength += item.bigCount
-					smallLength += item.smallCount
+					bigLength += Number(item.bigCount)
+					smallLength += Number(item.smallCount)
 				}
 			}
 			return {bigLength:bigLength,smallLength:smallLength,};
@@ -337,6 +343,7 @@ export default {
 
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
+			console.log('this.selectList',this.selectList)
 
 			//记忆已经选择的花材
 			uni.setStorageSync('selectList'+this.pageType, this.selectList)

+ 50 - 9
ghsApp/src/pagesOrder/detail.vue

@@ -76,7 +76,11 @@
 				</view>
 				<view class="order-info_box">
 					<view>订单状态:</view>
-					<view>{{ detailInfo.status==1?'待付款':detailInfo.status==2?'待配送':detailInfo.status==3?'配送中':detailInfo.status==4?'已完成':detailInfo.status==5?'已取消':'已退款' }}</view>
+					<view>{{ detailInfo.status==1?'待确认':detailInfo.status==2?'待配送':detailInfo.status==3?'配送中':detailInfo.status==4?'已完成':detailInfo.status==5?'已取消':'已退款' }}</view>
+				</view>
+				<view v-if="detailInfo.status==1" class="order-info_box">
+					<view>过期时间:</view>
+					<view>{{detailInfo.deadline}}</view>
 				</view>
 				<view v-if="detailInfo.refund == 2" class="order-info_box">
 					<view>退款金额:</view>
@@ -128,7 +132,6 @@
 					<view class="summary-bar">
 						<view class="operate-view" ></view>
 						<view class="describe-view">
-							<!--共{{ detailInfo.productStat.kind}}种, 共{{ detailInfo.productStat.bigNum }}扎{{detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ detailInfo.productStat.totalPrice }}</text>-->
 							共{{ detailInfo.productStat.kind}}种,共{{ detailInfo.productStat.bigNum }}扎{{detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ userPrice.toFixed(2) }}</text>
 						</view>
 					</view>
@@ -177,11 +180,8 @@
 		</view>
 		<div class="app-footer">
 			<template v-for="s in detailInfo.buttonList">
-				<button :key="s.type" @click="openBt(s, detailInfo)" v-if="s.show == 1&&s.type != 'print'" :disabled="s.disable === 1" class="admin-button-com default" :class="s.disable === 1?'active':''">
-					{{ s.type === "item" ? "改花材" : s.type === "selfGet" ? "自取" :s.type === "print" ? "打印" :s.type === "debtPay" ? "延期收款" :s.type === "hasPay" ? "已收款" : "发货" }}
-				</button>
-				<button :key="s.type" @click="openBt(s, detailInfo)" v-if="s.show == 1&&s.type == 'print'" :disabled="s.disable === 1" class="admin-button-com default" :class="s.disable === 1?'active':''">
-					打印{{detailInfo.printNum>0?`(${detailInfo.printNum})`:''}}
+				<button :key="s.type" @click="clickBtn(s, detailInfo)" v-if="s.show == 1" :disabled="s.disable === 1" class="admin-button-com default" :class="s.disable === 1?'active':''">
+					{{ s.type === "print" ? s.name+`(${detailInfo.printNum})` : s.name}}
 				</button>
 			</template>
 		</div>
@@ -201,7 +201,8 @@
 <script>
 import stepStatus from "./components/stepStatus";
 import TuiListCell from "@/components/plugin/list-cell";
-import { getDetail,debtPay,hasPay, freeShipping } from "@/api/order/index";
+import { getDetail,debtPay,hasPay, freeShipping,confirmFinish } from "@/api/order/index";
+import { getOrderProduct } from "@/api/order-item/index";
 import productMins from "@/mixins/product";
 import { ORDER_STATUS } from "@/utils/declare";
 import BLE from "@/mixins/BLE";
@@ -266,7 +267,7 @@ export default {
 		modalCancel() {
 			this.freeShipModal = false;
 		},
-		openBt(s, item) {
+		clickBtn(s, item) {
 			this.orderId = item.id;
 			if (s.type === "item") {
 				// 花材
@@ -334,6 +335,46 @@ export default {
 						}
 					}
 				});
+			}else if (s.type === "modifyProduct") {
+				//修改花材
+				let self = this;
+				let orderId = item.id
+				let customName = item.customName
+				let customId = item.customId
+				let modifyProductKey = 'modifyProduct_orderId_'+orderId
+
+				getOrderProduct({ id: orderId }).then(res => {
+					let productList = res.data.productList
+					uni.setStorageSync('selectList'+modifyProductKey, productList)
+					self.$util.pageTo({url: '/admin/billing/index',type:2,query: {customId: customId,customName:customName,orderId:orderId,modifyProductKey:modifyProductKey}})
+				})
+
+			}else if(s.type == 'confirm'){
+				let self = this;
+				uni.showActionSheet({
+					itemList: ['请选择结算方式:', '欠款', '已收款'],
+					success: function (res) {
+					let title = res.tapIndex == 1 ? '确认客户欠款?' : '确认已收款?'
+					let clearType = res.tapIndex == 1 ? 1 : 2;
+					uni.showModal({
+						title: '完成订单提示',
+						content: title,
+						success: function (res) {
+							if (res.confirm) {
+								confirmFinish({id:item.id,clearType:clearType}).then((res) => {
+									uni.showToast({title:res.msg,icon:'none'})
+									self.init();
+								})
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+					});
+					},
+					fail: function (res) {
+						console.log(res.errMsg);
+					}
+				});
 			}
 		},
 		copy(val) {

+ 1 - 1
hdApp/src/pagesPurchase/purDetails.vue

@@ -181,7 +181,7 @@
         </div>
       </view>
     </view>
-    <view class="footer_bar" v-if="detailInfo.status == 1 && detailInfo.ghsShopAdminId == 0"><view @click="toPay">付款</view></view>
+    <view class="footer_bar" v-if="detailInfo.status == 1"><view @click="toPay">付款</view></view>
   </view>
 </template>