From c36a033b53860a67286ca6653a871ef980731ad1 Mon Sep 17 00:00:00 2001 From: zhaoxiaoqiang Date: Sat, 15 May 2021 16:49:07 +0800 Subject: [PATCH] 店员门店管理 --- src/views/mine/stores/storeOprs-detail.vue | 167 +++----------- src/views/mine/stores/addClerk.vue | 110 ++++++++++ src/views/mine/stores/storeOprs.vue | 48 ++-- src/router/routes.js | 24 + src/views/mine/stores/stores-add.vue | 6 src/api/index.js | 7 src/views/mine/stores/stores.vue | 25 +- src/views/mine/toggle-identity.vue | 4 src/views/mine/stores/clerkdetail.vue | 151 +++++++++++++ src/views/mine/account/account-add.vue | 2 src/views/mine/stores/storeOprs-add.vue | 103 -------- 11 files changed, 382 insertions(+), 265 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 47527c6..2fbebf4 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -139,6 +139,9 @@ storeStoreList(data) { return $http.post('/store/storeList', data); }, + storeStorePersonList(data) { + return $http.post('/agency/userList', data); + }, //门店详情 storeDtl(data) { return $http.post('/store/dtl', data); @@ -151,7 +154,9 @@ storeAdd(data) { return $http.post('/store/add', data); }, - + agencyAddUser(data){ + return $http.post('/agency/addUser', data); + }, diff --git a/src/router/routes.js b/src/router/routes.js index a381988..7c73aa9 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -206,10 +206,11 @@ name:'stores-detail', component:()=>import("@/views/mine/stores/storeOprs-detail.vue") }, + // 店员详情 { - path:"/order/wxScore", - name:'order-wxScore', - component:()=>import("@/views/order/wxScore.vue") + path:"/mine/shopassistantDetail", + name:'shopassistantDetail', + component:()=>import("@/views/mine/stores/clerkdetail.vue") }, //和微分 { @@ -218,6 +219,23 @@ component:()=>import("@/views/old/store/wx-pay-score.vue") }, { + path:"/order/wxScore", + name:'order-wxScore', + component:()=>import("@/views/order/wxScore.vue") + }, + { + path:"/order/wxScore", + name:'order-wxScore', + component:()=>import("@/views/order/wxScore.vue") + }, + // 添加店员 + { + path:"/mine/shopassistant", + name:'shopassistant', + component:()=>import("@/views/mine/stores/addClerk.vue") + }, + + { path:"/wx-test-code", name:'wxTestCode', component:()=>import("@/views/old/store/wx-test-code.vue") diff --git a/src/views/mine/account/account-add.vue b/src/views/mine/account/account-add.vue index 33bd59d..5478d69 100644 --- a/src/views/mine/account/account-add.vue +++ b/src/views/mine/account/account-add.vue @@ -151,7 +151,7 @@ this.$api.userUpdate(this.form).then(res => { this.$notify("保存成功"); }) - .catch(err => {}); + .catch(err => {}); }, //冻结账号 freeze() { diff --git a/src/views/mine/stores/addClerk.vue b/src/views/mine/stores/addClerk.vue new file mode 100644 index 0000000..e9c1e42 --- /dev/null +++ b/src/views/mine/stores/addClerk.vue @@ -0,0 +1,110 @@ +<template> + <div class='addclerk_page'> + <NavTop title="添加店员" @click-left="backlast"></NavTop> + <div class="content"> + <div class="must-has-box"> + <van-field v-model="formData.name" label="店员姓名" placeholder="请输入店员姓名" /> + <van-field v-model="formData.mblNo" label="店员手机号" placeholder="请输入店员手机号" /> + </div> + <div class='tips'> + 该手机号作为登录用户名,密码将通过短信发送至手机 + </div> + <div class="must-has-box"> + <van-field v-model="formData.email" label="联系邮箱" placeholder="请输入联系邮箱" /> + </div> + <Button class='save_btn' @click="savePassworde">保存</Button> + </div> + </div> +</template> + +<script> +import { Cell, CellGroup,Toast ,Field } from "vant"; +export default { + name:'shopassistant', + components: { + Cell, + CellGroup, + Field, + }, + data() { + return { + formData:{ + mblNo:"", + name:"", + email:"" + } + }; + }, + created() { + + }, + mounted() { + + }, + methods: { + backlast(){ this.$router.go(-1);}, + savePassworde(){ + if(!this.formData.mblNo){ + Toast.fail('请输入手机号'); + return false + } + if(!this.formData.name){ + Toast.fail('请输入姓名'); + return false + } + if(!this.formData.email){ + Toast.fail('请输入邮箱'); + return false + } + this.$api.post('/store/addStoreClient',this.formData).then(res=>{ + Toast.success({ + message:'添加成功', + onClose:()=>{ + this.$router.go(-1) + } + }) + }) + } + } +}; +</script> + +<style scoped lang="less"> +.addclerk_page{ + background-color: #FAFAFC; + height: 100vh; + padding-top: 44px; + .content { + box-sizing: border-box; + padding: 16px 16px 21px; + .tit-class { + text-align: left; + color: #333; + font-size: 14px; + margin-left: 12px; + } + .maybe-has-box { + margin-bottom: 12px; + } + .must-has-box { + border-radius: 8px; + background: #fff; + .iconfont { + font-size: 18px; + } + } + } + .tips{ + color: #999999; + font-size: 12px; + margin-bottom: 20px; + text-align: left; + } + .save_btn{ + margin-top: 40px; + } + .van-field{ + border-radius: 8px; + } +} +</style> diff --git a/src/views/mine/stores/clerkdetail.vue b/src/views/mine/stores/clerkdetail.vue new file mode 100644 index 0000000..d3f1313 --- /dev/null +++ b/src/views/mine/stores/clerkdetail.vue @@ -0,0 +1,151 @@ +<template> + <div class='addclerk_page'> + <NavTop title="店员详情" @click-left="backlast"></NavTop> + <div class="content"> + <div class="must-has-box"> + <van-field v-model="formData.name" label="店员姓名" readonly placeholder="请输入店员姓名" /> + <van-field v-model="formData.mblNo" label="店员手机号" readonly placeholder="请输入店员手机号" /> + <van-field v-model="formData.email" label="联系邮箱" readonly placeholder="请输入联系邮箱" /> + </div> + <div class="must-has-box must-has-box-btn"> + <van-cell left title="停启用"> + <template #right-icon> + <van-switch v-model="checked" @change='changeStatus' active-color="#00B578" size="24" /> + </template> + </van-cell> + </div> + <!-- <Button class='save_btn' @click="savePassworde">保存</Button> --> + </div> + </div> +</template> + +<script> +import { Cell, CellGroup,Toast,Field,Switch } from "vant"; +import Vue from 'vue'; +Vue.use(Switch); +export default { + name:'', + components: { + Cell, + CellGroup, + Field, + }, + data() { + return { + formData:{ + mblNo:"", + name:"", + email:"" + }, + checked:false, + id:'' + }; + }, + computed: { + userInfo(){ + return this.$store.state.userInfo + } + }, + created() { + this.id =this.$route.query.id; + this.getDetail(this.$route.query.id); + }, + mounted() { + + }, + methods: { + backlast(){ this.$router.go(-1);}, + savePassworde(){ + if(!this.formData.mblNo){ + Toast.fail('请输入手机号'); + return false + } + if(!this.formData.name){ + Toast.fail('请输入姓名'); + return false + } + if(!this.formData.email){ + Toast.fail('请输入邮箱'); + return false + } + this.$api.post('/store/addStoreClient',this.formData).then(res=>{ + Toast.success({ + message:'添加成功', + onClose:()=>{ + this.$router.go(-1) + } + }) + }) + }, + getDetail(id){ + let {platId} = this.userInfo; + let data ={platId}; + data.mgrId = this.id*1; + this.$api.post('/store/storeClientDtl',data).then(res=>{ + this.formData =res.body; + res.body.status==1?this.checked =true:this.checked=false; + }) + }, + changeStatus(){ + let {platId} = this.userInfo; + let data ={platId}; + data.mgrId = this.id*1; + this.$api.post('/user/freezeMgr',data).then(res=>{ + Toast.success({ + message:this.checked?"已启用":"已停用", + }) + }) + } + } +}; +</script> + +<style scoped lang="less"> +.addclerk_page{ + background-color: #FAFAFC; + height: 100vh; + padding-top: 44px; + box-sizing: border-box; + .content { + box-sizing: border-box; + padding: 16px 16px 21px; + .tit-class { + text-align: left; + color: #333; + font-size: 14px; + margin-left: 12px; + } + .maybe-has-box { + margin-bottom: 12px; + } + .must-has-box { + border-radius: 8px; + background: #fff; + .iconfont { + font-size: 18px; + } + } + } + .tips{ + color: #999999; + font-size: 12px; + margin-bottom: 20px; + text-align: left; + } + .save_btn{ + margin-top: 40px; + } + .van-field{ + border-radius: 8px; + } + .van-cell__title{ + text-align: left; + } + .van-field__control{ + text-align: right; + } + .must-has-box-btn{ + margin-top: 12px; + } +} +</style> diff --git a/src/views/mine/stores/storeOprs-add.vue b/src/views/mine/stores/storeOprs-add.vue index 8b25316..9bd0f46 100644 --- a/src/views/mine/stores/storeOprs-add.vue +++ b/src/views/mine/stores/storeOprs-add.vue @@ -8,40 +8,17 @@ <v-navbar title="新增店员" fixed></v-navbar> <div class="cell-group"> - <v-cell v-model="form.storeName" :max="20" label='门店名称' icon='iconyonghu' placeholder='请输入门店名称'></v-cell> - <v-cell label='所在地区' icon='icondingwei' @click.native="isShowArea = true;" placeholder='请选择'> - <div slot="v-cell-right" class="flex-center-g"> - <div v-if="form.areaText">{{form.areaText}}</div> - <div v-else style="color: #a2a2a2">请选择 </div> - <svg class="icon" aria-hidden="true" style="width:18px;height:18px;fill:#999;"> - <use xlink:href="#iconyou"></use> - </svg> - </div> - </v-cell> - <v-cell v-model="form.dtlAddr" :max="30" label='详细地址' icon='icontishi' placeholder='请输入详细地址'></v-cell> - </div> - - <div class="cell-group"> - <v-cell v-model="form.priName" :max="6" label='负责人姓名' placeholder='请输入姓名'></v-cell> - <v-cell v-model="form.priMblNo" :max="11" type="tel" label='负责人手机号' placeholder='请输入手机号'></v-cell> - <v-cell v-model="form.priIdNo" :max="18" label='负责人身份证号' placeholder='请输入身份证号'></v-cell> - <v-cell v-model="form.outChanNo" :max="20" label='渠道编码' placeholder='请输入渠道编码'></v-cell> + <v-cell v-model="form.priName" :max="6" label='负责人姓名' placeholder='请输入负责人姓名'></v-cell> + <v-cell v-model="form.priMblNo" :max="11" type="tel" label='负责人手机号' placeholder='请输入负责人手机号'></v-cell> </div> <p class="tip">*该手机号将作为登录用户名,密码将通过短信发至手机</p> - <div class="cell-group"> <v-cell v-model="form.priEmail" :max="50" label='联系邮箱' placeholder='请输入邮箱地址'></v-cell> </div> <footer class="flex-center-g footer"> - <van-button class="btn" @click="addStore">新增门店</van-button> + <van-button class="btn" @click="addStore">新增店员</van-button> </footer> - - - <van-popup v-model="isShowArea" position="bottom" :close-on-click-overlay="false"> - <van-area ref='Area' :area-list='areaList' @cancel="closeAreaModal" @confirm="setAreaValue"></van-area> - </van-popup> - </div> </template> @@ -51,33 +28,20 @@ name: "stores-add", data(){ return { + queryStoreId:"", isShowArea:false, Btn:false, - form:{ - areaText:'', //地区文字展示 - storeName:'', //门店名称 - dtlAddr:'', //详细地址 priName:'', //负责人姓名 priEmail:'', //联系邮箱 priMblNo:'', //负责人手机 - priIdNo: '', //身份证号 - provCode: '', - cityCode: '', - areaCode: '', - outChanNo: '', }, rule:[ - {key:"storeName",message:"请输入门店名称",type:"isEmpty"}, - {key:"areaText",message:"请选择地址",type:"isEmpty"}, - {key:"dtlAddr",message:"请输入详细地址",type:"isEmpty"}, {key:"priName",message:"请输入负责人姓名",type:"isEmpty"}, {key:"priName",message:"请输入正确的负责人姓名",rule:/^[\u4e00-\u9fa50-9a-zA-Z]{1,6}$/}, {key:"priMblNo",message:"请输入负责人手机号",type:"isEmpty"}, {key:"priMblNo",message:"请输入正确的手机号",type:"isTel"}, - {key:"priIdNo",message:"请输入负责人身份证号",type:"isEmpty"}, - {key:"priIdNo",message:"请输入正确的身份证号",type:"checkIDCard"}, {key:"priEmail",message:"请输入联系邮箱",type:"isEmpty"}, {key:"priEmail",message:"请输入正确的联系邮箱",type:"isEmail"}, ] @@ -88,78 +52,31 @@ ...mapState(['areaList']) }, created() { + this.queryStoreId =this.$route.query.storeId; }, methods:{ // 验证form参数 validatorForm(){ - let v = this.$tool; - if(v.checkValEmpty(this.form.outChanNo)){ - v.toast('请输入渠道编码'); - return false; - } return this.$validator(this.form,this.rule).check(item=>{ this.$notify(item.message) }) }, - - //关闭地区弹窗 - closeAreaModal(){ - this.isShowArea = false; - this.$refs.Area.reset() - }, - - //保存 地区选择 - setAreaValue(arr){ - this.form.areaText = arr[0].name + '-' +arr[1].name +'-'+ arr[2].name; - this.form.provCode= arr[0].code; - this.form.cityCode= arr[1].code; - this.form.areaCode= arr[2].code; - this.form.provName= arr[0].name; - this.form.cityName= arr[1].name; - this.form.areaName= arr[2].name; - this.isShowArea = false; - this.$refs.Area.reset() - }, - - // 新增门店 addStore(){ if(!this.validatorForm()) return if(this.Btn)return let list = { - storeName: this.form.storeName, - addr:{ - province:{ - code:this.form.provCode, - name:this.form.provName - }, - city:{ - code:this.form.cityCode, - name:this.form.cityName - }, - area:{ - code:this.form.areaCode, - name:this.form.areaName - }, - dtlAddr:this.form.dtlAddr - }, - priName: this.form.priName, - priMblNo: this.form.priMblNo, - priEmail: this.form.priEmail, - priIdNo: this.form.priIdNo, - outChanNo: this.form.outChanNo, + name: this.form.priName, + mblNo: this.form.priMblNo, + email: this.form.priEmail, + orgId:this.queryStoreId }; - - this.$api.storeAdd(list).then(() => { + this.$api.agencyAddUser(list).then(() => { this.$notify('新增成功'); this.Btn = true; setTimeout(() => this.$router.go(-1), 1000); }); } - - - - } } </script> diff --git a/src/views/mine/stores/storeOprs-detail.vue b/src/views/mine/stores/storeOprs-detail.vue index dd29042..1fb2eee 100644 --- a/src/views/mine/stores/storeOprs-detail.vue +++ b/src/views/mine/stores/storeOprs-detail.vue @@ -2,36 +2,14 @@ <div class="stores-detail h-100-g"> <v-navbar title="店员详情" fixed rightText='保存' @right-click="Save"></v-navbar> - - <div class="cell-group"> - <v-cell v-model="form.storeName" :max="20" label='门店名称' :readonly="true" icon='iconyonghu' placeholder='门店名称'></v-cell> - <v-cell label='所在地区' icon='icondingwei' placeholder='所在地区' @click.native="isShowArea = true;"> - <div slot="v-cell-right" class="flex-center-g"> - <div>{{form.areaText}}</div> - <svg class="icon" aria-hidden="true" style="width:18px;height:18px;fill:#999;"> - <use xlink:href="#iconyou"></use> - </svg> - </div> - </v-cell> - <v-cell v-model="form.dtlAddr" :max="30" label='详细地址' icon='icontishi' placeholder='详细地址'></v-cell> - </div> - - <div class="cell-group"> <v-cell v-model="form.priName" :max="6" label='负责人姓名' :readonly="true" placeholder='负责人姓名'></v-cell> <v-cell v-model="form.priMblNo" :max="11" type="tel" label='负责人手机号' :readonly="true" placeholder='负责人手机号'></v-cell> - <v-cell v-model="form.priEmail" :max="50" label='联系邮箱' :readonly="true" placeholder='联系邮箱'></v-cell> - <v-cell v-model="form.priIdNo" :max="18" label='负责人身份证号' :readonly="true" placeholder='负责人身份证号'></v-cell> - <v-cell v-model="form.outChanNo" :max="18" label='渠道编码' :readonly="true" placeholder='渠道编码'></v-cell> + <v-cell v-model="form.priEmail" :max="50" label='联系邮箱' placeholder='联系邮箱'></v-cell> </div> - - - <footer class="flex-center-g footer"> - <van-button class="btn left" @click="freeze">{{ menText }}</van-button> - <van-button class="btn right" @click="$router.push('/order/wxScore')">订单查询</van-button> - </footer> - - + <footer class="flex-center-g footer"> + <van-button class="btn" @click="freeze">{{menText}}</van-button> + </footer> <van-dialog class="setting-box-dialog" v-model="dialogShow" @@ -40,12 +18,6 @@ @confirm="onConfirm" > </van-dialog> - - - <van-popup v-model="isShowArea" position="bottom" :close-on-click-overlay="false"> - <van-area ref='Area' :area-list='areaList' @cancel="closeAreaModal" @confirm="setAreaValue"></van-area> - </van-popup> - </div> </template> @@ -57,128 +29,78 @@ return { isShowArea:false, dialogShow:false, - menText:'', + menText:'冻结店员', Status:null, Msg:'', Btn:false, - form:{ - areaText:'',//地区文字展示 - storeName:'', //门店名称 - dtlAddr:'', //详细地址 priName:'', //负责人姓名 priEmail:'', //联系邮箱 - priMblNo:'', //负责人手机 - priIdNo:'', //负责人身份证号 - provCode: '', - cityCode: '', - areaCode: '', - outChanNo:'', + priMblNo:'', //负责人手机号 }, - rule:[ - {key:"dtlAddr",message:"请输入详细地址",type:"isEmpty"}, + {key:"priEmail",message:"请输入邮箱",type:"isEmpty"}, ] } - }, - computed:{ - ...mapState(['areaList']) }, created(){ this.init(); }, methods:{ init(){ - this.$api.storeDtl({storeId: this.$route.query.storeId}).then((res) => { - let data = res.body, - addr = data.addr; - this.Status = data.freezeStatus; - data.freezeStatus ? this.menText = '冻结门店':this.menText = '启用门店'; + let mgrId =this.$route.query.mgrId; + this.$api.getUserDetail(mgrId).then((res) => { + let data = res.body; + this.Status = data.status; + data.status ? this.menText = '冻结店员':this.menText = '启用店员'; this.form = { - areaText:addr.province.name + '-' + addr.city.name + '-' + addr.area.name, //地区文字展示 - storeName:data.storeName, //门店名称 - dtlAddr:addr.dtlAddr, //详细地址 - priName:data.priName, //负责人姓名 - priEmail:data.priEmail, //联系邮箱 - priMblNo:data.priMblNo, //负责人手机 - priIdNo:data.priIdNo, //负责人身份证号 - provCode: addr.province.code, - cityCode: addr.city.code, - areaCode: addr.area.code, - provName:addr.province.name, - cityName:addr.city.name, - areaName:addr.area.name, - outChanNo:data.outChanNo + priName:data.name, //负责人姓名 + priEmail:data.email, //联系邮箱 + priMblNo:data.mblNo //负责人手机 } }) }, - - freeze(){ this.dialogShow = !this.dialogShow; - this.Msg = `请问是否确认${this.Status ? '冻结' : '启用'}该门店?`; + this.Msg = `请问是否确认${this.Status ? '冻结' : '启用'}该店员?`; }, - //冻结/启用 门店 onConfirm() { if(this.Btn2){return} this.Btn2 = true; - this.$api.channSwitchStatus({ - orgId: this.$route.query.storeId, - orgType: 4, - statusType: this.Status ? 0 : 1 - }) - .then((res) => { + this.$api.userFreezeMgr(this.$route.query.mgrId).then((res) => { this.Btn2 = false; - this.$notify_success(`${ this.Status ? '冻结' : '启用'}门店成功`) + this.$notify_success(`${ this.Status ? '冻结' : '启用'}店员成功`) this.Status = this.Status ? 0 : 1; - this.menText = this.Status ? '冻结门店' :'启用门店'; + this.menText = this.Status ? '冻结店员' :'启用店员'; }); }, - - // 保存门店 Save(){ if(this.Btn){return} this.Btn = true; let list = { - addr:{ - province:{ - code:this.form.provCode, - name:this.form.provName - }, - city:{ - code:this.form.cityCode, - name:this.form.cityName - }, - area:{ - code:this.form.areaCode, - name:this.form.areaName - }, - dtlAddr:this.form.dtlAddr - }, - storeId:this.$route.query.storeId + name: this.form.priName, + mblNo: this.form.priMblNo, + email: this.form.priEmail, + orgId:this.queryStoreId, + id:this.$route.query.mgrId }; - - if(this.$validator(list.addr,this.rule).check(item=>{ + if(this.$validator(this.form,this.rule).check(item=>{ this.$notify(item.message); })){ - this.$api.storeEdit(list).then((res) => { + this.$api.userUpdate(list).then((res) => { this.Btn = false; this.$notify_success('保存成功!'); - }); + }); } }, - - - //关闭地区弹窗 closeAreaModal(){ this.isShowArea = false; this.$refs.Area.reset() }, - //保存 地区选择 setAreaValue(arr){ this.form.areaText = arr[0].name + '-' +arr[1].name +'-'+ arr[2].name; @@ -204,33 +126,22 @@ margin: 10px 8px 0; } + .btn { + width: 340px; + height: 44px; + border: none; + font-size: @font-16; + border-radius: 22px; + background-color: @c-bg-default; + color: @c-text-fff; - - - - - .footer{ - margin-top: 60px; - padding-bottom: 30px; - .btn{ - width: 170px; - height: 44px; - border: none; - font-size: @font-16; - &.left{ - background-color: @c-bg-eee; - color: @c-text-666; - border-radius:22px 0px 0px 22px; - } - &.right{ - background-color: @c-bg-default; - color: @c-text-fff; - border-radius:0px 22px 22px 0px; - } - } } +.footer { + margin-top: 60px; + padding-bottom: 30px; +} } </style> diff --git a/src/views/mine/stores/storeOprs.vue b/src/views/mine/stores/storeOprs.vue index 54c58df..bc25800 100644 --- a/src/views/mine/stores/storeOprs.vue +++ b/src/views/mine/stores/storeOprs.vue @@ -5,9 +5,8 @@ --> <template> <div class="stores-box h-100-g"> - <v-navbar title="店员管理" fixed></v-navbar> - <van-search class="search" placeholder="请输入门店名称/负责人姓名/负责人手机号" v-model="value" shape='round' @search="onSearch"/> + <van-search class="search" placeholder="负责人姓名/负责人手机号" v-model="value" shape='round' @search="onSearch"/> <div class="item-box"> <van-list v-model="loading" @@ -17,28 +16,25 @@ finished-text="没有更多了" @load="onLoad" > - <div class="stores-item flex-start-g" v-for="(item, index) in list" :key="index" @click="go(item.storeId)"> + <div class="stores-item flex-start-g" v-for="(item, index) in list" :key="index" @click="go(item.id)"> <p class="icon-box flex-center-g"> <svg class="icon" aria-hidden="true" style="width:25px;height:25px;fill:#fff" > <use xlink:href="#iconyonghu"></use> </svg> </p> <div> - <p class="name" v-text="item.storeName || ''">店员名称</p> - <p class="c-text-666-g font-12-g" v-text="item.priMblNo || ''">13586695442</p> + <p class="name" v-text="item.name || ''">店员名称</p> + <p class="c-text-666-g font-12-g" v-text="item.mblNo || ''">13586695442</p> </div> </div> </van-list> </div> - - <van-button class="btn" @click="$router.push('/mine/stores-add')"> + <van-button class="btn" @click="goAdd"> <div class="inner"> <van-icon name="plus"/> <span class="text">新增</span> </div> </van-button> - - </div> </template> @@ -51,55 +47,59 @@ list:[], loading:false, finished:false, - storeId:'' + storeId:'', + queryStoreId:"" } }, created(){ + this.queryStoreId =this.$route.query.storeId; this.init(); }, methods: { init(){ this.loading = true - this.$api.storeStoreList({ + this.$api.storeStorePersonList({ searchKey:this.value, - storeId:this.storeId, + orgId:this.queryStoreId, }).then((res) => { - if(res.body.storeList.length < 10){ - this.list = [...this.list,...res.body.storeList] + if(res.body.length < 10){ + this.list = [...this.list,...res.body] this.storeId = '' this.finished = true this.loading = false }else{ - this.list = [...this.list,...res.body.storeList] + this.list = [...this.list,...res.body] this.storeId = this.list[this.list.length-1].storeId this.finished = false this.loading = false } }) }, - - go(id) { - this.$router.push({path:'/mine/stores-detail',query:{storeId:id}}); + this.$router.push({path:'/mine/storeOprs-detail',query:{mgrId:id,storeId:this.queryStoreId}}); }, - + goAdd(){ + console.log(this.storeId) + this.$router.push({path:'/mine/storeOprs-add',query:{storeId:this.queryStoreId}}) + }, onLoad(){ this.init() }, onSearch(val){ this.list = [] this.loading = true - this.$api.storeStoreList({ + this.$api.storeStorePersonList({ searchKey:this.value, + orgId:this.queryStoreId, }).then(res=>{ - if(res.body.storeList.length < 10){ - this.list = [...this.list,...res.body.storeList] + if(res.body.length < 10){ + this.list = [...this.list,...res.body] this.storeId = '' this.finished = true this.loading = false }else{ - this.list = [...this.list,...res.body.storeList] + this.list = [...this.list,...res.body] this.storeId = this.list[this.list.length-1].storeId this.finished = false this.loading = false @@ -117,7 +117,7 @@ background-color: @c-bg-f5; padding-top: 44px; - + box-sizing: border-box; .btn { position: fixed; width: 50px; diff --git a/src/views/mine/stores/stores-add.vue b/src/views/mine/stores/stores-add.vue index 701c517..d0d8376 100644 --- a/src/views/mine/stores/stores-add.vue +++ b/src/views/mine/stores/stores-add.vue @@ -53,7 +53,6 @@ return { isShowArea:false, Btn:false, - form:{ areaText:'', //地区文字展示 storeName:'', //门店名称 @@ -88,6 +87,7 @@ ...mapState(['areaList']) }, created() { + this.merId = this.$route.query.merId; }, methods:{ // 验证form参数 @@ -149,7 +149,9 @@ priIdNo: this.form.priIdNo, outChanNo: this.form.outChanNo, }; - + if(this.merId){ + list.merId = this.merId; + } this.$api.storeAdd(list).then(() => { this.$notify('新增成功'); this.Btn = true; diff --git a/src/views/mine/stores/stores.vue b/src/views/mine/stores/stores.vue index 567da8c..e5f00d7 100644 --- a/src/views/mine/stores/stores.vue +++ b/src/views/mine/stores/stores.vue @@ -5,7 +5,6 @@ --> <template> <div class="stores-box h-100-g"> - <v-navbar title="门店管理" fixed></v-navbar> <van-search class="search" placeholder="请输入门店名称/负责人姓名/负责人手机号" v-model="value" shape='round' @search="onSearch"/> <div class="item-box"> @@ -32,7 +31,7 @@ </van-list> </div> - <van-button class="btn" @click="$router.push('/mine/stores-add')"> + <van-button class="btn" @click="$router.push(`/mine/stores-add?merId=${merId}`)"> <div class="inner"> <van-icon name="plus"/> <span class="text">新增</span> @@ -83,17 +82,14 @@ } }) }, - - //跳转到模板详情 - goStoreOprs(merId){ - this.$router.push({ - path:'/mine/storesOprs', - query:{ - storeId:this.storeId - } - }) - }, - + goStoreOprs(storeId){ + this.$router.push({ + path:'/mine/storesOprs', + query:{ + storeId:storeId + } + }) + }, go(id) { this.$router.push({path:'/mine/stores-detail',query:{storeId:id}}); }, @@ -188,6 +184,9 @@ margin-bottom: 5px; font-weight: bold; width:200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .opr-btn { diff --git a/src/views/mine/toggle-identity.vue b/src/views/mine/toggle-identity.vue index 326eea0..b0c8ed3 100644 --- a/src/views/mine/toggle-identity.vue +++ b/src/views/mine/toggle-identity.vue @@ -155,8 +155,12 @@ } .name { + width: 200px; font-size: @font-16; font-weight: bold; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .time { -- Gitblit v1.8.0