fuwei 4 лет назад
Родитель
Сommit
1f0701dd03

+ 99 - 39
ghsPad/src/admin/home/components/select-settle.vue

@@ -4,45 +4,41 @@
             <view class="select-item_box">
                 <view class="title">结账方式</view>
                 <view class="item-list_box">
-                    <view class="active">
-                        欠账
-                    </view>
-                    <view>
-                        已付款
-                    </view>
-                    <view>
-                      待付款
+                    <view 
+                        :key="item.id"
+                        @tap="changeType('settleId',item.id)"
+                        v-for="item in returnWay" 
+                        :class="[settleId===item.id?'active':'']">
+                        {{item.name}}
                     </view>    
                 </view>
             </view>
-            <view class="select-item_box">
-                <view class="title">收款方式</view>
-                <view class="item-list_box">
-                    <view class="active">
-                        欠账
-                    </view>
-                    <view>
-                        已付款
+            <template v-if="settleId!==3">
+                <view class="select-item_box">
+                    <view class="title">收款方式</view>
+                    <view class="item-list_box">
+                        <view 
+                            :key="item.id"
+                            @tap="changeType('payId',item.id)"
+                            v-for="item in payWay" 
+                            :class="[settleId===item.id?'active':'']">
+                            {{item.name}}
+                        </view>  
                     </view>
-                    <view>
-                      待付款
-                    </view>    
                 </view>
-            </view>
-            <view class="select-item_box">
-                <view class="title">收款人</view>
-                <view class="item-list_box">
-                    <view class="active">
-                        欠账
-                    </view>
-                    <view>
-                        已付款
+                <view class="select-item_box">
+                    <view class="title">收款人</view>
+                    <view class="item-list_box">
+                        <view 
+                            :key="item.id"
+                            @tap="changeType('payUserId',item.id)"
+                            v-for="item in payUser" 
+                            :class="[settleId===item.id?'active':'']">
+                            {{item.name}}
+                        </view>      
                     </view>
-                    <view>
-                      待付款
-                    </view>    
                 </view>
-            </view>
+            </template>
             <view class="select-item_box">
                 <view class="title">打印小票</view>
                 <view class="item-list_box">
@@ -54,7 +50,7 @@
         </view>
         <view class="line"></view>
         <view class="select-right">
-            <AppInputAll v-model="shopVal" title="商品合计" disabled></AppInputAll>
+            <AppInputAll v-model="totalShop.totalPrice" title="商品合计" disabled></AppInputAll>
             <AppInputAll v-model="shopVal" title="运费" placeholder="没有运费留空"></AppInputAll>
             <AppInputAll v-model="shopVal" title="总金额" placeholder="总金额"></AppInputAll>
             <AppInputAll v-model="shopVal" title="实收金额" placeholder="实收金额"></AppInputAll>
