新增 巡检照片按照巡检记录统计

master
wanghao 3 weeks ago
parent 5e9af6295e
commit 8e63b6f105

@ -40,6 +40,11 @@ public class RecordInspectionController extends BaseController
{
return prefix + "/record_inspection";
}
@GetMapping("/imgGroup")
public String record_img()
{
return prefix + "/record_img_group";
}
/**
*

@ -1,15 +1,13 @@
package com.ruoyi.manage.controller;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.manage.domain.RecordInspectionImg;
@ -21,29 +19,39 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
*
* @author wangh
* @date 2024-11-11
*/
@Controller
@RequestMapping("/manage/record_inspection_img")
public class RecordInspectionImgController extends BaseController
{
public class RecordInspectionImgController extends BaseController {
private String prefix = "manage/record_inspection_img";
@Autowired
private IRecordInspectionImgService recordInspectionImgService;
@RequiresPermissions("manage:record_inspection_img:view")
@GetMapping()
public String record_inspection_lo()
{
public String record_inspection_location() {
return prefix + "/record_inspection_location";
}
@GetMapping("/img/{location}")
public String record_inspection_img(@PathVariable("location") String location,ModelMap modelMap)
{
modelMap.put("location",location);
@RequiresPermissions("manage:record_inspection_img:view")
@GetMapping("/mainView/{id}")
public String record_inspection_lo(@PathVariable("id") Long id, ModelMap modelMap) {
modelMap.put("inspectionId", id);
return prefix + "/record_inspection_location";
}
@GetMapping("/img")
public String record_inspection_img(@RequestParam("code") String location,
@RequestParam(value = "id" ,defaultValue = "0") String inspectionId,
ModelMap modelMap) {
System.out.println(location);
System.out.println(inspectionId);
modelMap.put("location", location);
modelMap.put("inspectionId", inspectionId);
return prefix + "/record_inspection_img";
}
@ -53,17 +61,17 @@ public class RecordInspectionImgController extends BaseController
@RequiresPermissions("manage:record_inspection_img:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordInspectionImg recordInspectionImg)
{
public TableDataInfo list(RecordInspectionImg recordInspectionImg) {
startPage();
System.out.println("list"+recordInspectionImg.getInspectionId());
List<RecordInspectionImg> list = recordInspectionImgService.selectRecordInspectionImgList(recordInspectionImg);
return getDataTable(list);
}
@RequiresPermissions("manage:record_inspection_img:list")
@PostMapping("/locationList")
@ResponseBody
public TableDataInfo locationList(RecordInspectionImg recordInspectionImg)
{
public TableDataInfo locationList(RecordInspectionImg recordInspectionImg) {
startPage();
List<RecordInspectionImg> list = recordInspectionImgService.selectRecordInspectionlocationList(recordInspectionImg);
return getDataTable(list);
@ -76,8 +84,7 @@ public class RecordInspectionImgController extends BaseController
@Log(title = "巡检历史图片", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(RecordInspectionImg recordInspectionImg)
{
public AjaxResult export(RecordInspectionImg recordInspectionImg) {
List<RecordInspectionImg> list = recordInspectionImgService.selectRecordInspectionImgList(recordInspectionImg);
ExcelUtil<RecordInspectionImg> util = new ExcelUtil<RecordInspectionImg>(RecordInspectionImg.class);
return util.exportExcel(list, "巡检历史图片数据");
@ -87,8 +94,7 @@ public class RecordInspectionImgController extends BaseController
*
*/
@GetMapping("/add")
public String add()
{
public String add() {
return prefix + "/add";
}
@ -99,8 +105,7 @@ public class RecordInspectionImgController extends BaseController
@Log(title = "巡检历史图片", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(RecordInspectionImg recordInspectionImg)
{
public AjaxResult addSave(RecordInspectionImg recordInspectionImg) {
return toAjax(recordInspectionImgService.insertRecordInspectionImg(recordInspectionImg));
}
@ -109,8 +114,7 @@ public class RecordInspectionImgController extends BaseController
*/
@RequiresPermissions("manage:record_inspection_img:edit")
@GetMapping("/edit/{inspectionId}")
public String edit(@PathVariable("inspectionId") Long inspectionId, ModelMap mmap)
{
public String edit(@PathVariable("inspectionId") Long inspectionId, ModelMap mmap) {
RecordInspectionImg recordInspectionImg = recordInspectionImgService.selectRecordInspectionImgByInspectionId(inspectionId);
mmap.put("recordInspectionImg", recordInspectionImg);
return prefix + "/edit";
@ -123,8 +127,7 @@ public class RecordInspectionImgController extends BaseController
@Log(title = "巡检历史图片", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(RecordInspectionImg recordInspectionImg)
{
public AjaxResult editSave(RecordInspectionImg recordInspectionImg) {
return toAjax(recordInspectionImgService.updateRecordInspectionImg(recordInspectionImg));
}
@ -133,10 +136,9 @@ public class RecordInspectionImgController extends BaseController
*/
@RequiresPermissions("manage:record_inspection_img:remove")
@Log(title = "巡检历史图片", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
public AjaxResult remove(String ids) {
return toAjax(recordInspectionImgService.deleteRecordInspectionImgByInspectionIds(ids));
}
}

@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRecordInspectionImgList" parameterType="RecordInspectionImg" resultMap="RecordInspectionImgResult">
<include refid="selectRecordInspectionImgVo"/>
<where>
<if test="inspectionId != null "> and inspection_id = #{inspectionId}</if>
<if test="inspectionId != null and inspectionId != '' "> and inspection_id = #{inspectionId}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="imgPath != null and imgPath != ''"> and img_path = #{imgPath}</if>
@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from record_inspection_img
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="inspectionId != null "> and inspection_id = #{inspectionId}</if>
</where>
group by location_code order by location_code
</select>

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('巡检记录列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li class="select-time">
<label>巡检时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginInspectionTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endInspectionTime]"/>
</li>
<!-- <li>-->
<!-- <label>巡检人:</label>-->
<!-- <input type="text" name="inspectionUser"/>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manage:record_inspection:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manage:record_inspection:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manage:record_inspection:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manage:record_inspection:export">
<i class="fa fa-download"></i> 导出
</a>
</div>-->
<div class="col-sm-12 select-table table-striped">
<!-- <table id="bootstrap-table"></table>-->
<table id="bootstrap-table" data-page-size="10"
data-show-custom-view="true" data-custom-view="customViewFormatter"
data-show-custom-view-button="true"></table>
</div>
</div>
</div>
<template id="profileTemplate">
<div class="col-sm-2">
<div class="contact-box">
<a onclick="$.modal.openTab('图片详情','manage/record_inspection_img/mainView/%id%')">
<div class="col-sm-12">
<div class="text-center">
<img alt="image" class=" m-t-xs img-responsive col-sm-12" src="/img/folder.png"
style="padding: 20%"/>
<div class="m-t-xs font-bold">%datatime%</div>
</div>
</div>
<div class="clearfix"></div>
</a>
</div>
</div>
</template>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-custom-view-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manage:record_inspection:edit')}]];
var removeFlag = [[${@permission.hasPermi('manage:record_inspection:remove')}]];
var prefix = ctx + "manage/record_inspection";
$(function () {
var options = {
url: prefix + "/list",
// createUrl: prefix + "/add",
// updateUrl: prefix + "/edit/{id}",
// removeUrl: prefix + "/remove",
// exportUrl: prefix + "/export",
modalName: "巡检记录",
sortOrder: "desc",
sortName: "inspectionTime",
// detailView: true,
// onExpandRow: function (index, row, $detail) {
// initinspectionTable(index, row, $detail);
// },
columns: [{
checkbox: true
},
{
field: 'inspectionId',
title: '主键',
visible: false
},
{
field: 'inspectionTime',
title: '巡检时间'
},
// {
// field: 'inspectionUser',
// title: '巡检人'
// },
{
field: 'totalNumber',
title: '巡检数量'
},
{
field: 'normalNumber',
title: '正常数量'
},
{
field: 'abnormalNumber',
title: '异常数量'
},
{
field: 'skipNumber',
title: '跳过数量'
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)"' +
' onclick="openTaskTable(\'' + row.inspectionId + '\')"><i class="fa fa-camera"></i>查看机位</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function customViewFormatter(data) {
var template = $('#profileTemplate').html()
var view = ''
$.each(data, function (i, row) {
view += template.replace('%id%', row.inspectionId)
.replace("%datatime%", row.inspectionTime);
})
return `<div class="row mx-0">${view}</div>`
}
function openTaskTable(id) {
$.modal.openTab('巡检机位情况', ctx + "manage/record_inspection_task/" + id);
}
/* initinspectionTable = function (index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childTable).bootstrapTable({
url: ctx + "manage/record_inspection_info/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
inspectionId: row.inspectionId
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index+1
}
},
{
field: 'epcCode',
title: 'RFID'
},
{
field: 'locationCode',
title: '机位码'
},
{
field: 'inspectionState',
title: '巡检结果'
},
{
field: 'inspectionRemark',
title: '异常原因'
},
{
field: 'createTime',
title: '提交时间'
}
]
});
};*/
</script>
</body>
</html>

@ -16,10 +16,11 @@
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endInspectionTime]"/>
</li>
<li>
<label>巡检人:</label>
<input type="text" name="inspectionUser"/>
</li>
<!-- <li>-->
<!-- <label>巡检人:</label>-->
<!-- <input type="text" name="inspectionUser"/>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -80,10 +81,10 @@
field: 'inspectionTime',
title: '巡检时间'
},
{
field: 'inspectionUser',
title: '巡检人'
},
// {
// field: 'inspectionUser',
// title: '巡检人'
// },
{
field: 'totalNumber',
title: '巡检数量'

@ -21,6 +21,7 @@
<!-- <li>-->
<!-- <label>机位码:</label>-->
<input type="hidden" name="locationCode" th:value="${location}"/>
<input type="hidden" name="inspectionId" th:value="${inspectionId}"/>
<!-- </li>-->
<li>
<label>上传人:</label>
@ -88,20 +89,21 @@
columns: [{
checkbox: true
},
// {
// field: 'inspectionId',
// title: '巡检id'
// },
{
field: 'inspectionId',
title: '巡检id',
visible: false
},
{
field: 'objid',
title: '主键',
visible: false
},
// {
// field: 'locationCode',
// title: '机位码',
// visible: false
// },
{
field: 'locationCode',
title: '机位码',
visible: false
},
{
field: 'imgPath',
title: '巡检图片',

@ -1,95 +1,100 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('巡检历史图片列表')" />
<th:block th:include="include :: header('巡检历史图片列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>机位码:</label>
<input type="text" name="locationCode"/>
</li>
<li>
<label>机位码:</label>
<input type="text" name="locationCode"/>
</li>
<input type="text" name="inspectionId" th:value="${inspectionId}" hidden/>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manage:record_inspection_img:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manage:record_inspection_img:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manage:record_inspection_img:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manage:record_inspection_img:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<!-- <table id="bootstrap-table"></table>-->
<table id="bootstrap-table" data-page-size="10"
data-show-custom-view="true" data-custom-view="customViewFormatter"
data-show-custom-view-button="true"></table>
</div>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- &lt;!&ndash; <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manage:record_inspection_img:add">&ndash;&gt;-->
<!-- &lt;!&ndash; <i class="fa fa-plus"></i> 添加&ndash;&gt;-->
<!-- &lt;!&ndash; </a>&ndash;&gt;-->
<!-- &lt;!&ndash; <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manage:record_inspection_img:edit">&ndash;&gt;-->
<!-- &lt;!&ndash; <i class="fa fa-edit"></i> 修改&ndash;&gt;-->
<!-- &lt;!&ndash; </a>&ndash;&gt;-->
<!-- &lt;!&ndash; <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manage:record_inspection_img:remove">&ndash;&gt;-->
<!-- &lt;!&ndash; <i class="fa fa-remove"></i> 删除&ndash;&gt;-->
<!-- &lt;!&ndash; </a>&ndash;&gt;-->
<!-- &lt;!&ndash; <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manage:record_inspection_img:export">&ndash;&gt;-->
<!-- &lt;!&ndash; <i class="fa fa-download"></i> 导出&ndash;&gt;-->
<!-- &lt;!&ndash; </a>&ndash;&gt;-->
<!-- </div>-->
<div class="col-sm-12 select-table table-striped">
<!-- <table id="bootstrap-table"></table>-->
<table id="bootstrap-table" data-page-size="10"
data-show-custom-view="true" data-custom-view="customViewFormatter"
data-show-custom-view-button="true"></table>
</div>
</div>
<template id="profileTemplate">
<div class="col-sm-2">
<div class="contact-box">
<a onclick="$.modal.openTab('图片详情','manage/record_inspection_img/img/%locationCode%')">
<div class="col-sm-12" >
<div class="text-center">
<img alt="image" class=" m-t-xs img-responsive col-sm-12" src="/img/folder.png"
style="padding: 20%"/>
<div class="m-t-xs font-bold">%locationCode%</div>
</div>
</div>
<!-- <div class="col-sm-8">
<h3><strong>%userCode%</strong></h3>
<p><i class="fa fa-jpy"></i> %userBalance%</p>
<address>
<strong>RuoYi, Inc.</strong><br>
E-mail: %userEmail%<br>
<abbr title="Phone">Tel:</abbr> %userPhone%
</address>
</div>-->
<div class="clearfix"></div>
</a>
</div>
</div>
</template>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-custom-view-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manage:record_inspection_img:edit')}]];
var removeFlag = [[${@permission.hasPermi('manage:record_inspection_img:remove')}]];
var prefix = ctx + "manage/record_inspection_img";
</div>
<template id="profileTemplate">
<div class="col-sm-2">
<div class="contact-box">
<a onclick="$.modal.openTab('图片详情','manage/record_inspection_img/img?code=%locationCode%&id=%inspectionId%')">
<div class="col-sm-12">
<div class="text-center">
<img alt="image" class=" m-t-xs img-responsive col-sm-12" src="/img/folder.png"
style="padding: 20%"/>
<div class="m-t-xs font-bold">%locationCode%</div>
</div>
</div>
<!-- <div class="col-sm-8">
<h3><strong>%userCode%</strong></h3>
<p><i class="fa fa-jpy"></i> %userBalance%</p>
<address>
<strong>RuoYi, Inc.</strong><br>
E-mail: %userEmail%<br>
<abbr title="Phone">Tel:</abbr> %userPhone%
</address>
</div>-->
<div class="clearfix"></div>
</a>
</div>
</div>
</template>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-custom-view-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manage:record_inspection_img:edit')}]];
var removeFlag = [[${@permission.hasPermi('manage:record_inspection_img:remove')}]];
var prefix = ctx + "manage/record_inspection_img";
$(function() {
var options = {
url: prefix + "/locationList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "巡检历史图片",
columns: [{
checkbox: true
},
$(function () {
var options = {
url: prefix + "/locationList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "巡检历史图片",
columns: [{
checkbox: true
},
// {
// field: 'inspectionId',
// title: '巡检id'
@ -102,42 +107,48 @@
field: 'locationCode',
title: '机位码'
},
/* {
field: 'imgPath',
title: '路径'
},
{
field: 'createBy',
title: '上传人'
},
{
field: 'createTime',
title: '上传时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inspectionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inspectionId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}*/]
};
$.table.init(options);
});
function customViewFormatter(data) {
var template = $('#profileTemplate').html()
var view = ''
$.each(data, function (i, row) {
view += template.replace('%locationCode%', row.locationCode)
.replace("%locationCode%", row.locationCode);
})
/* {
field: 'imgPath',
title: '路径'
},
{
field: 'createBy',
title: '上传人'
},
{
field: 'createTime',
title: '上传时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inspectionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inspectionId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}*/]
};
$.table.init(options);
});
return `<div class="row mx-0">${view}</div>`
function customViewFormatter(data) {
var template = $('#profileTemplate').html()
var id=[[${inspectionId}]]
if (id==null){
id=0
}
</script>
var view = ''
$.each(data, function (i, row) {
view += template.replace('%locationCode%', row.locationCode)
.replace("%inspectionId%", id)
.replace("%locationCode%", row.locationCode);
})
return `<div class="row mx-0">${view}</div>`
}
</script>
</body>
</html>

@ -92,6 +92,11 @@
title: '主键',
visible: false
},
{
field: 'inspectionId',
title: 'id',
visible: false
},
{
@ -132,9 +137,66 @@
initinspectionTable = function (index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
var [childTable,childTable1] = $detail.html('<div class="col-sm-12">\n' +
' <div class="tabs-container">\n' +
' <ul class="nav nav-tabs">\n' +
' <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 第一个选项卡</a>\n' +
' </li>\n' +
' <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">第二个选项卡</a>\n' +
' </li>\n' +
' </ul>\n' +
' <div class="tab-content">\n' +
' <div id="tab-1" class="tab-pane active">\n' +
'<table class="table1" style="table-layout:fixed"></table>'+
' </div>\n' +
' <div id="tab-2" class="tab-pane">\n' +
'<table style="table-layout:fixed"></table>'+
' </div>\n' +
' </div>\n' +
' </div>\n' +
' </div>').find('table');
console.log(childTable)
console.log(childTable1)
$(childTable).bootstrapTable({
url: ctx + "manage/record_inspection_info/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
inspectionId: row.inspectionId,
locationCode:row.planePosition
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index+1
}
},
{
field: 'epcCode',
title: 'RFID'
},
{
field: 'locationCode',
title: '机位码'
},
{
field: 'inspectionState',
title: '巡检结果'
},
{
field: 'inspectionRemark',
title: '异常原因'
},
{
field: 'createTime',
title: '提交时间'
}
]});
$(childTable1).bootstrapTable({
url: ctx + "manage/record_inspection_img/list",
method: 'post',
sidePagination: "server",
@ -152,7 +214,7 @@
{
field: 'imgPath',
title: '路径',
title: '巡检照片',
formatter: function (value, row, index) {
return $.table.imageView(value, 818, 460, null);
@ -168,6 +230,8 @@
title: '上传时间'
}]
});
};
</script>
</body>

Loading…
Cancel
Save