Commit c9f66b3f by 陈羽

update: 商户列表数据类型更改

parent 9da47d88
......@@ -31,16 +31,18 @@
<div class="el-scrollbar define-search-select">
<div class="el-select-dropdown__wrap el-scrollbar__wrap" style="margin-bottom: -5px; margin-right: -5px;">
<ul class="el-scrollbar__view el-select-dropdown__list auth-merchant-add">
<li class="el-select-dropdown__item" v-for="(item, index) in searchArray" :key="index + 'search'" @click="handleSelect(item)">
<li class="el-select-dropdown__item" @click="handleSelect(searchObj)" v-if="Object.keys(searchObj).length">
<div class="flex flex-space-between">
<div style="line-height: 26px;">
<span class="block text-ellipsis">{{ item.enterpriseName }}</span>
<div class="text-ellipsis font-12 color-909399">{{ item.brandName || '--' }}</div>
<span class="block text-ellipsis">{{ searchObj.enterpriseName }}</span>
<div class="text-ellipsis font-12 color-909399">{{ searchObj.brandName || '--' }}</div>
</div>
<span v-if="item.enterpriseId == enterpriseId" class="font-12 color-2f54eb el-icon-check flex-align-center" style="display:flex;"></span>
<span v-if="searchObj.enterpriseId == enterpriseId" class="font-12 color-2f54eb el-icon-check flex-align-center" style="display:flex;"></span>
</div>
</li>
<li v-if="!searchArray.length" class="el-select-dropdown__item text-center">暂无商户数据</li>
<li v-if="!Object.keys(searchObj).length" class="el-select-dropdown__item text-center">
暂无商户数据
</li>
</ul>
</div>
</div>
......@@ -91,7 +93,7 @@
<el-radio v-model="partForm.wxEnterpriseType" :label="0" :disabled="type === 'edit'">总部</el-radio>
<el-radio v-model="partForm.wxEnterpriseType" :label="1" :disabled="type === 'edit'">代理</el-radio>
</el-form-item>
<el-button type="primary" style="display:block;margin:38px 0 0 128px;" @click="addShow = true" :disabled="!(enterpriseId && partForm.storeGroup.length && partForm.searchSelect)">授权校验并{{ type === 'edit' ? '保存' : '新建' }}</el-button>
<el-button type="primary" style="display:block;margin:38px 0 0 128px;" @click="addShow = true" :disabled="!(enterpriseId && partForm.storeGroup.length && partForm.searchSelect)"> 授权校验并{{ type === 'edit' ? '保存' : '新建' }}</el-button>
</el-form>
</div>
</div>
......@@ -153,7 +155,7 @@ export default {
},
checkedList: [],
dailogForm: {},
searchArray: [],
searchObj: {},
enterpriseId: '',
corpName: '',
addShow: false
......@@ -176,7 +178,7 @@ export default {
async querySearchAsync(type) {
const that = this;
if (String(that.partForm.searchSelect).trim() == '') {
that.searchArray = [];
that.searchObj = {};
return false;
}
if (type === 'search') {
......@@ -184,9 +186,9 @@ export default {
that.partForm.storeGroup = [];
}
const res = await that.getSearchList(that.partForm.searchSelect);
that.searchArray = res;
if (type === 'edit' && res[0]) {
that.handleSelect(res[0]);
that.searchObj = res;
if (type === 'edit' && res) {
that.handleSelect(res);
}
},
getSearchList(queryString) {
......@@ -203,14 +205,14 @@ export default {
if (resData.result) {
resData.result.value = resData.result.enterpriseName;
}
resolve(Array.isArray(resData.result) ? resData.result : []);
resolve(resData.result ? resData.result : {});
return false;
}
errMsg.errorMsg(resData);
resolve([]);
resolve({});
})
.catch(function(error) {
resolve([]);
resolve({});
that.$message.error({
duration: 1000,
message: error.message
......
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