|
|
@@ -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('');
|