shish 3 лет назад
Родитель
Сommit
e2ae114f7f

+ 22 - 7
hdApp/src/admin/billing/affirm.vue

@@ -12,7 +12,7 @@
 										<text class="item-name">{{ item.itemName }}</text>
 										<text class="item-price">
 											<text class="price">
-												¥{{ getSelectItemPrice(item) }}
+												¥{{ item.userPrice ? parseFloat(item.userPrice) : 0 }}
 											</text>
 										</text>
 									</view>
@@ -207,12 +207,25 @@ export default {
 			this.clientInfo = info;
 		},
 		affirmFormSubmit(){
-			const product = this.selectList.map(ele => {
-				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
-			});
+
+			if(this.$util.isEmpty(this.selectList)){
+				this.$msg('请选择花材')
+				return false
+			}
+
+			let product = []
+			this.selectList.forEach((item,idx,arr) => {
+				let unitType = Number(item.bigCount)>0 ? 0 : 1
+				let num = Number(item.bigCount)>0 ? Number(item.bigCount) : Number(item.smallCount)
+				let unitPrice = item.userPrice ? item.userPrice : 0
+				let current = {productId:item.id,bigNum:item.bigCount,smallNum:item.smallCount,classId:item.classId,num:num,
+				itemId:item.itemId,property:item.property,unitType:unitType,unitPrice:unitPrice}
+				product.push(current)
+			})
+			let packingFee = Number(this.packingMoney) > 0 ? Number(this.packingMoney) : 0 
 			let options = {
 				orderType:2,// 开单类型,1商品开单 2花材开单
-				packingFee:this.packingMoney,// 包装费
+				packingFee:packingFee,// 包装费
 				sendCost:this.freight,// 运费
 				customId:this.clientInfo.id,// 客户
 				payWay:this.payType,//付款方式
@@ -220,14 +233,16 @@ export default {
 				modifyPrice: this.modifyPrice,
 				product:JSON.stringify(product),//下单商品
 			};
-			let self = this;
+			let that = this;
 			uni.showModal({
 				title: '提示',
 				content: '确认开单?',
 				success: function (res) {
 					if (res.confirm) {
 						createOrder(options).then(res => {
-							self.resetSelectInfoByType(self.pageType);
+
+							that.removeFromSaveDirect()
+
 							const { data: { orderId, orderSn } } = res
 							let url = `/admin/billing/result?orderId=${orderId}&orderSn=${orderSn}&type=zuhe`;
 							uni.redirectTo({url: url})

+ 25 - 10
hdApp/src/admin/billing/index.vue

@@ -50,21 +50,34 @@
 		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx">
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
-					<view class="kc"> 库存 {{ customData.stock?parseFloat(customData.stock):0 }} </view>
+					<view class="kc">
+						<text class="unit_price">库存 {{ parseFloat(customData.stock) }}</text>
+						<text class="unit_price"> ¥{{ parseFloat(customData.price) }}</text>
+						<text>{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</text>
+					</view>
+					<view class="num_bx">
+						<input style="width: 280upx" v-model="customData.userPrice" @focus="customData.userPrice = null" 
+						:disabled="false" type="digit" placeholder="单价" />
+						<text style="font-size:35upx;font-weight:bold;color:#666666;">元</text>
+					</view>
 					<view class="num_bx">
 						<!-- #ifdef APP-PLUS -->
-						<input style="width: 260upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
+						<input style="width: 280upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
 						<text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">{{customData.bigUnit}}</text>
-						<input style="width: 260upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
+						<input style="width: 280upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
 						<text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">{{customData.smallUnit}}</text>
 						<!-- #endif -->
+
 						<!-- #ifdef MP-WEIXIN -->
-						<input style="width: 260upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
+						<input style="width: 280upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
 						<text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">{{customData.bigUnit}}</text>
-						<input style="width: 260upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
+						<input style="width: 280upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
 						<text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">{{customData.smallUnit}}</text>
 						<!-- #endif -->
-						<image @click="switchGlobalUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" style="width:86upx;height:86upx;" mode="widthFix"></image>
+
+						<image @click="switchGlobalUnitType" :src="`${constant.imgUrl}/icon/switch/switch128.png`" 
+						style="width:86upx;height:86upx;position:relative;top:-60upx;right:0upx;" mode="widthFix"></image>
+
 					</view>
 				</view>
 			</template>
@@ -285,16 +298,18 @@ export default {
 			color: #999999;
 			font-size: 28upx;
 			font-weight: 400;
-			margin-bottom: 60upx;
+			margin-bottom: 40upx;
 			text-align: center;
-			margin-top: 10upx;
+			margin-top: 30upx;
+			.unit_price{
+				padding-right:25upx;
+			}
 		}
 		& .num_bx {
 			display: flex;
 			align-items: center;
 			margin-bottom: 40upx;
-			justify-content:center;
-			padding-left:70upx;
+			padding-left:110upx;
 			& > input {
 				width: 212upx;
 				height: 80upx;

+ 34 - 104
hdApp/src/admin/billing/result.vue

@@ -1,6 +1,38 @@
+<template>
+  <view class="app-content">
+    <appResult>
+      <button class="admin-button-com blue big" @click="gotoPlace">返回</button>
+      <button class="admin-button-com blue big" @click="gotoDetail">订单详情</button>
+    </appResult>
+  </view>
+</template>
+<script>
+import appResult from "@/components/app-result";
+export default {
+	name: "result",
+	components: {
+		appResult
+	},
+	data(){
+		return {
+			name:'',
+			index:0,
+			type:[]
+		}
+	},
+	methods: {
+		gotoDetail() {
+			this.pageTo({url:`/admin/order/detail?id=${this.option.orderId}`, type: 2})
+		},
+		gotoPlace() {
+			uni.navigateBack({ delta: 1 })
+		}
+	}
+};
+</script>
 <style lang="scss" scoped>
 .admin-button-com {
-	margin-bottom: 20upx;
+	margin-bottom: 40upx;
 	width: 100%;
 }
 .zuhe-box{
@@ -50,106 +82,4 @@
 		}
 	}
 }
-</style>
-<template>
-  <view class="app-content">
-    <appResult>
-      <button class="admin-button-com blue big" @click="gotoOrderSend">发货</button>
-      <button class="admin-button-com big" @click="gotoDetail">订单详情</button>
-      <view style="text-align: center;color: #868686;margin-top: 30upx;" v-if="option.type === 'zuhe' && isGroup">
-        <view class="iconfont iconchenggong" style="color:#049E2C;margin-bottom:15upx;font-size:80upx;" ></view>
-        <view>保存成功,请在【开单 - 商品】查看</view>
-      </view>
-      <view class="zuhe-box" v-if="option.type === 'zuhe' && !isGroup">
-        <view class="">
-          <view class="zuhe-remark">保存此商品组合,以便下次取用:</view>
-          <view class="flex-space zuhe-center border">
-            <view class="zuhe-title">名称</view>
-            <input class="zuhe-val" type="text" placeholder="如:开业花篮 200元" v-model="name" placeholder-class="tui-placeholder">
-          </view>
-          <view class="flex-space zuhe-center">
-            <view class="zuhe-title">所属分类</view>
-            <picker class="zuhe-val active" @change="selectType" :value="index" :range="type" range-key="categoryName">
-              <view class="uni-input">{{type[index].categoryName}}</view>
-            </picker>
-          </view>
-        </view>
-      </view>
-      <button class="admin-button-com blue big" @click="SubSaveItemGroup" v-if="option.type === 'zuhe' && !isGroup">保存</button>
-    </appResult>
-    
-  </view>
-</template>
-
-<script>
-import appResult from "@/components/app-result";
-import { categoryListB,saveItemGroup } from "@/api/goods/index";
-export default {
-	name: "BillingResult", // 开单结果
-	components: {
-		appResult
-	},
-	data(){
-		return {
-			name:'',
-			index:0,
-			type:[],
-			isGroup:false,
-		}
-	},
-	onShow(){
-		this.getCategoryList()
-	},
-	methods: {
-		SubSaveItemGroup(){
-			let parameter = {
-				orderSn:this.option.orderSn,
-				name:this.name,
-				categoryId:this.type[this.index].id,
-			}
-			saveItemGroup(parameter).then(res=>{
-					this.isGroup = true;
-			})
-		},
-    gotoDetail() {
-      this.pageTo({url:`/admin/order/detail?id=${this.option.orderId}`, type: 2})
-    },
-		getCategoryList(){
-			categoryListB().then(res => {
-				this.type = res.data;
-			})
-		},
-		selectType(e){
-			this.index = e.target.value
-		},
-		gotoOrderSend(){
-			uni.navigateTo({url: `/admin/order/ship?id=${this.option.orderId}&pageStatus=0`});
-		},
-		gotoOrderDetails() {
-			uni.navigateTo({url: `/pagesOrder/detail?id=${this.option.orderId}`})
-		},
-		gotoPlace() {
-			uni.navigateBack({
-				delta: 1
-			});
-		},
-		gotoOrderPrint() {
-			uni.navigateTo({
-				url: `/admin/order/print?id=${this.option.orderId}`,
-				success: result => {},
-				fail: () => {},
-				complete: () => {}
-			});
-		},
-		gotoOrderList() {
-			this.$util.pageTo({
-					url: "/admin/home/order",
-					type: 4,
-					query: {
-						tabIndex: 0
-					},
-				});
-		}
-	}
-};
-</script>
+</style>

+ 0 - 4
hdApp/src/admin/home/me.vue

@@ -101,10 +101,6 @@
               <view class="tui-title">新手教程</view>
             </tui-list-cell>
 
-            <tui-list-cell @click="pageTo({ url: '/admin/staff/miniAutoLogin' })" class="line-cell" :hover="false" :arrow="true">
-              <view class="tui-title">自动登录</view>
-            </tui-list-cell>
-            
             <!-- #ifdef APP-PLUS -->
             <tui-list-cell @click="closeApp()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
               <view class="tui-title">关闭APP</view>

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

@@ -56,12 +56,19 @@ export default {
 					const itemInfo = this.getSelectItemById(item.id, item.classId);
 					if (itemInfo && !this.$util.isEmpty(itemInfo.bigPrice) && !this.$util.isEmpty(itemInfo.smallPrice)) {
 						if(item.userPrice>0){
-							price += Number(item.bigCount) * Number(itemInfo.userPrice);
-							let currentSmallPrice = (itemInfo.userPrice/itemInfo.ratio).toFixed(2)
-							price += Number(item.smallCount)*Number(currentSmallPrice)
+							if(Number(item.bigCount) > 0){
+								price += Number(item.bigCount) * Number(itemInfo.userPrice);
+							}
+							if(Number(item.smallCount) > 0){
+								price += Number(item.smallCount) * Number(itemInfo.userPrice);	
+							}
 						}else{
-							price += item.bigCount * Number(itemInfo.bigPrice);
-							price += item.smallCount * Number(itemInfo.smallPrice);
+							if(Number(item.bigCount) > 0){
+								price += Number(item.bigCount) * Number(itemInfo.bigPrice);
+							}
+							if(Number(item.smallCount) > 0){
+								price += Number(item.smallCount) * Number(itemInfo.smallPrice);	
+							}
 						}
 					}
 				}

+ 1 - 1
hdPad/src/manifest.json

@@ -64,7 +64,7 @@
                     "entitlements" : {
                         "com.apple.developer.associated-domains" : [ "applinks:fronttg.wixhb.com" ]
                     }
-                }
+                }          
             },
             /* SDK配置 */
             "sdkConfigs" : {