|
@@ -10,11 +10,11 @@
|
|
<a-form id="components-form-demo-validate-other" ref="form" :form="form" @submit="handleSubmit">
|
|
<a-form id="components-form-demo-validate-other" ref="form" :form="form" @submit="handleSubmit">
|
|
<a-form-item label="手机号码" :label-col="{ span: 7 }" :wrapper-col="{ span: 12 }">
|
|
<a-form-item label="手机号码" :label-col="{ span: 7 }" :wrapper-col="{ span: 12 }">
|
|
<a-input
|
|
<a-input
|
|
- id="editUserPhoneModal-contactPhone"
|
|
|
|
|
|
+ id="editUserPhoneModal-mobile"
|
|
:maxLength="11"
|
|
:maxLength="11"
|
|
v-decorator="[
|
|
v-decorator="[
|
|
- 'formData.contactPhone',
|
|
|
|
- { initialValue: formData.contactPhone, rules: [{ required: true, message: '请输入负责人手机号!' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }] }
|
|
|
|
|
|
+ 'formData.mobile',
|
|
|
|
+ { initialValue: formData.mobile, rules: [{ required: true, message: '请输入手机号码!' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }] }
|
|
]"
|
|
]"
|
|
placeholder="请输入手机号码"
|
|
placeholder="请输入手机号码"
|
|
allowClear />
|
|
allowClear />
|
|
@@ -29,10 +29,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-// import {
|
|
|
|
-// supplierDetails,
|
|
|
|
-// saveSupplier
|
|
|
|
-// } from '@/api/shopSetting.js'
|
|
|
|
|
|
+import { updateMobile } from '@/api/userInfo.js'
|
|
export default {
|
|
export default {
|
|
name: 'EditUserPhoneModal',
|
|
name: 'EditUserPhoneModal',
|
|
props: {
|
|
props: {
|
|
@@ -40,63 +37,42 @@ export default {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
},
|
|
},
|
|
- userPhone: {
|
|
|
|
|
|
+ userId: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
- },
|
|
|
|
- itemData: {
|
|
|
|
- type: Object,
|
|
|
|
- default: function () {
|
|
|
|
- return {}
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
isShow: this.openUserPhoneMoadl,
|
|
isShow: this.openUserPhoneMoadl,
|
|
form: this.$form.createForm(this, { name: 'editUserPhoneModal' }),
|
|
form: this.$form.createForm(this, { name: 'editUserPhoneModal' }),
|
|
formData: {
|
|
formData: {
|
|
- contactPhone: '' // 手机号码
|
|
|
|
|
|
+ mobile: '' // 手机号码
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 查看详情
|
|
|
|
- // getPageInfo () {
|
|
|
|
- // supplierDetails({
|
|
|
|
- // id: this.itemId
|
|
|
|
- // }).then(res => {
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // // this.form.setFieldsValue({ 'formData': res.data })
|
|
|
|
- // this.form.setFieldsValue({ 'formData.name': res.data.name })
|
|
|
|
- // this.form.setFieldsValue({ 'formData.contactName': res.data.contactName })
|
|
|
|
- // this.form.setFieldsValue({ 'formData.simpleName': res.data.simpleName })
|
|
|
|
- // this.form.setFieldsValue({ 'formData.contactPhone': res.data.contactPhone })
|
|
|
|
- // this.form.setFieldsValue({ 'formData.remarks': res.data.remarks })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
// 点击保存;
|
|
// 点击保存;
|
|
handleSubmit (e) {
|
|
handleSubmit (e) {
|
|
- this.$router.push({ path: `/userInfo/userManageList/list` })
|
|
|
|
- // e.preventDefault()
|
|
|
|
- // const _this = this
|
|
|
|
- // this.form.validateFields((err, values) => {
|
|
|
|
- // if (!err) {
|
|
|
|
- // const formData = Object.assign({}, this.itemData, this.formData, values.formData)
|
|
|
|
- // formData.id = _this.itemId
|
|
|
|
- // saveSupplier(formData).then(res => {
|
|
|
|
- // console.log(res, 'rrrrrrrrr')
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // _this.$message.success(res.message)
|
|
|
|
- // _this.$emit('refresh')
|
|
|
|
- // setTimeout(function () {
|
|
|
|
- // _this.isShow = false
|
|
|
|
- // }, 300)
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ e.preventDefault()
|
|
|
|
+ const _this = this
|
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
|
+ if (!err) {
|
|
|
|
+ const formData = Object.assign({}, { id: this.userId }, this.formData, values.formData)
|
|
|
|
+ updateMobile(formData).then(res => {
|
|
|
|
+ console.log(res, 'rrrrrrrrr')
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ // _this.$emit('refresh')
|
|
|
|
+ _this.$router.push({ path: `/userInfo/userManageList/list` })
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ _this.isShow = false
|
|
|
|
+ }, 300)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -104,21 +80,13 @@ export default {
|
|
this.isShow = newValue
|
|
this.isShow = newValue
|
|
},
|
|
},
|
|
isShow (val) {
|
|
isShow (val) {
|
|
|
|
+ console.log(this.userId)
|
|
if (!val) {
|
|
if (!val) {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
} else {
|
|
} else {
|
|
this.form.resetFields()
|
|
this.form.resetFields()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // itemId (newValue, oldValue) {
|
|
|
|
- // console.log(newValue, '----------id')
|
|
|
|
- // if (newValue && this.isShow) {
|
|
|
|
- // this.titleText = '编辑'
|
|
|
|
- // this.getPageInfo(newValue)
|
|
|
|
- // } else {
|
|
|
|
- // this.titleText = '新增'
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|