| New file |
| | |
| | | |
| | | <!-- |
| | | 新增门店 |
| | | --> |
| | | |
| | | <template> |
| | | <div class="stores-add-box h-100-g"> |
| | | |
| | | <v-navbar title="新增店员" fixed></v-navbar> |
| | | <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> |
| | | </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> |
| | | </footer> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex'; |
| | | export default { |
| | | name: "stores-add", |
| | | data(){ |
| | | return { |
| | | queryStoreId:"", |
| | | isShowArea:false, |
| | | Btn:false, |
| | | form:{ |
| | | priName:'', //负责人姓名 |
| | | priEmail:'', //联系邮箱 |
| | | priMblNo:'', //负责人手机 |
| | | }, |
| | | |
| | | rule:[ |
| | | {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:"priEmail",message:"请输入联系邮箱",type:"isEmpty"}, |
| | | {key:"priEmail",message:"请输入正确的联系邮箱",type:"isEmail"}, |
| | | ] |
| | | |
| | | } |
| | | }, |
| | | computed:{ |
| | | ...mapState(['areaList']) |
| | | }, |
| | | created() { |
| | | this.queryStoreId =this.$route.query.storeId; |
| | | }, |
| | | methods:{ |
| | | // 验证form参数 |
| | | validatorForm(){ |
| | | return this.$validator(this.form,this.rule).check(item=>{ |
| | | this.$notify(item.message) |
| | | }) |
| | | }, |
| | | // 新增门店 |
| | | addStore(){ |
| | | if(!this.validatorForm()) return |
| | | if(this.Btn)return |
| | | let list = { |
| | | name: this.form.priName, |
| | | mblNo: this.form.priMblNo, |
| | | email: this.form.priEmail, |
| | | orgId:this.queryStoreId |
| | | }; |
| | | this.$api.agencyAddUser(list).then(() => { |
| | | this.$notify('新增成功'); |
| | | this.Btn = true; |
| | | setTimeout(() => this.$router.go(-1), 1000); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .stores-add-box{ |
| | | background-color: @c-bg-f5; |
| | | padding-top: 44px; |
| | | .tip { |
| | | margin: 10px 0 15px 21px; |
| | | font-size: @font-12; |
| | | color: @c-text-999; |
| | | } |
| | | } |
| | | |
| | | |
| | | .cell-group { |
| | | 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; |
| | | } |
| | | |
| | | |
| | | </style> |