Răsfoiți Sursa

客户设置

shish 1 an în urmă
părinte
comite
3050781a99
3 a modificat fișierele cu 184 adăugiri și 1 ștergeri
  1. 178 0
      ghsApp/src/admin/custom/set.vue
  2. 5 1
      ghsApp/src/admin/home/member.vue
  3. 1 0
      ghsApp/src/pages.json

+ 178 - 0
ghsApp/src/admin/custom/set.vue

@@ -0,0 +1,178 @@
+<template>
+	<view class="app-content">
+		<form @submit="toSubmit">
+			<view class="module-com input-line-wrap">
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">客户可看库存</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.showStock == 0 ? false : true" @change="showStockChange" /> {{form.showStock==1 ? '可以' : '不要'}}
+					</view>
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">默认新客享受</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.isHd == 1 ? false : true" @change="isHdChange" /> {{form.isHd == 1 ? '批发价' : '零售价'}}
+					</view>
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">默认允许欠款</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.allowDebt == 0 ? false : true" @change="allowDebtChange" /> {{form.allowDebt==0 ? '不能' : '允许'}}
+					</view>
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false" v-if="form.allowDebt == 1">
+					<view class="tui-title ">默认欠款额度</view>
+					<input type="number" v-model="form.allowDebtAmount" @focus="form.allowDebtAmount=''" placeholder-class="phcolor" class="tui-input" name="allowDebtAmount" placeholder="请填写金额" />
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">默认新客要审</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.needCheck == 0 ? false : true" @change="needCheckChange" /> {{form.needCheck==0 ? '不要' : '需要'}}
+					</view>
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">客户可看销量</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.showSold == 0 ? false : true" @change="showSoldChange" /> {{form.showSold==1 ? '可以' : '不要'}}
+					</view>
+				</tui-list-cell>
+
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">线下开单超欠</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.overAllowDebt == 0 ? false : true" @change="overAllowDebtChange" /> {{form.overAllowDebt==1 ? '可以' : '不要'}}
+					</view>
+				</tui-list-cell>
+			</view>
+			<view class="confirm-btn">
+				<button class="admin-button-com big blue" formType="submit">提交</button>
+			</view>
+		</form>
+	</view>
+</template>
+<script>
+import TuiListCell from '@/components/plugin/list-cell'
+import AppAvatarModule from '@/components/module/app-avatar'
+import AppAreaSel from '@/components/app-area-sel'
+import AppUploader from "@/components/app-uploader";
+import { updateShop } from '@/api/shop'
+import {mapActions} from "vuex";
+import { getDetail } from "@/api/shop"
+export default {
+	name: 'set',
+	components: {
+		TuiListCell,
+		AppAvatarModule,
+		AppAreaSel,
+		AppUploader
+	},
+	data() {
+		return {
+			form: {
+				allowDebt:0,
+				needCheck:0,
+				allowDebtAmount:5000,
+				showStock:1,
+				showSold:0,
+				overAllowDebt:1,
+				isHd:1
+			}
+		}
+	},
+	onLoad() {
+
+	},
+	onShow() {
+	},
+	methods: {
+		init() {
+			this.getSetDetail()
+		},
+		getSetDetail() {
+            let id = 0
+            getDetail({shopId:id}).then(res=>{
+                let data = res.data.info
+                if (this.$util.isEmpty(data)){
+                    return
+                }
+                Object.keys(this.form).forEach((i, index) => {
+                    this.form[i] = data[i]
+                })
+            })
+		},
+		isHdChange(e){
+			this.form.isHd = e.target.value ? 0 : 1
+		},
+		showStockChange(e){
+			this.form.showStock = e.target.value ? 1 : 0
+		},
+		overAllowDebtChange(e){
+			this.form.overAllowDebt = e.target.value ? 1 : 0
+		},
+		showSoldChange(e){
+			this.form.showSold = e.target.value ? 1 : 0
+		},
+		allowDebtChange(e){
+			this.form.allowDebt = e.target.value ? 1 : 0
+		},
+		needCheckChange(e){
+			this.form.needCheck = e.target.value ? 1 : 0
+		},
+		toSubmit() {
+            this.$msg('开发中')
+            return false
+			uni.showLoading({mask:true})
+			updateShop(this.form).then(res => {
+				uni.hideLoading()
+				this.$msg('修改成功')
+				setTimeout(() => {
+					this.$util.pageTo(1)
+				}, 1000)
+			})
+		}
+	}
+}
+</script>
+<style lang="scss" scoped>
+	.app-content {
+		min-height: calc(100vh - 20upx);
+		padding-top:10upx;
+		padding-bottom:150upx;
+	}
+	.prompt-text {
+		color: $fontColor3;
+		padding-left: 30upx;
+		margin-bottom: 30upx;
+	}
+	.module-com {
+		.member-wrap {
+			.member-det {
+				font-size: 24upx;
+				margin-left: 20upx;
+			}
+		}
+		.remark-wrap {
+			align-items: flex-start;
+			.remark {
+				height: 180upx;
+			}
+		}
+	}
+	// 按钮
+	.confirm-btn {
+		position: fixed;
+		bottom: 0upx;
+		width: calc(100% - 60upx);
+		margin: 60upx 30upx 20upx;
+		background-color: white;
+		z-index: 999;
+		.admin-button-com {
+			width: 100%;
+		}
+	}
+</style>

+ 5 - 1
ghsApp/src/admin/home/member.vue

@@ -5,7 +5,8 @@
         <AppSearchModule placeholder="名称 / 手机尾号" @input="searchFn"/>
       </view>
       <view style="padding:0 10upx 0 20upx;" >
-        <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="showAllShop()">拉取客户</button>
+        <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="getSet()">设置</button>
+        <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="showAllShop()">拉取</button>
 				<button class="admin-button-com middle blue" @click="pageTo({ url: '/pagesClient/member/addCustomer' })">添加客户</button>
 			</view>
     </view>
@@ -152,6 +153,9 @@ export default {
   methods: {
     init(){
 
+    },
+    getSet(){
+      this.$util.pageTo({url: "/admin/custom/set"})
     },
     showAllShop () {
       this.$refs.shopSelectComponent.dropdownShow = true;

+ 1 - 0
ghsApp/src/pages.json

@@ -54,6 +54,7 @@
 		{
 			"root": "admin/custom",
 			"pages": [
+				{"path": "set","style": {"navigationBarTitleText": "设置"}},
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级标准"}},
 				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}},