Răsfoiți Sursa

修改历史数据默认值及数据匹配显示

fuwencai 4 ani în urmă
părinte
comite
5cea15077b

+ 7 - 5
src/service/customer_service.go

@@ -1007,14 +1007,15 @@ func (c *Customer) CustomerHistory() {
 		}
 	} else {
 		var user_name, user_customername, user_salesperson, appid = "", "", "", ""
-		var push_model, push_type, i_push = 0, 0, 0
+		//var push_model, push_type, i_push = 0, 0, 0
+		var _, _, i_push = 0, 0, 0
 		userInfo, ok := Mgo.FindOne("euser", query)
 		if ok && userInfo != nil && *userInfo != nil {
 			user_name = qu.ObjToString((*userInfo)["s_name"])
 			user_customername = qu.ObjToString((*userInfo)["s_customername"])
 			user_salesperson = qu.ObjToString((*userInfo)["s_salesperson"])
-			push_model = qu.IntAll((*userInfo)["i_pushmodel"])
-			push_type = qu.IntAll((*userInfo)["i_pushtype"])
+			//push_model = qu.IntAll((*userInfo)["i_pushmodel"])
+			//push_type = qu.IntAll((*userInfo)["i_pushtype"])
 			i_push = qu.IntAll((*userInfo)["i_push"])
 			appid = qu.ObjToString((*userInfo)["s_appid"])
 		}
@@ -1027,8 +1028,8 @@ func (c *Customer) CustomerHistory() {
 			"s_name":         user_name,
 			"s_customername": user_customername,
 			"s_salesperson":  user_salesperson,
-			"i_pushmodel":    push_model,
-			"i_pushtype":     push_type,
+			//"i_pushmodel":    push_model,
+			//"i_pushtype":     push_type,
 			"i_push":         i_push,
 			"s_appid":        appid,
 		})
@@ -1036,6 +1037,7 @@ func (c *Customer) CustomerHistory() {
 		return
 	}
 	c.T["history_id"] = history_id
+	fmt.Println(c.T)
 	c.Render("private/customer_history.html", &c.T)
 }
 

+ 5 - 5
src/web/templates/com/modal.html

@@ -42,7 +42,7 @@
 
 
                     </div>
-                    <span style="display: block; color: red;font-size: 12px;margin-left: 25px;">提示:第一行可多选,第二行不可多选</span>
+                    <span style="display: block; color: red;font-size: 12px;margin-left: 25px;">提示:第一行可多选,第二行不可多选;采购单位,中标单位不可与其他匹配方式同时选择</span>
 
                 </div>
                 <div class="modal-footer">
@@ -264,18 +264,18 @@
 
                     </div>
                     <div class="row">
-                        <label class="col-sm-2 control-label">数据标题</label>
+                        <label class="col-sm-2 control-label">公告标题</label>
                         <div class="col-sm-10">
-                            <textarea placeholder="请输入数据标题" id="dataTest-title"
+                            <textarea placeholder="请输入公告标题" id="dataTest-title"
                                       style="overflow-y: visible; margin: 0px;resize: none; width: 100%; height: 40px;"></textarea>
 
                         </div>
                     </div>
                     <div class="row">
-                        <label class="col-sm-2 control-label">数据正文</label>
+                        <label class="col-sm-2 control-label">公告正文</label>
                         <div class="col-sm-10">
 
-                            <textarea placeholder="请输入数据正文" id="dataTest-detail"
+                            <textarea placeholder="请输入公告正文" id="dataTest-detail"
                                       style="overflow-y:visible;margin: 0px;resize: none; width:100%; height: 40px;"></textarea>
                         </div>
                     </div>

+ 1 - 1
src/web/templates/private/cuser_rule_list.html

