Commit 14f21381 by liwk
2 parents bc193d38 6dd599f9
......@@ -50,19 +50,27 @@
<div class="storeTitle">
门店:
</div>
<el-input
<el-select
v-model="batchListSearch.merchantName"
placeholder="请输入门店"
></el-input>
filterable
remote
reserve-keyword
placeholder="请输入关联门店"
:remote-method="remoteMethod"
:loading="loading"
>
<el-option
v-for="(item, index) in options"
:key="index"
:label="item.merchantName"
:value="item.merchantName"
>
</el-option>
</el-select>
</div>
</div>
<div class="selctMerchantBtn">
<el-button
type="primary"
icon="el-icon-search"
@click="selectMerchant('batchListSearch')"
>搜索门店</el-button>
</div>
</div>
<!-- 批次界面弹窗 -->
<el-dialog
......@@ -187,7 +195,6 @@
width="50%"
:before-close="handleClose"
>
<h3>权益卡信息</h3>
<el-form
:model="generateRightCardsForm"
:rules="rules"
......@@ -200,27 +207,27 @@
prop="merchantName"
>
<div class="InputContainer2">
<div class="storeTitle">
门店:
</div>
<el-input
v-model="generateRightCardsForm.merchantName"
placeholder="请输入门店"
></el-input>
</div>
<!-- <el-select
<el-select
v-model="generateRightCardsForm.merchantName"
placeholder="请选择关联门店"
value-key="id"
@change="generateCardsformat"
filterable
remote
reserve-keyword
placeholder="请输入关联门店"
:remote-method="generateRemoteMethod"
:loading="loading"
>
<el-option
v-for="item in baseDate.equityList"
:key="item.merchantId"
v-for="(item, index) in generateOptions"
:key="index"
:label="item.merchantName"
:value="item.merchantName"
></el-option>
</el-select> -->
>
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item
label="生成张数"
......@@ -351,16 +358,22 @@
</div> -->
<div class="firstpickerContainer">
门店:
<el-select
<el-select
v-model="collectionListSearch.merchantName"
placeholder="请选择门店"
filterable
remote
reserve-keyword
placeholder="请输入关联门店"
:remote-method="remoteMethod"
:loading="loading"
>
<el-option
v-for="(item, index) in baseDate.equityList"
v-for="(item, index) in options"
:key="index"
:label="item.merchantName"
:value="item.merchantName"
></el-option>
>
</el-option>
</el-select>
<!-- <el-cascader
v-model="batchListSearch.benefitPackagePickerList"
......@@ -407,6 +420,15 @@ export default {
data() {
return {
// exportMemberCard: exportMemberCard,
// 批次下拉框
options: [],
// value: [],
list: [],
loading: false,
states: [],
//批量生成下拉框
generateOptions:[],
colletionDate: '',
batchDate: '',
date_format,
......@@ -427,8 +449,8 @@ export default {
// 批次列表搜索项
selectBatchId: '' || null,
batchListSearch: {
batchNo: '' || null,
merchantName: '' || null,
batchNo: '' ,
merchantName: '' ,
startTime: '',
endTime: ''
},
......@@ -668,7 +690,16 @@ export default {
}
},
mounted() {
this.list = this.states.map(item => {
return { value: `value:${item}`, label: `label:${item}` };
});
},
watch:{
'generateRightCardsForm.merchantName'(n){
this.generateOptions.map(e=>{
if(e.merchantName == n) this.generateRightCardsForm.merchantId = e.merchantId
})
}
},
methods: {
fetch(url, params) {
......@@ -683,11 +714,34 @@ export default {
xhr.send(params)
})
},
//批次搜索获取门店下拉框
selectMerchant(listName) {
equityApi.getCollectionMerchantList({ merchantName: this[listName].merchantName }).then((res) => {
this[listName].merchantName = res.merchantName
})
//批次下拉框异步请求
remoteMethod(query) {
if (query !== '') {
this.loading = true;
equityApi.getCollectionMerchantList({
merchantName: query
}).then((res) => {
this.loading = false;
this.options = res.data.list
})
} else {
this.options = [];
}
},
//批量生成下拉框异步请求
generateRemoteMethod(query) {
if (query !== '') {
this.loading = true;
equityApi.getCollectionMerchantList({
merchantName: query
}).then((res) => {
this.loading = false;
this.generateOptions = res.data.list
})
} else {
this.options = [];
}
},
// 批次界面导出
exportbatchdetail() {
......@@ -872,7 +926,9 @@ export default {
resolve()
})
},
handleClick(tab, event) { },
handleClick(tab, event) {
this.options = []
},
handleChange(value) { },
// 关闭批量生成界面
handleClose(done) {
......
......@@ -11,6 +11,23 @@
<el-select
v-model="searchForm.merchantName"
filterable
remote
reserve-keyword
placeholder="请输入关联门店"
:remote-method="remoteMethod"
:loading="loading"
>
<el-option
v-for="(item, index) in options"
:key="index"
:label="item.merchantName"
:value="item.merchantName"
>
</el-option>
</el-select>
<!-- <el-select
v-model="searchForm.merchantName"
filterable
placeholder="请选择门店"
>
<el-option
......@@ -20,7 +37,7 @@
:value="item.name"
>
</el-option>
</el-select>
</el-select> -->
<div class="buttonContainer">
<el-button
:id="tableParams.btnId"
......@@ -110,6 +127,23 @@
<el-select
v-model="ruleForm.merchantName"
filterable
remote
reserve-keyword
placeholder="请输入关联门店"
:remote-method="generateRemoteMethod"
:loading="loading"
>
<el-option
v-for="(item, index) in generateOptions"
:key="index"
:label="item.merchantName"
:value="item.merchantName"
>
</el-option>
</el-select>
<!-- <el-select
v-model="ruleForm.merchantName"
filterable
placeholder="请选择门店"
size="mini"
@change="changeStore"
......@@ -121,7 +155,7 @@
:value="item.name"
>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item
label="有效期:"
......@@ -218,6 +252,14 @@ import { equityApi } from '@/api/api'
export default {
data() {
return {
//分页查询下拉框
options: [],
// value: [],
list: [],
loading: false,
states: [],
// 建卡下拉框
generateOptions:[],
//新建or编辑
isAdd: false,
//门店搜索下拉框
......@@ -227,54 +269,54 @@ export default {
src: './images/yiquan.jpg',
inputSwitch: true,
dataSwitch: true,
storeOptions: [
{
id: '21',
name: '辛巴克'
}, {
id: '22',
name: '必胜客'
},
{
id: '23',
name: '肯德基'
},
{
id: '24',
name: '汉堡王'
},
{
id: '27',
name: '太平洋咖啡'
},
{
id: '28',
name: 'COSTA咖啡'
},
{
id: '26',
name: '哈根达斯'
},
{
id: '25',
name: 'CoCo都可'
},
{
id: '30',
name: '百果园 '
},
{
id: '31',
name: '腾讯会员'
}, {
id: '4',
name: '淘票票'
},
{
id: '2',
name: '淘票票2'
}
],
// storeOptions: [
// {
// id: '21',
// name: '辛巴克'
// }, {
// id: '22',
// name: '必胜客'
// },
// {
// id: '23',
// name: '肯德基'
// },
// {
// id: '24',
// name: '汉堡王'
// },
// {
// id: '27',
// name: '太平洋咖啡'
// },
// {
// id: '28',
// name: 'COSTA咖啡'
// },
// {
// id: '26',
// name: '哈根达斯'
// },
// {
// id: '25',
// name: 'CoCo都可'
// },
// {
// id: '30',
// name: '百果园 '
// },
// {
// id: '31',
// name: '腾讯会员'
// }, {
// id: '4',
// name: '淘票票'
// },
// {
// id: '2',
// name: '淘票票2'
// }
// ],
effectiveNum: '',
data: '',
ruleForm: {
......@@ -285,7 +327,7 @@ export default {
effectiveType: '',
platformGoodsId: +'',
merchantName: '',
id:''
id: ''
},
product: [
{
......@@ -393,16 +435,50 @@ export default {
}
},
mounted() {
// 门店下拉框的的获取
// getStoreList({}).then((res) => {
// this.storeOptions = res
// })
this.list = this.states.map(item => {
return { value: `value:${item}`, label: `label:${item}` };
});
},
watch:{
'ruleForm.merchantName'(n){
this.generateOptions.map(e=>{
if(e.merchantName == n) this.ruleForm.merchantId = e.merchantId
})
}
},
methods: {
//管理分页列表下拉框
remoteMethod(query) {
if (query !== '') {
this.loading = true;
equityApi.getMerchantList({
merchantName: query
}).then((res) => {
this.loading = false;
this.options = res.data.list
})
} else {
this.options = [];
}
},
//建卡下拉框
generateRemoteMethod(query) {
if (query !== '') {
this.loading = true;
equityApi.getCollectionMerchantList({
merchantName: query
}).then((res) => {
this.loading = false;
this.generateOptions = res.data.list
})
} else {
this.options = [];
}
},
//改变门店
changeStore(value) {
this.ruleForm.merchantId = this.storeOptions.filter(item => item.name == value)[0].id
console.log(this.ruleForm.merchantId);
console.log(this.ruleForm.merchantId);
},
//编辑
edit(row) {
......@@ -422,7 +498,6 @@ export default {
console.log(this.isAdd)
this.dialogVisible = true
this.ruleForm = row
this.ruleForm.merchantName = ''
this.ruleForm.effectiveType = row.effectiveType + ''
if (this.ruleForm.effectiveType == 2) {
this.effectiveNum = row.effectiveNum
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!