Browse Source

Merge branch 'master' of http://git.xt.wenhq.top:8083/wenhongquan/VisualInspection

# Conflicts:
#	VisualInspection/qzd/js/task/new.js
MSI\liwei 7 năm trước cách đây
mục cha
commit
a988767857

+ 3 - 0
VisualInspection/js/lib/ckplayer/ckplayer/ckplayer.js

@@ -409,6 +409,9 @@ function ckplayerConfig() {
                         case '.mp4':
                             this.VA[0][1] = 'video/mp4';
                             break;
+                        case '.MP4':
+                            this.VA[0][1] = 'video/mp4';
+                            break;
                         case '.ogg':
                             this.VA[0][1] = 'video/ogg';
                             break;

+ 8 - 0
VisualInspection/js/lib/mytable.js

@@ -179,6 +179,10 @@ String.prototype.replaceAll = function(s1, s2) {
                                     src = src.split('.mp4')[0] + "_screen_0.png"
                                     ispic = false;
                                 }
+                                if (src.indexOf('.MP4') != -1) {
+                                    src = src.split('.MP4')[0] + "_screen_0.png"
+                                    ispic = false;
+                                }
                                 var pic = (ispic ? '<a class="card lightbox-toggle" onclick="img_play(\'' + src + '\')" href="javascript:void(0)" style="width:60px;height:50px;float:left;">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="width:60px;height:50px;">') +
                                     '<img class="pic-class  img-thumbnail" style="width:60px;height:50px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 10px;left: 15px;color: white;"></i>') +
                                     '</a>';
@@ -218,6 +222,10 @@ String.prototype.replaceAll = function(s1, s2) {
                                     src = src.split('.mp4')[0] + "_screen_0.png"
                                     ispic = false;
                                 }
+                                if (src.indexOf('.MP4') != -1) {
+                                    src = src.split('.MP4')[0] + "_screen_0.png"
+                                    ispic = false;
+                                }
                                 // var pic = (ispic ? '<a class="card lightbox-toggle" onclick="img_play(\'' + src + '\')" href="javascript:void(0)" style="width:60px;height:50px;float:left;">' : '<a class="card" onclick="video_paly(\'' + videosrc + '\')" href="javascript:void(0)" style="width:60px;height:50px;">') +
                                 //     '<img class="pic-class  img-thumbnail" style="width:60px;height:50px;" src="' + src + '" alt="">' + (ispic ? '' : '<i class="icon icon-play-circle" style=" font-size: 30px;position: absolute;top: 10px;left: 15px;color: white;"></i>') +
                                 //     '</a>';

+ 1 - 1
VisualInspection/js/user/userManager.js

@@ -343,7 +343,7 @@
                      var userdata = {};
                      userdata["checked"] = false;
                      var btns = "";
