Commit f0686a38 by 前端

Merge branch 'v3.7.0' into 'master'

合并V3.7.0

See merge request !48
2 parents 6fd1106a 92cdb9bf
......@@ -356,21 +356,26 @@
name: 'staffLabel',
selected: true,
data: [
{
name: '精品升级(太阳膜)',
value: '1'
},
{
name: '1.0车损升级',
value: '0'
name: '次新车转化(车衣、改色膜)',
value: '4'
},
{
name: '1.1精品升级',
value: '1'
name: '售后众筹活动',
value: '3'
},
{
name: '1.2膨胀金活动',
value: '2'
name: '会员权益/升级',
value: '0'
},
{
name: '1.3众筹活动',
value: '3'
name: '膨胀金活动',
value: '2'
}
],
on: function (data) {
......@@ -560,7 +565,7 @@
}
var params = helper.clone(true, data.field, otherParams)
delete params.merhcnatImg
console.log(params)
params.createdSource = 1
request(params, function (result) {
if (result.code == '0') {
layer.msg('操作成功', {
......
......@@ -411,16 +411,19 @@
employeeData.staffLabel.map((item, index) => {
switch (item) {
case '0':
employeeData.staffLabel[index] = '1.0车损升级'
employeeData.staffLabel[index] = '会员权益/升级'
break
case '1':
employeeData.staffLabel[index] = '1.1精品升级'
employeeData.staffLabel[index] = '精品升级(太阳膜)'
break
case '2':
employeeData.staffLabel[index] = '1.2膨胀金活动'
employeeData.staffLabel[index] = '膨胀金活动'
break
case '3':
employeeData.staffLabel[index] = '1.3众筹活动'
employeeData.staffLabel[index] = '售后众筹活动'
break
case '4':
employeeData.staffLabel[index] = '次新车转化(车衣、改色膜)'
break
default:
employeeData.staffLabel[index] = '无'
......
......@@ -88,6 +88,18 @@
class="layui-input updateCircleAngle" />
</div>
</div>
<div id="from" class="layui-inline">
<label class="layui-form-label">来源:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="createdSource" id="searchfrom">
<option value="">全部</option>
<option value="1">账户中心</option>
<option value="2">SCRM</option>
<option value="3">生意助手</option>
<option value="4">门店助手</option>
</select>
</div>
</div>
<div class="layui-inline" style="float: right" pane>
<button type="button" class="layui-btn layui-btn-normal exportInputBtn" id="employeeExport">导出</button>
<button id="employeeReset" class="layui-btn">重置</button>
......@@ -143,6 +155,8 @@
{ field: 'statusName', title: '状态', align: 'center', width: 80 },
{ field: 'createdAccount', title: '创建者', align: 'center' },
{ field: 'merchantName', title: '商户名(商户号)', align: 'center', width: 160 },
{ field: 'createdSourceStr', title: '来源', align: 'center', width: 160 ,templet: '#sourceTpl',},
{ field: 'createdTime', title: '创建时间', align: 'center', width: 160 },
{ field: 'updatedTime', title: '更新时间', align: 'center', width: 90 },
{ title: '操作', width: 160, align: 'center', toolbar: '#employeeBar' },
{ field: 'statusName', title: '启用开关', width: 85, templet: '#switchTpl', unresize: true }
......@@ -475,6 +489,7 @@
lay-filter="sexDemo" {{ d.status==0 ? 'checked' : '' }}>
</div>
</script>
</body>
</html>
\ No newline at end of file
......@@ -1017,8 +1017,34 @@
} else {
params.status = 1
}
console.log(params)
request(params, function (res) {
verifyMerchantName(params.merchantName,params,loading)
layer.close(loading)
return false
})
function verifyDialog(params,loading){
// 验证商户名是否重复
layer.confirm('商户名称已经被使用,是否确定继续使用', {
title: "提示",
btn: ['取消', '确定'] //可以无限个按钮
,btn2: function(index, layero){
//按钮【按钮二】的回调
nextStepRequest(params,loading)
}
}, function(index, layero){
//按钮【按钮一】的回调
layer.close(index);
layer.close(loading)
})
}
function nextStepRequest(params,loading){
params.createdSource = 1
request(params, function (res) {
if (res.code == '0') {
layer.close(loading)
if (editLevel == 3) {
......@@ -1050,12 +1076,25 @@
}
})
}
} else {
layer.close(loading)
}
})
return false
})
layer.close(loading)
}
function verifyMerchantName(name,paramsM,loading){
var params = {
method: 'merchants.api.merchant.checkMerchantNameRepeat',
merchantName: paramsM.merchantName
}
request(params, function (res) {
if(res && res.data == true){
return nextStepRequest(paramsM,loading)
}else if(res && res.data ==false){
return verifyDialog(paramsM,loading)
}
})
}
function findId(nodeList) {
var idList = []
......
......@@ -987,7 +987,6 @@
if (treeObj) {
let getCheckedNodes = treeObj.getCheckedNodes(true)
const getCheckedKeys = treeObj.getCheckedNodes(true).map(item => item.id)
console.log(getCheckedKeys)
getCheckedNodes = getCheckedNodes.filter(item => item.children)
merchantForm.merchantBrandList = getCheckedNodes.map(car => {
let merchantBrandId = []
......@@ -1001,7 +1000,6 @@
merchantBrandId
}
})
console.log(merchantForm.merchantBrandList)
params.merchantBrandListJson = JSON.stringify(merchantForm.merchantBrandList)
}
if (merchantForm.merchantFiles.length) {
......@@ -1029,8 +1027,17 @@
} else {
params.status = 1
}
console.log(params)
request(params, function (res) {
verifyMerchantName(params.merchantName,params,loading)
layer.close(loading)
return false
})
function nextStepRequest(params,loading){
params.createdSource = 1
request(params, function (res) {
if (res.code == '0') {
layer.close(loading)
if (editLevel == 3) {
......@@ -1063,12 +1070,40 @@
}
})
}
} else {
layer.close(loading)
}
})
layer.close(loading)
}
function verifyMerchantName(name,paramsM,loading){
var params = {
method: 'merchants.api.merchant.checkMerchantNameRepeat',
merchantName: paramsM.merchantName
}
request(params, function (res) {
if(res && res.data == true){
return nextStepRequest(paramsM,loading)
}else if(res && res.data ==false){
return verifyDialog(paramsM,loading)
}
})
return false
})
}
function verifyDialog(params,loading){
// 验证商户名是否重复
layer.confirm('商户名称已经被使用,是否确定继续使用', {
title: "提示",
btn: ['取消', '确定'] //可以无限个按钮
,btn2: function(index, layero){
//按钮【按钮二】的回调
nextStepRequest(params,loading)
}
}, function(index, layero){
//按钮【按钮一】的回调
layer.close(index);
layer.close(loading)
})
}
function findId(nodeList) {
var idList = []
......@@ -1115,7 +1150,6 @@
var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区'
console.log(cityIdx)
if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
......
......@@ -367,7 +367,7 @@
<div class="layui-form-item">
<label class="layui-form-label required">商户名称:</label>
<div class="layui-input-inline">
<input class="layui-input disabled" maxlength="50" name="merchantName" disabled required lay-verify="required" placeholder="请输入商户名称" />
<input class="layui-input " maxlength="50" name="merchantName" required lay-verify="required" placeholder="请输入商户名称" />
</div>
</div>
</div>
......@@ -792,7 +792,6 @@
focusElem.css(verifyType == 'radio' ? { color: '' } : { 'border-color': '' })
})
.focus()
console.log(222)
return '必填项不能为空'
}
}
......@@ -915,6 +914,7 @@
// if (treeObj) merchantForm.merchantBrandMain = treeObj.getCheckedNodes(true)
// params.merchantBrandMain = findId(merchantForm.merchantBrandMain).join(',')
if (treeObj) {
let getCheckedNodes = treeObj.getCheckedNodes(true)
const getCheckedKeys = treeObj.getCheckedNodes(true).map(item => item.id)
// getCheckedNodes = getCheckedNodes.filter(item => item.children)
......@@ -923,6 +923,7 @@
let parent = childCheckNodes.map(item => {
return item.getParentNode()
})
parent = parent.filter(item => item !== null)
const removeDuplicateObj = arr => {
let obj = {}
arr = arr.reduce((newArr, next) => {
......@@ -969,7 +970,22 @@
} else {
params.status = 1
}
console.log(params)
verifyMerchantName(params.merchantName,params)
// request(params, function (res) {
// if (res.code == '0') {
// layer.msg('操作成功', {
// icon: 1
// })
// if (!functionClick) {
// go('merchant', 'index')
// }
// }
// })
return false
})
function nextStepRequest(params){
request(params, function (res) {
if (res.code == '0') {
layer.msg('操作成功', {
......@@ -980,8 +996,38 @@
}
}
})
return false
})
}
function verifyDialog(params){
// 验证商户名是否重复
layer.confirm('商户名称已经被使用,是否确定继续使用', {
title: "提示",
btn: ['取消', '确定'] //可以无限个按钮
,btn2: function(index, layero){
//按钮【按钮二】的回调
nextStepRequest(params)
}
}, function(index, layero){
//按钮【按钮一】的回调
layer.close(index);
})
}
function verifyMerchantName(name,paramsM){
var params = {
method: 'merchants.api.merchant.checkMerchantNameRepeat',
merchantName: paramsM.merchantName
}
request(params, function (res) {
if(res && res.data == true){
return nextStepRequest(paramsM)
}else if(res && res.data ==false){
return verifyDialog(paramsM)
}
})
}
function findId(nodeList) {
var idList = []
......
......@@ -220,6 +220,16 @@
</div>
</div>
</div>
<div id="from" class="layui-inline">
<label class="layui-form-label">来源:</label>
<div class="layui-input-inline" style="width: 246px">
<select name="createdSource" id="searchfrom">
<option value="">全部</option>
<option value="1">账户中心</option>
<option value="3">生意助手</option>
</select>
</div>
</div>
<div class="layui-inline searchInputBtn" style="float: right;">
<button class="layui-btn" id="merchantReset">重置</button>
......@@ -403,6 +413,24 @@
// width: 160
},
{
field: 'createdSourceStr',
title: '来源',
align: 'center',
width: 120
},
{
field: 'createdAccount',
title: '创建人',
align: 'center',
width: 120
},
{
field: 'createdTime',
title: '创建时间',
align: 'center',
width: 120
},
{
field: 'updatedTime',
title: '更新时间',
align: 'center',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!