shish hace 3 años
padre
commit
d0b025c459

+ 4 - 3
ghsPad/src/api/main/index.js

@@ -1,8 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
-/** *
- * 商城分享(零售、供应商相同) b  wangning  2021-6-12
- */
+export const mainInfo = data => {
+	return https.get('/main/info', data)
+}
+
 export const mainGetMallPoster = data => {
 export const mainGetMallPoster = data => {
 	return https.get('/main/get-mall-poster', data)
 	return https.get('/main/get-mall-poster', data)
 }
 }

+ 9 - 0
ghsPad/src/api/shop-money/index.js

@@ -0,0 +1,9 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const inMoney = data => {
+	return https.get('/shop-money/in', data)
+}
+
+export const outMoney = data => {
+	return https.get('/shop-money/out', data)
+}

+ 1 - 0
ghsPad/src/pages.json

@@ -3,6 +3,7 @@
 		{"path": "pages/home/cash","style": {"navigationBarTitleText": "收银"}},
 		{"path": "pages/home/cash","style": {"navigationBarTitleText": "收银"}},
 		{"path": "pages/home/order","style": {"navigationBarTitleText": "订单"}},
 		{"path": "pages/home/order","style": {"navigationBarTitleText": "订单"}},
 		{"path": "pages/home/mt","style": {"navigationBarTitleText": "美团单"}},
 		{"path": "pages/home/mt","style": {"navigationBarTitleText": "美团单"}},
+		{"path": "pages/home/xj","style": {"navigationBarTitleText": "现金"}},
 		{"path": "pages/home/sh","style": {"navigationBarTitleText": "散花"}},
 		{"path": "pages/home/sh","style": {"navigationBarTitleText": "散花"}},
 		{"path": "pages/home/work","style": {"navigationBarTitleText": "门店单"}},
 		{"path": "pages/home/work","style": {"navigationBarTitleText": "门店单"}},
 		{"path": "pages/home/modify","style": {"navigationBarTitleText": "修改"}},
 		{"path": "pages/home/modify","style": {"navigationBarTitleText": "修改"}},

+ 1 - 0
ghsPad/src/pages/home/components/nav.vue

@@ -30,6 +30,7 @@ export default {
       nav: [
       nav: [
         { name: "收银", page: "/pages/home/cash",flag:'casher'},
         { name: "收银", page: "/pages/home/cash",flag:'casher'},
         { name: "订单", page: "/pages/home/order",flag:'order'},
         { name: "订单", page: "/pages/home/order",flag:'order'},
+        { name: "现金", page: "/pages/home/xj",flag:'xj'},
         { name: "退出", page: "/pages/home/logout",flag:'logout'},
         { name: "退出", page: "/pages/home/logout",flag:'logout'},
         { name: "关闭", page: "/pages/home/close",flag:'close'},
         { name: "关闭", page: "/pages/home/close",flag:'close'},
         //{ name: "损耗", page: "/pages/home/waste",flag:'waste'},
         //{ name: "损耗", page: "/pages/home/waste",flag:'waste'},

+ 155 - 0
ghsPad/src/pages/home/xj.vue

@@ -0,0 +1,155 @@
+<template>
+<view>
+    <view>
+        <view class="app-casher-area">
+            <view class="nav-left">
+                <casherNav navType="xh"></casherNav>
+            </view>
+            <view class="work-list">
+                <view class="cash">现金:¥{{xjInfo.money ? parseFloat(xjInfo.money) : 0}}</view>
+				<view class="draw">
+					<input v-model="drawCash" class="draw-input" type="digit" @focus="drawCash=''" placeholder="提取金额" /> 
+					<text @click="outAmount()" style="margin-left:30upx;">提取</text>
+				</view>
+				<view class="save">
+					<input v-model="saveCash" type="digit" class="save-input" @focus="drawCash=''" placeholder="存入金额" /> 
+					<text @click="inAmount()" style="margin-left:30upx;">存入</text>
+				</view>
+            </view>
+        </view>
+    </view>
+
+	<uni-popup ref="outAmountRef" type="dialog">
+        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认提交?" @confirm="toDrawCash()"></uni-popup-dialog>
+    </uni-popup>
+
+	<uni-popup ref="inAmountRef" type="dialog">
+        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认存入?" @confirm="toSaveCash()"></uni-popup-dialog>
+    </uni-popup>
+
+</view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import casherNav from './components/nav.vue'
+import { mainInfo } from "@/api/main"
+import { inMoney,outMoney } from "@/api/shop-money"
+export default {
+	name: "xj",
+	components: {casherNav},
+	mixins: [],
+	data() {
+		return {
+			currentJobType:'xj',
+			currentJobId:0,
+			xjInfo:{},
+			drawCash:'',
+			saveCash:''
+		}
+	},
+	computed: {
+		...mapGetters(["getLoginInfo"])
+	},
+	onLoad(){
+		this.getMainInfo()
+	},
+	methods: {
+		init(){
+
+		},
+		getMainInfo(){
+			let that = this
+			mainInfo().then(res=>{
+				if(res.code == 1){
+					that.xjInfo = res.data.info ? res.data.info : []
+				}
+			})
+		},
+		outAmount(){
+			this.$util.hitVoice()
+			let that=this;
+			if(that.$util.isEmpty(that.drawCash) || Number(that.drawCash)<=0){
+				that.$msg('请填写金额')
+				return false
+			}
+			this.$refs.outAmountRef.open()
+		},
+		inAmount(){
+			this.$util.hitVoice()
+			let that=this;
+			if(that.$util.isEmpty(that.saveCash) || Number(that.saveCash)<=0){
+				that.$msg('请填写金额')
+				return false
+			}
+			this.$refs.inAmountRef.open()
+		},
+		toDrawCash(){
+			let that=this;
+			if(that.$util.isEmpty(that.drawCash) || Number(that.drawCash)<=0){
+				that.$msg('请填写金额')
+				return false
+			}
+			outMoney({amount:that.drawCash}).then(res=>{
+				if(res.code == 1){
+					that.getMainInfo()
+					that.$msg('操作成功')
+					that.drawCash = ''
+					that.$refs.outAmountRef.close()
+				}
+			})			
+		},
+		toSaveCash(){
+			let that=this;
+			if(that.$util.isEmpty(that.saveCash) || Number(that.saveCash)<=0){
+				that.$msg('请填写金额')
+				return false
+			}
+			inMoney({amount:that.saveCash}).then(res=>{
+				if(res.code == 1){
+					that.getMainInfo()
+					that.$msg('操作成功')
+					that.saveCash = ''
+					that.$refs.inAmountRef.close()
+				}
+			})			
+		},
+	}
+};
+</script>
+<style lang="scss" scoped>
+.app-casher-area {
+	display: flex;
+	height: 100vh;
+	& .nav-left {
+		flex: 5;
+		background-color: rgba(72, 91, 107, 1);
+	}
+	& .work-list {
+		flex: 121;
+		.cash{
+			margin-left:50upx;
+			margin-top:50upx;
+		}
+		.draw{
+			margin-top:50upx;
+			margin-left:50upx;
+			.draw-input{
+				width:160upx;
+				border:1upx solid #ccc;
+				display: inline-block;
+				text-align: center;
+			}
+		}
+		.save{
+			margin-top:50upx;
+			margin-left:50upx;
+			.save-input{
+				width:160upx;
+				border:1upx solid #ccc;
+				display: inline-block;
+				text-align: center;
+			}
+		}
+	}
+}
+</style>