@@ -134,7 +134,7 @@
                     "data": "_id", width: "26%", render: function (val, a, row, pos) {
                         var s = [val, row.s_dataid];
                         tmp = '<div>' +
-                            '<a class="btn btn-sm btn-primary" href="/service/cuser/rule/downloadrule?id=' + val + '">导出标签</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" href="/service/cuser/rule/downloadrule?id=' + val + '">导出规则</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-info" href="/service/cuser/rule/downloadata?s_dataid=' + val + '">导出数据</a>&nbsp;&nbsp;' +
                             '<a class="btn btn-sm btn-warning" onclick="archive(\'' + val + '\')">存档</a>&nbsp;&nbsp;' +
                             '</div>';

+ 87 - 67
src/web/templates/private/customer_history.html

@@ -70,17 +70,56 @@
                                                         <option value=0>全局模式</option>
                                                         <option value=1>部门模式</option>
                                                         <option value=2>标签模式</option>
-                                                        <option value=3>部门+标签模式</option>
-                                                        <option value=4>规则模式(不去重)</option>
+<!--                                                        <option value=3>部门+标签模式</option>-->
+                                                        <option value=4 selected>规则模式</option>
                                                     </select>
                                                 </div>
                                                 <label class="col-sm-2 control-label"><span style="color:red;">* </span>推送方式</label>
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" id="pushTypeSelect">
-                                                        <option value=0 code="email">邮箱</option>
+                                                        <option value=0 code="email" selected>邮箱</option>
                                                         <option value=1 code="interface">接口</option>
                                                     </select>
                                                 </div>
+                                                <label class="col-sm-2 control-label">发送邮箱</label>
+                                                <div class="col-sm-2">
+                                                    <input type="text" class="form-control" id="sendMail"
+                                                           placeholder="发送邮箱"
+                                                           value="{{.T.data.sendMail}}">
+                                                </div>
+
+                                            </div>
+
+                                            <div class="form-group">
+                                                <label class="col-sm-2 control-label">公告去重</label>
+                                                <div class="col-sm-2">
+                                                    <select class="form-control selectpicker" id="pushIsDup">
+                                                        <option name="noticeDup" selected value=0>否</option>
+                                                        <option name="noticeDup" value=1>是</option>
+                                                    </select>
+                                                </div>
+                                                <label class="col-sm-2 control-label">项目去重</label>
+                                                <div class="col-sm-2">
+                                                    <select class="form-control selectpicker" id="projectIsDup">
+                                                        <option value=0>否</option>
+                                                        <option value=1>是</option>
+                                                    </select>
+                                                </div>
+                                                <label class="col-sm-2 control-label ">存储位置</label>
+                                                <div class="col-sm-2">
+                                                    <select class="form-control selectpicker" id="dataTableSelect">
+                                                        <option value="0" selected>历史数据表</option>
+                                                        <option value="1">接口数据表</option>
+                                                        <option value="2">商机管理数据表</option>
+                                                    </select>
+                                                    {{/*<script>
+                                                    $('#extfiledselect').on("change", function () {
+                                                        dataMap["i_datatable"] = $('#dataTableSelect option:selected').val();
+                                                    })
+                                                </script>*/}}
+                                                </div>
+                                            </div>
+                                            <div class="form-group">
                                                 <label class="col-sm-2 control-label">数据扩展</label>
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" multiple
@@ -103,60 +142,23 @@
                                                         })
                                                     </script>
                                                 </div>
