Commit b3900535 by 胡悦

tijao

1 parent c1abb457
...@@ -139,7 +139,6 @@ ...@@ -139,7 +139,6 @@
//Demo //Demo
layui.use(['form', 'upload', 'gtree', 'request', 'helper'], function() { layui.use(['form', 'upload', 'gtree', 'request', 'helper'], function() {
console.log(qs('merchantId'))
var merchantId = qs('merchantId') var merchantId = qs('merchantId')
var id = qs('id') var id = qs('id')
var form = layui.form var form = layui.form
...@@ -215,14 +214,12 @@ ...@@ -215,14 +214,12 @@
} }
if (data.merchantFileResponse) { if (data.merchantFileResponse) {
merchantFileRequest = { fileName: data.merchantFileResponse.fileName, fileUrl: data.merchantFileResponse.fileUrl } merchantFileRequest = { fileName: data.merchantFileResponse.fileName, fileUrl: data.merchantFileResponse.fileUrl }
$('#img').attr('src', merchantFileRequest.fileUrl)
$('#img').removeClass('hide')
$('#img').addClass('show')
$('.img-add').removeClass('show')
$('.img-add').addClass('hide')
} }
var imgEl = $('#img')
var addEl = $('.img-add')
imgEl.attr('src', merchantFileRequest.fileUrl)
imgEl.removeClass('hide')
imgEl.addClass('show')
addEl.removeClass('show')
addEl.addClass('hide')
var visibleInferiorMerArr = data.visibleInferiorMer.split(',') var visibleInferiorMerArr = data.visibleInferiorMer.split(',')
$.each(visibleInferiorMerArr, function(index, item) { $.each(visibleInferiorMerArr, function(index, item) {
visibleInferiorMerArr[index] = +item visibleInferiorMerArr[index] = +item
...@@ -230,7 +227,7 @@ ...@@ -230,7 +227,7 @@
// var visibleInferiorMerArr = [32, 38] // var visibleInferiorMerArr = [32, 38]
callback(visibleInferiorMerArr) callback(visibleInferiorMerArr)
} }
console.log(employeeForm) console.log(employeeForm, merchantFileRequest)
form.val('employeeForm', employeeForm) form.val('employeeForm', employeeForm)
}) })
} }
...@@ -270,6 +267,7 @@ ...@@ -270,6 +267,7 @@
// 提交表单 // 提交表单
form.on('submit(employeeSubmit)', function(data) { form.on('submit(employeeSubmit)', function(data) {
console.log(id, 'llll')
var visibleInferiorMer = visibleMerchant.getCheckedNodes(true).map(function(i) { var visibleInferiorMer = visibleMerchant.getCheckedNodes(true).map(function(i) {
return i.id return i.id
}).join(',') }).join(',')
...@@ -280,14 +278,17 @@ ...@@ -280,14 +278,17 @@
} }
if (merchantFileRequest.fileName) { if (merchantFileRequest.fileName) {
otherParams.merchantFileRequest = JSON.stringify(merchantFileRequest) otherParams.merchantFileRequest = JSON.stringify(merchantFileRequest)
} else }
if (id) { if (id) {
console.log(id)
otherParams.id = id otherParams.id = id
otherParams.method = 'cn.com.glsx.merchants.staff.updateStaff' otherParams.method = 'cn.com.glsx.merchants.staff.updateStaff'
} else { } else {
otherParams.method = 'cn.com.glsx.merchants.staff.saveStaff' otherParams.method = 'cn.com.glsx.merchants.staff.saveStaff'
} }
var params = helper.clone(true, data.field, otherParams) var params = helper.clone(true, data.field, otherParams)
delete params.merhcnatImg
console.log(params)
request(params, function (result) { request(params, function (result) {
if (result.code == '0') { if (result.code == '0') {
window.history.back() window.history.back()
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
<div class="layui-inline" pane> <div class="layui-inline" pane>
<label class="layui-form-label">状态</label> <label class="layui-form-label">状态</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="status" lay-verify="required"> <select name="status" id="status" lay-verify="required">
<option value="">全部</option> <!-- <option value="">全部</option>
<option value="0">存草稿</option> <option value="0">存草稿</option>
<option value="1">启用</option> <option value="1">启用</option>
<option value="2">已注销</option> <option value="2">已注销</option> -->
</select> </select>
</div> </div>
</div> </div>
...@@ -78,7 +78,9 @@ ...@@ -78,7 +78,9 @@
var $ = layui.$ var $ = layui.$
// 商户名称列表 // 商户名称列表
var merchantName = $("#merchantName") var merchantName = $("#merchantName")
var status = $('#status')
findAllMerchant() findAllMerchant()
findAllDictData()
//创建table实例 //创建table实例
var employeeTable = table.render({ var employeeTable = table.render({
elem: '#employeeTable', elem: '#employeeTable',
...@@ -130,21 +132,6 @@ ...@@ -130,21 +132,6 @@
} }
) )
} }
// 查询所有商户
function findAllMerchant() {
var params = { method: 'cn.com.glsx.merchants.menu.findAllMerchant' }
request(params, function (result) {
if (result.code == '0') {
console.log(result)
var list = result.data
list.unshift('')
$.each(list, function (index, item) {
merchantName.append(new Option(item.merchantName, item.id))
})
form.render('select')
}
})
}
// table工具条事件 // table工具条事件
table.on('tool(employeeTool)', function(obj) { table.on('tool(employeeTool)', function(obj) {
var data = obj.data var data = obj.data
...@@ -197,6 +184,11 @@ ...@@ -197,6 +184,11 @@
}) })
} }
}) })
// 查询事件
$('#employeeSearch').on('click', function() {
var searchData = getSearch()
getTabelList(employeeTable, searchData)
})
// 新增点击事件 // 新增点击事件
$('#addEmployee').on('click', function() { $('#addEmployee').on('click', function() {
var value = merchantName.val() var value = merchantName.val()
...@@ -216,11 +208,22 @@ ...@@ -216,11 +208,22 @@
} }
}) })
}) })
// 查询事件 // 查询所有商户
$('#employeeSearch').on('click', function() { function findAllMerchant() {
var searchData = getSearch() var params = { method: 'cn.com.glsx.merchants.menu.findAllMerchant' }
getTabelList(employeeTable, searchData) request(params, function (result) {
}) if (result.code == '0') {
console.log(result)
var list = result.data
list.unshift('')
$.each(list, function (index, item) {
merchantName.append(new Option(item.merchantName, item.id))
})
form.render('select')
}
})
}
function getSearch() { function getSearch() {
var formVal = form.val('employeeForm') var formVal = form.val('employeeForm')
var searchData = helper.clone(false, formVal) var searchData = helper.clone(false, formVal)
...@@ -239,6 +242,22 @@ ...@@ -239,6 +242,22 @@
delete searchData.keywords delete searchData.keywords
return searchData return searchData
} }
function findAllDictData() {
var params = {
method: 'cn.com.glsx.merchants.menu.findAllDictData',
dictType: 'staff_status'
}
request(params, function(res) {
if (res.code == '0') {
var list = res.data
list.unshift('')
$.each(list, function (index, item) {
status.append(new Option(item.dictLabel, item.dictValue))
})
form.render('select')
}
})
}
}) })
</script> </script>
<script type="text/html" id="employeeBar"> <script type="text/html" id="employeeBar">
......
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
accountType.append(str) accountType.append(str)
if (roleid) { if (roleid) {
// 角色权限的check // 角色权限的check
for (var i = 0; i < check_arr.length; i++) { for (var i = 0; i < check_arr.length; i++) {
if (check_arr[i].accounttypeId == item.accounttypeId) { if (check_arr[i].accounttypeId == item.accounttypeId) {
var productData = check_arr[i] var productData = check_arr[i]
str.attr("checked", true) str.attr("checked", true)
...@@ -321,7 +321,6 @@ ...@@ -321,7 +321,6 @@
// 树的回显 // 树的回显
} }
break
} }
if (check_arr.length != 0) { if (check_arr.length != 0) {
active.tabChange('roleAuth', check_arr[0].accounttypeId) active.tabChange('roleAuth', check_arr[0].accounttypeId)
......
...@@ -175,11 +175,6 @@ ...@@ -175,11 +175,6 @@
if (res.code == '0') { if (res.code == '0') {
menuFunTreeData = res.data menuFunTreeData = res.data
console.log(menuFunTreeData) console.log(menuFunTreeData)
// var select = $('#accountType')
// $.each(menuFunTreeData, function (index, item) {
// select.append(new Option(item.accounttypeName, item.accounttypeId))
// })
// form.render('select')
getById(function(responseList) { getById(function(responseList) {
console.log('responseList:', responseList) console.log('responseList:', responseList)
if (responseList && responseList.length != 0) { if (responseList && responseList.length != 0) {
...@@ -203,32 +198,11 @@ ...@@ -203,32 +198,11 @@
var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId
active.tabChange(filterName, productId) active.tabChange(filterName, productId)
} }
break
} }
// $.each(responseList, function (idx, i) {
// if (item.accounttypeId == i.accounttypeId) {
// console.log(i, item)
// detailTreeData.push(i)
// active.tabAdd({
// title: item.accounttypeName,
// value: item.accounttypeId
// })
// var menuData = []
// for(var j = 0; j < i.productList.length; j++) {
// }
// }
// })
}) })
active.tabChange('roleAuth', responseList[0].accounttypeId) active.tabChange('roleAuth', responseList[0].accounttypeId)
} }
}) })
// $.each(menuFunTreeData[0].products, function(index, i) {
// active.tabAdd({
// title: i.productName,
// value: i.productId
// })
// })
} }
}) })
} }
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
<script type="text/html" id="roleBar"> <script type="text/html" id="roleBar">
<a class="layui-btn-xs" lay-event="detail">查看</a> <a class="layui-btn-xs" lay-event="detail">查看</a>
<a class="layui-btn-xs" lay-event="edit">修改</a> <a class="layui-btn-xs" lay-event="edit">修改</a>
{{# if(d.delFlag == 0){ }} {{# if(d.delFlag == 1){ }}
<a class="layui-btn-xs" lay-event="del">删除</a> <a class="layui-btn-xs" lay-event="del">删除</a>
{{# } }} {{# } }}
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!