Commit b23adaf1 by 张立顺

feat 场景上架功能联调

1 parent 610b7d0a
Showing 30 changed files with 478 additions and 241 deletions
......@@ -25,3 +25,4 @@ yarn-error.log*
*.njsproj
*.sln
*.sw*
src/main.js
......@@ -35,6 +35,9 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt
apiName = "dj";
} else if (params.method.includes("dj.api.oaapproval")) {
apiName = "oaapproval";
} else if (params.method.includes("merchants.api.open.createMerchantWithPermissions")) {
/** 开放平台创建商户 — 与同网关 oaapproval 一致,使用 axios_oaapproval / baseURL */
apiName = "oaapproval";
} else {
// console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0];
......
......@@ -26,10 +26,18 @@ export function bind4SStore(data) {
return request(data, "post");
}
// 潜客信息核验提交(与新增商户字段一致;method 待后端确认后替换)
// 潜客信息核验提交(dj.api.smartcarlife.sale.potentialCustomers.submitVerification)
export function potentialCustomersInfoVerify(data) {
data.method = 'dj.api.smartcarlife.sale.potentialCustomers.infoVerify'
return request(data, "post")
data.method =
"dj.api.smartcarlife.sale.potentialCustomers.submitVerification";
return request(data, "post");
}
// 潜客新建商户 — 校验商户名称是否与账户中心重复
export function potentialCustomersCheckMerchantName(data) {
data.method =
"dj.api.smartcarlife.sale.potentialCustomers.checkMerchantName";
return request(data, "post");
}
// 分页查询大区
......
......@@ -2,6 +2,13 @@ import request from "./request"
const path = "dj.smartcarlife.api."
/** 开放平台新建商户(含权限);走 request 层 oaapproval 路由→axios_oaapproval;园区店 merchantType=6、服务商 merchantType=7;提交固定 source=DJ */
export function createMerchantWithPermissions(data) {
data.method = "merchants.api.open.createMerchantWithPermissions"
data.source = "DJ"
return request(data, "post")
}
// 分页查询园区店服务商列表
export function getList(data) {
// data.method = `${path}partnerMerchant.serviceRef.page`
......
......@@ -101,6 +101,12 @@ export function findMerchantListByPage(data) {
return request(data, RequestMethods.POST);
}
/** 账户中心校验商户名称是否已存在(method 与请求体以后端文档为准联调) */
export function checkMerchantNameExists(data) {
data.method = `merchants.api.open.merchantName.exists`;
return request(data, RequestMethods.POST);
}
// 嘀加上架 - 保存
export function operationConfirm(data) {
data.method = `dj.api.create.business.approve.operationConfirm`;
......
......@@ -43,6 +43,19 @@
</template>
<script>
/** 后端约定 integer:车系 id、车品牌 id */
function toBrandInt(val) {
if (val === '' || val === null || val === undefined) return undefined
const n = parseInt(val, 10)
return Number.isNaN(n) ? undefined : n
}
/** 勾选 key 与节点 id 可能是 number/string,统一比较 */
function checkedKeysHas(keys, id) {
const sid = String(id)
return (keys || []).some((k) => String(k) === sid)
}
export default {
name: 'SelectBrand',
data() {
......@@ -82,43 +95,50 @@ export default {
}
},
methods: {
/**
* 提交结构(submitVerification:merchantBrandList[].cars、merchantBrandList[].merchantBrandId[])
* - cars:车系 id(一级)
* - merchantBrandId:车品牌 id 数组(二级),integer[]
*/
collectMerchantBrandIdsFromSeriesNode(car, checkedKeys) {
const merchantBrandId = []
if (!car.children || !car.children.length) return merchantBrandId
car.children.forEach((item) => {
if (checkedKeysHas(checkedKeys, item.id)) {
const bid = toBrandInt(item.id)
if (bid !== undefined) merchantBrandId.push(bid)
}
})
return merchantBrandId
},
getMerchantBrandList() {
let getCheckedNodes = this.$refs.tree.getCheckedNodes()
const getCheckedKeys = this.$refs.tree.getCheckedKeys()
const getHalfCheckedNodes = this.$refs.tree.getHalfCheckedNodes()
let merchantBrandList = getHalfCheckedNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
const tree = this.brandListTree || []
const rows = []
/*
* 仅用「顶层车系 + 勾选中的二级叶子」组装,一车系一行。
* 原先用 half-checked 父级 + 全选父级 + 勾选叶子三套 concat,
* 在只选部分/全部叶子时同一车系会重复多行相同 cars。
*/
tree.forEach((series) => {
if (!series.children || !series.children.length) {
if (checkedKeysHas(getCheckedKeys, series.id)) {
const cars = toBrandInt(series.id)
if (cars !== undefined) {
rows.push({ cars, merchantBrandId: [] })
}
}
})
return {
cars: car.id,
merchantBrandId
return
}
})
let checkNodes = getCheckedNodes.filter(item => item.children)
let noCheckNodes = getCheckedNodes
.filter(item => item.children === null)
.map(i => {
return {
cars: i.id
}
})
let merchantBrandList2 = checkNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
const merchantBrandId = this.collectMerchantBrandIdsFromSeriesNode(series, getCheckedKeys)
if (merchantBrandId.length) {
const cars = toBrandInt(series.id)
if (cars !== undefined) {
rows.push({ cars, merchantBrandId })
}
})
return {
cars: car.id,
merchantBrandId
}
})
return merchantBrandList.concat(merchantBrandList2).concat(noCheckNodes)
return rows
},
//勾选
handleCheck() {
......@@ -129,6 +149,7 @@ export default {
if (this.$refs.tree.getCheckedKeys().length == this.treeArr.length) {
this.checkedAll = true
}
this.$emit('brand-change')
},
getCheckList(checkArr = []) {
checkArr.forEach(item => (item = parseInt(item)))
......@@ -165,6 +186,7 @@ export default {
}
setTimeout(() => {
this.loading = false
this.$emit('brand-change')
}, 1000)
},
//重置
......@@ -172,6 +194,7 @@ export default {
this.treeArr = []
this.checkedAll = false
this.$refs.tree.setCheckedKeys([])
this.$emit('brand-change')
},
//删除
removeItem(checkItem, index) {
......@@ -193,6 +216,7 @@ export default {
}
this.$nextTick(() => {
this.loading = false
this.$emit('brand-change')
})
},
//过滤
......
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
:append-to-body="appendToBody"
:fullscreen="fullscreen"
>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose"
:close-on-click-modal="false" :width="width" :append-to-body="appendToBody" :fullscreen="fullscreen">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
......@@ -22,12 +14,8 @@
<slot name="btn-start" />
<el-button v-if="!noCancel" @click="handleClose"> 取消 </el-button>
<slot name="btn-middle" />
<el-button
type="primary"
v-if="isShowFooter"
@click="handleConfirm"
:loading="$store.state.d2admin.loading.value"
>
<el-button type="primary" v-if="isShowFooter" @click="handleConfirm"
:loading="$store.state.d2admin.loading.value">
{{ btnOkLabel }}
</el-button>
<slot name="btn-end" />
......
......@@ -135,6 +135,14 @@
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]" />
</el-select>
<el-radio-group v-else-if="item.type === 'radio'"
v-model="searchForm[item.name]"
:style="{ width: item.width || '100%' }"
@change="item.changeAttr && item.changeAttr($event, item)">
<el-radio v-for="(subItem, subIndex) in item.optionList"
:key="subIndex"
:label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'"
v-model="searchForm[item.name]"
:clearable="item.isClear || false"
......
......@@ -18,6 +18,7 @@
:form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth"
:nested-modal-append-to-body="nestedModalAppendToBody"
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
<template v-for="name in slotArr" #[name]>
......@@ -85,6 +86,11 @@ export default {
type: Boolean,
default: false,
},
/** 表单内含地图/上传预览等内层弹窗时,外层已是 d2-dialog 则建议开启 */
nestedModalAppendToBody: {
type: Boolean,
default: false,
},
},
data() {
return {
......
<!-- 弹窗 -->
<template>
<div>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :modal-append-to-body="false" :width="width" class="app-dialog">
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose"
:close-on-click-modal="false" append-to-body :modal-append-to-body="modalAppendToBody" :width="width" class="app-dialog">
<el-scrollbar v-if="hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="main-title">{{ title }}</span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
......@@ -13,7 +14,7 @@
</el-scrollbar>
<template v-if="!hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="main-title">{{ title }}</span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
......@@ -23,9 +24,9 @@
<div slot="footer">
<slot name="btn-start"></slot>
<el-button :type="typeName" v-if="!noClose" :size="btnSize" @click="handleClose"></el-button>
<el-button type="default" v-if="!noCancel" :size="btnSize" @click="handleClose"></el-button>
<el-button type="primary" v-if="!noBtnOk" :size="btnSize" @click="handleConfirm"></el-button>
<el-button :type="typeName" v-if="!noClose" :size="btnSize" @click="handleClose">{{ btnCloseLabel }}</el-button>
<el-button type="default" v-if="!noCancel" :size="btnSize" @click="handleClose">{{ btnCancelLabel }}</el-button>
<el-button type="primary" v-if="!noBtnOk" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
......@@ -90,6 +91,10 @@ export default {
btnSize: {
type: String,
default: 'small'
},
modalAppendToBody: {
type: Boolean,
default: false
}
},
......
/* MessageBox 挂在 body,与信息核验弹窗叠层共用;类名供确认 / 成功两种框 */
.el-message-box.merchant-submit-confirm-msgbox {
width: 440px;
padding-bottom: 10px;
.el-message-box__header {
padding: 12px 16px;
border-bottom: 1px solid #ebeef5;
}
.el-message-box__title {
font-size: 16px;
font-weight: 600;
color: #303133;
text-align: left;
}
.el-message-box__content {
padding: 20px 20px 12px;
}
.el-message-box__btns {
padding: 12px 16px;
border-top: 1px solid #ebeef5;
text-align: right;
.el-button {
padding: 8px 18px;
min-height: 32px;
line-height: 1;
}
}
}
.el-message-box.merchant-submit-success-msgbox {
width: 440px;
padding-bottom: 10px;
.el-message-box__header {
padding: 12px 16px;
border-bottom: 1px solid #ebeef5;
}
.el-message-box__title {
font-size: 16px;
font-weight: 600;
color: #303133;
text-align: left;
}
.el-message-box__content {
padding: 24px 24px;
}
.el-message-box__container {
display: flex;
flex-direction: column;
align-items: center;
padding-left: 0 !important;
}
.el-message-box__btns {
padding: 12px 16px;
border-top: 1px solid #ebeef5;
text-align: right;
.el-button {
padding: 8px 18px;
min-height: 32px;
line-height: 1;
}
}
.el-message-box__status {
position: static !important;
top: auto !important;
transform: none !important;
display: block;
margin: 0 auto 16px;
font-size: 56px !important;
padding-right: 0;
text-align: center;
}
.el-message-box__status + .el-message-box__message {
padding-left: 0 !important;
padding-right: 0 !important;
}
.el-message-box__message {
margin: 0;
padding: 0;
width: 100%;
text-align: center;
line-height: 22px;
font-size: 14px;
color: #606266;
}
}
/** 货架新增商户 / 潜客信息核验:提交前确认与创建成功 MessageBox */
export const MERCHANT_SUBMIT_CONFIRM_TITLE = "信息确认";
export const MERCHANT_SUBMIT_CONFIRM_MESSAGE =
"请确认商户信息无误,点击确认按钮后会同步账户中心生成商户账号!";
export const MERCHANT_CREATE_SUCCESS_TITLE = "提示";
export const MERCHANT_CREATE_SUCCESS_MESSAGE = "商户创建完成!";
export function showMerchantSubmitConfirm(vm) {
return vm.$confirm(
MERCHANT_SUBMIT_CONFIRM_MESSAGE,
MERCHANT_SUBMIT_CONFIRM_TITLE,
{
type: "warning",
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
customClass: "merchant-submit-confirm-msgbox",
}
);
}
export function showMerchantCreateSuccess(vm) {
return vm.$msgbox.alert(
MERCHANT_CREATE_SUCCESS_MESSAGE,
MERCHANT_CREATE_SUCCESS_TITLE,
{
type: "success",
confirmButtonText: "知道了",
customClass: "merchant-submit-success-msgbox",
}
);
}
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" :inline="inline" label-width="154px" >
<el-form-item :label="provinceLabel" >
<el-select size="small" v-model="provinceForm.provinceName" clearable placeholder="选择省份" @clear="selectProvince" class="select-padding" :style="{ width: subdistrict == 2 ? '52%' : '33.33%' }">
<el-option v-for="(item, index) in AllData" :key="'province' + index" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
<el-form ref="provinceForm" :model="provinceForm" :inline="inline" :class="{ 'province-city--embed': embedMode }"
:label-width="embedMode ? '0px' : formLabelWidth" :style="embedFormCssVars">
<el-form-item :label="embedMode ? '' : provinceLabel">
<el-select size="small" v-model="provinceForm.provinceName" clearable placeholder="选择省份" @clear="selectProvince"
class="select-padding" :style="embedSelectWidthStyle" @blur.native="$emit('merchant-address-part-blur')">
<el-option v-for="(item, index) in AllData" :key="'province' + index" :label="item.name" :value="item.name"
@click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable placeholder="选择市" @clear="selectCity" class="select-padding" :style="{ width: subdistrict == 2 ? '52%' : '33.33%' }">
<el-option v-for="(item, index) in cityList" :key="'city' + index" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
<el-select size="small" v-model="provinceForm.cityName" clearable placeholder="选择市" @clear="selectCity"
class="select-padding" :style="embedSelectWidthStyle" @blur.native="$emit('merchant-address-part-blur')">
<el-option v-for="(item, index) in cityList" :key="'city' + index" :label="item.name" :value="item.name"
@click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区" @clear="selectTown" class="select-padding" :style="{ width: subdistrict == 2 ? '52%' : '33.33%' }">
<el-option v-for="(item, index) in townList" :key="'town' + index" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区"
@clear="selectTown" class="select-padding" :style="embedSelectWidthStyle" @blur.native="$emit('merchant-address-part-blur')">
<el-option v-for="(item, index) in townList" :key="'town' + index" :label="item.name" :value="item.name"
@click.native="selectTown(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="detailAddressLabel" >
<el-input size="small" v-if="mapView" readonly placeholder="请选择详细地址" v-model="provinceForm.fullAddress" class="map-input">
<el-form-item :label="embedMode ? '' : detailAddressLabel">
<el-input size="small" v-if="mapView" readonly placeholder="请选择详细地址" v-model="provinceForm.fullAddress"
class="map-input" @blur.native="$emit('merchant-address-part-blur')">
<el-button size="small" slot="append" @click="hanleSelectMap" icon="el-icon-location-outline">
<!-- <img src="@/assets/map.png" alt="" class="map-icon" /> -->
<!-- <i class="gl-icon-location"></i> -->
......@@ -21,7 +29,7 @@
</el-input>
</el-form-item>
</el-form>
<GLDialog :visible.sync="dialogMapVisible" :mode="'big'" bigTitle="选择地址">
<GLDialog :append-to-body="true" :visible.sync="dialogMapVisible" :mode="'big'" bigTitle="选择地址">
<map-view ref="mapForm" :mapHeight="mapHeight"></map-view>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogMapVisible = false">取 消</el-button>
......@@ -81,6 +89,39 @@ export default {
detailAddressLabel: {
type: String,
default: '详细地址:'
},
// 表单 label 宽度(与外层 glsx-combi-form 对齐时用默认;嵌入弹窗无内层标题时可配合 embedMode)
formLabelWidth: {
type: String,
default: '154px'
},
/** 嵌入外层表单项时使用:不占内层 label 区,由外层展示「商户地址」等 */
embedMode: {
type: Boolean,
default: false
},
/**
* 嵌入模式下列宽(px 数字或带单位字符串),通过 --pc-embed-select-w 生效。
*/
embedSelectWidth: {
type: [String, Number],
default: 108
}
},
computed: {
/** 非嵌入模式:省市下拉用百分比宽度 */
embedSelectWidthStyle() {
if (this.embedMode) {
return {};
}
return { width: this.subdistrict == 2 ? "52%" : "33.33%" };
},
/** 嵌入模式:用变量控制宽度(见 .province-city--embed .select-padding),可被父组件 prop 覆盖 */
embedFormCssVars() {
if (!this.embedMode) return {}
const w = this.embedSelectWidth
const val = typeof w === 'number' ? `${w}px` : String(w || '108px')
return { '--pc-embed-select-w': val }
}
},
data() {
......@@ -245,9 +286,9 @@ export default {
this.dialogMapVisible = true
this.$nextTick(() => {
// if (this.provinceForm.fullAddress && !this.$refs.mapForm.address) {
this.$refs.mapForm.address = this.provinceForm.fullAddress
this.$refs.mapForm.mapInit(this.provinceForm.lng, this.provinceForm.lat)
// this.$refs.mapForm.addMarker([this.provinceForm.lng, this.provinceForm.lat])
this.$refs.mapForm.address = this.provinceForm.fullAddress
this.$refs.mapForm.mapInit(this.provinceForm.lng, this.provinceForm.lat)
// this.$refs.mapForm.addMarker([this.provinceForm.lng, this.provinceForm.lat])
// }
})
},
......@@ -272,9 +313,16 @@ export default {
this.provinceForm.provinceName = province
this.provinceForm.cityName = city
this.provinceForm.townName = district
this.provinceForm.provinceCode = +((adcode + '').slice(0,3) + '000')
this.provinceForm.provinceCode = +((adcode + '').slice(0, 3) + '000')
this.provinceForm.cityCode = adcode
this.provinceForm.townCode = town_code
const tcFallback =
town_code != null && town_code !== ''
? town_code
: adcode != null && adcode !== ''
? adcode
: ''
this.provinceForm.townCode =
tcFallback !== '' ? String(tcFallback) : ''
}
var fullAddress = ''
var provincecode = ''
......@@ -322,6 +370,20 @@ export default {
return
}
}
// 地图确认后同步区级编码:逆地理常不带 town_code,用区级 adcode 兜底,避免外层表单校验缺少 districtCode 仍飘红
const md = mapData || {}
const tcMerged =
md.town_code != null && md.town_code !== ''
? String(md.town_code)
: md.adcode != null && md.adcode !== ''
? String(md.adcode)
: ''
if (tcMerged) {
this.provinceForm.townCode = tcMerged
}
if (town && String(this.provinceForm.townName || '').trim() === '') {
this.provinceForm.townName = town
}
this.provinceForm.fullAddress = this.$refs.mapForm.address
this.dialogMapVisible = false
// this.subdistrict == 2 ? this.init(province, city) : this.init(province, city, town)
......@@ -339,30 +401,56 @@ export default {
// }
.select-padding {
width: 120px !important;
&:nth-child(1) {
margin-left: 0;
}
margin-left: 10px;
}
/* 嵌入模式:固定列宽(勿用 width:auto!important,会覆盖业务父级 scoped 样式) */
.province-city--embed .select-padding.el-select {
width: var(--pc-embed-select-w, 108px) !important;
max-width: var(--pc-embed-select-w, 108px) !important;
min-width: 0 !important;
margin-left: 0 !important;
flex-shrink: 0;
}
.province-city--embed .select-padding.el-select .el-input {
width: 100% !important;
}
.map-input {
margin-top: 10px;
// margin-top: 10px;
::v-deep .el-input__inner {
border-right: none;
}
}
::v-deep {
.el-input-group__append {
background-color: #fff;
padding: 0 11px;
}
.el-form-item__content {
width: 400px !important;
display: flex;
margin-left: 0 !important;
}
.province-city--embed .el-form-item__content {
width: auto !important;
max-width: 100% !important;
}
.el-form-item {
display: flex;
}
.el-dialog__body {
padding: 20px 10px 30px !important;
}
......
......@@ -84,6 +84,10 @@ import { findMerchantListByPage, brandList as getBrandListApi, getMerchantType a
import { deepClone, Util } from "@/common/util";
import ProvinceCity from "@/components/province-city/index.vue";
import SelectBrand from "@/components/SelectBrand/index.vue";
import {
showMerchantCreateSuccess,
showMerchantSubmitConfirm,
} from "@/components/merchantVerify/merchantVerifyDialogs";
export default {
name: "AddMerchant",
......@@ -528,31 +532,38 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validateField("merchantAddress");
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
// 判断主营品牌
const merchantBrandList = this.$refs.brandListTree.getMerchantBrandList();
this.$refs.editFormRef.$refs[this.editChildRef].validate(async (valid) => {
if (!valid) {
return;
}
const merchantBrandList = this.$refs.brandListTree.getMerchantBrandList();
if (!merchantBrandList?.length) {
this.loading = false;
this.$message({
message: "请选择主营品牌",
type: "error",
});
return;
}
let params = deepClone(this.editData);
params.merchantBrandListJson = JSON.stringify(merchantBrandList);
params.status = 2;
params.isloginName = 0;
this.loading = true;
saveMerchant(params).then((res) => {
this.$message.success("操作成功");
this.$EventBus.$emit("updateMerchant");
this.$emit("handleClose");
}).finally(() => {
this.loading = false;
if (!merchantBrandList?.length) {
this.$message({
message: "请选择主营品牌",
type: "error",
});
return;
}
try {
await showMerchantSubmitConfirm(this);
} catch {
return;
}
const params = deepClone(this.editData);
params.merchantBrandListJson = JSON.stringify(merchantBrandList);
params.status = 2;
params.isloginName = 0;
this.loading = true;
try {
await saveMerchant(params);
await showMerchantCreateSuccess(this);
this.$EventBus.$emit("updateMerchant");
this.$emit("handleClose");
} catch (e) {
/* 失败由全局封装提示 */
} finally {
this.loading = false;
}
});
},
......@@ -560,6 +571,10 @@ export default {
};
</script>
<style lang="scss">
@import "@/components/merchantVerify/merchantSubmitMsgbox.scss";
</style>
<style lang="scss" scoped>
::v-deep.drawer-container {
.el-drawer__header {
......
......@@ -19,7 +19,8 @@
:form-rules="formRules"
glsx-combi-form
:is-block="isBlock"
:label-width="labelWidth">
:label-width="labelWidth"
:nested-modal-append-to-body="true">
<template #fileHtml>
<el-row>
<el-col :span="19">
......
......@@ -39,15 +39,16 @@
<div slot="auth-button" slot-scope="scope" width="400">
<!-- 首次绑定 / 重新绑定 -->
<span
v-if="[4].includes(scope.scope.potentialCustomersStatus) || ([3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == '1')"
v-if="[4].includes(scope.scope.potentialCustomersStatus) || ([3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == 1)"
style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9210102']" />
</span>
<!-- 信息核验 -->
<span v-if="([3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == '0')"
style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9210104']" />
</span>
<!-- 信息核验(已签约且未完成核验) -->
<!-- <span
v-if="[3].includes(scope.scope.potentialCustomersStatus) && scope.scope.isBind == 0"
style="margin-right: 10px"> -->
<auth-button :data="scope.scope" :show-btn-ids="['9210104']" />
<!-- </span> -->
<!-- 详情 -->
<span>
<auth-button :data="scope.scope" :show-btn-ids="['9210103']" />
......@@ -59,42 +60,18 @@
<!-- 查看 -->
<customer-detail-dialog :detail-visible="detailVisible" :record-info="recordInfo" v-if="detailVisible"
@dialogClose="dialogClose" />
<!-- 首次绑定 / 重新绑定 -->
<info-verify-merchant-dialog
:visible.sync="infoVerifyVisible"
:customer-row="infoVerifyRow"
:submit-api="infoVerifySubmit"
:merchant-type-labels="['4S店']"
@success="handleSearch"
>
<!-- 信息核验 -->
<info-verify-merchant-dialog :visible.sync="infoVerifyVisible" :customer-row="infoVerifyRow"
:submit-api="infoVerifySubmit" :merchant-type-labels="['4S店']" dialog-title="信息核验" dialog-width="1080px"
@success="handleSearch">
<template #storeDetail="{ customerRow }">
<div
v-if="customerRow && customerRow.id"
class="info-verify-store-detail"
>
<div class="info-verify-store-detail__title">
门店详情
</div>
<div class="info-verify-store-detail__grid">
<div class="info-verify-store-detail__row">
<span class="info-verify-store-detail__label">门店名称</span>
<span class="info-verify-store-detail__value">{{ customerRow.storeName || '-' }}</span>
</div>
<div class="info-verify-store-detail__row">
<span class="info-verify-store-detail__label">所在地区</span>
<span class="info-verify-store-detail__value">{{ [customerRow.provinceName, customerRow.city].filter(Boolean).join(' ') || '-' }}</span>
</div>
<div class="info-verify-store-detail__row info-verify-store-detail__row--full">
<span class="info-verify-store-detail__label">详细地址</span>
<span class="info-verify-store-detail__value">{{ customerRow.address || '-' }}</span>
</div>
</div>
</div>
<potential-customer-store-detail-section v-if="customerRow && customerRow.id != null"
:record-id="customerRow.id" :show-visit-record="false" :show-section-title="true" />
</template>
</info-verify-merchant-dialog>
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig" label-width="104px"
dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData" :slotArr="slotArr"
:base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<glsk-form-dialog v-if="editVisible" :selectVisible="editVisible" :dialogConfig="editDialogConfig"
label-width="104px" dialog-width="520px" :formRules="editRules" :editData="editData" :editFormData="editFormData"
:slotArr="slotArr" :base-data="baseData" @handleClose="editVisible = false" @handleConfirm="handleEditConfirm">
<template #merchantMutilHtml>
<el-select v-model="editData[editFormData[1].name]" :placeholder="editFormData[1].placeholder"
@change="editFormData[1].changeAttr" style="width: 274px" filterable remote reserve-keyword
......@@ -115,6 +92,7 @@ import { busTypeOpt, cooperModeOpt, flowSituateOpt, potentialCustomerOpt } from
import { mapActions, mapState } from 'vuex'
import { potentialCustomersPage, regionUserList, bind4SStore, potentialCustomersInfoVerify } from '@api/salesManagement'
import CustomerDetailDialog from '../components/CustomerDetailDialog.vue'
import PotentialCustomerStoreDetailSection from '../components/PotentialCustomerStoreDetailSection.vue'
import InfoVerifyMerchantDialog from '@/components/merchantVerify/InfoVerifyMerchantDialog.vue'
import { getList } from "@api/merchant"
// import { tmplTypeList } from "../constant/baseData"
......@@ -266,15 +244,14 @@ export default {
{
label: '信息核验',
name: 'isBind',
type: 'select',
type: 'radio',
optionList: [
{ value: '', label: '全部' },
{ value: '1', label: '是' },
{ value: '0', label: '否' }
],
optionId: 'value',
optionLabel: 'label',
isClear: true
optionLabel: 'label'
},
{
label: '门店名称',
......@@ -325,7 +302,12 @@ export default {
prop: 'merchantName',
width: '120px',
formatter: (cellValue) => {
return ((cellValue.merchantName || '') + (cellValue.merchantId ? ('(' + cellValue.merchantId + ')') : '')) || '-'
// 仅已签约且已完成信息核验时展示商户名与商户号
if (cellValue.potentialCustomersStatus != 3 || cellValue.isBind != 1) return '-'
const text =
(cellValue.merchantName || '') +
(cellValue.merchantId ? '(' + cellValue.merchantId + ')' : '')
return text || '-'
}
}, {
label: '业务类型',
......@@ -393,8 +375,9 @@ export default {
label: '信息核验',
prop: 'isBind',
formatter: (cellValue) => {
if (cellValue.isBind === 1) return '是'
if (cellValue.isBind === 0) return '否'
if (cellValue.potentialCustomersStatus != 3) return '-'
if (cellValue.isBind == 1) return '是'
if (cellValue.isBind == 0) return '否'
return '-'
}
}]
......@@ -484,6 +467,7 @@ export default {
components: {
CustomerDetailDialog,
PotentialCustomerStoreDetailSection,
InfoVerifyMerchantDialog
},
directives: {
......@@ -696,6 +680,7 @@ export default {
},
handleExport() {
// 导出入参与列表一致(含 isBind、storeName、merchantName);「信息核验」列由服务端导出模板配置并与列表口径一致。
var params = this.searchFormSearch
params.method = 'dj.api.smartcarlife.sale.potentialCustomers.export.async'
const list = [
......@@ -819,41 +804,4 @@ export default {
text-overflow: ellipsis;
overflow: hidden;
}
.info-verify-store-detail {
margin-bottom: 16px;
padding: 12px 14px;
background: #f7f8fa;
border-radius: 6px;
border: 1px solid #ebeef5;
}
.info-verify-store-detail__title {
font-size: 14px;
font-weight: 600;
color: #303133;
margin-bottom: 10px;
}
.info-verify-store-detail__grid {
display: flex;
flex-wrap: wrap;
gap: 8px 24px;
}
.info-verify-store-detail__row {
flex: 1 1 40%;
min-width: 200px;
font-size: 13px;
line-height: 1.5;
}
.info-verify-store-detail__row--full {
flex: 1 1 100%;
}
.info-verify-store-detail__label {
color: #909399;
margin-right: 8px;
}
</style>
......@@ -359,6 +359,8 @@ export default {
return i === -1 ? 0 : i
},
sceneLabel() {
const name = this.routerInfo.baseSceneName
if (name != null && String(name).trim() !== "") return String(name).trim()
const scene = this.routerInfo.scene
if (scene == null || scene === "") return "—"
const label = this.sceneList[scene]
......
......@@ -553,7 +553,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${index == length ? "" : "、"}`
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${index == length ? "" : "、"}`
return str
}, '')
return text
......
......@@ -584,7 +584,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${
index == length ? "" : "、"
}`
return str
......
......@@ -245,6 +245,8 @@ export default {
},
/** A1:避免模板每次渲染调用方法;scene 缺失时安全展示 */
sceneLabel() {
const name = this.merchantRow?.baseSceneName
if (name != null && String(name).trim() !== "") return String(name).trim()
const key = this.merchantRow?.scene
if (key == null || key === "") return "-"
const label = this.sceneList[key]
......
......@@ -558,7 +558,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${index == length ? "" : "、"}`
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${index == length ? "" : "、"}`
return str
}, '')
return text
......
......@@ -678,7 +678,7 @@ export default {
if (arr[0]?.categoryType == 2) {
const length = arr.length - 1
text = arr.reduce((str, item, index) => {
str += `${item.upgradeGoodsName}(${item.commodityCode})${
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${
index == length ? "" : "、"
}`
return str
......
......@@ -3,7 +3,7 @@
<div class="merchant-checkdetail">
<div class="merchant-title">
<span>商户名称:{{ merchantRow.merchantName }}</span>
<span>业务场景:{{ sceneList[merchantRow.sceneType] }}</span>
<span>业务场景:{{ sceneDisplayLabel }}</span>
<span>类型:{{ ruleReviewType[merchantRow.ruleType] }}</span>
<span>生效时间:{{ merchantRow.effectStartDateShow }}</span>
</div>
......@@ -106,7 +106,16 @@ export default {
ledgerAccount,
reconciliation
},
computed: {}
computed: {
sceneDisplayLabel() {
const name = this.merchantRow?.baseSceneName
if (name != null && String(name).trim() !== "") return String(name).trim()
const key = this.merchantRow?.sceneType
if (key == null || key === "") return "—"
const label = this.sceneList[key]
return label != null && label !== "" ? label : "—"
}
}
}
</script>
<style lang="scss">
......
......@@ -14,30 +14,24 @@
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">服务商列表</span>
<el-button type="primary"
size="small"
@click="openInfoVerifyDialog">
<!-- <span slot="left">服务商列表</span> -->
<el-button type="primary" size="small" @click="openInfoVerifyDialog">
新增
</el-button>
</d2-table-header>
<d2-table ref="serviceStoreTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button" slot-scope="scope" :show-btn-ids="['9060503']" :data="scope.scope" />
</d2-table>
</div>
<info-verify-merchant-dialog :visible.sync="infoVerifyVisible"
:customer-row="null"
:submit-api="infoVerifySubmit"
:merchant-type-labels="['园区店']"
@success="onInfoVerifySuccess" />
<info-verify-merchant-dialog :visible.sync="infoVerifyVisible" :customer-row="null" :submit-api="submitInfoVerifyMerchant"
:merchant-type-labels="['服务商']" @success="onInfoVerifySuccess" />
</d2-container>
</template>
<script>
import { Util } from '@/common/util'
import { getList } from '@api/serviceManage'
import { potentialCustomersInfoVerify } from '@api/salesManagement'
import { getList, createMerchantWithPermissions } from '@api/serviceManage'
import InfoVerifyMerchantDialog from '@/components/merchantVerify/InfoVerifyMerchantDialog.vue'
import { mapActions } from 'vuex'
import { procureModeList } from "@/common/constants"
......@@ -180,7 +174,6 @@ export default {
}]
},
infoVerifyVisible: false,
infoVerifySubmit: potentialCustomersInfoVerify
}
},
......@@ -216,6 +209,13 @@ export default {
onInfoVerifySuccess() {
this.$refs.serviceStoreTable.refreshTable()
},
/** 服务商新增提交:merchantType=7 */
submitInfoVerifyMerchant(params) {
return createMerchantWithPermissions({
...params,
merchantType: 7
})
},
// 编辑服务商
handleEdit(row) {
this.close({ tagName: '/editService' })
......
<!-- 服务商管理 -->
<template>
<d2-container class="service-manage">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
label-width="100px"
:search-form="searchForm"
:form-data="showFormData" />
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" label-width="100px" :search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
<el-button :id="tableParams.btnId" size="small" type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">园区店服务商关联列表</span>
<el-button type="primary"
size="small"
@click="openInfoVerifyDialog">
<!-- <span slot="left">园区店服务商关联列表</span> -->
<el-button type="primary" size="small" @click="openInfoVerifyDialog">
新增
</el-button>
<auth-button category="Button" />
<!-- <auth-button category="Button" /> -->
</d2-table-header>
<d2-table ref="serviceStoreTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope">
<d2-table ref="serviceStoreTable" :search-form="searchForm" :table-params="tableParams" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button" slot-scope="scope" :data="scope.scope">
</auth-button>
</d2-table>
<qrcode-dialog :q-rcode-visible="qRcodeVisible"
:info="recordInfo"
v-if="qRcodeVisible"
@dialogClose="dialogClose" />
<qrcode-dialog :q-rcode-visible="qRcodeVisible" :info="recordInfo" v-if="qRcodeVisible"
@dialogClose="dialogClose" />
</div>
<wxQRcodeDialog :q-rcode-visible.sync="QRcodeDialog"
v-if="QRcodeDialog"
:merchant-info="recordInfo" />
<scene-entry-dialog :scene-entry-visible="sceneEntryVisible"
:info="recordInfo"
v-if="sceneEntryVisible"
@dialogClose="sceneDialogClose" />
<info-verify-merchant-dialog :visible.sync="infoVerifyVisible"
:customer-row="null"
:submit-api="infoVerifySubmit"
:merchant-type-labels="['园区店']"
@success="onInfoVerifySuccess" />
<wxQRcodeDialog :q-rcode-visible.sync="QRcodeDialog" v-if="QRcodeDialog" :merchant-info="recordInfo" />
<scene-entry-dialog :scene-entry-visible="sceneEntryVisible" :info="recordInfo" v-if="sceneEntryVisible"
@dialogClose="sceneDialogClose" />
<info-verify-merchant-dialog :visible.sync="infoVerifyVisible" :customer-row="null" :submit-api="submitInfoVerifyMerchant"
:merchant-type-labels="['园区店']" @success="onInfoVerifySuccess" />
</d2-container>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { getYqMerchantinfoPage } from '@api/serviceManage'
import { potentialCustomersInfoVerify } from '@api/salesManagement'
import { getYqMerchantinfoPage, createMerchantWithPermissions } from '@api/serviceManage'
import InfoVerifyMerchantDialog from '@/components/merchantVerify/InfoVerifyMerchantDialog.vue'
import { mapActions } from 'vuex'
import { BaseData, manageTypeList } from '@/common/constants.js'
......@@ -236,7 +212,6 @@ export default {
recordInfo: {},
sceneEntryVisible: false,
infoVerifyVisible: false,
infoVerifySubmit: potentialCustomersInfoVerify
}
},
......@@ -338,6 +313,13 @@ export default {
onInfoVerifySuccess() {
this.$refs.serviceStoreTable.refreshTable()
},
/** 园区店新增提交:merchantType=6 */
submitInfoVerifyMerchant(params) {
return createMerchantWithPermissions({
...params,
merchantType: 6
})
},
// 上架
handleLaunch(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!