rev:维修单填报新增备件出库

This commit is contained in:
2023-09-19 17:39:12 +08:00
parent 3d682bb785
commit 56bcda4269
13 changed files with 405 additions and 53 deletions

View File

@@ -296,6 +296,7 @@ public class EmBiIostorinvOutServiceImpl extends ServiceImpl<EmBiIostorinvOutMap
stIvtIostorinvYl.setDetail_count(rows.size());
stIvtIostorinvYl.setRemark(whereJson.getString("remark"));
stIvtIostorinvYl.setWorkshop_id(whereJson.getString("workshop_id"));
stIvtIostorinvYl.setSource_id(whereJson.getString("source_id"));
return stIvtIostorinvYl;
}

View File

@@ -20,6 +20,7 @@ import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
import org.nl.wms.device_manage.repair.service.DevicerepairmstService;
import org.nl.wms.device_manage.repair.service.dto.DevicerepairmstDto;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
@@ -49,6 +50,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
// private final StorattrService storattrService;
// private final SparePartOutServiceImpl sparePartOutService;
@Autowired
private EmBiIostorinvOutService emBiIostorinvOutService;
@Autowired
private ISysDeptService deptService;
@@ -169,6 +173,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
jsonMst.put("remark", whereJson.getString("remark"));
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
jsonMst.put("detail_count", tableData.size());
jsonMst.put("update_optname", whereJson.getString("update_optname"));
jsonMst.put("input_optid", currentUserId);
jsonMst.put("input_optname", nickName);
jsonMst.put("input_time", DateUtil.now());
@@ -208,6 +213,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
jsonMst.put("remark", whereJson.getString("remark"));
jsonMst.put("plan_start_date", whereJson.getString("plan_start_date"));
jsonMst.put("estimaterepair_times", whereJson.getString("estimaterepair_times"));
jsonMst.put("update_optname", whereJson.getString("update_optname"));
jsonMst.put("detail_count", tableData.size());
mstTab.update(jsonMst);
@@ -260,8 +266,8 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst");
WQLObject dtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl");
JSONArray resultJSONArray = dtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(resultJSONArray)) throw new BadRequestException("维修项目为空");
/* JSONArray resultJSONArray = dtlTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(resultJSONArray)) throw new BadRequestException("维修项目为空");*/
JSONObject json = mstTab.query("repair_id ='" + whereJson.getString("repair_id") + "'").uniqueResult(0);
json.put("invstatus", "02");
@@ -283,7 +289,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
jsonReMst.put("invstatus", "03");
jsonReMst.put("estimaterepair_times", whereJson.getString("estimaterepair_times"));
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
// jsonReMst.put("update_optname", whereJson.getString("update_optname"));
jsonReMst.put("real_start_date", DateUtil.now());
reMstTab.update(jsonReMst);
// 2.更新设备档案表
@@ -322,7 +328,9 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
@Override
@Transactional(rollbackFor = Exception.class)
public void endRepair(JSONObject whereJson) {
public void endRepair(JSONObject whereJson2) {
JSONObject whereJson = whereJson2.getJSONObject("form");
Long currentUserId = Long.parseLong(SecurityUtils.getCurrentUserId());
String nickName = SecurityUtils.getCurrentNickName();
@@ -374,6 +382,7 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
jsonReMst.put("invstatus", "06");
jsonReMst.put("real_end_date", DateUtil.now());
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
jsonReMst.put("confirm_optid", currentUserId);
jsonReMst.put("confirm_optname", nickName);
jsonReMst.put("confirm_time", DateUtil.now());
@@ -397,6 +406,28 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
jsonLife.put("create_name",nickName);
jsonLife.put("create_time", DateUtil.now());
lifeTab.insert(jsonLife);
// 5.判断是否需要新增备件出库单
Boolean aSwitch = whereJson.getBoolean("switch");
if (ObjectUtil.isEmpty(aSwitch)) aSwitch = false;
if (aSwitch) {
whereJson2.put("repair_code", jsonReMst.getString("repair_code"));
this.createIos(whereJson2);
}
}
private void createIos(JSONObject whereJson) {
JSONObject mst = whereJson.getJSONObject("form2");
JSONArray tableDataDtl = mst.getJSONArray("tableDataDtl");
// 准备参数
mst.put("biz_date", DateUtil.now());
mst.put("tableData", tableDataDtl);
mst.put("source_id", whereJson.getString("repair_code"));
mst.put("remark", "由维修单创建");
emBiIostorinvOutService.create(mst);
}
@Override
@@ -407,19 +438,27 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
WQLObject reMstTab = WQLObject.getWQLObject("EM_BI_DeviceRepairMst"); // 设备维修单主表
WQLObject reDtlTab = WQLObject.getWQLObject("EM_BI_DeviceRepairDtl"); // 设备维修单明细表
WQLObject recordTab = WQLObject.getWQLObject("EM_BI_DeviceRepairRecord"); // 设备维修单情况记录表
WQLObject itemTab = WQLObject.getWQLObject("em_bi_devicerepairitems"); // 设备维修项目表
// 1.更新维修主表
JSONObject jsonReMst = reMstTab.query("repair_id = '" + whereJson.getString("repair_id") + "'").uniqueResult(0);
// jsonReMst.put("update_optname", whereJson.getString("update_optname"));
jsonReMst.put("update_optname", whereJson.getString("update_optname"));
jsonReMst.put("product_person_name", whereJson.getString("product_person_name"));
jsonReMst.put("update_time", DateUtil.now());
reMstTab.update(jsonReMst);
// 2.更新明细表
// 2.删除所有明细重新插入
reDtlTab.delete("repair_id = '"+whereJson.getString("repair_id")+"'");
for (int i = 0; i < tableData.size(); i++) {
JSONObject json = tableData.getJSONObject(i);
JSONObject jsonRedtl = reDtlTab.query("repair_dtl_id = '" + json.getString("repair_dtl_id") + "'").uniqueResult(0);
jsonRedtl.put("isfinish", json.getString("isfinish"));
reDtlTab.update(jsonRedtl);
JSONObject jsonObject = tableData.getJSONObject(i);
JSONObject json = new JSONObject();
json.put("repair_dtl_id", org.nl.common.utils.IdUtil.getStringId());
json.put("repair_id", whereJson.getString("repair_id"));
json.put("repair_item_id", jsonObject.getString("repair_item_id"));
json.put("isfinish", jsonObject.getString("isfinish"));
reDtlTab.insert(json);
}
// 3.插入设备维修单情况记录表

View File

@@ -10,6 +10,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.SecurityUtils;
@@ -20,6 +21,8 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.device_manage.repair.service.DevicerepairrequestService;
import org.nl.wms.device_manage.repair.service.dto.DevicerepairrequestDto;
import org.nl.wms.masterdata_manage.service.em.EmBiRepairDeviceService;
import org.nl.wms.masterdata_manage.service.em.dao.EmBiRepairDevice;
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
import org.nl.wms.system_manage.service.dept.ISysDeptService;
import org.nl.wms.system_manage.service.user.ISysUserService;
@@ -50,6 +53,9 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
@Autowired
private ISysDeptService deptService;
@Autowired
private EmBiRepairDeviceService emBiRepairDeviceService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
@@ -272,7 +278,15 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
jsonRequest.put("process_time", DateUtil.now());
requestTab.update(jsonRequest);
// 3.插入设备维修单主表
// 3.判断此设备是否有对应的维修人
List<EmBiRepairDevice> repairDeviceDaoList = emBiRepairDeviceService.list(
new QueryWrapper<EmBiRepairDevice>().lambda()
.eq(EmBiRepairDevice::getDevice_code, jsonFile.getString("device_code"))
);
if (repairDeviceDaoList.size() > 1) throw new BadRequestException("此设备对应维修人员超过2人请检查!");
// 4.插入设备维修单主表
JSONObject jsonReMst = new JSONObject();
jsonReMst.put("repair_id", IdUtil.getSnowflake(1,1).nextId());
jsonReMst.put("repair_code", CodeUtil.getNewCode("REPAIR_CODE"));
@@ -292,6 +306,10 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
jsonReMst.put("input_time", DateUtil.now());
jsonReMst.put("sysdeptid", 1);
jsonReMst.put("syscompanyid",1);
if (ObjectUtil.isNotEmpty(repairDeviceDaoList)){
SysUser userDao = iSysUserService.getById(repairDeviceDaoList.get(0).getUser_id());
jsonReMst.put("update_optname", userDao.getPerson_name());
}
reMstTab.insert(jsonReMst);
}
}

