|
@@ -74,111 +74,123 @@
|
|
|
</style>
|
|
|
|
|
|
<body>
|
|
|
- <header id="header" class="mui-bar mui-bar-nav">
|
|
|
- <h1 class="mui-title">库房列表</h1>
|
|
|
- </header>
|
|
|
- <div class="mui-content">
|
|
|
- <div style="display: flex;margin: 10px;">
|
|
|
- <input type="text" placeholder="请输入关键字" id="searchInput"
|
|
|
- style="width: calc(100% - 80px);height: 40px;background: #FFFFFF;border-radius: 10px 0px 0px 10px;border: none;margin-bottom: 0;">
|
|
|
- </input>
|
|
|
- <div class="search" id="search">
|
|
|
- <img src="images/search.png"></img><span>搜索</span>
|
|
|
- </div>
|
|
|
+<header id="header" class="mui-bar mui-bar-nav">
|
|
|
+ <h1 class="mui-title">库房列表</h1>
|
|
|
+</header>
|
|
|
+<div class="mui-content">
|
|
|
+ <div style="display: flex;margin: 10px;">
|
|
|
+ <input type="text" placeholder="请输入关键字" id="searchInput"
|
|
|
+ style="width: calc(100% - 80px);height: 40px;background: #FFFFFF;border-radius: 10px 0px 0px 10px;border: none;margin-bottom: 0;">
|
|
|
+ </input>
|
|
|
+ <div class="search" id="search">
|
|
|
+ <img src="images/search.png"></img><span>搜索</span>
|
|
|
</div>
|
|
|
- <div class="mui-card">
|
|
|
- <ul id="kfList" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
|
|
|
+ </div>
|
|
|
+ <div class="mui-card">
|
|
|
+ <ul id="kfList" class="mui-table-view mui-table-view-striped mui-table-view-condensed">
|
|
|
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- <script src="js/jquery.min.js"></script>
|
|
|
- <script src="js/mui.min.js"></script>
|
|
|
- <script>
|
|
|
- function getDatalist(departmentName) {
|
|
|
- mui.ajax({
|
|
|
- // url: window.location.origin +'/wzglxtht/system/goods/getOpenKuFangList?userId=' + params.get('id'),
|
|
|
- // url: window.location.origin+'/system/dept/getDepartments',
|
|
|
- url: 'http://58.144.199.81:9081/system/dept/getDepartments',
|
|
|
- type: 'get',
|
|
|
- data: {
|
|
|
- departmentName: departmentName ? departmentName : "",
|
|
|
- },
|
|
|
- success: function (json) {
|
|
|
- $('#kfList').empty();
|
|
|
- if (json.data && json.data.length) {
|
|
|
- let html = ''
|
|
|
- for (let i = 0; i < json.data.length; i++) {
|
|
|
- html += `<li class="mui-table-view-cell">
|
|
|
+</div>
|
|
|
+<script src="js/jquery.min.js"></script>
|
|
|
+<script src="js/mui.min.js"></script>
|
|
|
+<script>
|
|
|
+ function getDatalist(departmentName) {
|
|
|
+ mui.ajax({
|
|
|
+ // url: window.location.origin +'/wzglxtht/system/goods/getOpenKuFangList?userId=' + params.get('id'),
|
|
|
+ // url: window.location.origin+'/system/dept/getDepartments',
|
|
|
+ url: 'http://58.144.199.81:9081/system/dept/getDepartments',
|
|
|
+ type: 'get',
|
|
|
+ data: {
|
|
|
+ departmentName: departmentName ? departmentName : "",
|
|
|
+ },
|
|
|
+ success: function (json) {
|
|
|
+ $('#kfList').empty();
|
|
|
+ if (json.data && json.data.length) {
|
|
|
+ let html = ''
|
|
|
+ for (let i = 0; i < json.data.length; i++) {
|
|
|
+ html += `<li class="mui-table-view-cell">
|
|
|
<div class="mui-table">
|
|
|
<div class="mui-table-cell mui-col-xs-10">
|
|
|
<div class="mui-ellipsis" data-id="${json.data[i].DepartMentDto.companyId}" data-departmentId="${json.data[i].DepartMentDto.departmentId}" data-name="${json.data[i].DepartMentDto.name}"
|
|
|
data-kgyIds="${json.data[i].kgyIds}"><img src="images/logo.png"></img>${json.data[i].DepartMentDto.name ? json.data[i].DepartMentDto.name : ""}</div>
|
|
|
<div style="padding:10px;">
|
|
|
<div class="list" id="list">
|
|
|
- <img src="images/kufanimg.png" style="width:140px;border-radius: 10px;"></img>
|
|
|
+ <img src="images/kufang1.png" style="width:140px;border-radius: 10px;"></img>
|
|
|
<div style="color:#333;display: flex;flex-direction: column;justify-content: flex-start;">`
|
|
|
- var data = json.data[i].kgyNames;
|
|
|
- for (var j = 0; j < data.length; j++) {
|
|
|
- var tephone = json.data[i].phones[j];
|
|
|
- html += `<div style="display:flex;margin-bottom:15px;">
|
|
|
+ var data = json.data[i].kgyNames;
|
|
|
+ for (var j = 0; j < data.length; j++) {
|
|
|
+ var tephone = json.data[i].phones[j];
|
|
|
+ html += `<div style="display:flex;margin-bottom:15px;">
|
|
|
<div class="listTitle">管理员:</div>
|
|
|
<div>${data[j]}</div>
|
|
|
<div class='telclick' data-tel='${tephone}'>${tephone ? tephone : '-'}</div>
|
|
|
</div>
|
|
|
`
|
|
|
- }
|
|
|
- html +=`<div style="display:flex;"><div class="listTitle">资产汇总:</div><div>234件</div></div>
|
|
|
+ }
|
|
|
+ html +=`<div style="display:flex;"><div class="listTitle">资产汇总:</div><div>${json.data[i].DepartMentDto.assetNum ? json.data[i].DepartMentDto.assetNum : '-'} 件</div></div>
|
|
|
</div></div></div>
|
|
|
<div class="list" style="display: flex;justify-content: space-between;padding:10px;"><div style="color: #333;">${json.data[i].DepartMentDto.location ? json.data[i].DepartMentDto.location : ""}</div>
|
|
|
- <div style="display: flex;align-items: flex-end;">`
|
|
|
- html+=`<img src="images/address.png" style="width: 22px;height: 18px;"></img>
|
|
|
+ <div class="btn-map" data-addr="${json.data[i].DepartMentDto.location ? json.data[i].DepartMentDto.location : ""}" style="display: flex;align-items: flex-end;">`
|
|
|
+ html+=`<img src="images/address.png" style="width: 22px;height: 18px;"></img>
|
|
|
<div style="color: #1484FE;text-shadow: 3px 4px 4px rgba(20,132,254,0.33);">地图</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</li>`
|
|
|
+ }
|
|
|
+ $('#kfList').append(html)
|
|
|
+ $(".telclick").on('click', function (e) {
|
|
|
+ if ((e.target).getAttribute("data-tel")) {
|
|
|
+ var link = document.createElement('a');
|
|
|
+ link.href = 'tel:' + $(".telclick").attr("data-tel")
|
|
|
+ link.click();
|
|
|
}
|
|
|
- $('#kfList').append(html)
|
|
|
- $(".telclick").on('click', function (e) {
|
|
|
- if ((e.target).getAttribute("data-tel")) {
|
|
|
- var link = document.createElement('a');
|
|
|
- link.href = 'tel:' + $(".telclick").attr("data-tel")
|
|
|
- link.click();
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+
|
|
|
+ $(".btn-map").on("click", function(e) {
|
|
|
+ sessionStorage.removeItem("map_addr")
|
|
|
+ let addr = $(this).attr("data-addr");
|
|
|
+ if (addr) {
|
|
|
+ sessionStorage.setItem("map_addr", addr);
|
|
|
+ mui.openWindow({
|
|
|
+ id: 'map',
|
|
|
+ url: 'map.html'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- }
|
|
|
}
|
|
|
- })
|
|
|
- mui("#kfList").on('click', '.mui-ellipsis', function (e) {
|
|
|
- document.getElementById('searchInput').value = "";
|
|
|
- getDatalist();
|
|
|
- const dutyId = this.getAttribute('data-kgyIds')
|
|
|
- const id = this.getAttribute('data-id')
|
|
|
- const name = this.getAttribute('data-name')
|
|
|
- const departmentId = this.getAttribute('data-departmentId')
|
|
|
- mui.openWindow({
|
|
|
- id: 'goods',
|
|
|
- url: 'goods.html?type=1&id=' + id + '&name=' + name + '&departmentId=' + departmentId + '&dutyId=' + dutyId
|
|
|
- });
|
|
|
- })
|
|
|
- }
|
|
|
- mui.init({
|
|
|
- statusBarBackground: '#f7f7f7'
|
|
|
- });
|
|
|
- mui.ready(() => {
|
|
|
- // const params = new URLSearchParams(window.location.search);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ mui("#kfList").on('click', '.mui-ellipsis', function (e) {
|
|
|
+ document.getElementById('searchInput').value = "";
|
|
|
getDatalist();
|
|
|
+ const dutyId = this.getAttribute('data-kgyIds')
|
|
|
+ const id = this.getAttribute('data-id')
|
|
|
+ const name = this.getAttribute('data-name')
|
|
|
+ const departmentId = this.getAttribute('data-departmentId')
|
|
|
+ mui.openWindow({
|
|
|
+ id: 'goods',
|
|
|
+ url: 'goods.html?type=1&id=' + id + '&name=' + name + '&departmentId=' + departmentId + '&dutyId=' + dutyId
|
|
|
+ });
|
|
|
})
|
|
|
- var node = document.getElementById("search");
|
|
|
- // 绑定点击事件
|
|
|
- node.onclick = function () {
|
|
|
- var searchInput = document.getElementById('searchInput').value;
|
|
|
- getDatalist(searchInput);
|
|
|
- };
|
|
|
- </script>
|
|
|
+ }
|
|
|
+ mui.init({
|
|
|
+ statusBarBackground: '#f7f7f7'
|
|
|
+ });
|
|
|
+ mui.ready(() => {
|
|
|
+ // const params = new URLSearchParams(window.location.search);
|
|
|
+ getDatalist();
|
|
|
+ })
|
|
|
+ var node = document.getElementById("search");
|
|
|
+ // 绑定点击事件
|
|
|
+ node.onclick = function () {
|
|
|
+ var searchInput = document.getElementById('searchInput').value;
|
|
|
+ getDatalist(searchInput);
|
|
|
+ };
|
|
|
+</script>
|
|
|
</body>
|
|
|
|
|
|
</html>
|