From d6428f6980dd0fc8cb753b1de19a18ed00fdf1a5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 08 十一月 2022 10:49:17 +0800
Subject: [PATCH] #
---
src/main/webapp/views/cstmr/cstmr_more.html | 130 ++++++++++++++++++++-----------------------
1 files changed, 61 insertions(+), 69 deletions(-)
diff --git a/src/main/webapp/views/cstmr/cstmr_more.html b/src/main/webapp/views/cstmr/cstmr_more.html
index b0cd688..dcac652 100644
--- a/src/main/webapp/views/cstmr/cstmr_more.html
+++ b/src/main/webapp/views/cstmr/cstmr_more.html
@@ -197,10 +197,14 @@
<div class="form-group-bottom text-right">
<button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button>
- <button class="layui-btn layui-btn-normal" lay-filter="save" lay-submit><i class="layui-icon"></i> 淇濆瓨 </button>
</div>
</form>
+
+<script type="text/html" id="followerTabOperate">
+ <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+</script>
+
<!-- 璺熻繘浜� -->
<script type="text/html" id="followerEditDialog">
<form id="followerEditForm" lay-filter="followerEditForm" class="layui-form model-form">
@@ -280,38 +284,63 @@
if (!cstmrId) {
return;
}
- var insTb = table.render({
- elem: '#followersTable',
- url: baseUrl + '/cstmr/followers/table/auth',
- where: {
+ $.ajax({
+ url: baseUrl+"/cstmr/followers/table/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
cstmrId: cstmrId
},
- // height: 'full-100',
- headers: {token: localStorage.getItem('token')},
- request: {
- pageName: 'curr',
- pageSize: 'limit'
- },
- parseData: function (res) {
- return {
- 'code': res.code,
- 'msg': res.msg,
- 'count': res.data.total,
- 'data': res.data.records
+ method: 'GET',
+ success: function (res) {
+ if (res.code === 200){
+ var follTab = table.render({
+ elem: '#followersTable',
+ data: res.data,
+ limit: 999,
+ height: 'full-418',
+ cols: [[
+ {field: 'userName', title: '宸ヤ綔浜哄憳'},
+ {fixed: 'right', title:'', align: 'center', toolbar: '#followerTabOperate', width: 70}
+ ]],
+ done: function (res, curr, count) {
+ $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
+ }
+ });
+ // 鐩戝惉琛屽伐鍏蜂簨浠�
+ table.on('tool(followersTable)', function(obj){
+ let data = obj.data;
+ switch (obj.event) {
+ case "del":
+ let loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/cstmr/followers/remove/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ cstmrId: cstmrId,
+ userId: data.userId
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ initFollowers(cstmrId);
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ break;
+ }
+ });
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2})
}
- },
- response: {
- statusCode: 200
- },
- defaultToolbar: [],
- cols: [[
- {field: 'id', title: '缂栧彿', width: 70, align: 'center'},
- {field: 'name', title: '宸ヤ綔浜哄憳'}
- ]],
- done: function (res, curr, count) {
- $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click');
}
- });
+ })
}
// 娣诲姞璺熻繘浜�
@@ -332,12 +361,7 @@
layer.msg("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�", {icon: 3});
return false;
}
- console.log(JSON.stringify({
- cstmrId: cstmrId,
- followerIds: selectList.map(function (d) {
- return d.value;
- })
- }))
+ let loadIndex = layer.load(2);
$.ajax({
url: baseUrl+"/cstmr/followers/add/auth",
headers: {'token': localStorage.getItem('token')},
@@ -350,8 +374,8 @@
method: 'POST',
success: function (res) {
if (res.code === 200){
- layer.msg(res.msg, {icon: 1})
- // insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+ layer.close(loadIndex);
+ initFollowers(cstmrId);
} else if (res.code === 403){
top.location.href = baseUrl+"/";
}else {
@@ -400,38 +424,6 @@
/* 鐩戝惉琛ㄥ崟鎻愪氦 */
form.on('submit(refresh)', function (data) {
init();
- return false;
- });
- form.on('submit(save)', function (elem) {
- let data = elem.field;
- notice.msg('姝e湪鎷煎懡淇敼鏁版嵁......', {icon: 4, position: "topRight"});
- $.ajax({
- url: baseUrl + "/issue/process/auth",
- headers: {'token': localStorage.getItem('token')},
- contentType: 'application/json;charset=UTF-8',
- method: 'POST',
- data: JSON.stringify({
- id: Number(data.id),
- uuid: data.uuid,
- dealer: data.dealer,
- settle: Number(data.settle),
- endTime: top.strToDate(data.endTime$),
- // lastTime: data.lastTime,
- reason: data.reason,
- deal: data.deal,
- }),
- success: function (res) {
- notice.destroy();
- if (res.code === 200) {
- notice.success({title: '娑堟伅閫氱煡', message: res.msg});
- $('.layui-layer-close').click();
- } else if (res.code === 403) {
- top.location.href = baseUrl + "/";
- } else {
- notice.error({title: '娑堟伅閫氱煡', message: res.msg});
- }
- }
- })
return false;
});
--
Gitblit v1.9.1