优化
This commit is contained in:
@@ -451,20 +451,23 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void confirmRepair(JSONObject whereJson) {
|
public void confirmRepair(JSONObject map) {
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getNickName();
|
||||||
|
|
||||||
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
|
||||||
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
|
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
|
||||||
|
|
||||||
|
JSONArray rows = map.getJSONArray("rows");
|
||||||
|
for(int m=0; m<rows.size();m++){
|
||||||
|
JSONObject whereJson = rows.getJSONObject(m);
|
||||||
// 1.判断维修单明细中是否完成 都为是,不是则报错
|
// 1.判断维修单明细中是否完成 都为是,不是则报错
|
||||||
JSONArray reDtlArr = reDtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
JSONArray reDtlArr = reDtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
|
||||||
if (ObjectUtil.isEmpty(reDtlArr)) throw new BadRequestException("明细为空");
|
if (ObjectUtil.isEmpty(reDtlArr)) throw new BadRequestException(whereJson.getString("repair_code")+"明细为空");
|
||||||
for (int i = 0; i < reDtlArr.size(); i++) {
|
for (int i = 0; i < reDtlArr.size(); i++) {
|
||||||
JSONObject json = reDtlArr.getJSONObject(i);
|
JSONObject json = reDtlArr.getJSONObject(i);
|
||||||
if (!StrUtil.equals(json.getString("isfinish"), "1")) {
|
if (!StrUtil.equals(json.getString("isfinish"), "1")) {
|
||||||
throw new BadRequestException("维修项目未完成");
|
throw new BadRequestException(whereJson.getString("repair_code")+"维修项目未完成");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 2.维修人、维修时间不能为空
|
// 2.维修人、维修时间不能为空
|
||||||
@@ -472,7 +475,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
String update_optname = jsonRemst.getString("update_optname");
|
String update_optname = jsonRemst.getString("update_optname");
|
||||||
String update_time = jsonRemst.getString("update_time");
|
String update_time = jsonRemst.getString("update_time");
|
||||||
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time)) {
|
if (ObjectUtil.isEmpty(update_optname) || ObjectUtil.isEmpty(update_time)) {
|
||||||
throw new BadRequestException("维修人活着维修时间不能为空");
|
throw new BadRequestException(whereJson.getString("repair_code")+"维修人或者维修时间不能为空");
|
||||||
}
|
}
|
||||||
// 3.更新维修单主表
|
// 3.更新维修单主表
|
||||||
jsonRemst.put("invstatus","07");
|
jsonRemst.put("invstatus","07");
|
||||||
@@ -481,6 +484,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
|||||||
jsonRemst.put("confirm_time",DateUtil.now());
|
jsonRemst.put("confirm_time",DateUtil.now());
|
||||||
reMstTab.update(jsonRemst);
|
reMstTab.update(jsonRemst);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -108,6 +108,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
file.is_delete = '0'
|
file.is_delete = '0'
|
||||||
AND file.status not in ('90','91')
|
AND file.status not in ('90','91')
|
||||||
|
and file.device_level in ('A','B')
|
||||||
|
|
||||||
OPTION 输入.device_code <> ""
|
OPTION 输入.device_code <> ""
|
||||||
(file.device_code like 输入.device_code or
|
(file.device_code like 输入.device_code or
|
||||||
@@ -121,7 +122,7 @@
|
|||||||
OPTION 输入.deptIds <> ""
|
OPTION 输入.deptIds <> ""
|
||||||
d1.dept_id in 输入.deptIds
|
d1.dept_id in 输入.deptIds
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
order by file.use_groupid,file.device_code
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -490,7 +490,6 @@ export default {
|
|||||||
this.changeShow = true
|
this.changeShow = true
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
//this.crud.toQuery()
|
|
||||||
this.crud.refresh()
|
this.crud.refresh()
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,7 +93,6 @@
|
|||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-position"
|
icon="el-icon-position"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="crud.selections.length !== 1"
|
|
||||||
@click="confirmRepair"
|
@click="confirmRepair"
|
||||||
>
|
>
|
||||||
班组验收
|
班组验收
|
||||||
@@ -102,7 +101,7 @@
|
|||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
<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" 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">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
|
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
|
||||||
</template>
|
</template>
|
||||||
@@ -133,7 +132,7 @@
|
|||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
</div>
|
</div>
|
||||||
<AddDialog/>
|
<AddDialog />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -251,11 +250,16 @@ export default {
|
|||||||
},
|
},
|
||||||
confirmRepair() {
|
confirmRepair() {
|
||||||
const _selectData = this.$refs.table.selection
|
const _selectData = this.$refs.table.selection
|
||||||
const data = _selectData[0]
|
if (_selectData.length === 0) {
|
||||||
if (data.invstatus !== '06') {
|
return this.crud.notify('请选择需要确认的记录!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
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.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
})
|
})
|
||||||
@@ -376,7 +380,6 @@ export default {
|
|||||||
|
|
||||||
color: "#CCCFD6";
|
color: "#CCCFD6";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vue-treeselect--has-value .vue-treeselect__input {
|
.vue-treeselect--has-value .vue-treeselect__input {
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ export default {
|
|||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('update:dialogShow', false)
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged')
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</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-form ref="form" :model="form" :rules="rules" size="mini" label-width="160px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
<pagination />
|
<pagination />
|
||||||
</div>
|
</div>
|
||||||
<DeviceDialog :dialog-show.sync="deviceDialog" :is-single="true" @tableChanged2="tableChanged2"/>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user