|
|
@@ -0,0 +1,130 @@
|
|
|
+<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>
|
|
|
+</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(){
|
|
|
+ let that=this;
|
|
|
+ if(that.$util.isEmpty(that.drawCash) || Number(that.drawCash)<=0){
|
|
|
+ that.$msg('请填写金额')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.$util.confirmModal({content:'确认取出'},() => {
|
|
|
+ outMoney({amount:that.drawCash}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.getMainInfo()
|
|
|
+ that.$msg('操作成功')
|
|
|
+ that.drawCash = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ inAmount(){
|
|
|
+ let that=this;
|
|
|
+ if(that.$util.isEmpty(that.saveCash) || Number(that.saveCash)<=0){
|
|
|
+ that.$msg('请填写金额')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.$util.confirmModal({content:'确认存入'},() => {
|
|
|
+ inMoney({amount:that.saveCash}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.getMainInfo()
|
|
|
+ that.$msg('操作成功')
|
|
|
+ that.saveCash = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</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>
|