Commit 37ace8ca by 前端

修改多选

1 parent 7d8e33ca
......@@ -122,6 +122,10 @@
xm-select>.xm-body .scroll-body {
width: 360px;
}
xm-select:hover {
border: 1px solid #5850ff !important;
}
</style>
</head>
......@@ -236,12 +240,13 @@
<div class="layui-form-item">
<label class="layui-form-label">员工标签:</label>
<div class="layui-input-block">
<select name="staffLabel" id="tagAuth">
<div id="tagAuth" name="staffLabel" class="xm-select-demo"></div>
<!-- <select name="staffLabel" id="tagAuth" xm-select="selectId">
<option value="0">1.0新车权益销售</option>
<option value="1">1.1次新车精品升级</option>
<option value="2">1.2次新车线上转化</option>
<option value="3">1.3存量用户众筹</option>
</select>
</select> -->
</div>
</div>
......@@ -317,6 +322,45 @@
}
}
// 员工标签
var tagAuth = xmSelect.render({
el: '#tagAuth',
prop: {
name: 'name',
value: 'value'
},
// layVerify: `${qs('channel') ? '' : 'required'}`,
// model: {
// label: {
// type: 'text',
// text: {}
// }
// },
name: 'staffLabel',
selected: true,
data: [
{
name: '1.0新车权益销售',
value: '0'
},
{
name: '1.1次新车精品升级',
value: '1'
},
{
name: '1.2次新车线上转化',
value: '2'
},
{
name: '1.3存量用户众筹',
value: '3'
}
],
on: function (data) {
staffLabel = data.change[0].value
}
})
var merchantNameSelect = xmSelect.render({
el: '#merchantNameSelect',
......@@ -337,7 +381,6 @@
radio: true,
data: [],
on: function (data) {
console.log(data)
merchantId = data.change[0].id
getList(merchantId)
}
......@@ -545,7 +588,6 @@
function getVisibleMerchant(merchantId) {
var visibleMerchantParams = { id: merchantId, method: 'merchants.api.merchant.findMerchantTree' }
request(visibleMerchantParams, function (res) {
console.log(res)
if (res.code == '0') {
const data = res.data
if (id) {
......@@ -584,7 +626,6 @@
}
function createMerchant(arr, data) {
console.log(arr, data)
visibleMerchant = tree.create('visibleInferiorMerTree', data, null, {
check: {
enable: true,
......@@ -655,11 +696,14 @@
staffEmail: data.staffEmail,
staffJob: data.staffJob,
department: data.department,
staffLabel: data.staffLabel,
weChatNickName: data.weChatNickName,
weChatPhone: data.weChatPhone,
weChatOpenId: data.weChatOpenId
}
if (data.staffLabel) {
var item = data.staffLabel.split(','.toString())
tagAuth.setValue(item)
}
if (data.merchantFileResponse) {
merchantFileRequest = { fileName: data.merchantFileResponse.fileName, fileUrl: data.merchantFileResponse.fileUrl }
$('#img').attr('src', merchantFileRequest.fileUrl)
......
......@@ -372,7 +372,7 @@
}
// 所属部门
if (employeeData.department) {
switch(employeeData.department) {
switch(employeeData.department) {
case 1 :
$('#department').text('销售部')
break;
......@@ -388,25 +388,32 @@
default:
$('#department').text('无')
}
}
// 员工标签
if (employeeData.staffLabel) {
switch(employeeData.staffLabel) {
case 0 :
$('#staffLabel').text('1.0新车权益销售')
employeeData.staffLabel = employeeData.staffLabel.split(',')
console.log(employeeData.staffLabel, '0');
employeeData.staffLabel.map((item,index) => {
switch(item) {
case '0' :
employeeData.staffLabel[index] = '1.0新车权益销售'
break;
case 1 :
$('#staffLabel').text('1.1次新车精品升级')
case '1' :
employeeData.staffLabel[index] = '1.1次新车精品升级'
break;
case 2 :
$('#staffLabel').text('1.2次新车线上转化')
case '2' :
employeeData.staffLabel[index] = '1.2次新车线上转化'
break;
case 3 :
$('#staffLabel').text('1.3存量用户众筹')
case '3' :
employeeData.staffLabel[index] = '1.3存量用户众筹'
break;
default:
$('#staffLabel').text('无')
employeeData.staffLabel[index] = '无'
}
})
console.log(employeeData.staffLabel.join(','), '1');
$('#staffLabel').text(employeeData.staffLabel.join(','))
}
if (employeeData.visibleInferiorMerName) {
var visibleName = employeeData.visibleInferiorMerName.split(',')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!