View File

@@ -48,4 +48,10 @@ public class DevicePairQueryController {
return new ResponseEntity<>(devicePairQueryService.getDeviceInfo(whereJson), HttpStatus.OK);
}
@PostMapping("/getIosMst")
@ApiOperation("获取备件出库单信息")
public ResponseEntity<Object> getIosMst(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(devicePairQueryService.getIosMst(whereJson), HttpStatus.OK);
}
}

View File

@@ -32,4 +32,7 @@ public interface DevicePairQueryService {
* @return JSONObject
*/
JSONObject getDeviceInfo(JSONObject whereJson);
JSONObject getIosMst(JSONObject whereJson);
}

View File

@@ -5,13 +5,17 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.utils.FileUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
import org.nl.wms.device_manage.stat.service.DevicePairQueryService;
import org.nl.wms.masterdata_manage.备份master.service.ClassstandardService;
import org.nl.wms.system_manage.service.dept.ISysDeptService;
@@ -33,6 +37,9 @@ public class DevicePairQueryServiceImpl implements DevicePairQueryService {
@Autowired
private ISysDeptService deptService;
@Autowired
private EmBiIostorinvOutService emBiIostorinvOutService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
@@ -194,4 +201,13 @@ public class DevicePairQueryServiceImpl implements DevicePairQueryService {
json.put("tableData2", relArr);
return json;
}
@Override
public JSONObject getIosMst(JSONObject whereJson) {
EmBiostorinv dao = emBiIostorinvOutService.getOne(
new QueryWrapper<EmBiostorinv>().lambda()
.eq(EmBiostorinv::getSource_id, whereJson.getString("repair_code"))
);
return JSON.parseObject(JSONObject.toJSONString(dao));
}
}

