shish 3 лет назад
Родитель
Сommit
36124252ed
2 измененных файлов с 64 добавлено и 10 удалено
  1. 4 3
      ghsPad/src/api/custom/index.js
  2. 60 7
      ghsPad/src/pages/home/xj.vue

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

@@ -1,8 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
-/** *
- * 修改欠款额度
- */
+export const createCumtomer = data => {
+	return https.post('/custom/create-customers', data)
+}
+
 export const updateDebtLimit = data => {
 	return https.get('/custom/update-debt-limit', data)
 }

+ 60 - 7
ghsPad/src/pages/home/xj.vue

@@ -15,6 +15,12 @@
 					<input v-model="saveCash" type="digit" class="save-input" @focus="saveCash=''" placeholder="金额" /> 
 					<text @click="inAmount()" style="margin-left:30upx;font-size:34upx;">存入</text>
 				</view>
+				<view class="custom">
+					<input v-model="form.name1" type="text" class="custom-input" @focus="form.name1=''" placeholder="客户名称" /> 
+					<input v-model="form.mobile1" type="number" class="custom-input" @focus="form.mobile1=''" placeholder="手机号" /> 
+					<input v-model="form.confirmMobile1" type="number" class="custom-input" @focus="form.confirmMobile1=''" placeholder="确认手机号" /> 
+					<text @click="addCustom()" style="font-size:34upx;">添加客户</text>
+				</view>
             </view>
         </view>
     </view>
@@ -34,6 +40,7 @@ import { mapGetters } from "vuex";
 import casherNav from './components/nav.vue'
 import { mainInfo } from "@/api/main"
 import { inMoney,outMoney } from "@/api/shop-money"
+import { createCumtomer } from '@/api/custom'
 export default {
 	name: "xj",
 	components: {casherNav},
@@ -44,7 +51,12 @@ export default {
 			currentJobId:0,
 			xjInfo:{},
 			drawCash:'',
-			saveCash:''
+			saveCash:'',
+			form: {
+				name1: "",
+				mobile1: "",
+				confirmMobile1: ""
+			}
 		}
 	},
 	computed: {
@@ -54,6 +66,34 @@ export default {
 		this.getMainInfo()
 	},
 	methods: {
+		addCustom() {
+			let that = this
+			if(this.$util.isEmpty(this.form.name1)){
+				that.$msg('请填写客户名称')
+				return false
+			}
+			if(this.$util.isEmpty(this.form.mobile1)){
+				that.$msg('请填写客户手机号')
+				return false
+			}
+			if(this.$util.isEmpty(this.form.confirmMobile1)){
+				that.$msg('请填写确认手机号')
+				return false
+			}
+			if(this.form.mobile1 != this.form.confirmMobile1){
+				this.$msg('二次手机号不一致')
+				return false
+			}
+			uni.showLoading({mask:true})
+			createCumtomer({ ...this.form }).then(res => {
+				if(res.code == 1){
+					this.$msg(res.msg)
+					that.form.name1 = ''
+					that.form.mobile1 = ''
+					that.form.confirmMobile1 = ''
+				}
+			});
+    	},
 		init(){
 
 		},
@@ -127,12 +167,12 @@ export default {
 	& .work-list {
 		flex: 121;
 		.cash{
-			margin-left:50upx;
-			margin-top:50upx;
+			margin-left:40upx;
+			margin-top:30upx;
 		}
 		.draw{
-			margin-top:50upx;
-			margin-left:50upx;
+			margin-top:30upx;
+			margin-left:40upx;
 			.draw-input{
 				width:160upx;
 				height:35upx;
@@ -143,8 +183,8 @@ export default {
 			}
 		}
 		.save{
-			margin-top:50upx;
-			margin-left:50upx;
+			margin-top:30upx;
+			margin-left:40upx;
 			.save-input{
 				width:160upx;
 				height:35upx;
@@ -154,6 +194,19 @@ export default {
 				font-size:30upx;
 			}
 		}
+		.custom{
+			margin-top:60upx;
+			margin-left:40upx;
+			.custom-input{
+				width:160upx;
+				height:35upx;
+				border:1upx solid #ccc;
+				display: inline-block;
+				text-align: center;
+				font-size:23upx;
+				margin-right:10upx;
+			}
+		}
 	}
 }
 </style>