Commit 6cec7f55 by 前端

Merge branch 'huy_dev_v2.0.0' into 'v2.0.0'

修改经营业务类型、主营品牌更换接口

See merge request !4
2 parents 5433b08e 81e54083
......@@ -100,7 +100,7 @@
}
.hide {
display: none;
display: none !important;
}
.option-btns {
......@@ -206,6 +206,13 @@
border-bottom-left-radius: 0;
border-left: none;
}
.no-car {
display: flex;
height: 100px;
align-items: center;
justify-content: center;
}
</style>
<title>商户编辑</title>
</head>
......@@ -354,6 +361,10 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">经营业务类型:</label>
<div class="removeCheckBg" id="busiScopeEl"></div>
</div>
<!-- <div class="layui-form-item">
<label class="layui-form-label">营业范围:</label>
<div class="layui-input-inline removeCheckBg" id="busiScopeEl"></div>
</div>
......@@ -369,19 +380,17 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon">&#xe654</i>
</div> -->
</div>
</div>
</div>
</div>
</div> -->
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<div id="carBrandTree" class="wrapper-tree" style="height: 200px; overflow-y: scroll"></div>
<div id="carBrandTree" class="wrapper-tree hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div>
</div>
</div>
</div>
......@@ -532,15 +541,18 @@
<script src="/js/load.js"></script>
<script src="/js/validator.js"></script>
<script>
layui.use(['gtree', 'request', 'helper', 'layer', 'laydate', 'element', 'xmSelect', 'laytpl', 'validator'], function () {
layui.use(['gtree', 'request', 'helper', 'layer', 'laydate', 'element', 'xmSelect', 'laytpl', 'validator', 'util'], function () {
var tree = layui.gtree
var request = layui.request
var form = layui.form
var laydate = layui.laydate
var util = layui.util
var $ = layui.$
var validator = layui.validator
var helper = layui.helper
var element = layui.element
var laytpl = layui.laytpl
var xmSelect = layui.xmSelect
var editData = {}
var treeObj = null
var all_nodes = []
......@@ -573,7 +585,7 @@
lat: '',
lng: '',
merchantAddress: '',
businessScope: '',
businessType: '',
merchantFiles: []
}
......@@ -642,7 +654,6 @@
elem: '#expireDate',
format: 'yyyy-MM-dd'
})
editLevel = qs('editLevel')
isFactory = qs('isFactory') == 'true'
step = qs('step')
......@@ -799,7 +810,7 @@
}
var checkClassNameList = [
{
attr: 'businessScope',
attr: 'businessType',
toString: ','
},
{
......@@ -836,9 +847,9 @@
tempList.push(item.value)
}
})
merchantForm.businessScopeCustomize = tempList.join(',')
params.businessScopeCustomize = tempList.join(',')
merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if (treeObj) merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
params.merchantBrand = findId(merchantForm.merchantBrand).join(',')
if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
......@@ -1264,26 +1275,33 @@
// 品牌
function getCarBrandTree() {
var params = {
method: 'merchants.api.merchantCommon.getCarbrandTree'
method: 'dj.api.get.car.brandList',
needCarSeries: true
// method: 'merchants.api.merchantCommon.getCarbrandTree'
}
request(params, function (res) {
baseData.carBrandTreeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
if (res.data && res.data.length) {
$('#carBrandTree').removeClass('hide')
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
})
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
} else {
$('#noCarbrand').removeClass('hide')
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
})
}, { isDjUrl: true })
}
// 获取字典数据
function getDictData(dictType, fn) {
......@@ -1340,16 +1358,16 @@
// 营业范围
function getBusiScope() {
getDictData('business_scope', function (res) {
getDictData('business_type', function (res) {
baseData.busiScopeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.businessScope) {
checkedList = merchantForm.businessScope.split(',')
if (editLevel == 3 && merchantForm.businessType) {
checkedList = merchantForm.businessType.split(',')
}
var el = $('#busiScopeEl')
$.each(baseData.busiScopeList, function (index, item) {
var optionEl = $(
'<input type="checkbox" class="businessScope" name="businessScope[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
'<input type="checkbox" class="businessType" name="businessType[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
)
// 修改-回显
if (editLevel == 3) {
......@@ -1454,8 +1472,6 @@
}
// 数 - start
var laytpl = layui.laytpl
var xmSelect = layui.xmSelect
var check_arr = []
var requestList = []
var templateData = {}
......
......@@ -113,7 +113,7 @@
}
.hide {
display: none;
display: none !important;
}
.option-btns {
......@@ -218,6 +218,13 @@
#basicForm {
margin-bottom: 87px;
}
.no-car {
display: flex;
height: 100px;
align-items: center;
justify-content: center;
}
</style>
<title>商户编辑</title>
</head>
......@@ -343,10 +350,10 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">营业范围:</label>
<div class="layui-input-inline" id="busiScopeEl"></div>
<label class="layui-form-label">经营业务类型:</label>
<div id="busiScopeEl"></div>
</div>
<div class="layui-form-item" id="custom-scope">
<!-- <div class="layui-form-item" id="custom-scope">
<div class="layui-form-item">
<label class="layui-form-label"></label>
<div>
......@@ -358,19 +365,17 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon">&#xe654</i>
</div> -->
</div>
</div>
</div>
</div>
</div> -->
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<div id="carBrandTree" style="height: 200px; overflow-y: scroll"></div>
<div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div>
</div>
</div>
</div>
......@@ -572,7 +577,7 @@
lat: '',
lng: '',
merchantAddress: '',
businessScope: '',
businessType: '',
merchantFiles: []
}
......@@ -811,7 +816,7 @@
}
var checkClassNameList = [
{
attr: 'businessScope',
attr: 'businessType',
toString: ','
},
{
......@@ -848,9 +853,9 @@
tempList.push(item.value)
}
})
merchantForm.businessScopeCustomize = tempList.join(',')
params.businessScopeCustomize = tempList.join(',')
merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if (treeObj) merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
params.merchantBrand = findId(merchantForm.merchantBrand).join(',')
if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
......@@ -1279,26 +1284,33 @@
// 品牌
function getCarBrandTree() {
var params = {
method: 'merchants.api.merchantCommon.getCarbrandTree'
// method: 'merchants.api.merchantCommon.getCarbrandTree'
method: 'dj.api.get.car.brandList',
needCarSeries: true
}
request(params, function (res) {
baseData.carBrandTreeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
if (res.data && res.data.length) {
$('#carBrandTree').removeClass('hide')
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
})
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
} else {
$('#noCarbrand').removeClass('hide')
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
})
}, { isDjUrl: true })
}
// 获取字典数据
function getDictData(dictType, fn) {
......@@ -1355,16 +1367,16 @@
// 营业范围
function getBusiScope() {
getDictData('business_scope', function (res) {
getDictData('business_type', function (res) {
baseData.busiScopeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.businessScope) {
checkedList = merchantForm.businessScope.split(',')
if (editLevel == 3 && merchantForm.businessType) {
checkedList = merchantForm.businessType.split(',')
}
var el = $('#busiScopeEl')
$.each(baseData.busiScopeList, function (index, item) {
var optionEl = $(
'<input type="checkbox" class="businessScope" name="businessScope[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
'<input type="checkbox" class="businessType" name="businessType[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
)
// 修改-回显
if (editLevel == 3) {
......
......@@ -472,10 +472,10 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">营业范围:</label>
<label class="layui-form-label">经营业务类型:</label>
<div class="layui-input-block">
<!-- layui-form-mid -->
<div class="layui-word-aux" id="businessScopName"></div>
<div class="layui-word-aux" id="businessTypeName"></div>
</div>
</div>
</div>
......@@ -582,7 +582,7 @@
'merchantAddress',
'merchantLegalPerson',
'merchantLegalPersonPhone',
'businessScopName',
'businessTypeName',
'merchantBrandName',
'merchantModelName',
'statusName',
......@@ -683,9 +683,9 @@
if (res.code == '0') {
roleData = helper.clone(true, res.data)
for (var i in basicArr) {
if (basicArr[i] == 'businessScopName' && roleData.businessScopeCustomize) {
roleData.businessScopName = roleData.businessScopName ? roleData.businessScopName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize
}
// if (basicArr[i] == 'businessTypeName' && roleData.businessScopeCustomize) {
// roleData.businessTypeName = roleData.businessTypeName ? roleData.businessTypeName + ',' + roleData.businessScopeCustomize : roleData.businessScopeCustomize
// }
$('#' + [basicArr[i]]).text(roleData[basicArr[i]] ? roleData[basicArr[i]] : '-')
}
if (roleData.merchantType == 2) {
......
......@@ -114,7 +114,7 @@
}
.hide {
display: none;
display: none !important;
}
.option-btns {
......@@ -210,6 +210,13 @@
color: #c0c4cc;
cursor: not-allowed;
}
.no-car {
display: flex;
height: 100px;
align-items: center;
justify-content: center;
}
</style>
<title>商户编辑</title>
</head>
......@@ -427,10 +434,10 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">营业范围:</label>
<div class="layui-input-inline removeCheckBg" id="busiScopeEl"></div>
<label class="layui-form-label">经营业务类型:</label>
<div class="removeCheckBg" id="busiScopeEl"></div>
</div>
<div class="layui-form-item" id="custom-scope">
<!-- <div class="layui-form-item" id="custom-scope">
<div class="layui-form-item">
<label class="layui-form-label"></label>
<div>
......@@ -442,19 +449,17 @@
<button type="button" class="layui-btn btn-no-border" data-type="handleAddScope">
<i class="layui-icon layui-icon-add-circle scope-btn"></i>
</button>
<!-- <div class="wrap-add-signal" data-type="handleAddScope">
<i class="layui-icon">&#xe654</i>
</div> -->
</div>
</div>
</div>
</div>
</div> -->
<div class="layui-col-md6">
<div class="layui-form-item">
<label class="layui-form-label">主营品牌:</label>
<div class="layui-input-inline">
<input class="layui-input" placeholder="车型品牌" id="brand" />
<div id="carBrandTree" style="height: 200px; overflow-y: scroll"></div>
<div id="carBrandTree" class="hide" style="height: 200px; overflow-y: scroll"></div>
<div id="noCarbrand" class="no-car hide">暂无数据</div>
</div>
</div>
</div>
......@@ -569,7 +574,7 @@
lat: '',
lng: '',
merchantAddress: '',
businessScope: '',
businessType: '',
merchantFiles: []
}
......@@ -797,7 +802,7 @@
}
var checkClassNameList = [
{
attr: 'businessScope',
attr: 'businessType',
toString: ','
},
{
......@@ -833,9 +838,9 @@
tempList.push(item.value)
}
})
merchantForm.businessScopeCustomize = tempList.join(',')
params.businessScopeCustomize = tempList.join(',')
merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
// merchantForm.businessScopeCustomize = tempList.join(',')
// params.businessScopeCustomize = tempList.join(',')
if (treeObj) merchantForm.merchantBrand = treeObj.getCheckedNodes(true)
params.merchantBrand = findId(merchantForm.merchantBrand).join(',')
if (merchantForm.merchantFiles.length) {
params.merchantFiles = JSON.stringify(merchantForm.merchantFiles)
......@@ -860,6 +865,7 @@
} else {
params.status = 1
}
console.log(params)
request(params, function (res) {
if (res.code == '0') {
layer.msg('操作成功', {
......@@ -1279,26 +1285,33 @@
// 品牌
function getCarBrandTree() {
var params = {
method: 'merchants.api.merchantCommon.getCarbrandTree'
// method: 'merchants.api.merchantCommon.getCarbrandTree'
method: 'dj.api.get.car.brandList',
needCarSeries: true
}
request(params, function (res) {
baseData.carBrandTreeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
if (res.data && res.data.length) {
$('#carBrandTree').removeClass('hide')
var checkedList = []
if (editLevel == 3 && merchantForm.merchantBrand) {
checkedList = merchantForm.merchantBrand.split(',')
$.each(checkedList, function (index, item) {
checkedList[index] = parseInt(item)
})
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
} else {
$('#noCarbrand').removeClass('hide')
}
treeObj = tree.create('carBrandTree', res.data, {
checkedList: checkedList
})
if (checkedList) {
treeObj.checkNodes(checkedList)
}
all_nodes = treeObj.transformToArray(treeObj.getNodes())
bindEvent()
})
}, { isDjUrl: true })
}
// 获取字典数据
function getDictData(dictType, fn) {
......@@ -1355,16 +1368,16 @@
// 营业范围
function getBusiScope() {
getDictData('business_scope', function (res) {
getDictData('business_type', function (res) {
baseData.busiScopeList = res.data
var checkedList = []
if (editLevel == 3 && merchantForm.businessScope) {
checkedList = merchantForm.businessScope.split(',')
if (editLevel == 3 && merchantForm.businessType) {
checkedList = merchantForm.businessType.split(',')
}
var el = $('#busiScopeEl')
$.each(baseData.busiScopeList, function (index, item) {
var optionEl = $(
'<input type="checkbox" class="businessScope" name="businessScope[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
'<input type="checkbox" class="businessType" name="businessType[' + item.dictValue + ']" title=' + item.dictLabel + ' value="' + item.dictValue + '" lay-skin="primary">'
)
// 修改-回显
if (editLevel == 3) {
......
......@@ -3,11 +3,11 @@
* @version: 1.0.0
* @Author: limin
* @Date: 2021-07-15 15:46:53
* @LastEditors: limin
* @LastEditTime: 2021-08-11 11:46:34
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-12 15:57:00
* @FilePath: \account\js\load.js
*/
;(function load() {
; (function load() {
loadLayConfig()
loadConfig()
loadHeaderFooter()
......@@ -22,7 +22,7 @@ function go(module, page, params, blank) {
if (blank) {
window.open(href, '_blank')
} else {
window.location.href = _p ? href + '?' + _p : href
}
}
......@@ -39,7 +39,7 @@ function loadHeaderFooter() {
var isExternal = isAppend()
var store = layui.store
console.log(qs('sessionId'))
if(isExternal){ //运营平台外部系统
if (isExternal) { //运营平台外部系统
append()
} else {//嵌入运营平台 或者是登录页面
if (qs('sessionId')) {
......@@ -52,11 +52,11 @@ function loadHeaderFooter() {
store.set('token', qs('sessionId'))
} else {
// 运营平台
if(isLoginPage()){ //如果是登陆页面 直接返回 登录成功会设置token
if (isLoginPage()) { //如果是登陆页面 直接返回 登录成功会设置token
return
}
var t = qs('t') //运营平台子系统从 父系统的iframe src获取 TGT.
if(t){
if (t) {
store.set('token', t)
}
}
......@@ -70,14 +70,14 @@ function append() {
$(header).load('/html/components/header.html')
$(footer).load('/html/components/footer.html')
$('main').before(header).after(footer)
}
function isAppend() {
return !isLoginPage() && self == top
}
function isLoginPage(){
function isLoginPage() {
var _href = location.href.split('/')
var _path = _href.slice(_href.length - 1, _href.length).toString()
return _path.split('?')[0] === 'login.html'
......@@ -91,7 +91,8 @@ function loadConfig() {
}
var ajax = layui.$.ajax
ajax({
url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config',
// url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/glsx-oss-account-config',
url: 'http://192.168.3.171:7300/mock/5be17454f31545347559d499/config/glsx-oss-account-config',
async: false,
success: function (res) {
store.setEx('external', res.external, 10 * 60 * 1000)
......
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: limin
* @Date: 2021-07-19 10:15:48
* @LastEditors: limin
* @LastEditTime: 2021-08-09 14:09:12
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-12 15:50:52
* @FilePath: \account\js\request.js
*/
layui.define(['sha1', 'md5', 'helper'], function (exports) {
......@@ -88,6 +88,14 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
settings.processData = false
settings.contentType = false
}
if (config.isDjUrl) {
console.log(common)
settings.url = common.otherRequest + '?method=' + params.method
settings.beforeSend = function (request) {
var token = store.get('token')
request.setRequestHeader('token', token)
}
}
return $.ajax(settings)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!