View File

@@ -180,7 +180,8 @@
{{ fun(scope.row.total_qty) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip min-width="120" />
<el-table-column label="来源单据号" align="center" prop="source_id" show-overflow-tooltip min-width="120" />
<el-table-column label="制单人" align="center" prop="create_name" />
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
<el-table-column label="修改人" align="center" prop="update_name" />

View File

@@ -77,6 +77,9 @@
/>
</el-select>
</el-form-item>
<el-form-item v-show="crud.status.edit !== 0 || crud.status.view !== 0 " label="维修人" prop="update_optname">
<el-input v-model.trim="form.update_optname" v-show="crud.status.edit !== 0 || crud.status.view !== 0 " style="width: 200px;" :disabled="crud.status.view > 0" />
</el-form-item>
<el-form-item v-show="crud.status.edit === 1" label="预计修复时间(小时)" prop="estimaterepair_times">
<el-input-number v-show="crud.status.edit === 1" v-model="form.estimaterepair_times" :disabled="crud.status.view > 0" :precision="1" :min="0" :max="999" style="width: 200px" :controls="false" />
</el-form-item>

View File

@@ -152,4 +152,12 @@ export function getDeviceInfo(data) {
})
}
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo }
export function getIosMst(data) {
return request({
url: 'api/devicerepairquery/getIosMst',
method: 'post',
data
})
}
export default { findByCode, add, edit, del, getDtl, submit, startRepair, endRepair, submitRepair, confirmRepair, submitResuft, getResult, outRepair, checkRepair, uditRepair, getNormBom, getFileBom, submitReceive, getDeviceInfo, getIosMst }

View File

