Commit 9dd403aa by caoyanzhi

Merge branch 'feature/8月-奥莱定制' of http://git.gicdev.com/marketing-web/marketing…

Merge branch 'feature/8月-奥莱定制' of http://git.gicdev.com/marketing-web/marketing into feature/8月-奥莱定制
parents 676911cc 32fbc40f
......@@ -140,6 +140,13 @@ const requests = (url, data = {}, contentTypeIsJSON = false, isSilence = false,
reject(res);
if (res.data.message.indexOf('抱歉') >= 0) {
Vue.prototype.$alert(res.data.message, '提示');
} else if (res.data.errorCode == 170009) {
// return; //在核销记录的新增员工时 校验手机号重复后依然回调保存接口并弹出提示信息,为了去掉信息
if (res.data.message == '核销会员手机号已存在,无法重复添加') {
// return
} else {
handlerErr(res.data.errorCode, res.data.message);
}
} else {
handlerErr(res.data.errorCode, res.data.message);
}
......
......@@ -12,7 +12,7 @@
</el-form>
<span slot="footer">
<el-button @click="handleClose" :loading="loadings">取 消</el-button>
<el-button type="primary" @click="submit" :loading="loadings">确定</el-button>
<el-button type="primary" @click="submit('form')" :loading="loadings">确定</el-button>
</span>
</el-dialog>
</template>
......@@ -34,12 +34,12 @@ export default {
//验证手机号的正则表达式
let reg = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[3-8]{1})|(18[0-9]{1})|(19[0-9]{1})|(14[5-7]{1}))+\d{8})$/;
//验证方法
let validatorPhone = async (writeOffPhone, value, callback) => {
let validatorPhone = async (rule, value, callback) => {
if (value === '') {
callback(new Error('手机号不能为空'));
} else if (!reg.test(value)) {
callback(new Error('手机号格式错误'));
} else if (value) {
} else if (value != this.editPhone) {
await searchRePhone({ writeOffPhone: value }).then(res => {
if (res.errorCode == 0) {
if (!res.result) {
......@@ -65,7 +65,8 @@ export default {
rules: {
writeOffName: [{ required: true, message: '请输入员工姓名', trigger: 'blur' }],
writeOffPhone: [{ required: true, validator: validatorPhone, trigger: 'blur' }]
}
},
editPhone: ''
};
},
methods: {
......@@ -76,9 +77,9 @@ export default {
this.$emit('refresh');
});
},
submit() {
submit(form) {
this.loadings = true;
this.$refs.form.validate(valid => {
this.$refs[form].validate(async valid => {
if (valid) {
if (!this.form.writeOffStoreStaffId) {
delete this.form.writeOffStoreStaffId;
......@@ -86,16 +87,15 @@ export default {
let param = {
...this.form
};
setStraff(param)
await setStraff(param)
.then(res => {
this.$tips({ type: 'success', message: '操作成功' });
this.loading = false;
this.loadings = false;
this.handleClose();
return;
})
.catch(err => {
this.$tips({ type: 'error', message: err.message || '操作失败' });
this.loading = false;
// this.$tips({ type: 'error', message: err.data.message || '操作失败' });
this.loadings = false;
});
} else {
this.loadings = false;
......@@ -111,6 +111,7 @@ export default {
if (val.writeOffStoreStaffId) {
this.form.writeOffName = val.writeOffName;
this.form.writeOffPhone = val.writeOffPhone;
this.editPhone = val.writeOffPhone;
this.form.storeId = val.storeId;
this.form.writeOffStoreStaffId = val.writeOffStoreStaffId;
this.form.storeCode = val.storeCode;
......
......@@ -80,7 +80,7 @@ export default {
exportResult() {
this.dialogVisible = true;
this.excelUrl = 'api-marketing/export-card-write-off-store';
this.params = {
this.paramsex = {
search: this.params.search,
writeOffBeginTime: this.params.writeOffBeginTime,
writeOffEndTime: this.params.writeOffEndTime,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment