增加 外协

master
wanghao 3 months ago
parent 82cb1029d0
commit 633c20cb18

@ -118,6 +118,10 @@ public class RepairOutsourcingController extends BaseController {
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
RepairOutsourcing repairOutsourcing = repairOutsourcingService.selectRepairOutsourcingByObjid(objid);
mmap.put("repairOutsourcing", repairOutsourcing);
if (baseManufacturerList == null || baseManufacturerList.isEmpty()) {
baseManufacturerList = baseManufacturerService.selectBaseManufacturerList(null);
}
mmap.put("baseManufacturerList", baseManufacturerList);
return prefix + "/edit";
}

@ -26,8 +26,7 @@ import java.util.List;
*/
@Controller
@RequestMapping("/device/repart_bills")
public class RepartBillsController extends BaseController
{
public class RepartBillsController extends BaseController {
private String prefix = "device/repart_bills";
@Autowired
@ -38,10 +37,10 @@ public class RepartBillsController extends BaseController
@Autowired
private IBaseManufacturerService baseManufacturerService;
private List<BaseDeviceManufacturer> baseDeviceManufacturerList;
@RequiresPermissions("device:repart_bills:view")
@GetMapping()
public String repart_bills()
{
public String repart_bills() {
return prefix + "/repart_bills";
}
@ -51,8 +50,7 @@ public class RepartBillsController extends BaseController
@RequiresPermissions("device:repart_bills:list")
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list( DeviceRepartBills deviceRepartBills)
{
public TableDataInfo list(DeviceRepartBills deviceRepartBills) {
startPage();
List<DeviceRepartBills> list = deviceRepartBillsService.selectDeviceRepartBillsList(deviceRepartBills);
@ -66,8 +64,7 @@ public class RepartBillsController extends BaseController
@Log(title = "维修工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(DeviceRepartBills deviceRepartBills)
{
public AjaxResult export(DeviceRepartBills deviceRepartBills) {
List<DeviceRepartBills> list = deviceRepartBillsService.selectDeviceRepartBillsList(deviceRepartBills);
ExcelUtil<DeviceRepartBills> util = new ExcelUtil<DeviceRepartBills>(DeviceRepartBills.class);
return util.exportExcel(list, "维修工单数据");
@ -77,8 +74,7 @@ public class RepartBillsController extends BaseController
*
*/
@GetMapping("/add")
public String add()
{
public String add() {
return prefix + "/add";
}
@ -89,8 +85,7 @@ public class RepartBillsController extends BaseController
@Log(title = "维修工单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(DeviceRepartBills deviceRepartBills)
{
public AjaxResult addSave(DeviceRepartBills deviceRepartBills) {
return toAjax(deviceRepartBillsService.insertDeviceRepartBills(deviceRepartBills));
}
@ -99,22 +94,14 @@ public class RepartBillsController extends BaseController
*/
@RequiresPermissions("device:repart_bills:edit")
@GetMapping("/edit/{objid}")
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
{
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
DeviceRepartBills deviceRepartBills = deviceRepartBillsService.selectDeviceRepartBillsByObjid(objid);
mmap.put("deviceRepartBills", deviceRepartBills);
// return prefix + "/edit";
// if (baseScadaDeviceInfos == null || baseScadaDeviceInfos.isEmpty()) {
// baseScadaDeviceInfos = baseScadaDeviceInfoService.selectAllBaseScadaDeviceInfoList();
// }
// mmap.put("baseScadaDeviceInfos", baseScadaDeviceInfos);
if (baseDeviceManufacturerList == null || baseDeviceManufacturerList.isEmpty()) {
baseDeviceManufacturerList = baseManufacturerService.selectBaseManufacturerList(null);
}
mmap.put("baseManufacturerList", baseDeviceManufacturerList);
return "device/repair_outsourcing/add_device";
return "device/repair_outsourcing/repair_add";
}
/**
@ -124,8 +111,7 @@ public class RepartBillsController extends BaseController
@Log(title = "维修工单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(DeviceRepartBills deviceRepartBills)
{
public AjaxResult editSave(DeviceRepartBills deviceRepartBills) {
return toAjax(deviceRepartBillsService.updateDeviceRepartBills(deviceRepartBills));
}
@ -134,10 +120,9 @@ public class RepartBillsController extends BaseController
*/
@RequiresPermissions("device:repart_bills:remove")
@Log(title = "维修工单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
public AjaxResult remove(String ids) {
return toAjax(deviceRepartBillsService.deleteDeviceRepartBillsByObjids(ids));
}

@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
reason,
dro.create_by,
dro.create_time,
bsd.obj_id,
bsd.device_code,
device_name,
end_day
from device_repair_outsourcing dro

@ -13,9 +13,9 @@
<div class="col-sm-8">
<!-- <input name="deviceId" class="form-control" type="text">-->
<select id="deviceId" name="deviceId" class="form-control select2-multiple">
<option th:each="baseScadaDeviceInfo:${baseScadaDeviceInfos}"
th:value="${baseScadaDeviceInfo.uuid}"
th:text="${baseScadaDeviceInfo.deviceName}"></option>
<option th:each="info:${baseScadaDeviceInfos}"
th:value="${info.objId}"
th:text="${info.deviceCode+' - '+info.deviceName}"></option>
</select>
</div>
@ -52,7 +52,7 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间:</label>
<label class="col-sm-3 control-label">预计完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="endDay" class="form-control" placeholder="yyyy-MM-dd" type="text">
@ -86,7 +86,7 @@
$('#manufacturerName').on('select2:select', function (e) {
var name = $('#manufacturerName').select2('val');
datas.forEach(function (value, i) {
console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
// console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
if (value.manufacturerName == name) {
$("input[name=contacts]").val(value.contacts);

@ -7,22 +7,14 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-repair_outsourcing-edit" th:object="${repairOutsourcing}">
<input name="objid" th:field="*{objid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">单号:</label>
<div class="col-sm-8">
<input name="billsCode" th:field="*{billsCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<input name="deviceId" th:field="*{deviceId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">委外单位:</label>
<div class="col-sm-8">
<input name="manufacturerName" th:field="*{manufacturerName}" class="form-control" type="text">
<select id="manufacturerName" name="manufacturerName" class="form-control select2-multiple" th:field="*{manufacturerName}">
<option th:each="base:${baseManufacturerList}"
th:value="${base.manufacturerName}"
th:text="${base.manufacturerName}"></option>
</select>
</div>
</div>
<div class="form-group">
@ -47,6 +39,20 @@
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
$('#manufacturerName').on('select2:select', function (e) {
var name = $('#manufacturerName').select2('val');
datas.forEach(function (value, i) {
if (value.manufacturerName == name) {
$("input[name=contacts]").val(value.contacts);
$("input[name=phone]").val(value.phone);
return;
}
})
});
var prefix = ctx + "device/repair_outsourcing";
$("#form-repair_outsourcing-edit").validate({
focusCleanup: true

@ -3,34 +3,21 @@
<head>
<th:block th:include="include :: header('新增委外工单')"/>
<th:block th:include="include :: select2-css"/>
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-repair_outsourcing-add" th:object="${deviceRepartBills}">
<div class=" form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<!-- -->
<select id="deviceId" name="deviceId" class="form-control select2-multiple">
<option th:each="baseScadaDeviceInfo:${baseScadaDeviceInfos}"
th:value="${baseScadaDeviceInfo.uuid}"
th:text="${baseScadaDeviceInfo.deviceName}"
th:selected="${baseScadaDeviceInfo.uuid==deviceRepartBills.deviceID}"></option>
</select>
</div>
<form class="form-horizontal m" id="form-repair_outsourcing-add">
<input name="deviceId" class="form-control" type="hidden" th:value="*{deviceRepartBills.deviceID}" >
</div>
<div class="form-group">
<label class="col-sm-3 control-label">委外单位:</label>
<div class="col-sm-8">
<!-- <input name="manufacturerName" class="form-control" type="text">-->
<select id="manufacturerName" name="manufacturerName" class="form-control select2-multiple">
<option value=""/>
<option th:each="base:${baseManufacturerList}"
th:value="${base.manufacturerName}"
th:text="${base.manufacturerName}"
th:selected="${base.objid==deviceRepartBills.deviceInfo.manufacturerId}"></option>
th:text="${base.manufacturerName}"></option>
</select>
</div>
</div>
@ -44,7 +31,6 @@
<label class="col-sm-3 control-label">联系方式:</label>
<div class="col-sm-8">
<input name="phone" class="form-control" type="text">
<input name="repairBillsCode" class="form-control" type="hidden" th:value="*{objid}">
</div>
</div>
<div class="form-group">
@ -53,8 +39,9 @@
<textarea name="reason" class="form-control" type="text"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间:</label>
<label class="col-sm-3 control-label">预计完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="endDay" class="form-control" placeholder="yyyy-MM-dd" type="text">
@ -66,7 +53,7 @@
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
var prefix = ctx + "device/repair_outsourcing"
var datas = [[${baseManufacturerList}]]
@ -78,26 +65,17 @@
placeholder: "请选择设备厂家",
allowClear: false
});
var name = $('#manufacturerName').select2('val');
if (name != null) {
datas.forEach(function (value, i) {
console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
if (value.manufacturerName == name) {
$("input[name=contacts]").val(value.contacts);
$("input[name=phone]").val(value.phone);
return
}
//
})
}
// $('#deviceId').select2({
// placeholder: "请选择设备",
// allowClear: true
// });
})
$('#manufacturerName').on('select2:select', function (e) {
var name = $('#manufacturerName').select2('val');
datas.forEach(function (value, i) {
console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
// console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
if (value.manufacturerName == name) {
$("input[name=contacts]").val(value.contacts);
@ -112,6 +90,7 @@
minView: "month",
autoclose: true
});
function submitHandler() {
var name = $('#manufacturerName').select2('val');
if (name == null) {

@ -91,7 +91,7 @@
visible: false
},
{
field: 'deviceInfo.deviceId',
field: 'deviceInfo.deviceCode',
title: '设备编号',
},
{

@ -140,19 +140,22 @@
initinspectionTable = function (index, row, $detail) {
// 为每个展开行生成唯一的标识符
var uniqueId = 'tab-' + row.objid + '-';
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 class="active"><a data-toggle="tab" href="#' + uniqueId + '1" aria-expanded="true">巡检记录</a>\n' +
' </li>\n' +
' <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">第二个选项卡</a>\n' +
' <li class=""><a data-toggle="tab" href="#' + uniqueId + '2" aria-expanded="false">巡检照片</a>\n' +
' </li>\n' +
' </ul>\n' +
' <div class="tab-content">\n' +
' <div id="tab-1" class="tab-pane active">\n' +
' <div id="' + uniqueId + '1" class="tab-pane active">\n' +
'<table class="table1" style="table-layout:fixed"></table>' +
' </div>\n' +
' <div id="tab-2" class="tab-pane">\n' +
' <div id="' + uniqueId + '2" class="tab-pane">\n' +
'<table style="table-layout:fixed"></table>' +
' </div>\n' +
' </div>\n' +
@ -236,6 +239,7 @@
});
};
</script>
</body>

Loading…
Cancel
Save