@@ -244,6 +244,9 @@ export default {
if (data.invstatus !== '01') {
return this.crud.notify('只能对生成状态的单据提交', CRUD.NOTIFICATION_TYPE.INFO)
}
if (data.update_optname === '') {
return this.crud.notify('维修人不允许为空', CRUD.NOTIFICATION_TYPE.INFO)
}
crudDevicerepairmst.submit(data).then(res => {
this.crud.notify('提交成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()

View File

@@ -7,6 +7,7 @@
:before-close="handleClose"
destroy-on-close
@close="close"
@open="open"
>
<el-row>
<el-col :span="18" style="border: 1px solid white">
@@ -14,7 +15,7 @@
</el-col>
<el-col :span="6">
<span>
<el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">预保存</el-button>
<!-- <el-button icon="el-icon-check" size="mini" type="primary" @click="submitMain">预保存</el-button>-->
<el-button icon="el-icon-check" size="mini" type="primary" @click="endRepair">保存并结束</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
</span>
@@ -23,19 +24,19 @@
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="120px" label-suffix=":">
<el-row>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="单据号" prop="repair_code">
<el-input v-model.trim="form.repair_code" style="width: 200px;" disabled placeholder="系统自动生成" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<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 />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="维修类型" prop="maintenancecycle">
<el-select
v-model="form.maintenancecycle"
@@ -55,21 +56,26 @@
</el-row>
<el-row>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="设备名称" prop="device_name">
<el-input v-model.trim="form.device_name" :disabled="true" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="维修人" prop="update_optname">
<el-input v-model.trim="form.update_optname" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="班组配合人" prop="product_person_name">
<el-input v-model.trim="form.product_person_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="备件出库">
<el-switch v-model="form.switch" active-color="#13ce66" inactive-color="#ff4949" />
</el-form-item>
</el-col>
</el-row>
<el-row>
@@ -122,6 +128,23 @@
<span class="role-span">项目明细</span>
</div>
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="putItem"
>
添加项目
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
@@ -154,18 +177,159 @@
</el-select>
</template>
</el-table-column>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" :disabled="scope.row.isfinish === '1'" @click.native.prevent="delRow(scope.$index, form.tableData)" />
</template>
</el-table-column>
</el-table>
</el-card>
<div v-if="form.switch" class="crud-opts2">
<span class="role-span">新增备件出库</span> &nbsp;&nbsp;&nbsp;
</div>
<div v-if="form.switch" class="crud-opts2">
<el-form
ref="form"
:inline="true"
:model="form2"
:rules="rules"
size="mini"
label-width="85px"
label-suffix=":"
>
<el-form-item label="业务类型" prop="bill_type">
<el-select
v-model="form2.bill_type"
clearable
size="mini"
placeholder="业务类型"
class="filter-item"
>
<el-option
v-for="item in dict.EM_BI_OUT_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓库</label>
<el-select
v-model="form2.stor_id"
clearable
class="filter-item"
style="width: 210px"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="车间" prop="workshop_id">
<label slot="label">车间</label>
<el-select
v-model="form2.workshop_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
>
<el-option
v-for="item in dict.product_area"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<div v-if="form.switch" class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="insertEvent"
>
添加库存
</el-button>
</span>
</div>
<el-card v-if="form.switch" class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="form2.tableDataDtl"
style="width: 100%;"
max-height="500"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量">
<template slot-scope="scope">
<el-input-number
v-model="form2.tableDataDtl[scope.$index].plan_qty"
size="small"
:controls="false"
controls-position="right"
precision="3"
:min="0"
/>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
<template slot-scope="scope">
<el-input
v-model="form2.tableDataDtl[scope.$index].remark"
size="small"
:controls="false"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delRow(scope.$index, form2.tableDataDtl)" />
</template>
</el-table-column>
</el-table>
</el-card>
<ItemDialog :dialog-show.sync="itemDialog" :is-single="false" :open-param="openParam" @tableChanged1="tableChanged1" />
<StructIvt :dialog-show.sync="ivtShow" @setMaterValue="tableChanged" />
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
import ItemDialog from '@/views/wms/device_manage/repair/devicerepairplan/ItemDialog'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt'
export default {
name: 'ExecuteDialog',
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT'],
dicts: ['EM_DEVICE_WX_INVTYPE', 'IS_OR_NOT', 'EM_BI_OUT_TYPE', 'product_area'],
components: { ItemDialog, StructIvt },
mixins: [crud()],
props: {
dialogShow: {
@@ -179,8 +343,19 @@ export default {
data() {
return {
form: {
switch: false,
tableData: []
},
form2: {
bill_type: '',
stor_id: '',
workshop_id: '',
total_qty: '0',
tableDataDtl: []
},
storlist: [],
itemDialog: false,
ivtShow: false,
dialogVisible: false
}
},
@@ -202,6 +377,11 @@ export default {
.catch(_ => {
})
},
open() {
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('update:dialogShow', false)
},
@@ -214,12 +394,95 @@ export default {
})
},
endRepair() {
const data = this.form
// 校验备件出库
if (this.form.switch) {
if (this.form2.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form2.stor_id === '') {
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form2.workshop_id === '') {
this.crud.notify('请选择车间!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form2.tableDataDtl.length === 0) {
this.crud.notify('请添加备件!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form2.tableDataDtl.length; i++) {
const row = this.form2.tableDataDtl[i]
if (!row.plan_qty) {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
}
const data = {
'form': this.form,
'form2': this.form2
}
crudDevicerepairmst.endRepair(data).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
this.dialogVisible = false
})
},
putItem() {
this.openParam = this.form
this.itemDialog = true
},
tableChanged1(row) {
const arr = row
const data = this.form.tableData
arr.forEach((item) => {
if (this.form.tableData.length !== 0) {
this.fla = false
for (let i = 0; i < data.length; i++) {
if (data[i].repair_item_id === item.repair_item_id) {
this.fla = true
}
}
if (this.fla === false) {
this.form.tableData.push(item)
}
} else {
this.form.tableData.push(item)
}
})
},
insertEvent(row) {
this.ivtShow = true
},
delRow(index, rows) {
rows.splice(index, 1)
},
tableChanged(rows) {
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form2.tableDataDtl.forEach((row) => {
if (row.material_code === item.material_code) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = item.canuse_qty
this.form2.total_qty = parseFloat(this.form2.total_qty) + parseFloat(item.plan_qty)
this.form2.tableDataDtl.splice(-1, 0, item)
}
})
this.form2.detail_count = this.form2.tableDataDtl.length
}
}
}
@@ -250,4 +513,8 @@ export default {
background-color: #fff;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>

View File

@@ -9,13 +9,13 @@
@close="close"
>
<el-form ref="form" :inline="true" :model="form4" :rules="rules" size="mini" label-width="150px" label-suffix=":">
<el-row>
<!-- <el-row>
<el-col :span="24">
<el-form-item label="维修人" prop="update_optname">
<el-input v-model.trim="form4.update_optname" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
</el-row>-->
<el-row>
<el-col :span="24">
<el-form-item label="预计修复时间(小时)" prop="estimaterepair_times">

View File

@@ -1,12 +1,13 @@
<template>
<el-dialog
title="维修领用"
title="维修详情"
append-to-body
:visible.sync="dialogVisible"
fullscreen
:before-close="handleClose"
destroy-on-close
@close="close"
@open="open"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
@@ -97,22 +98,7 @@
</el-card>
<div class="crud-opts2">
<span class="role-span">设备bom</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-check"
size="mini"
disabled
@click="addChange"
>
添加更换件
</el-button>
</span>
<span class="role-span">备件出库明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@@ -127,18 +113,11 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="repair_item_code" label="维修项目编号" align="center" />
<el-table-column show-overflow-tooltip prop="device_code" label="设备编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="sparepart_only_id" label="备件唯一标识" align="center" />
<el-table-column show-overflow-tooltip prop="change_only_id" label="更换备件唯一标识" align="center" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="danger" disabled class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="delRow(scope.$index, tableData)" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" />
</el-table>
</el-card>
@@ -152,6 +131,7 @@
import crudDevicerepairmst from '@/views/wms/device_manage/repair/devicerepair/devicerepairmst'
import CRUD, { crud } from '@crud/crud'
import AddChangeDialog from '@/views/wms/device_manage/repair/devicerepairpa/AddChangeDialog'
import crudProductOut from '@/views/wms/device_manage/ios/embiout/embiout'
export default {
name: 'ReceiveDialog',
@@ -188,6 +168,13 @@ export default {
}
},
methods: {
open() {
crudDevicerepairmst.getIosMst(this.form3).then(res => {
crudProductOut.getIODtl({ 'iostorinv_id': res.iostorinv_id }).then(res => {
this.tableData = res
})
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {