Commit f66f4c28 by 张权

第三轮bug回归

1 parent 498064e8
<!-- 编辑礼包 --> <!-- 编辑礼包 -->
<template> <template>
<div v-if="isLoaded" class="edit-gift marketing p-t-20 edit-box"> <div class="edit-gift marketing p-t-20 edit-box">
<div v-if="routeInfo.addOrEdit != 'add'" class="container approval-container"> <div v-if="routeInfo.addOrEdit != 'add'" class="container approval-container">
<p class="edit-title">审批信息</p> <p class="edit-title">审批信息</p>
<div class="approval-info"> <div class="approval-info">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</div> </div>
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div> <div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div>
<el-button slot="selectGiftBtn" :disabled="routeInfo.receivedStock" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button> <el-button slot="selectGiftBtn" :disabled="routeInfo.receivedStock" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': labelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0"> <div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': labelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
...@@ -113,6 +113,7 @@ export default { ...@@ -113,6 +113,7 @@ export default {
return { return {
phone: '', phone: '',
isLoaded: true, isLoaded: true,
loading:false,
phoneList: [], phoneList: [],
size: 'small', size: 'small',
title: '新增礼包', title: '新增礼包',
...@@ -412,7 +413,10 @@ export default { ...@@ -412,7 +413,10 @@ export default {
this.editForm.stock = e.replace(/^(0+)|[^\d]+/g, '') this.editForm.stock = e.replace(/^(0+)|[^\d]+/g, '')
}, },
delPhone(val) { delPhone(val) {
let phone = this.phone.replace(new RegExp('[\n]*' + val + '[\n]*', 'g'), '\n') let phone = '\n' + this.phone + '\n'
phone = phone.replace(/[\n]/g, '\n\n')
phone = phone.replace(new RegExp('[\n]'+ val + '[\n]', 'g'), '\n')
phone = phone.replace(/[\n]+/g, '\n')
phone = phone.replace(/^[\n]+/, '') phone = phone.replace(/^[\n]+/, '')
this.phone = phone this.phone = phone
this.formatPhone() this.formatPhone()
...@@ -438,6 +442,7 @@ export default { ...@@ -438,6 +442,7 @@ export default {
}, },
getInfo() { getInfo() {
this.isLoaded = false this.isLoaded = false
this.loading = true
this.$apis.giftBag this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id }) .getGiftInfoApi({ id: this.routeInfo.id })
.then(res => { .then(res => {
...@@ -604,6 +609,10 @@ export default { ...@@ -604,6 +609,10 @@ export default {
}) })
if (this.editForm.receiveRule == 1) { if (this.editForm.receiveRule == 1) {
params.receiveDetailList = this.phoneList.map(item => item.tel) params.receiveDetailList = this.phoneList.map(item => item.tel)
let maxLength = 250
if(params.receiveDetailList && params.receiveDetailList.length > maxLength){
return this.$message.error(`领取${this.receiveWay == 1 ? '手机号' : '车架号'}不能超过${maxLength}个`)
}
params.receiveWay = this.receiveWay params.receiveWay = this.receiveWay
} }
delete params.staffList delete params.staffList
...@@ -641,7 +650,7 @@ export default { ...@@ -641,7 +650,7 @@ export default {
}, },
// 创建-更新接口 // 创建-更新接口
insertHttp(params) { insertHttp(params) {
this.loading = true // this.loading = true
this.$apis.giftBag this.$apis.giftBag
.insertGiftApi(params) .insertGiftApi(params)
.then(res => { .then(res => {
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span> <span v-if="editForm.receiveRule == 2 && editForm.receiveWay">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span> <span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<div v-if="editForm.receiveRule == 1" class="phone-wrap"> <div v-if="editForm.receiveRule == 1" class="phone-wrap">
<span class="phone" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span> <span :class="['phone',editForm.receiveWay==1?'realTel':'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div> </div>
</div> </div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0"> <div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
...@@ -343,6 +343,12 @@ export default { ...@@ -343,6 +343,12 @@ export default {
display: inline-block; display: inline-block;
margin: 5px 16px 5px 0; margin: 5px 16px 5px 0;
} }
.realTel{
width: 120px;
}
.realNum{
width: 80px;
}
} }
// 发放员工 // 发放员工
.sale-select { .sale-select {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!