-                                            </div>
-                                            <div class="form-group">
-                                                <label class="col-sm-2 control-label">发送邮箱</label>
-                                                <div class="col-sm-2">
-                                                    <input type="text" class="form-control" id="sendMail"
-                                                           placeholder="发送邮箱"
-                                                           value="{{.T.data.sendMail}}">
-                                                </div>
-                                                <label class="col-sm-2 control-label ">存储位置</label>
-                                                <div class="col-sm-2">
-                                                    <select class="form-control selectpicker" id="dataTableSelect">
-                                                        <option value="0">历史数据表</option>
-                                                        <option value="1">接口数据表</option>
-                                                        <option value="2">商机管理数据表</option>
-                                                    </select>
-                                                    {{/*<script>
-                                                        $('#extfiledselect').on("change", function () {
-                                                            dataMap["i_datatable"] = $('#dataTableSelect option:selected').val();
-                                                        })
-                                                    </script>*/}}
-                                                </div>
+
                                                 <label class="col-sm-2 control-label ">字段包</label>
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" id="extfiledselect">
-                                                        <option value="2">高级字段包</option>
+                                                        <option value="2" selected>高级字段包</option>
                                                         <option value="1">标准字段包</option>
                                                         <option value="3">深信服字段包</option>
                                                         <option value="4">高级字段包+部门名称+规则名称</option>
                                                         <option value="5">河南移动字段包</option>
                                                     </select>
-                                                    <script>
-                                                        $('#extfiledselect').on("change", function () {
-                                                            dataMap["i_extfieldstype"] = $('#extfiledselect option:selected').val();
-                                                        })
-                                                    </script>
+<!--                                                    <script>-->
+<!--                                                        $('#extfiledselect').on("change", function () {-->
+<!--                                                            dataMap["i_extfieldstype"] = $('#extfiledselect option:selected').val();-->
+<!--                                                        })-->
+<!--                                                    </script>-->
                                                 </div>
                                             </div>
-                                            <div class="form-group">
-                                                <label class="col-sm-2 control-label">公告去重</label>
-                                                <div class="col-sm-2">
-                                                    <select class="form-control selectpicker" id="pushIsDup">
-                                                        <option name="noticeDup" value=0>否</option>
-                                                        <option name="noticeDup" value=1>是</option>
-                                                    </select>
-                                                </div>
-                                                <label class="col-sm-2 control-label">项目去重</label>
-                                                <div class="col-sm-2">
-                                                    <select class="form-control selectpicker" id="projectIsDup">
-                                                        <option value=0>否</option>
-                                                        <option value=1>是</option>
-                                                    </select>
-                                                </div>
-
-                                            </div>
                                         </div>
                                     </div>
                                     <div class="box-header with-border">
@@ -364,13 +366,20 @@
             } else {
                 $('#pushSwitch').bootstrapSwitch('state', false);
             }
