重复用户添加
This commit is contained in:
parent
bf8563de9b
commit
2cc8c4a26a
@ -157,7 +157,8 @@
|
||||
const tagVal = ref('')
|
||||
const tagList = ref([])
|
||||
const form = ref({
|
||||
name: ''
|
||||
name: '',
|
||||
repeatConfirmationFlag: 0 //重复客户依旧添加 0否 1是
|
||||
})
|
||||
const type = ref('add')
|
||||
const errorType = ref('message')
|
||||
@ -355,19 +356,47 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
if (type.value == 'add') {
|
||||
await customerCreate(form.value)
|
||||
if (prePage().route == 'pages/customer/index') {
|
||||
prePage().$vm.isRefresh = true
|
||||
}
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
await customerUpdate(form.value)
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
// 提交
|
||||
const onSubmit = () => {
|
||||
if (type.value == 'add') {
|
||||
customerCreate(form.value).then(res => {
|
||||
if (prePage().route == 'pages/customer/index') {
|
||||
prePage().$vm.isRefresh = true
|
||||
}
|
||||
uni.navigateBack()
|
||||
}).catch(e => {
|
||||
if (e.data.code == 200012) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: e.data.msg,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
form.value.repeatConfirmationFlag = 1
|
||||
onSubmit()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
customerUpdate(form.value).then(res => {
|
||||
uni.navigateBack()
|
||||
}).catch(e => {
|
||||
if (e.data.code == 200012) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: e.data.msg,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
form.value.repeatConfirmationFlag = 1
|
||||
onSubmit()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user