增加 外协

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) { public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
RepairOutsourcing repairOutsourcing = repairOutsourcingService.selectRepairOutsourcingByObjid(objid); RepairOutsourcing repairOutsourcing = repairOutsourcingService.selectRepairOutsourcingByObjid(objid);
mmap.put("repairOutsourcing", repairOutsourcing); mmap.put("repairOutsourcing", repairOutsourcing);
if (baseManufacturerList == null || baseManufacturerList.isEmpty()) {
baseManufacturerList = baseManufacturerService.selectBaseManufacturerList(null);
}
mmap.put("baseManufacturerList", baseManufacturerList);
return prefix + "/edit"; return prefix + "/edit";
} }

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

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

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

@ -7,22 +7,14 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-repair_outsourcing-edit" th:object="${repairOutsourcing}"> <form class="form-horizontal m" id="form-repair_outsourcing-edit" th:object="${repairOutsourcing}">
<input name="objid" th:field="*{objid}" type="hidden"> <input name="objid" th:field="*{objid}" type="hidden">
<div class="form-group"> <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> <label class="col-sm-3 control-label">委外单位:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -47,6 +39,20 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <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"; var prefix = ctx + "device/repair_outsourcing";
$("#form-repair_outsourcing-edit").validate({ $("#form-repair_outsourcing-edit").validate({
focusCleanup: true focusCleanup: true

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

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

@ -140,19 +140,22 @@
initinspectionTable = function (index, row, $detail) { initinspectionTable = function (index, row, $detail) {
// 为每个展开行生成唯一的标识符
var uniqueId = 'tab-' + row.objid + '-';
var [childTable, childTable1] = $detail.html('<div class="col-sm-12">\n' + var [childTable, childTable1] = $detail.html('<div class="col-sm-12">\n' +
' <div class="tabs-container">\n' + ' <div class="tabs-container">\n' +
' <ul class="nav nav-tabs">\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>\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' + ' </li>\n' +
' </ul>\n' + ' </ul>\n' +
' <div class="tab-content">\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>' + '<table class="table1" style="table-layout:fixed"></table>' +
' </div>\n' + ' </div>\n' +
' <div id="tab-2" class="tab-pane">\n' + ' <div id="' + uniqueId + '2" class="tab-pane">\n' +
'<table style="table-layout:fixed"></table>' + '<table style="table-layout:fixed"></table>' +
' </div>\n' + ' </div>\n' +
' </div>\n' + ' </div>\n' +
@ -236,6 +239,7 @@
}); });
}; };
</script> </script>
</body> </body>

Loading…
Cancel
Save