/div>

No Description

setting-dealer-editor.vue 3.1KB

    <template> <div class="setting-dealer-editor"> <el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form-item label="经销商名称" prop="distributor_name"> <el-input placeholder="请输入经销商名称" v-model="form.distributor_name"></el-input> </el-form-item> <el-form-item label="经销商省份" prop="province_name"> <el-select v-model="form.province_name" placeholder="请选择经销商省份"> <el-option v-for="province in provinces" :key="province.name" :value="province.name"></el-option> </el-select> </el-form-item> <el-form-item> <el-button type="primary" @click="onSubmit('form')">保存</el-button> </el-form-item> </el-form> </div> </template> <script> import axios from 'axios' export default { data () { return { form: { distributor_id: '', distributor_name: '', province_code: '', province_name: '' }, provinces: [], rules: { distributor_name: [ { required: true, message: '请输入经销商名称', trigger: 'blur' } ], province_name: [ { required: true, message: '请选择经销商区域', trigger: 'change' } ] } } }, created () { if (this.$route.params.distributor_id !== undefined) { this.form = this.$route.params } var self = this axios('/web_static/provinces.json').then( (response) => { self.$nextTick(function () { self.provinces = response.data }) } ) }, methods: { onSubmit (formName) { this.$refs[formName].validate((valid) => { if (valid) { for (var province in this.provinces) { if (province.name === this.form.province_name) { this.form.province_code = province.id } } var self = this if (this.form.distributor_id.length !== 0) { this.$axios.post('distributor/update', this.form) .then(function (response) { if (response.data.status === 200) { self.$message({ type: 'success', message: '修改成功!' }) self.$router.back() } else { self.$message({ type: 'failure', message: '修改失败!' }) } }) } else { this.$axios.post('distributor/add', this.form) .then(function (response) { if (response.data.status === 200) { self.$message({ type: 'success', message: '添加成功!' }) self.$router.back() } else { self.$message({ type: 'failure', message: '添加失败!' }) } }) } } else { return false } }) } } } </script> <style scoped lang="scss"> .setting-dealer-editor { width: 500px; margin: 0 auto; } </style>
kodo - Gogs: Go Git Service

Nenhuma Descrição

huangqimin: 3d0d214667 :sparkles: Member Infos 7 anos atrás
..
0001_initial.py 4defb80fdc gogs first init 11 anos atrás
0002_auto_20151202_2251.py 434468279f add api of lesman login & update other api 11 anos atrás
0003_auto_20151202_2313.py 434468279f add api of lesman login & update other api 11 anos atrás
0004_auto_20151207_1811.py 4a8b4f8819 add watermark 11 anos atrás
0005_auto_20151209_1638.py 3454610bb7 add api of user signup/login 11 anos atrás
0006_auto_20151223_1533.py 5ef425fee7 add api wx_authorize_api 10 anos atrás
0007_auto_20160120_1830.py a121b75ff2 add db_index=True for status field 10 anos atrás
0008_userinfo_unionid.py 8aeca53563 record unionid for wx_authorize user 10 anos atrás
0009_auto_20160428_1410.py 269576f8b9 add guest user 10 anos atrás
0010_userinfo_uuid.py 63eaee0951 modify guest_login_api 10 anos atrás
0011_auto_20160627_1411.py 6d6c8485ce bind LensmanInfo and UserInfo 10 anos atrás
0012_auto_20160627_1419.py 6d6c8485ce bind LensmanInfo and UserInfo 10 anos atrás
0013_auto_20160711_1436.py d0affd4b01 add lensman_oauth page 10 anos atrás
0014_lensmaninfo_refused_reason.py 30d24179d9 add refused relative 10 anos atrás
0015_auto_20160713_1646.py 30d24179d9 add refused relative 10 anos atrás
0016_auto_20160718_1258.py c7071ae7f1 wx_uid to openid 10 anos atrás
0017_auto_20160908_1053.py 4fdd237863 add api price_fix 10 anos atrás
0018_auto_20161020_1844.py e249360c0c Add freeze_balance for lensman/user 10 anos atrás
0019_auto_20161024_1235.py c7abce172a Rename field name 10 anos atrás
0020_tourguideinfo.py 8a213207ea Add tour guide oauth 9 anos atrás
0021_auto_20161213_1639.py 8a213207ea Add tour guide oauth 9 anos atrás
0022_auto_20170212_2153.py c3e3681541 Create user in api get_userinfo_api for weapp 9 anos atrás
0023_auto_20170709_1923.py d38cc6ceb2 Add multi openid for UserInfo & Change create order support miniapp 9 anos atrás
0024_auto_20170917_1825.py a6195fa70d Add outtake lensman 9 anos atrás
0025_auto_20180101_2220.py 9bb56c50cc Makemigrations 8 anos atrás
0026_auto_20180103_0446.py a7cbbf15a7 Update max_length for CharField 8 anos atrás
0027_franchiserinfo_saleclerkinfo.py 627187a7d7 Update Kodo 8 anos atrás
0028_saleclerkinfo_total_integral.py 2bac598d19 Clerk Sale Submit 8 anos atrás
0029_userinfo_has_membercard.py 852e8b89b5 Has Member Card Flag 8 anos atrás
0030_userinfo_membercardid.py 4bfdba3718 MemberCardID 8 anos atrás
0031_auto_20180417_1031.py e47aa7f8c4 Add field test_user 8 anos atrás
0032_delete_saleclerkinfo.py e7dcf47e22 SaleclerkInfo 8 anos atrás
0033_delete_franchiserinfo.py 619711142e Makemigrations 8 anos atrás
0034_auto_20180930_1159.py 66a598b30c Makemigrations 8 anos atrás
0035_auto_20181006_1142.py 69f5e16982 Makemigrations 8 anos atrás
0036_auto_20190826_1537.py 8d998319f7 Makemigrations 7 anos atrás
0037_auto_20191119_1348.py 3d0d214667 :sparkles: Member Infos 7 anos atrás
__init__.py 4defb80fdc gogs first init 11 anos atrás