-                     if (!roleContains("STATION")) {
+                     if (!roleContains("STATION") && !roleContains("WRECKER") && !roleContains("QZD")) {
                          btns = '<button class="btn btn-primary btn-sm" name="user_edit" id=' + user.id + '><i class="icon icon-edit"></i>修改</button> <button class="btn btn-danger btn-sm" name="user_tansfer" id=' + user.id + '><i class="icon icon-random"></i>转站</button>';
 
                          btns += '<button class="btn btn-primary btn-sm" name="user_delete" id=' + user.id + ' ><i class="icon icon-remove-circle"></i>删除</button>';

+ 3 - 1
VisualInspection/js/util/const.js

@@ -68,4 +68,6 @@ var ROLE_FWQ_ADMIN = "ROLE_FWQ_ADMIN";
 var ROLE_FWQ = "ROLE_FWQ";
 var ROLE_WRECKER_MANAGER = "ROLE_WRECKER_MANAGER";
 var ROLE_WRECKER = "ROLE_WRECKER";
-var ROLE_WRECKER_NQ = "ROLE_WRECKER_NQ";
+var ROLE_WRECKER_NQ = "ROLE_WRECKER_NQ";
+var ROLE_DDZS_ADMIN = "ROLE_DDZS_ADMIN";
+var ROLE_DDZS = "ROLE_DDZS";

+ 4 - 2
VisualInspection/qzd/js/task/check.js

@@ -111,8 +111,9 @@ function initCheck() {
             for (var v in vlist) {
 
                 var vv = vlist[v];
-                console.log(vv.split("/")[0]);
-                var o = "<option val='" + vv + "' " + (v == 0 ? "selected" : "") + " >" + vv.split("/")[0] + "</option>"
+                var idss = vv.split("/");
+                var filename = idss[idss.length - 1];
+                var o = "<option value='" + vv + "' " + (v == 0 ? "selected" : "") + " >" + filename + "</option>"
                 htmlo += o;
             }
 
@@ -164,6 +165,7 @@ function initCheck() {
 
 function onvideoselect(obj) {
     videoid = (obj.value);
+    console.log(videoid)
     var videoObject = {
         container: '.video', //“#”代表容器的ID,“.”或“”代表容器的class
         variable: 'player', //该属性必需设置,值等于下面的new chplayer()的对象

+ 13 - 36
VisualInspection/qzd/js/task/new.js

@@ -74,15 +74,16 @@ function initTableRowBtn() {
 }
 //查询任务
 function queryTask() {
-    console.log(user.roles[0]);
+
     var t = getTimeByMonth(GV("#start_time"));
     var data = {
         "startTime": getMomentTimeFormat(t.starttime),
         "endTime": getMomentTimeFormat(t.endtime),
         "dept": $("#deptlist").val(),
-        "isComplete":$("#isComplete").val()
         // "check_status": cur_status
     };
+
+
     var hide = false;
     if (hasRole(ROLE_WRECKER_MANAGER) || hasRole(ROLE_WRECKER) || hasRole(ROLE_JICHA) || roleContains('ROLE_WRECKER')) {
         hide = true;
@@ -94,17 +95,15 @@ function queryTask() {
         { width: 80, text: '车牌号', type: 'string', flex: true, hide: hide, colClass: 'text-center', field: 'car_info' },
         { width: 80, text: '客户信息', type: 'string', flex: true, sort: 'down', colClass: 'text-center', field: 'car_user_info' },
         { width: 120, text: '接警时间', type: 'string', flex: true, sort: 'down', colClass: 'text-center', field: 'received_time' },
-        { width: 160, text: '最后时间', type: 'string', flex: true, sort: 'down', colClass: 'text-center', field: 'last_time' },
-        { width: 120, text: '出勤人员', type: 'string', flex: true, sort: 'down', colClass: 'text-center', field: 'userNames' },
+        { width: 160, text: '出勤人员', type: 'string', flex: true, sort: 'down', colClass: 'text-center', field: 'userNames' },
         // {width: 120, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'}
     ];
-    user.roles[0].id = 20;
-    if (user.roles[0].id == 20 || user.roles[0].id == 21) {
+    if (hasRole(ROLE_DDZS_ADMIN) || hasRole(ROLE_DDZS)) {
         var colFunc = { width: 160, text: '操作', type: 'string', flex: true, field: 'id', colClass: 'text-center' };
         colFunc.oper = $.zui.store.get("task_table_btn_1");
         cols.push(colFunc);
         $("#saveButton").show();
-    } else if (user.roles[0].id == 16 || user.roles[0].id == 17) {
+    } else if (hasRole(ROLE_WRECKER_MANAGER) || hasRole(ROLE_WRECKER_NQ) || hasRole(ROLE_WRECKER)) {
         var colFunc = { width: 160, text: '操作', type: 'imagebutton', flex: true, field: 'videos', colClass: 'text-center' };
         colFunc.oper = $.zui.store.get("task_table_btn_1");
         cols.push(colFunc);
@@ -128,9 +127,6 @@ function queryTask() {
             'p_cur': cur_page
         },
         renderfunction: function() {
-            // console.log("-------------------------")
-
-
 
             $(".uploadervideo").each(function() {
                 $(this).uploader({
@@ -146,6 +142,7 @@ function queryTask() {
                         prevent_duplicates: true
                     },
                     onFileUploaded: function(file, responseObject) {
+                        var id = this.$.attr("id").split("uploaderExample_")[1];
                         var file_src = recordVideos;
                         var datas = eval('(' + responseObject.response + ')');
                         if (file_src != '' && file_src != null && file_src != undefined) {
@@ -155,9 +152,12 @@ function queryTask() {
                         }
                         var data = {
                             "videos": file_src,
-                            "id": recordId
+                            "id": id
                         };
+                        recordVideos = file_src;
+
                         post_common_service('q/record/update', data, function(redata) {
+                            cur_page = taskTableObj.options.pager.p_cur;
                             queryTask();
                         });
                     },
@@ -174,7 +174,6 @@ function queryTask() {
 
 
 function addTask() {
-    $('#modalTitle').html("新增清障记录");
     is_save = 0;
     resert();
     // var contenthtml =  base_ui_url+'qzd/view/task/addtask.html';
@@ -193,59 +192,38 @@ function checkUpdate(id) {
     var data = {
         "id": id
     };
-  
-    $('#modalTitle').html("修改清障记录");
     post_common_service('q/record/one', data, function(redata) {
         $('#addModal').modal('show');
         $("#type").val(redata.type);
         $("#carinfo").val(redata.car_info);
-        if(redata.arrive_time != null){
         var time = moment(redata.arrive_time).format("YYYY-MM-DD HH:mm:ss");
         $("#arrive_time").val(time);
-        }
-        if(redata.received_time != null){
         time = moment(redata.received_time).format("YYYY-MM-DD HH:mm:ss");
         $("#received_time").val(time);
-         }
-        if(redata.start_time != null){
         time = moment(redata.start_time).format("YYYY-MM-DD HH:mm:ss");
         $("#startTime").val(time);
-        }
-        if(redata.back_time != null){
         time = moment(redata.back_time).format("YYYY-MM-DD HH:mm:ss");
         $("#back_time").val(time);
-        }
-        if(redata.backfield_time != null){
         time = moment(redata.backfield_time).format("YYYY-MM-DD HH:mm:ss");
         $("#backfield_time").val(time);
-        }
-        if(redata.delivery_time != null){
         time = moment(redata.delivery_time).format("YYYY-MM-DD HH:mm:ss");
         $("#delivery_time").val(time);
-        }
-        if(redata.accept_time != null){
         time = moment(redata.accept_time).format("YYYY-MM-DD HH:mm:ss");
         $("#accept_time").val(time);
-        }
-        if(redata.rescue_time != null){
         time = moment(redata.rescue_time).format("YYYY-MM-DD HH:mm:ss");
         $("#rescue_time").val(time);
-        }
-        if(redata.relief_time != null){
         time = moment(redata.relief_time).format("YYYY-MM-DD HH:mm:ss");
         $("#relief_time").val(time);
-        }
         $("#carUserinfo").val(redata.car_user_info);
         $("#dept").val(redata.dept);
         setRecordUser();
         $("#carUserSatisfaction").val(redata.car_user_satisfaction);
         var userids = redata.users.split(",");
-        setTimeout(function (){
+        setTimeout(function() {
             for (var i in userids) {
                 $('span[data-id="' + userids[i] + '"] input').click();
             }
-        }
-        ,500);
+        }, 500);
         $("#recordUser").val(redata.userNames);
         $("#addr").val(redata.addr);
     })
@@ -266,7 +244,6 @@ function resert() {
     $("#arrive_time").val('');
     $("#received_time").val('');
     $("#startTime").val('');
-    $("#relief_time").val('');
     $("#back_time").val('');
     $("#backfield_time").val('');
     $("#delivery_time").val('');

+ 0 - 1
VisualInspection/qzd/js/task/task_list.js

@@ -110,7 +110,6 @@ function queryTask() {
         "check_status": cur_status,
         "hasScore": $("#hasScoreList").val(),
     };
-    console.log(data);
     var hide = false;
     if (hasRole(ROLE_WRECKER_MANAGER) || hasRole(ROLE_WRECKER) || hasRole(ROLE_JICHA) || roleContains('ROLE_WRECKER')) {
         hide = true;