Kaynağa Gözat

现金管理

shish 3 yıl önce
ebeveyn
işleme
3b3ff5455d
1 değiştirilmiş dosya ile 43 ekleme ve 18 silme
  1. 43 18
      hdPad/src/pages/home/xj.vue

+ 43 - 18
hdPad/src/pages/home/xj.vue

@@ -18,6 +18,15 @@
             </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>
@@ -57,36 +66,52 @@ export default {
 			})
 		},
 		outAmount(){
+			this.$util.hitVoice()
 			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 = ''
-					}
-				})
-			})
+			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
 			}
-			that.$util.confirmModal({content:'确认存入'},() => {       
-				inMoney({amount:that.saveCash}).then(res=>{
-					if(res.code == 1){
-						that.getMainInfo()
-						that.$msg('操作成功')
-						that.saveCash = ''
-					}
-				})
-			})
+			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()
+				}
+			})			
 		},
 	}
 };