ws 1 yıl önce
ebeveyn
işleme
3e7ce048cd

+ 1 - 0
nngkxxdp/src/main/resources/static/district/css/sy_mobile_new.css

@@ -994,6 +994,7 @@ a {
 .url_from_ajax {
   display: flex;
   padding: 15px 12px 0;
+  align-items: center;
 }
 .point_from_ajax {
   width: 4px;

+ 11 - 1
nngkxxdp/src/main/resources/static/district/js/sy_mobile.js

@@ -1564,7 +1564,7 @@ function getDistances(lat1, lng1, lat2, lng2) {
     debugger
     $("#deptDiv2").empty();
     $("#deptDiv2").prev().remove();
-    $(".wrap_handle").hide();
+    // $(".wrap_handle").hide();
     var discript = "";
     $.each(arrey, function (i) {
       discrptAddress = arrey[i].address;
@@ -3283,6 +3283,11 @@ function getDistances(lat1, lng1, lat2, lng2) {
             let getClick = getAllArr.filter((i) => {
               return i.address == discript_text;
             });
+			if (!getClick.length) {
+				getClick = digitGroupItem.filter((i) => {
+				  return i.address == discript_text;
+				});
+			}
             for (let i = 0; i < getClick.length; i++) {
               for (let j = i + 1; j < getClick.length; j++) {
                 if (getClick[j].dep === getClick[i].dep) {
@@ -3336,6 +3341,11 @@ function getDistances(lat1, lng1, lat2, lng2) {
             let getClick = getAllArr.filter((i) => {
               return i.address == discript_text;
             });
+			if (!getClick.length) {
+				getClick = digitGroupItem.filter((i) => {
+				  return i.address == discript_text;
+				});
+			}
             for (let i = 0; i < getClick.length; i++) {
               for (let j = i + 1; j < getClick.length; j++) {
                 if (getClick[j].dep === getClick[i].dep) {

+ 16 - 4
nngkxxdp/src/main/resources/static/page/index.html

@@ -8,6 +8,7 @@
     <link rel="stylesheet" type="text/css" href="./layui/css/modules/laydate/default/laydate.css"/>
     <link rel="stylesheet" href="./css/login.css">
     <link rel="stylesheet" type="text/css" href="./css/webStatis.css"/>
+	<link rel="stylesheet" type="text/css" href="./layui/labelGeneration.css"/>
     <script type="text/javascript" src="../constans.js"></script>
     <style type="text/css">
         .layui-nav .layui-this:after,
@@ -1741,10 +1742,16 @@
 <div id="ly-sms" class="layui-hide">
     <form id="ly-form2" class="layui-form" action="" style="margin: 20px;">
         <input type="hidden" id="ly-type2">
+		<div class="layui-form-item">
+		    <label class="layui-form-label">已有联系人:</label>
+		    <div class="layui-input-block">
+		        <div id="ly-sms-phones"></div>
+		    </div>
+		</div>
         <div class="layui-form-item">
             <label class="layui-form-label">手机号:</label>
             <div class="layui-input-block">
-                <input type="text" id="ly-sms-phone" autocomplete="off" placeholder="请输入手机号" class="layui-input">
+				<div id="ly-sms-phone"></div>
             </div>
         </div>
         <div class="layui-form-item">
@@ -1753,12 +1760,12 @@
                 <textarea id="ly-sms-remark" placeholder="请输入内容" class="layui-textarea" maxlength="500"></textarea>
             </div>
         </div>
-        <div class="layui-form-item">
+        <!-- <div class="layui-form-item">
             <div class="layui-input-block">
                 <button id="ly-ljbtn-sms" type="button" class="layui-btn">发送</button>
                 <button id="ly-back-sms" type="reset" class="layui-btn layui-btn-primary">返回</button>
             </div>
-        </div>
+        </div> -->
     </form>
 </div>
 </body>
@@ -1825,7 +1832,12 @@
         element.tabChange('page-item', 'main-zntj');
     }
 
-    layui.use(["layer", "form", "table", "element", "laydate", "dropdown", "upload"], function () {
+    layui.config({
+		base: './layui/'
+	}).extend({
+		xmSelect: 'xm-select',
+		labelGeneration: 'labelGeneration'
+	}).use(["layer", "form", "table", "element", "laydate", "dropdown", "upload", "xmSelect", "labelGeneration"], function () {
         form = layui.form;
         table = layui.table;
         element = layui.element;

+ 139 - 15
nngkxxdp/src/main/resources/static/page/js/base/fbtx.item.js

@@ -440,7 +440,22 @@ function lyupload() {
         });
 
         $('#ly-ljbtn-sms').on('click', function () {
-            if (!$('#ly-sms-phone').val()) {
+			let phones = []
+			let arr = smsView.phoneSelect.getValue()
+			for (let i = 0; i < arr.length; i++) {
+				const p = arr[i].value.replace(/\s/g, "")
+				if (!phones.includes(p)) {
+					phones.push(p)
+				}
+			}
+			let arr2 = $("#ly-sms-phone .layui-btn")
+			for (let i = 0; i < arr2.length; i++) {
+				const p = $(arr2[i]).text().replace(/\s/g, "")
+				if (!phones.includes(p)) {
+					phones.push(p)
+				}
+			}
+            if (!phones.length) {
                 layer.msg("请输入手机号", {icon: 5});
                 return false;
             }
@@ -448,17 +463,19 @@ function lyupload() {
                 layer.msg("请输入短信内容", {icon: 5});
                 return false;
             }
-            post("/smsmessage/sendSms", true, {
-                'phone': $('#ly-sms-phone').val(),
-                'content': $('#ly-sms-remark').val()
-            }, function (res) {
-                if (res.result) {
-                    layer.close(index);
-                    layer.msg('发送成功!');
-                }
-            }, function (err) {
-
-            });
+			const indexss = layer.load(2)
+			smsView.sendMsg(phones, 0, indexss)
+            // post("/smsmessage/sendSms", true, {
+            //     'phone': $('#ly-sms-phone').val(),
+            //     'content': $('#ly-sms-remark').val()
+            // }, function (res) {
+            //     if (res.result) {
+            //         layer.close(index);
+            //         layer.msg('发送成功!');
+            //     }
+            // }, function (err) {
+
+            // });
         })
 
         $('#smsSendRecord').on('click', function () {
@@ -637,19 +654,50 @@ function errorSensitive(index) {
 }
 
 $('#smsSend').on('click', function () {
-    index = layer.open({
+    layer.open({
         type: 1,
         title: '短信发送',
-        area: ['600px', '400px'], //宽高
+        area: ['60%', '70%'], //宽高
+		btn: ['发送', '关闭'],
         content: $('#ly-sms'),
         success: function (layero, index) {
             $('#ly-sms').removeClass('layui-hide');
+			smsView.initPhones()
+			smsView.initPhoneInput()
+			
         },
         end: function () {
             $('#ly-sms').addClass('layui-hide');
             $('#ly-sms-phone').val('')
             $('#ly-sms-remark').val('')
-        }
+        },
+		btn1: function() {
+			let phones = []
+			let arr = smsView.phoneSelect.getValue()
+			for (let i = 0; i < arr.length; i++) {
+				const p = arr[i].value.replace(/\s/g, "")
+				if (!phones.includes(p)) {
+					phones.push(p)
+				}
+			}
+			let arr2 = $("#ly-sms-phone .layui-btn")
+			for (let i = 0; i < arr2.length; i++) {
+				const p = $(arr2[i]).text().replace(/\s/g, "")
+				if (!phones.includes(p)) {
+					phones.push(p)
+				}
+			}
+			if (!phones.length) {
+			    layer.msg("请输入手机号", {icon: 5});
+			    return false;
+			}
+			if (!$('#ly-sms-remark').val()) {
+			    layer.msg("请输入短信内容", {icon: 5});
+			    return false;
+			}
+			const indexss = layer.load(2)
+			smsView.sendMsg(phones, 0, indexss)
+		},
     });
 });
 
@@ -1048,3 +1096,79 @@ function xg1(staffName ,leadName, leadPhone, staffPhone,id ) {
     });
 }
 
+const smsView = {
+	phoneSelect: null,
+	initPhones: function() {
+		const _this = this
+		$('#ly-sms-phones').empty()
+		$.ajax({
+		    url: PATH + '/websitesms/getShortMessage',
+			data: {
+				page: 1,
+				limit: 10
+			},
+		    type: 'get',
+		    success: function (json) {
+				if (json.data && json.data.length) {
+					let arr = []
+					for (let i = 0; i < json.data.length; i++) {
+						if (json.data[i].leaderphone) {
+							arr.push({
+								name: json.data[i].leaderphone + '(' + json.data[i].deptname + ':' + json.data[i].leaderperson + ')',
+								value: json.data[i].leaderphone
+							})
+						}
+						if (json.data[i].mainLeaderPhone) {
+							arr.push({
+								name: json.data[i].mainLeaderPhone + '(' + json.data[i].deptname + ':' + json.data[i].mainLeader + ')',
+								value: json.data[i].mainLeaderPhone
+							})
+						}
+						if (json.data[i].workphone) {
+							arr.push({
+								name: json.data[i].workphone + '(' + json.data[i].deptname + ':' + json.data[i].workperson + ')',
+								value: json.data[i].workphone
+							})
+						}
+					}
+					_this.phoneSelect = layui.xmSelect.render({
+						el: '#ly-sms-phones',
+						language: 'zn',
+						filterable: true,
+						data: arr
+					})
+				}
+		        
+		    }
+		});
+	},
+	initPhoneInput: function() {
+		$('#ly-sms-phone').empty()
+		layui.labelGeneration.render({
+			elem:'#ly-sms-phone',
+			isEnter:true
+		})
+	},
+	sendMsg: function(arr, idx, indexss) {
+		
+		this.sendSms(arr, idx, indexss)
+	},
+	sendSms: function(arr, idx, indexss) {
+		if (idx >= arr.length) {
+			layer.close(indexss)
+			layer.msg('发送完成!')
+			return
+		}
+		const _this = this
+		post("/smsmessage/sendSms", true, {
+		    'phone': arr[idx],
+		    'content': $('#ly-sms-remark').val()
+		}, function (res) {
+			idx++;
+		    _this.sendMsg(arr, idx, indexss)
+		}, function (err) {
+			idx++;
+			 _this.sendMsg(arr, idx, indexss)
+		});
+	}
+}

+ 7 - 0
nngkxxdp/src/main/resources/static/page/layui/labelGeneration.css

@@ -0,0 +1,7 @@
+.none-transition{
+    transition: none;
+    -webkit-transition: none;
+}
+.layui-btn{
+	margin: 10px 0px 10px 10px;
+}

+ 289 - 0
nngkxxdp/src/main/resources/static/page/layui/labelGeneration.js

@@ -0,0 +1,289 @@
+layui.define(['form'], function (exports) {
+
+    var form = layui.form,
+        $ = layui.jquery,
+        index = 0,
+		oldId,
+    MOD_NAME = 'labelGeneration',
+        formField = {
+            label: {
+                id: '-1',
+                tag: "label",
+            },
+        },
+        labelGeneration = {
+            set: function (options) {
+                var that = this;
+                that.config = $.extend({}
+                    , that.config
+                    , options);
+                return that;
+            }
+            //事件监听
+            , on: function (events
+                , callback) {
+                return layui.onevent.call(this
+                    , MOD_NAME
+                    , events
+                    , callback);
+            }
+        },
+        Class = function (options) {
+            var that = this;
+            that.config = $.extend({}
+                , that.config
+                , labelGeneration.config
+                , options);
+            that.render();
+        },
+        thisIns = function () {
+            var that = this
+                , options = that.config;
+            return {
+                reload: function (options) {
+                    that.reload.call(that
+                        , options);
+                }, getOptions: function () {
+                    return options || null;
+                }, getData: function () {
+                    return options.data || null;
+                }
+            }
+        }
+
+    Class.prototype.config = {
+        version: "1.0.0"
+        , Author: "谁家没一个小强"
+        , generateId: 0
+        , data: []
+        , isEnter: false
+    };
+
+    /* 自动生成ID 当前页面自动排序*/
+    Class.prototype.autoId = function (tag) {
+        var that = this,
+            options = that.config;
+        options.generateId = options.generateId + 1;
+        return tag + '_' + options.generateId;
+    }
+
+    Class.prototype.components = {
+        label: {
+            render: function (json,options) {
+                var _html = '<blockquote class="layui-elem-quote">';
+                _html += '<div class="layui-form layui-form-pane layui-form-item">';
+                _html += '<label class="layui-form-label">输入手机号</label>';
+                _html += '<div class="layui-input-inline">';
+				if (options.isEnter) {
+                _html += '<input type="text" id="{0}" lay-verify="required" placeholder="按回车生成手机号" autocomplete="off" class="layui-input">'
+                    .format(json.id);
+				} else {
+					_html += '<input type="text" id="{0}" lay-verify="required" placeholder="通过按钮生成标签" autocomplete="off" class="layui-input">'
+                    .format(json.id);
+				}
+                _html += '</div>';
+                if (!options.isEnter) {
+                    _html += '<button type="button" id="{0}-button" class="layui-btn layui-btn-normal">确定</button>'.format(json.id);
+                }
+                // _html += '<label class="layui-form-label">颜色选择</label>';
+                // _html += '<div class="layui-input-inline">';
+                // _html += '<select lay-filter="{0}-switchTest">'.format(json.id);
+                // _html += '<option value="" selected>墨绿色</option>';
+                // _html += '<option value="layui-btn-primary">原始色</option>';
+                // _html += '<option value="layui-btn-normal">天蓝色</option>';
+                // _html += '<option value="layui-btn-warm">暖黄色</option>';
+                // _html += '<option value="layui-btn-danger">红色</option>';
+                // _html += '</select>';
+                // _html += '</div>';
+                _html += '</div>';
+                _html += '<div id="{0}-content"></div>'.format(json.id);
+                _html += '</blockquote>';
+                return _html;
+            },
+            update: function (json) {
+
+            },
+            /* 获取对象 */
+            jsonData: function (id, that) {
+                //分配一个新的ID
+                var _json = JSON.parse(JSON.stringify(formField.label));
+                _json.id = id == undefined ? that.autoId(_json.tag) : id;
+				that.checkId(_json,that);
+                return _json;
+            }
+        }
+    };
+
+	/* 判定id是否重复*/
+    Class.prototype.checkId = function (json,that) {
+        if ($("#" + json.id + "-content").length != 0) {
+				json.id = that.autoId(json.tag);
+				that.checkId(json);
+		} else {
+			return;
+		}
+    }
+
+    // Class.prototype.bindGridSortEvent = function (json) {
+    //     var that = this
+    //         , options = that.config;
+    //     var formItemSort = Sortable.create(document.getElementById(json.id + "-content"), {
+    //         group: {
+    //             name: 'group' + json.id
+    //         },
+    //         animation: 1000,
+    //         onEnd: function (evt) {
+    //             var _values = $("#" + json.id + "-content").find("div");
+    //             var ops = [];
+    //             for (var i = 0; i < _values.length; i++) {
+    //                 ops.push({"ngColor": $(_values[i]).attr("ng-color"), "value": $(_values[i]).text()});
+    //             }
+    //             options.data = ops;
+    //         }
+    //     });
+    // }
+
+    /* 绑定事件*/
+    Class.prototype.deleteValue = function (value, ngValue) {
+        var that = this
+            , options = that.config;
+        for (var i = 0; i < options.data.length; i++) {
+            if (options.data[i].value === value && options.data[i].ngColor === ngValue) {
+                options.data.splice(i, 1);
+                break;
+            }
+        }
+    }
+
+    /* 绑定事件*/
+    Class.prototype.bindPropertyEvent = function (_json) {
+        var that = this
+            , options = that.config;
+        var colorClass = "";
+        if (options.isEnter) {
+            $("#" + _json.id).keypress(function (event) {
+                if (event.which === 13) {
+                    var _value = $(this).val();
+					if (!_value) {
+						layer.msg('请输入手机号!')
+						return;
+					}
+					if (!/^1[3456789]\d{9}$/.test(_value)) {
+						layer.msg('手机号格式错误!')
+						return;
+					}
+					let arr = $("#" + _json.id + "-content .layui-btn")
+					for (let i = 0; i < arr.length; i++) {
+						if ($(arr[i]).text().trim() == _value) {
+							layer.msg('输入手机号重复!')
+							return
+						}
+					}
+					
+                    index = index + 1;
+                    var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
+                        .format(colorClass, _value, _json.id + index, index);
+                    $("#" + _json.id + "-content").append(_html);
+					 $("#" + _json.id).val('');
+                    options.data.push({"ngColor": colorClass, "value": _value});
+                    $("#" + _json.id + index + " .layui-icon-close").click(function () {
+                        that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
+                        $(this).parent().remove();
+                    });
+                }
+            });
+        } else {
+            $("#" + _json.id + "-button").click(function (event) {
+                var _value = $("#" + _json.id).val();
+                index = index + 1;
+                var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
+                    .format(colorClass, _value, _json.id + index, index);
+                $("#" + _json.id + "-content").append(_html);
+                options.data.push({"ngColor": colorClass, "value": _value});
+                $("#" + _json.id + index + " .layui-icon-close").click(function () {
+                    that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
+                    $(this).parent().remove();
+                });
+            });
+        }
+
+        form.on('select(' + _json.id + '-switchTest)', function (data) {
+            colorClass = data.value;
+        });
+        for (var i = 0; i < options.data.length; i++) {
+            index = index + 1;
+            var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
+                .format(options.data[i].ngColor, options.data[i].value, _json.id + index, index);
+            $("#" + _json.id + "-content").append(_html);
+            $("#" + _json.id + index + " .layui-icon-close").click(function () {
+                that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
+                $(this).parent().remove();
+            });
+        }
+    }
+
+    /* 渲染组件 */
+    Class.prototype.renderComponents = function () {
+        var that = this
+            , options = that.config;
+        var elem = $(options.elem);
+        elem.empty();
+        var jsonData = that.components['label'].jsonData(undefined, that);
+        elem.append(that.components['label'].render(jsonData,options));
+        that.bindPropertyEvent(jsonData);
+        // that.bindGridSortEvent(jsonData);
+        form.render();
+    }
+
+    Class.prototype.reload = function (options) {
+        var that = this;
+        options = options || {};//如果是空的话,就赋值 {}
+        that.config = $.extend({}
+            , that.config
+            , labelGeneration.config
+            , options);
+        that.render();
+    }
+
+    //核心入口 初始化一个 regionSelect 类
+    labelGeneration.render = function (options) {
+        var ins = new Class(options);
+        return thisIns.call(ins);
+    }
+    /**
+     * 渲染组件
+     */
+    Class.prototype.render = function (options) {
+        var that = this
+            , options = that.config;
+        that.renderComponents();
+    }
+
+    String.prototype.format = function (args) {
+        var result = this;
+        if (arguments.length > 0) {
+            if (arguments.length == 1 && typeof (args) == "object") {
+                for (var key in args) {
+                    if (args[key] != undefined) {
+                        var reg = new RegExp("({" + key + "})"
+                            , "g");
+                        result = result.replace(reg
+                            , args[key]);
+                    }
+                }
+            } else {
+                for (var i = 0; i < arguments.length; i++) {
+                    if (arguments[i] != undefined) {
+                        var reg = new RegExp("({[" + i + "]})"
+                            , "g");
+                        result = result.replace(reg
+                            , arguments[i]);
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
+    exports(MOD_NAME, labelGeneration);
+});

Dosya farkı çok büyük olduğundan ihmal edildi
+ 7 - 0
nngkxxdp/src/main/resources/static/page/layui/xm-select.js


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor