Commit 156052c5 by 张晓玮

Merge branch 'dev_v4.15.6' into 'develop'

Dev v4.15.6

See merge request !59
2 parents ef4b0bb0 0fa854d6
...@@ -287,3 +287,15 @@ export function deleteShopRef(data) { ...@@ -287,3 +287,15 @@ export function deleteShopRef(data) {
data.method = `${path}scenemerchantref.deleteShopRef` data.method = `${path}scenemerchantref.deleteShopRef`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 根据4S店商户号查询二级流量方
export function getDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.getDiversionMerchantRef`
return request(data, "post")
}
// 新增或更新商户二级流量方
export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
return request(data, "post")
}
...@@ -115,6 +115,12 @@ export const routerName = { ...@@ -115,6 +115,12 @@ export const routerName = {
handle: "setWarrantyCard" handle: "setWarrantyCard"
}, },
{ {
authId: "90603010",
parentId: "90603",
label: "下级商户配置",
handle: "setSubordinateMerchant"
},
{
authId: "9060305", authId: "9060305",
parentId: "90603", parentId: "90603",
label: "删除", label: "删除",
......
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
label="流量方" label="流量方"
width="170" width="170"
align="center" /> align="center" />
<el-table-column prop="subShopMerchantName" <!-- <el-table-column prop="subShopMerchantName"
v-if="isShowSubShopMerchantName" v-if="isShowSubShopMerchantName"
label="二级流量方" label="二级流量方"
width="170" width="170"
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.subShopMerchantName || '-' }}</span> <span>{{ scope.row.subShopMerchantName || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="shopProfitType" <el-table-column prop="shopProfitType"
label="流量方比例" label="流量方比例"
width="120" width="120"
......
...@@ -178,8 +178,8 @@ export default { ...@@ -178,8 +178,8 @@ export default {
if (this.addOrEdit === 'edit') { if (this.addOrEdit === 'edit') {
this.show = false this.show = false
this.editData = deepClone(this.$route.params.form) this.editData = deepClone(this.$route.params.form)
this.editData.brandMerchantCode = Number(deepClone(this.$route.params.form).brandMerchantCode) this.editData.brandMerchantCode = Number(deepClone(this.$route.params.form).brandMerchantCode) || ''
this.editData.supplierCode = Number(deepClone(this.$route.params.form).supplierCode) this.editData.supplierCode = Number(deepClone(this.$route.params.form).supplierCode) || ''
// !this.userInfo.beSuper && (this.editData.merchantId = this.userInfo.detail.merchantId) // !this.userInfo.beSuper && (this.editData.merchantId = this.userInfo.detail.merchantId)
this.editData.thumbUrlList = [{ this.editData.thumbUrlList = [{
content: '' content: ''
......
...@@ -101,6 +101,13 @@ ...@@ -101,6 +101,13 @@
{{ detail.sellerMerchantAddress }} {{ detail.sellerMerchantAddress }}
</el-form-item> </el-form-item>
</div> </div>
<div>
<!-- 审计特殊字段 -->
<el-form-item label="二级流量方:"
v-if="detail.subShopMerchantName">
{{ detail.subShopMerchantName }}
</el-form-item>
</div>
</el-form> </el-form>
</div> </div>
<div class="form_table_gp"> <div class="form_table_gp">
......
...@@ -169,10 +169,22 @@ ...@@ -169,10 +169,22 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="4s店" <!-- <el-table-column label="4s店"
align="center"
width="170"
prop="merchantName" /> -->
<el-table-column label="流量方"
align="center" align="center"
width="170" width="170"
prop="merchantName" /> prop="merchantName" />
<el-table-column label="二级流量方"
align="center"
width="170"
prop="merchantName">
<template slot-scope="scope">
<span>{{ scope.row.subShopMerchantName || '-' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="园区店" --> <!-- <el-table-column label="园区店" -->
<el-table-column label="服务对接" <el-table-column label="服务对接"
align="center" align="center"
...@@ -264,6 +276,7 @@ ...@@ -264,6 +276,7 @@
<script> <script>
import { Util } from '@/common/util' import { Util } from '@/common/util'
import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order' import { getList, getOrderCount, waitinputorderCount, orderImport } from '@api/order'
import { getDiversionMerchantRef } from '@api/merchant'
import { manageTypeList, BaseData } from '@/common/constants' import { manageTypeList, BaseData } from '@/common/constants'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer' import { getServiceStore, getParkStore } from '@api/editCustomer'
...@@ -353,6 +366,7 @@ export default { ...@@ -353,6 +366,7 @@ export default {
optionsName: 'parkServiceList', optionsName: 'parkServiceList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
if (value) { if (value) {
// 获取流量方
this.getServiceStore(value) this.getServiceStore(value)
} else { } else {
this.baseData.storeIdList = [] this.baseData.storeIdList = []
...@@ -369,7 +383,17 @@ export default { ...@@ -369,7 +383,17 @@ export default {
optionList: [], optionList: [],
optionId: 'merchantId', optionId: 'merchantId',
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'storeIdList' optionsName: 'storeIdList',
changeAttr: (value, targetItem) => {
if (value) {
// // 获取二级流量方
this.getDiversionMerchantRef(value)
} else {
this.baseData.subShopMerchantList = []
}
this.searchForm.subShopMerchantId = ''
this.getOptionsList()
}
}, { }, {
label: '下单日期', label: '下单日期',
name: 'orderTime', name: 'orderTime',
...@@ -409,6 +433,16 @@ export default { ...@@ -409,6 +433,16 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confLabel', optionLabel: 'confLabel',
optionsName: 'manageTypeList' optionsName: 'manageTypeList'
}, {
label: '二级流量方',
name: 'subShopMerchantId',
type: 'select',
noDataText: '请先选择流量来源',
isHide: this.subShopMerchanShowHide,
optionList: [],
optionId: 'subMerchantId',
optionLabel: 'subMerchantName',
optionsName: 'subShopMerchantList'
}], }],
searchForm: { searchForm: {
status: '', status: '',
...@@ -420,7 +454,8 @@ export default { ...@@ -420,7 +454,8 @@ export default {
constructionFlag: '', constructionFlag: '',
sourceList: '', sourceList: '',
channelType: '', channelType: '',
businessModel: '' businessModel: '',
subShopMerchantId: ''
}, },
baseData: { baseData: {
orderStatusList: [{ orderStatusList: [{
...@@ -493,7 +528,8 @@ export default { ...@@ -493,7 +528,8 @@ export default {
confLabel: '系统导入' confLabel: '系统导入'
} }
], ],
channelTypeList: [] channelTypeList: [],
subShopMerchantList: []
}, },
tableData: [], tableData: [],
total: 0, total: 0,
...@@ -503,7 +539,8 @@ export default { ...@@ -503,7 +539,8 @@ export default {
}, },
totalCount: '', totalCount: '',
jurisdictionFlag: false, // 待补录按钮权限标识 jurisdictionFlag: false, // 待补录按钮权限标识
signRefundFlag: false // 标记退款权限标识 signRefundFlag: false, // 标记退款权限标识
subShopMerchanShowHide: true
} }
}, },
computed: { computed: {
...@@ -561,6 +598,18 @@ export default { ...@@ -561,6 +598,18 @@ export default {
this.handleSearch() this.handleSearch()
this.setUpdateRefesh('false') this.setUpdateRefesh('false')
} }
},
'baseData.subShopMerchantList': {
handler(val) {
console.log('baseData.subShopMerchantList', val);
if (val.length > 0) {
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = false
} else {
this.showFormData[this.findFormIdx('subShopMerchantId')].isHide = true
}
},
immediate: true
} }
}, },
methods: { methods: {
...@@ -647,7 +696,8 @@ export default { ...@@ -647,7 +696,8 @@ export default {
orderTime: '', orderTime: '',
constructionFlag: '', constructionFlag: '',
channelType: '', channelType: '',
businessModel: '' businessModel: '',
subShopMerchantId: ''
} }
this.baseData.storeIdList = [] this.baseData.storeIdList = []
this.getOptionsList() this.getOptionsList()
...@@ -660,6 +710,14 @@ export default { ...@@ -660,6 +710,14 @@ export default {
this.getOptionsList() this.getOptionsList()
}) })
}, },
getDiversionMerchantRef(merchantId) {
getDiversionMerchantRef({
merchantId: merchantId
}).then(res => {
this.baseData.subShopMerchantList = res || []
this.getOptionsList()
})
},
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
...@@ -782,6 +840,10 @@ export default { ...@@ -782,6 +840,10 @@ export default {
waitinputorderCount({}).then(res => { waitinputorderCount({}).then(res => {
this.waitOrderNum = res.waitInputCount this.waitOrderNum = res.waitInputCount
}) })
},
findFormIdx(name) {
return this.showFormData.findIndex(item => item.name === name)
} }
} }
} }
......
<!-- 质保卡 -->
<template>
<d2-dialog title="下级商户设置"
:is-visible="subordinateMerchantVisible"
class="accountDailog"
@closeDialog="handleClose"
width="800px"
@confirmDialog="handleAddConfirm">
<div class="container">
<el-form ref="editSubordinateMerchantFrom"
class="editSubordinateMerchantFrom d2-container-content"
:model="form"
label-width="150px"
v-loading="$store.state.d2admin.loading.value">
<el-table :data="form.tableData"
border>
<el-table-column type="index"
label="序号"
:index="index => index + 1"
width="50"
align="center" />
<el-table-column label="商户名称"
width="400"
align="center">
<template slot-scope="scope">
<div class="inputCol">
<el-form-item :prop="'tableData.'+scope.$index+'.merchantNo'"
:rules="[{ required: true, message: '请选择二级流量方', trigger: 'change' }]">
<!-- <el-autocomplete style="width: 350px;"
v-model="scope.row.merchantName"
:fetch-suggestions="querySearchAsync"
placeholder="请选择二级流量方"
@select="handleSelect"></el-autocomplete> -->
<el-select v-model="scope.row.merchantNo"
filterable
remote
reserve-keyword
placeholder="请输入关键字"
style="width: 350px"
:remote-method="remoteMethod"
@change="changeOpt"
:loading="loading">
<el-option v-for="(item,index) in options"
:key="index"
:label="item.merchantName"
:value="item.merchantNo"
:disabled="setDisabled(item.merchantNo)">
</el-option>
</el-select>
</el-form-item>
</div>
</template>
</el-table-column>
<el-table-column label="商户号"
align="center"
prop="merchantNo"
width="140" />
<el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-button type="text"
style="color: red;"
@click="handleDelMerchant(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="add-btn">
<el-button type="primary"
@click="handleAddMerchant">添加新的一行</el-button>
</div>
</el-form>
</div>
</d2-dialog>
</template>
<script>
import { getDiversionMerchantRef, serviceGetMerchantList, insertOrUpdateDiversionMerchantRef } from '@api/merchant'
import { deepClone } from '@/common/util'
export default {
name: 'WarrantyCardDialog',
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
form: {
tableData: []
},
// tableData: [],
subShopMerchantList: [],
timeout: null,
loading: false,
options: [],
}
},
props: {
subordinateMerchantVisible: {
type: Boolean,
default: false
},
subShopMerchantInfo: {
type: Object,
default: null
}
},
watch: {
},
created() {
},
components: {},
mounted() {
if (this.subShopMerchantInfo) {
this.getInfo(this.subShopMerchantInfo.merchantId)
}
},
methods: {
getInfo(merchantId) {
getDiversionMerchantRef({
merchantId: merchantId
}).then(res => {
this.subShopMerchantList = res || []
if (this.subShopMerchantList.length > 0) {
this.form.tableData = deepClone(this.subShopMerchantList)
this.form.tableData = this.form.tableData.map(item => {
let item_new = {
id: item.id,
merchantName: item.subMerchantName,
merchantNo: item.subMerchantId
}
this.options.push(item_new)
return item_new
})
}
})
},
handleAddConfirm() {
this.$refs.editSubordinateMerchantFrom.validate(valid => {
if (valid) {
var params = {}
params.merchantId = this.subShopMerchantInfo.merchantId
params.merchantName = this.subShopMerchantInfo.merchantName
let list = []
let info
this.form.tableData.forEach(item => {
// info = {}
// if (item.id) {
// info.id = item.id
// }
// info.subMerchantId = item.merchantNo
// info.subMerchantName = item.merchantName
// info.merchantAccountLevel = item.merchantAccountLevel
// info.merchantLoginAccount = item.merchantLoginAccount
// info.channelType = item.channelType
// info.createdTime = item.createdTime
info = deepClone(item)
info.subMerchantId = info.merchantNo
info.subMerchantName = info.merchantName
list.push(info)
})
params.list = list
insertOrUpdateDiversionMerchantRef(params).then(res => {
this.notice.okTips('操作成功')
this.handleClose(true)
})
}
})
},
handleAddMerchant() {
this.options = [];
this.form.tableData.push({
// merchantName: '',
merchantNo: ''
})
},
handleDelMerchant(index) {
this.form.tableData.splice(index, 1)
},
// querySearchAsync(queryString, cb) {
// if (queryString) {
// // 请求接口
// var params = { currentPage: 1, pageSize: 100, merchantIdName: queryString }
// serviceGetMerchantList(params).then(res => {
// let result = res.list || []
// result = result.map(item => {
// return { 'value': item.merchantName, 'address': item.merchantNo }
// })
// console.log(result);
// clearTimeout(this.timeout);
// this.timeout = setTimeout(() => {
// cb(result);
// }, 1000 * Math.random());
// })
// }
// },
// handleSelect(item) {
// console.log(item)
// console.log(this.form.tableData);
// },
remoteMethod(queryString) {
if (queryString) {
this.loading = true;
setTimeout(() => {
this.loading = false;
var params = { currentPage: 1, pageSize: 1000, merchantIdName: queryString }
serviceGetMerchantList(params).then(res => {
this.options = res.list || []
})
}, 200);
} else {
this.options = [];
}
},
setDisabled(val) {
let info = this.form.tableData.find(item => item.merchantNo == val)
if (info) {
return true
} else {
return false
}
},
changeOpt(val) {
let info = this.options.find(item => item.merchantNo == val)
console.log(info);
this.form.tableData = this.form.tableData.map(item => {
if (item.merchantNo == info.merchantNo) {
let id = deepClone(item.id)
delete info.id
item = deepClone(info)
if (id) {
item.id = id
// return item = Object.assign(info, { id: item.id })
}
}
return item
})
console.log(this.form.tableData);
},
handleClose(flag) {
this.$emit('dialogClose', flag)
}
}
}
</script>
<style scoped lang="scss">
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.add-btn {
width: 100%;
display: flex;
margin-top: 15px;
}
.accountDailog .el-dialog {
margin-top: 20vh !important;
min-width: 1000px;
}
.accountDailog .el-select-dropdown__item {
width: 395px !important;
}
.inputCol {
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 20px;
line-height: 80px;
::v-deep.el-form-item__content {
margin-left: 0 !important;
}
/* height: 70px;
*/
/* padding: 0 40px; */
/* */
}
// .formItemCla {
// margin-left: 0px !important;
// }
</style>
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
v-if="scope.scope.scene != 3" v-if="scope.scope.scene != 3"
:show-btn-ids="['9060309']" :show-btn-ids="['9060309']"
:data="scope.scope" /> :data="scope.scope" />
<span v-if="scope.scope.scene == 1">
<!-- 下级商户配置 -->
<auth-button slot="auth-button"
:show-btn-ids="['90603010']"
:data="scope.scope" />
</span>
<!-- 删除 --> <!-- 删除 -->
<auth-button slot="auth-button" <auth-button slot="auth-button"
:show-btn-ids="['9060305']" :show-btn-ids="['9060305']"
...@@ -253,6 +259,10 @@ ...@@ -253,6 +259,10 @@
:warranty-card-visible="warrantyCardVisible" :warranty-card-visible="warrantyCardVisible"
:record-info="recordInfo" :record-info="recordInfo"
@dialogClose="closeWarrantyCard" /> @dialogClose="closeWarrantyCard" />
<subordinateMerchantDialog v-if="subordinateMerchantVisible"
:subordinateMerchantVisible="subordinateMerchantVisible"
:sub-shop-merchant-info="subShopMerchantInfo"
@dialogClose="colseSubordinateMerchant" />
</d2-container> </d2-container>
</template> </template>
...@@ -285,6 +295,7 @@ import { ...@@ -285,6 +295,7 @@ import {
import relateStoreMerDialog from "./components/relateStoreMerDialog" import relateStoreMerDialog from "./components/relateStoreMerDialog"
import relateMerDialog from "./components/relateMerDialog" import relateMerDialog from "./components/relateMerDialog"
import warrantyCardDialog from "./components/warrantyCardDialog" import warrantyCardDialog from "./components/warrantyCardDialog"
import subordinateMerchantDialog from "./components/subordinateMerchantDialog"
export default { export default {
name: "MerchantManage", name: "MerchantManage",
...@@ -294,7 +305,8 @@ export default { ...@@ -294,7 +305,8 @@ export default {
financialRulesDetail, financialRulesDetail,
// QRcodeDialog // QRcodeDialog
relateMerDialog, relateMerDialog,
warrantyCardDialog warrantyCardDialog,
subordinateMerchantDialog
}, },
data() { data() {
return { return {
...@@ -624,7 +636,9 @@ export default { ...@@ -624,7 +636,9 @@ export default {
relateVisible: false, relateVisible: false,
warrantyCardVisible: false, // 质保卡弹窗 warrantyCardVisible: false, // 质保卡弹窗
recordInfo: {} recordInfo: {},
subordinateMerchantVisible: false, // 下级商户弹窗
subShopMerchantInfo: {}
} }
}, },
watch: { watch: {
...@@ -1265,6 +1279,18 @@ export default { ...@@ -1265,6 +1279,18 @@ export default {
closeWarrantyCard(flag) { closeWarrantyCard(flag) {
this.warrantyCardVisible = !this.warrantyCardVisible this.warrantyCardVisible = !this.warrantyCardVisible
flag && this.queryList() flag && this.queryList()
},
// 打开下级商户配置弹窗
setSubordinateMerchant(row) {
this.subordinateMerchantVisible = !this.subordinateMerchantVisible
this.subShopMerchantInfo = row
},
// 关闭下级商户配置弹窗
colseSubordinateMerchant(flag) {
this.subordinateMerchantVisible = !this.subordinateMerchantVisible
flag && this.queryList()
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!