Commit 52d0802e by cwq0219

商户列表

1 parent daef1265
......@@ -11845,6 +11845,21 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha1-Mk2YprOvx+iolT4QZBUJsOTiP5c=",
"requires": {
"camelcase": "1.2.1"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
}
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "http://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
......@@ -12010,6 +12025,11 @@
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
"dev": true
},
"vee-validate": {
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-2.1.7.tgz",
"integrity": "sha512-IyPDTTvIRY6o9y14jXlgfY76Qv+hmvYDwNaMn9JY5KbQN8a1tJAu7H/+a/+EdHg1w8Zl9tsdG8lndGqY1lyMzQ=="
},
"vendors": {
"version": "1.0.2",
"resolved": "http://registry.npm.taobao.org/vendors/download/vendors-1.0.2.tgz",
......@@ -12040,6 +12060,14 @@
"resolved": "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz",
"integrity": "sha1-D4eJrXGL5oyhhyYpgy7VM1icato="
},
"vue-amap": {
"version": "0.5.8",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.8.tgz",
"integrity": "sha512-VWU6M58jAY4K80QGi+2tYWxvAszd/MQiWkBEYdyu2ptBHAgsNfZz2zxR1mWL32V74Q2bFoZz4yfOycMrQywlUA==",
"requires": {
"uppercamelcase": "1.1.0"
}
},
"vue-eslint-parser": {
"version": "2.0.3",
"resolved": "http://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz",
......
......@@ -4,6 +4,7 @@ import {
const path = '/oss-merchant-data/businessList'
const __sGetList = `${path}/findMerchantsRemote`
const __sSaveMerchant = `${path}/saveMerchantRemote`
const getList = {
p: [__sGetList],
......@@ -12,6 +13,14 @@ const getList = {
})
}
const saveMerchant = {
p: [__sSaveMerchant],
req: params => GlAxios.get(__sSaveMerchant, {
params
})
}
export {
getList
getList,
saveMerchant
}
......@@ -23,7 +23,8 @@ Vue.use(VeeValidate, {
digits: (field, data) => `${field}必须为数字,且长度必须等于${data[0]}`,
min_value: (field, data) => `${field}数值不能小于${data[0]}`,
max_value: (field, data) => `${field}数值不能大于${data[0]}`,
not_in: (field, data) => `${field}不能为${data.join(',')}`
not_in: (field, data) => `${field}不能为${data.join(',')}`,
is_phone: () => '请输入11位正确的手机号码'
}
}
},
......
import Vue from 'vue'
export default new Vue({
methods: {
warningTips(message) {
this.$notify({
type: 'warning',
title: message
})
},
okTips(message) {
this.$notify({
type: 'success',
title: message || '操作成功'
})
},
errorTips(message) {
this.$notify({
type: 'error',
title: message || '操作失败'
})
}
}
})
......@@ -8,17 +8,33 @@
:width="diaWidth"
>
<gl-form
:model="merchantForm"
label-width="85px"
:model="merchantForm"
:rules="rules"
>
<gl-form-item label="商户名称:">
<gl-input
v-model="merchantForm.name"
placeholder="请输入商户名称"
name="name"
data-vv-as="商户名称"
v-validate="'required'"
clearable
></gl-input>
<span v-show="errorBags.has('name')" class="error">{{ errorBags.first('name') }}</span>
</gl-form-item>
<gl-form-item label="商户地址:">
<gl-input
v-model="merchantForm.address"
placeholder="请输入详细地址"
name="address"
data-vv-as="详细地址"
v-validate="'required'"
clearable
>
</gl-input>
<span v-show="errorBags.has('address')" class="error">{{ errorBags.first('address') }}</span>
</gl-form-item>
<gl-form-item label="商户地址:"></gl-form-item>
<gl-form-item label="商户渠道:">
<gl-select
v-model="merchantForm.merchantChannel"
......@@ -29,15 +45,23 @@
<gl-input
v-model="merchantForm.contactor"
placeholder="请输入联系人姓名"
name="contactor"
data-vv-as="联系人姓名"
v-validate="'required'"
clearable
></gl-input>
<span v-show="errorBags.has('contactor')" class="error">{{ errorBags.first('contactor') }}</span>
</gl-form-item>
<gl-form-item label="手机号码:">
<gl-input
v-model="merchantForm.contactPhone"
placeholder="请输入联系人手机号码"
name="contactPhone"
data-vv-as="联系人手机号码"
v-validate="'required|is_phone'"
clearable
></gl-input>
<span v-show="errorBags.has('contactPhone')" class="error">{{ errorBags.first('contactPhone') }}</span>
</gl-form-item>
</gl-form>
<span slot="footer">
......@@ -52,11 +76,24 @@
</template>
<script>
const isPhone = {
validate: (value, args) => {
return value.length === 11 && /^((13|14|15|17|18)\d{9})$/.test(value)
}
}
export default {
name: 'AddDialog',
data() {
return {
title: '新增商户'
title: '新增商户',
// phoneFixed: 11,
rules: {
merchantName: [{ required: true }],
address: [{ required: true }],
merchantChannel: [{ required: true }],
contactor: [{ required: true }],
contactPhone: [{ required: true, isPhone: true }]
}
}
},
props: {
......@@ -70,13 +107,25 @@ export default {
},
merchantForm: Object
},
watch: {
isVisible() {
this.$validator.errors.clear()
}
},
mounted() {
this.$validator.extend('is_phone', isPhone)
},
methods: {
handleClose() {
this.$emit('hideDialog')
},
handleComfrim() {
this.$validator.validateAll().then((result) => {
if (result) {
this.$emit('comfirmDialog')
}
})
}
}
}
......
......@@ -44,7 +44,8 @@
<script>
import SearchDialog from './SearchDialog'
import AddDialog from './AddDialog'
import { getList } from '@/api/bussinessListApi'
import { getList, saveMerchant } from '@/api/bussinessListApi'
import notice from '@/common/notice'
export default {
name: 'businessList',
components: {
......@@ -69,6 +70,7 @@ export default {
merchantId: '',
provinceId: '',
cityId: '',
address: '',
merchantChannel: '',
merchantStatus: '',
startTime: '',
......@@ -133,7 +135,8 @@ export default {
label: '详情',
type: 'text',
callback: (index, rows) => {
console.log(rows[index])
const url = encodeURI(`../../customer/businessDetails.html?id=${rows[index].merchantId}&name=${rows[index].merchantName}`)
location.href = url
}
}]
}
......@@ -160,9 +163,20 @@ export default {
this.reset(this.merchantSearch)
}).catch(err => {
console.log(err)
notice.errorTips()
this.reset(this.merchantSearch)
})
},
saveMerchant() {
saveMerchant.req(this.merchantForm).then(res => {
notice.okTips()
this.reset(this.merchantForm)
}).catch(err => {
console.log(err)
notice.errorTips()
this.reset(this.merchantForm)
})
},
// 接口请求-end
handleSizeChange(val) {
this.pageSize = val
......@@ -202,6 +216,7 @@ export default {
},
handleAddComfirm() {
this.handleAdd()
this.saveMerchant()
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!