-            $('#pushModelSelect').val(dataMap.i_pushmodel);
-            $('#extfiledselect').val(dataMap.i_extfieldstype);
-            if (dataMap.i_pushtype == 0) {
-                $('#pushTypeSelect').val(0)
-            } else {
-                $('#pushTypeSelect').val(1)
+            if (dataMap.i_pushmodel != undefined){
+                $('#pushModelSelect').val(dataMap.i_pushmodel);
             }
+            if (dataMap.i_extfieldstype != undefined){
+                $('#extfiledselect').val(dataMap.i_extfieldstype);
+            }
+            if (dataMap.i_pushtype != undefined){
+                $('#pushTypeSelect').val(dataMap.i_pushtype);
+            }
+            // if (dataMap.i_pushtype == 0) {
+            //     $('#pushTypeSelect').val(0)
+            // } else {
+            //     $('#pushTypeSelect').val(1)
+            // }
             if (dataMap.s_extends && dataMap.s_extends.indexOf("hospitalgrade") >= 0 && dataMap.s_extends.indexOf("enterpise") >= 0) {
                 $('#expandSelect').find("option[value = hospitalgrade]").attr("selected", "selected");
                 $('#expandSelect').find("option[value = enterpise]").attr("selected", "selected");
@@ -380,26 +389,31 @@
                 $('#expandSelect').find("option[value = enterpise]").attr("selected", "selected");
             }
             $("#sendMail").val(dataMap.sendMail);
-            $("#pushIsDup").val(dataMap.isDup);
-            if (dataMap.isDup == 1) {
-                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("是");
-            } else {
-                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("否");
+            if (dataMap.isDup != undefined){
+                $("#pushIsDup").val(dataMap.isDup);
             }
+            // if (dataMap.isDup == 1) {
+            //     $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("是");
+            // } else {
+            //     $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("否");
+            // }
             if (dataMap.i_projectdup == 1) {
                 $("button[data-id=projectIsDup]").find(".filter-option-inner-inner").text("是");
             } else {
                 $("button[data-id=projectIsDup]").find(".filter-option-inner-inner").text("否");
             }
-            if (dataMap.i_datatable == 2) {
-                $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("商机管理数据表");
-            } else if (dataMap.i_datatable == 1) {
-                $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("接口数据表");
-            } else {
-                $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("历史数据表");
+            // if (dataMap.i_datatable == 2) {
+            //     $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("商机管理数据表");
+            // } else if (dataMap.i_datatable == 1) {
+            //     $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("接口数据表");
+            // } else {
+            //     $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("历史数据表");
+            // }
+            if (dataMap.i_datatable != undefined){
+                $('#dataTableSelect').val(dataMap.i_datatable);
             }
             console.log(dataMap.isDup, dataMap.i_projectdup, dataMap.i_datatable)
-            $("#pushIsDup option[value='" + dataMap.isDup + "']").attr("selected", true);
+            // $("#pushIsDup option[value='" + dataMap.isDup + "']").attr("selected", true);
             $("#projectIsDup option[value='" + dataMap.i_projectdup + "']").attr("selected", true);
             $("#dataTableSelect option[value='" + dataMap.i_datatable + "']").attr("selected", true);
         }
@@ -528,12 +542,15 @@
     }
 
     function saveCuser() {
-        dataMap.send_mode = document.getElementById("pushModelSelect").selectedIndex;
+        debugger
+        // dataMap.send_mode = document.getElementById("pushModelSelect").selectedIndex;
+        dataMap.send_mode =$("#pushModelSelect option:selected").val();
         dataMap.push_type = document.getElementById("pushTypeSelect").selectedIndex;
         // dataMap.s_extends = document.getElementById("expandSelect").selectedIndex;
         dataMap.isDup = $("#pushIsDup option:selected").val();
         dataMap.i_projectdup = $("#projectIsDup option:selected").val();
         dataMap.i_datatable = $('#dataTableSelect option:selected').val();
+        dataMap.i_extfieldstype = $('#extfiledselect option:selected').val();
         // console.log(dataMap.isDup, dataMap.projectIsDup, dataMap.i_datatable)
         dataMap.sendMail = $("#sendMail").val();
         dataMap.history_id = history_id;
@@ -554,7 +571,10 @@
 
     function showDepart() {
         if (history_id != "") {
-            var send_mode = document.getElementById("pushModelSelect").selectedIndex;
+            // var send_mode = document.getElementById("pushModelSelect").selectedIndex;
+            // var push_type = document.getElementById("pushTypeSelect").selectedIndex;
+            // var expand_type = document.getElementById("expandSelect").selectedIndex;
+            var send_mode = $("#pushModelSelect option:selected").val();
             var push_type = document.getElementById("pushTypeSelect").selectedIndex;
             var expand_type = document.getElementById("expandSelect").selectedIndex;
             var s_name = dataMap.s_name

+ 1 - 1
src/web/templates/private/history_rule_edit.html

@@ -42,7 +42,7 @@
                     <li class="active" data-mode="guide"><a href="#tab_1" data-toggle="tab" aria-expanded="true">通用规则</a></li>
                     <li data-mode="guide" class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">关键词规则</a></li>
                     <button class="btn btn-primary btn-sm" style="float: right;margin-top: 4px;margin-right: 10px"
-                            onclick="saveTag()"><i class="fa fa-fw fa-file-text fa-lg"></i>保存标签
+                            onclick="saveTag()"><i class="fa fa-fw fa-file-text fa-lg"></i>保存
                     </button>
                 </ul>
                 <div class="tab-content">