rev:出入库编辑异常
This commit is contained in:
@@ -63,7 +63,7 @@ public interface IBmVehicleInfoService extends IService<BmVehicleInfo> {
|
||||
* @param code code
|
||||
* @return BmVehicleInfo
|
||||
*/
|
||||
Object findByCode(String code);
|
||||
BmVehicleInfo findByCode(String code);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
|
||||
@@ -124,8 +124,8 @@ public class BmVehicleInfoServiceImpl extends ServiceImpl<BmVehicleInfoMapper, B
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object findByCode(String code) {
|
||||
return this.getOne(new QueryWrapper<BmVehicleInfo>().eq("storagevehicle_code",code));
|
||||
public BmVehicleInfo findByCode(String code) {
|
||||
return this.getOne(new QueryWrapper<BmVehicleInfo>().eq("vehicle_code",code));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,12 @@ public class StIvtIostorinvController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject form) {
|
||||
iStIvtIostorinvService.update(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("getIosInvDtl")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody String inv_id) {
|
||||
List<Map> mapList = iStIvtIostorinvDtlService.getByInv(inv_id);
|
||||
|
||||
@@ -54,6 +54,12 @@ public class StIvtIostorinvOutController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject form) {
|
||||
iStIvtIostorinvService.update(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("getIosInvDtl")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody String inv_id) {
|
||||
List<Map> mapList = iStIvtIostorinvDtlOutService.getByInv(inv_id);
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.nl.wms.stor_manage.io.service.iostor.dao.StIvtIostorinv;
|
||||
public interface IStIvtIostorinvService extends IService<StIvtIostorinv> {
|
||||
|
||||
void save(JSONObject form);
|
||||
void update(JSONObject form);
|
||||
|
||||
/**
|
||||
* 出库分配
|
||||
|
||||
@@ -101,7 +101,7 @@ public class StIvtIostorinv implements Serializable {
|
||||
/**
|
||||
* 是否为入库单
|
||||
*/
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER)
|
||||
@TableField(insertStrategy = FieldStrategy.NEVER,updateStrategy = FieldStrategy.NEVER)
|
||||
private Boolean in_storage;
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
|
||||
private IMdGruopDickService iMdGruopDickService;
|
||||
@Autowired
|
||||
private IBmVehicleInfoService iBmVehicleInfoService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(JSONObject form) {
|
||||
@@ -79,6 +80,24 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
|
||||
this.save(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void update(JSONObject form) {
|
||||
if (form == null) {
|
||||
return;
|
||||
}
|
||||
List<Map> dtls = (List<Map>) form.remove("item");
|
||||
StIvtIostorinv mst = form.toJavaObject(StIvtIostorinv.class);
|
||||
if (dtls != null && dtls.size() > 0) {
|
||||
for (int i = 0; i < dtls.size(); i++) {
|
||||
StIvtIostorinvdtl dtl = new JSONObject(dtls.get(i)).toJavaObject(StIvtIostorinvdtl.class);
|
||||
// dtl.setInv_id(mst.getId());
|
||||
iStIvtIostorinvDtlService.updateById(dtl);
|
||||
}
|
||||
}
|
||||
this.updateById(mst);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary"
|
||||
@click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
|
||||
:model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据号" prop="code">
|
||||
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 150px"/>
|
||||
</el-form-item>
|
||||
@@ -104,10 +106,14 @@
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
|
||||
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格"/>
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="物料批次" width="160" align="center">
|
||||
<template scope="scope"><el-input v-model="tableData[scope.$index].pcsn" class="input-with-select" /></template>
|
||||
<template scope="scope">
|
||||
<el-input v-model="tableData[scope.$index].pcsn" class="input-with-select"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="计划数量" width="160" align="center">
|
||||
<template scope="scope"><el-input-number v-model="tableData[scope.$index].qty" class="input-with-select" /></template>
|
||||
<template scope="scope">
|
||||
<el-input-number v-model="tableData[scope.$index].qty" class="input-with-select"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="unit_id" label="单位" width="160">
|
||||
<template slot-scope="scope">
|
||||
@@ -197,6 +203,7 @@ import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
|
||||
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import measureunit from '@/views/wms/base_manage/measure/measureunit'
|
||||
import crudProductIn from '@/views/wms/stor_manage/in/storinvin'
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
@@ -241,6 +248,7 @@ export default {
|
||||
dtlShow: false,
|
||||
opendtlParam: null,
|
||||
materType: '03', // 关键成品
|
||||
id: '',
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
rules: {
|
||||
@@ -255,9 +263,12 @@ export default {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setForm(row) {
|
||||
this.id = row.form.id
|
||||
},
|
||||
open() {
|
||||
this.tableData = [],
|
||||
formstruc.getHeader('st_ivt_iostorinv').then(res => {
|
||||
@@ -272,12 +283,18 @@ export default {
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
console.log(this.id)
|
||||
console.log(2222222)
|
||||
if (this.id !== '' && this.id !== null && this.id !== undefined) {
|
||||
crudProductIn.getIosInvDtl(this.id).then(res => {
|
||||
this.tableData = res
|
||||
this.id = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
|
||||
|
||||
insertEvent(row) {
|
||||
this.materShow = true
|
||||
},
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary"
|
||||
@click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
|
||||
:model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据号" prop="code">
|
||||
<el-input v-model="form.code" disabled placeholder="系统生成" clearable style="width: 150px"/>
|
||||
</el-form-item>
|
||||
@@ -114,7 +116,8 @@
|
||||
<el-table-column show-overflow-tooltip prop="vehicle_code" label="载具编码" width="160"/>
|
||||
<el-table-column show-overflow-tooltip prop="source_form_type" label="源单类型"/>
|
||||
<el-table-column show-overflow-tooltip prop="source_form_id" label="源单id"/>
|
||||
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value" :label="item.lable" >
|
||||
<el-table-column width="130" show-overflow-tooltip v-for="(item, index) in dtlCols" :key="item.value"
|
||||
:label="item.lable">
|
||||
<template slot-scope="scope">{{ scope.row.form_data[item.value] }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="备注"/>
|
||||
@@ -207,7 +210,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="subRow(scope.$index, scope.row)">删除</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="subRow(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -373,7 +377,25 @@ export default {
|
||||
this.vehicleform = {}
|
||||
},
|
||||
submitDialogVehicle() {
|
||||
//判断每条载具信息的qty是否小于等于0或者大于vehicleform.qty
|
||||
//判断每条载具信息的qty和是否小于0或者大于vehicleform.qty
|
||||
this.vehicleform.item = this.vehicledis
|
||||
const invalidItem = this.vehicleform.item.some(item => item.qty <= 0 || item.qty > this.vehicleform.qty);
|
||||
if (invalidItem) {
|
||||
this.crud.notify('载具分配失败,请检查载具分配中数量是否满足条件大于0或者小于' + this.vehicleform.qty, CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return false
|
||||
}
|
||||
|
||||
let sum = 0;
|
||||
this.vehicleform.item.some(item => {
|
||||
sum += item.qty;
|
||||
});
|
||||
|
||||
if (sum <= 0 || sum > this.vehicleform.qty) {
|
||||
this.crud.notify('载具分配失败,请检查载具分配中数量之和是否满足条件大于0或者小于' + this.vehicleform.qty, CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return false
|
||||
}
|
||||
|
||||
crudProduct.inDecision(this.vehicleform).then(res => {
|
||||
this.crud.notify('载具分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.dialogVehicle = false
|
||||
|
||||
@@ -155,13 +155,14 @@
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>-->
|
||||
</template>
|
||||
-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<AddDialog ref="editDialog" @AddChanged="querytable"/>
|
||||
<ViewDialog ref="itemview"/>
|
||||
<TaskDialog ref="taskDis"/>
|
||||
</div>
|
||||
@@ -199,7 +200,17 @@ const defaultForm = {
|
||||
|
||||
export default {
|
||||
name: 'ProductOut',
|
||||
components: { TaskDialog, AddDialog, ViewDialog, formstruc, crudProductIn, crudOperation, rrOperation, udOperation, pagination },
|
||||
components: {
|
||||
TaskDialog,
|
||||
AddDialog,
|
||||
ViewDialog,
|
||||
formstruc,
|
||||
crudProductIn,
|
||||
crudOperation,
|
||||
rrOperation,
|
||||
udOperation,
|
||||
pagination
|
||||
},
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
@@ -258,7 +269,9 @@ export default {
|
||||
this.cols = res
|
||||
})
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeToEdit](row) {
|
||||
this.$refs.editDialog.setForm(row)
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.itemview.setForm(row)
|
||||
|
||||
@@ -227,6 +227,8 @@ import MaterDialog from '@/views/wms/base_manage/material/MaterDialog'
|
||||
import FormDialog from '@/views/wms/pm_manage/form_data/FormDialog'
|
||||
import formstruc from '@/views/wms/config_manage/formStruc/formstruc'
|
||||
import measureunit from '@/views/wms/base_manage/measure/measureunit'
|
||||
import crudProductIn from '@/views/wms/stor_manage/out/storinvout'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
id: '',
|
||||
@@ -267,6 +269,7 @@ export default {
|
||||
tableData:[],
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
id: '',
|
||||
formShow: false,
|
||||
dtlShow: false,
|
||||
opendtlParam: null,
|
||||
@@ -288,6 +291,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setForm(row) {
|
||||
this.id = row.form.id
|
||||
},
|
||||
open() {
|
||||
this.tableData = [],
|
||||
formstruc.getHeader('st_ivt_iostorinv').then(res => {
|
||||
@@ -302,6 +308,12 @@ export default {
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
if (this.id !== '' && this.id !== null && this.id !== undefined) {
|
||||
crudProductIn.getIosInvDtl(this.id).then(res => {
|
||||
this.tableData = res
|
||||
this.id = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<AddDialog ref="editDialog" @AddChanged="querytable" />
|
||||
<ViewDialog ref="itemview"/>
|
||||
<TaskDialog ref="taskDis"/>
|
||||
</div>
|
||||
@@ -258,7 +258,9 @@ export default {
|
||||
this.cols = res
|
||||
})
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeToEdit](row) {
|
||||
this.$refs.editDialog.setForm(row)
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.itemview.setForm(row)
|
||||
|
||||
Reference in New Issue
Block a user