优化
This commit is contained in:
@@ -34,7 +34,7 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
|
||||
|
||||
// 1.1获取当前日期 - 前14天的日期
|
||||
String now = DateUtil.now();
|
||||
for (int i = 0; i < 14; i++) {
|
||||
for (int i = 13; i >= 0; i--) {
|
||||
JSONObject json = new JSONObject();
|
||||
String run_date = DateUtil.offsetDay(DateUtil.parse(now), -i).toString().substring(0, 10);
|
||||
// 棒料事业部:H900000 矿用合金事业部:H800000 型材事业部:H400000 混合料厂:H1300000 武汉运营保障部:H1200200 精密零件事业部:H1000000
|
||||
|
||||
@@ -209,6 +209,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
JSONArray tableData = whereJson.getJSONArray("tableData");
|
||||
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst");
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl");
|
||||
if(StrUtil.isEmpty(whereJson.getString("invstatus"))){
|
||||
throw new BadRequestException("状态不能为空");
|
||||
}
|
||||
|
||||
// 更新主表
|
||||
JSONObject jsonMst = mstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
|
||||
@@ -460,6 +463,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
|
||||
|
||||
String invstatus = map.getString("invstatus");
|
||||
if(StrUtil.isEmpty(invstatus)){
|
||||
throw new BadRequestException("状态不能为空");
|
||||
}
|
||||
JSONArray rows = map.getJSONArray("rows");
|
||||
for(int m=0; m<rows.size();m++){
|
||||
JSONObject whereJson = rows.getJSONObject(m);
|
||||
|
||||
@@ -22,6 +22,21 @@
|
||||
<el-form-item label="单据号" prop="repair_code">
|
||||
<el-input v-model="form.repair_code" style="width: 200px;" disabled placeholder="系统自动生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="invstatus">
|
||||
<el-select
|
||||
v-model="form.invstatus"
|
||||
disabled
|
||||
size="mini"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_DEVICE_WX_INVSTATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划维修日期" prop="plan_start_date">
|
||||
<el-date-picker v-model="form.plan_start_date" type="date" placeholder="选择日期" style="width: 200px" value-format="yyyy-MM-dd" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
@@ -134,6 +149,7 @@ const defaultForm = {
|
||||
repair_code: null,
|
||||
devicerecord_id: null,
|
||||
maintenancecycle: '02',
|
||||
invstatus: '01',
|
||||
estimaterepair_times: 0,
|
||||
fault_desc: null,
|
||||
fault_level: null,
|
||||
@@ -149,7 +165,7 @@ import CRUD, { form, crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_FAULT_LEVEL'],
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_FAULT_LEVEL', 'EM_DEVICE_WX_INVSTATUS'],
|
||||
components: { ItemDialog, DeviceDialog },
|
||||
mixins: [form(defaultForm), crud()],
|
||||
props: {
|
||||
|
||||
@@ -100,17 +100,6 @@
|
||||
>
|
||||
委外维修
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="execu_flag"
|
||||
@click="executeRepair"
|
||||
>
|
||||
维修执行
|
||||
</el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -340,11 +329,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({ invstatus: '07', rows: _selectData }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user