@@ -79,6 +75,12 @@
     import AppInputAll from '@/components/app_input_all'
     export default {
         name:'selectCustomer',
+        props:{
+            totalShop:{
+                type:Object,
+                default:()=>{}
+            }
+        },
         components:{
             VKeyboard,
             AppInputAll
@@ -86,13 +88,71 @@
         data() {
 			return {
 				input: '',//键盘输入
-                shopVal: '¥100'
+                shopVal: '¥100',
+                settleId: 1,
+                payId:1,
+                payUserId:1,
+                returnWay:[
+                    {
+                        name:'欠款',
+                        id:1,
+                    },
+                    {
+                        name:'已付款',
+                        id:2,
+                    },
+                    {
+                        name:'待付款',
+                        id:3,
+                    }
+                ],
+                payWay:[
+                    {
+                        name:'微信',
+                        id:1
+                    },
+                    {
+                        name:'支付宝',
+                        id:2
+                    },
+                    {
+                        name:'现金',
+                        id:3
+                    },
+                     {
+                        name:'银行卡',
+                        id:4
+                    }
+                ],
+                payUser:[
+                    {
+                        name:'收款码',
+                        id:1    
+                    },
+                    {
+                        name:'微信客服1',
+                        id:2   
+                    },
+                    {
+                        name:'微信客服2',
+                        id:3   
+                    },{
+                        name:'微信客服3',
+                        id:4  
+                    },{
+                        name:'微信客服4',
+                        id:5   
+                    }
+                ]
 			};
 		},
         mounted() {
             this.activeKeyboard();
         },
         methods: {
+            changeType(key, id){
+                this[key] = id
+            },
 			//键盘方法
 			activeKeyboard() {
 				this.$refs.keyboard.activate();
@@ -125,22 +185,22 @@
             padding: 10rpx;
             & .select-item_box {
                 & > .title {
-                    font-size: 14rpx;
+                    font-size: 12rpx;
                 }
                 & .item-list_box {
                         display: flex;
                         align-items: center;
                         justify-content: flex-start;
                         flex-wrap: wrap;
-                        padding: 10rpx 0;
+                        padding: 8rpx 0;
                         & > view {
                             width: 85rpx;
-                            height: 35rpx;
+                            height: 30rpx;
                             text-align: center;
-                            line-height: 35rpx;
+                            line-height: 30rpx;
                             font-size: 12rpx;
                             border: 1px solid #eee;
-                            margin: 0 8rpx 8rpx 0;
+                            margin: 0 5rpx 5rpx 0;
                             color: #333333;
                             border-radius: 3rpx;
                             &.active {

+ 7 - 7
ghsPad/src/admin/home/components/shopTypeSelect.vue

@@ -29,30 +29,30 @@
                 </view>
             </view>
         </view>
-        <view class="shop-footer_box">
-										<slot name="footer"></slot>
-            <!-- <view class="btn-breakage">
+        <slot name="footer"></slot>
+        <!-- <view class="shop-footer_box">
+             <view class="btn-breakage">
                 报损
             </view>
             <view
                 @click="settle"
                 class="btn-account">
                 结算
-            </view> -->
-        </view>
+            </view>
+        </view> -->
         <!-- <uniPopup
             :show.sync="isShowFllowNum"
             type="top"
             maxHeight="90vh">
 								<keyboardSetFlower :selectItem.sync="selectItem"></keyboardSetFlower>
 							</uniPopup> -->
-							<uniPopup
+							<!-- <uniPopup
 																:show.sync="isShowSettle"
 																type="top"
 																maxHeight="90vh"
 																>
 							<selectSettle></selectSettle>
-						</uniPopup>
+						</uniPopup> -->
     </view>
 </template>
 

+ 65 - 5
ghsPad/src/admin/home/workbench.vue

@@ -72,7 +72,20 @@
 			</view>
 		</view>
 		<view class="shop-list">
-			<shopTypeSelect @selectItemChange="selectItemChange"></shopTypeSelect>
+			<shopTypeSelect @selectItemChange="selectItemChange">
+				<view slot="footer" class="shop-footer_box">
+					<view 
+					@tap="breakage"
+					class="btn-breakage">
+						报损
+					</view>
+					<view
+						@click="settle"
+						class="btn-account">
+						结算
+					</view>
+				</view>
+			</shopTypeSelect>
 		</view>
 		<uniPopup
 		:show.sync="isShowUser"
@@ -88,6 +101,13 @@
 		     maxHeight="90vh">
 			<keyboardSetFlower @enterNum="enterReturn" :selectItem.sync="selectItem"></keyboardSetFlower>
 		</uniPopup>
+		<uniPopup
+			:show.sync="isShowSettle"
+			type="top"
+			maxHeight="90vh"
+			>
+			<selectSettle :totalShop="totalShop"></selectSettle>
+		</uniPopup>
 		<NotLogin></NotLogin>
 	</view>
 </template>
@@ -98,12 +118,13 @@ import productMins from "@/mixins/product";
 import autoUpdateMixins from "@/mixins/autoUpdate";
 import uniPopup from '@/components/uni-popup'
 import keyboardSetFlower from '@/components/app-boardSet-flower.vue'
-// import selectSettle from './components/select-settle.vue'
+import selectSettle from './components/select-settle.vue'
 import selectUser from './components/select-user.vue'
 import shopTypeSelect from './components/shopTypeSelect.vue'
+import { createOrder } from '@/api/home/index'
 export default {
 	name: "workbench",
-	components: { NotLogin,uniPopup,selectUser,shopTypeSelect,keyboardSetFlower },
+	components: { NotLogin,uniPopup,selectUser,shopTypeSelect,keyboardSetFlower,selectSettle },
 	mixins: [productMins,autoUpdateMixins],
 	data() {
 		return {
@@ -173,8 +194,23 @@ export default {
 		selectUser(){
 			this.isShowUser = true
 		},
+		breakage(){
+			if(this.$util.isEmpty(this.shopList)) {
+				this.$msg('请选择报损商品')
+				return false
+			}
+			this.$util.confirmModal({content:'确定报损吗?'}, 
+			async() => {
+				// that.paySuccess(parameter)
+			})
+		},
 		settle(){
+			if(this.$util.isEmpty(this.shopList)) {
+				this.$msg('请选择结算商品')
+				return false
+			}
 			this.isShowSettle = true
+			
 		},
 		clearShop(){
 			this.shopList = []
@@ -211,16 +247,40 @@ export default {
 		& .shop-list {
 			flex: 63;
 			height: 100%;
+			& .shop-footer_box {
+				height: 40rpx;
+				display: flex;
+				align-items: center;
+				justify-content: flex-end;
+				& > view {
+					height: 40rpx;
+					padding: 5rpx 25rpx;
+					border-radius: 5rpx;
+					font-size: 14rpx;
+					margin: 0 10rpx;
+					vertical-align: middle;
+					display: flex;
+					align-items: center;
+					&.btn-breakage {
+						background-color: #da9f5a;
+						color: #ffffff;
+					}
+					&.btn-account {
+						background-color: #009966;
+						color: #ffffff;
+					}
+				}
+			}
 		}
 		& .nav-left {
 			height: 100%;
 			// width: 50rpx;
-			flex: 4;
+			flex: 5;
 			background-color: rgba(72, 91, 107, 1);
 			// #599981
 			& .item-list {
 				margin-top: 50rpx;
-				font-size: 20rpx;
+				font-size: 16rpx;
 				text-align: center;
 				padding: 15rpx 0;
 				background-color: #599981;

+ 4 - 0
ghsPad/src/api/home/index.js

@@ -25,4 +25,8 @@ export const showList = async (data) => {
 export const customList = async (data) => {
 	return https.get("/custom/list", data);
 };
+export const createOrder = data => {
+	return https.post('/wastage/create-order', data)
+}
+