Quellcode durchsuchen

累计欠款有限制

jf vor 5 Jahren
Ursprung
Commit
ebbf8ba6ab

+ 8 - 0
ghsApp/src/api/custom/index.js

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

+ 6 - 0
ghsApp/src/pagesClient/member/add.vue

@@ -26,6 +26,10 @@
 					<div class="tui-title">允许欠款</div>
 					<switch :checked="form.debt" @change="form.debt = !form.debt" color="#3385FF"/>
 				</tui-list-cell>
+				<tui-list-cell class="line-cell" :hover="false">
+					<div class="tui-title required">欠款额度</div>
+					<input v-model="form.debtLimit" placeholder-class="phcolor" class="tui-input" placeholder="请输入,默认5000元" type="text" />
+				</tui-list-cell>
 				<!--<view class="line-hint_bx">-->
 					<!--以下选填-->
 				<!--</view>-->
@@ -96,6 +100,7 @@ export default {
 				adminName: '',
 				lat:'',
 				long: '',
+				debtLimit: '',
 				debt:true
 			},
 			levelSelData: {}
@@ -140,6 +145,7 @@ export default {
 				confirmMobile: this.form.confirmMobile,
 				address:this.form.address,
 				debt:this.form.debt?1:0,
+				debtLimit:this.form.debtLimit,
 			}).then(res => {
 				uni.hideLoading();
 				uni.setStorageSync('newClient', res.data)

+ 14 - 4
ghsApp/src/pagesClient/member/detail.vue

@@ -56,6 +56,10 @@
                 <text></text>
                 <switch :checked="form.debt == 0 ? false : true" @change="remindChangeFn" />
               </div>
+            </tui-list-cell>
+											<tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title">欠款额度</div>
+              <input v-model="debtLimit" @confirm="amendMoney" placeholder-class="phcolor" class="tui-input" placeholder="请填写" type="text" />
             </tui-list-cell>
             <!-- <tui-list-cell class="line-cell" :hover="false" :arrow="true">
               <div class="tui-title">消费记录</div>
@@ -73,10 +77,8 @@ import { mapGetters } from "vuex";
 import AppAvatarModule from "@/components/module/app-avatar";
 import TuiListCell from '@/components/plugin/list-cell'
 import { share } from "@/mixins";
-import {
-  getUserDet,
-  debt
-} from "@/api/member";
+import { getUserDet,debt} from "@/api/member";
+import { updateDebtLimit} from "@/api/custom";
 export default {
   name: "member-detail",
   components: {
@@ -87,6 +89,7 @@ export default {
   props: {},
   data() {
     return {
+					debtLimit:null,
       userInfo: {},
       form:{
         name:'',
@@ -121,6 +124,12 @@ export default {
   computed: {},
   onLoad() {},
   methods: {
+			//修改欠款额度
+  	amendMoney(){
+				updateDebtLimit({ id: this.option.id,debtLimit:this.debtLimit }).then(res => {
+					uni.showToast({title:'修改成功',icon: "none"});
+				});
+			},
     async remindChangeFn(e){
       this.form.debt = e.detail.value ? 1 : 0;
       try {
@@ -146,6 +155,7 @@ export default {
     },
     _getUserDet() {
       getUserDet({ id: this.option.id }).then(res => {
+        this.debtLimit = res.data.debtLimit;
         this.userInfo = res.data;
         this.form.debt = this.userInfo.debt
         this.orderData[0].value = this.userInfo.debtAmount