优化
This commit is contained in:
@@ -451,35 +451,39 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirmRepair(JSONObject whereJson) {
|
||||
public void confirmRepair(JSONObject map) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
|
||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
|
||||
|
||||
// 1.判断维修单明细中是否完成 都为是,不是则报错
|
||||
JSONArray reDtlArr = reDtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(reDtlArr)) throw new BadRequestException("明细为空");
|
||||
for (int i = 0; i < reDtlArr.size(); i++) {
|
||||
JSONObject json = reDtlArr.getJSONObject(i);
|
||||
if (!StrUtil.equals(json.getString("isfinish"), "1")) {
|
||||
throw new BadRequestException("维修项目未完成");
|
||||
JSONArray rows = map.getJSONArray("rows");
|
||||
for(int m=0; m<rows.size();m++){
|
||||
JSONObject whereJson = rows.getJSONObject(m);
|
||||
// 1.判断维修单明细中是否完成 都为是,不是则报错
|
||||
JSONArray reDtlArr = reDtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(reDtlArr)) throw new BadRequestException(whereJson.getString("repair_code")+"明细为空");
|
||||
for (int i = 0; i < reDtlArr.size(); i++) {
|
||||
JSONObject json = reDtlArr.getJSONObject(i);
|
||||
if (!StrUtil.equals(json.getString("isfinish"), "1")) {
|
||||
throw new BadRequestException(whereJson.getString("repair_code")+"维修项目未完成");
|
||||
}
|
||||
}
|
||||
// 2.维修人、维修时间不能为空
|
||||
JSONObject jsonRemst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
String update_optname = jsonRemst.getString("update_optname");
|
||||
String update_time = jsonRemst.getString("update_time");
|
||||
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time)) {
|
||||
throw new BadRequestException(whereJson.getString("repair_code")+"维修人或者维修时间不能为空");
|
||||
}
|
||||
// 3.更新维修单主表
|
||||
jsonRemst.put("invstatus","07");
|
||||
jsonRemst.put("confirm_optid",currentUserId);
|
||||
jsonRemst.put("confirm_optname",nickName);
|
||||
jsonRemst.put("confirm_time",DateUtil.now());
|
||||
reMstTab.update(jsonRemst);
|
||||
}
|
||||
// 2.维修人、维修时间不能为空
|
||||
JSONObject jsonRemst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
String update_optname = jsonRemst.getString("update_optname");
|
||||
String update_time = jsonRemst.getString("update_time");
|
||||
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time)) {
|
||||
throw new BadRequestException("维修人活着维修时间不能为空");
|
||||
}
|
||||
// 3.更新维修单主表
|
||||
jsonRemst.put("invstatus","07");
|
||||
jsonRemst.put("confirm_optid",currentUserId);
|
||||
jsonRemst.put("confirm_optname",nickName);
|
||||
jsonRemst.put("confirm_time",DateUtil.now());
|
||||
reMstTab.update(jsonRemst);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
WHERE
|
||||
file.is_delete = '0'
|
||||
AND file.status not in ('90','91')
|
||||
and file.device_level in ('A','B')
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
@@ -121,7 +122,7 @@
|
||||
OPTION 输入.deptIds <> ""
|
||||
d1.dept_id in 输入.deptIds
|
||||
ENDOPTION
|
||||
|
||||
order by file.use_groupid,file.device_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -490,7 +490,6 @@ export default {
|
||||
this.changeShow = true
|
||||
},
|
||||
querytable() {
|
||||
//this.crud.toQuery()
|
||||
this.crud.refresh()
|
||||
this.handleCurrentChange()
|
||||
},
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="confirmRepair"
|
||||
>
|
||||
班组验收
|
||||
@@ -102,38 +101,38 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column fixed="left" type="selection" min-width="35" />
|
||||
<el-table-column fixed="left" prop="repair_code" label="维修单号" min-width="120" >
|
||||
<el-table-column fixed="left" prop="repair_code" label="维修单号" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="left" prop="device_code" label="设备编码" min-width="85" />
|
||||
<el-table-column fixed="left" prop="device_name" label="设备名称" min-width="150" />
|
||||
<el-table-column fixed="left" prop="extend_code" label="设备自编码" min-width="100" />
|
||||
<el-table-column fixed="left" prop="dept_name" label="归属部门" min-width="130" />
|
||||
<el-table-column fixed="left" prop="use_name" label="使用班组" min-width="130" />
|
||||
<el-table-column fixed="left" prop="device_code" label="设备编码" min-width="85" />
|
||||
<el-table-column fixed="left" prop="device_name" label="设备名称" min-width="150" />
|
||||
<el-table-column fixed="left" prop="extend_code" label="设备自编码" min-width="100" />
|
||||
<el-table-column fixed="left" prop="dept_name" label="归属部门" min-width="130" />
|
||||
<el-table-column fixed="left" prop="use_name" label="使用班组" min-width="130" />
|
||||
<el-table-column fixed="left" prop="invstatus" label="单据状态" :formatter="formatStatusName" min-width="70" />
|
||||
<el-table-column fixed="left" prop="maintenancecycle" label="单据类型" :formatter="formatTypeName" min-width="70" />
|
||||
<el-table-column fixed="left" prop="fault_level" label="故障等级" :formatter="formatLevelName" min-width="70" />
|
||||
<el-table-column fixed="left" prop="plan_start_date" label="计划维修日期" min-width="95" />
|
||||
<el-table-column prop="fault_desc" label="故障描述" min-width="200" />
|
||||
<el-table-column prop="remark" label="备注" min-width="200" />
|
||||
<el-table-column fixed="left" prop="plan_start_date" label="计划维修日期" min-width="95" />
|
||||
<el-table-column prop="fault_desc" label="故障描述" min-width="200" />
|
||||
<el-table-column prop="remark" label="备注" min-width="200" />
|
||||
<el-table-column prop="input_optname" label="制单人" min-width="90" />
|
||||
<el-table-column prop="input_time" label="制单时间" min-width="140" />
|
||||
<el-table-column prop="input_time" label="制单时间" min-width="140" />
|
||||
<el-table-column prop="update_optname" label="维修人" min-width="150" />
|
||||
<el-table-column prop="real_start_date" label="开始时间" min-width="140" />
|
||||
<el-table-column prop="real_end_date" label="结束时间" min-width="140" />
|
||||
<el-table-column prop="real_start_date" label="开始时间" min-width="140" />
|
||||
<el-table-column prop="real_end_date" label="结束时间" min-width="140" />
|
||||
<el-table-column prop="confirm_optname" label="验收人" min-width="150" />
|
||||
<el-table-column prop="confirm_time" label="验收时间" min-width="140" />
|
||||
<el-table-column prop="confirm_time" label="验收时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="120px" />
|
||||
<el-table-column prop="audit_time" label="审核时间" min-width="140" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" min-width="120px" />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" min-width="90" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog/>
|
||||
<AddDialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -251,11 +250,16 @@ export default {
|
||||
},
|
||||
confirmRepair() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
if (data.invstatus !== '06') {
|
||||
return this.crud.notify('只能对结束状态的单据确认', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (_selectData.length === 0) {
|
||||
return this.crud.notify('请选择需要确认的记录!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
crudDevicerepairmst.confirmRepair(data).then(res => {
|
||||
for (let i = 0; i < _selectData.length; i++) {
|
||||
const now = _selectData[i]
|
||||
if (now.invstatus !== '06') {
|
||||
return this.crud.notify('只能对结束状态的单据确认:' + now.repair_code, CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
}
|
||||
crudDevicerepairmst.confirmRepair({ rows: _selectData }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
@@ -376,7 +380,6 @@ export default {
|
||||
|
||||
color: "#CCCFD6";
|
||||
|
||||
|
||||
}
|
||||
|
||||
.vue-treeselect--has-value .vue-treeselect__input {
|
||||
|
||||
@@ -120,6 +120,7 @@ export default {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged')
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="820px">
|
||||
<el-dialog :close-on-click-modal="false" :show-close="false" :before-close="crud.cancelCU" @close="crud.refresh()" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="820px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@@ -161,7 +161,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
|
||||
<PaDialog :dialog-show.sync="addPaDialog" :open-param="openParam" />
|
||||
<PaDialog :dialog-show.sync="addPaDialog" :open-param="openParam" @tableChanged="crud.refresh()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user