盘点修改
This commit is contained in:
@@ -160,4 +160,11 @@ public class CheckController {
|
|||||||
checkService.confirmBtn(whereJson);
|
checkService.confirmBtn(whereJson);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/repairSubmit")
|
||||||
|
@Log("补录明细")
|
||||||
|
@ApiOperation("补录明细")
|
||||||
|
public ResponseEntity<Object> repairSubmit(@RequestBody JSONObject whereJson) {
|
||||||
|
checkService.repairSubmit(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,4 +124,9 @@ public interface CheckService {
|
|||||||
* 强制确认
|
* 强制确认
|
||||||
*/
|
*/
|
||||||
void confirmBtn(JSONObject whereJson);
|
void confirmBtn(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补录明细
|
||||||
|
*/
|
||||||
|
void repairSubmit(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -797,13 +797,23 @@ public class CheckServiceImpl implements CheckService {
|
|||||||
public void allInsert(JSONObject jsonObject) {
|
public void allInsert(JSONObject jsonObject) {
|
||||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst"); // 盘点单主表
|
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst"); // 盘点单主表
|
||||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl"); // 盘点单明细表
|
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl"); // 盘点单明细表
|
||||||
|
WQLObject storTab = WQLObject.getWQLObject("st_ivt_bsrealstorattr"); // 仓库表
|
||||||
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
Long deptId = SecurityUtils.getDeptId();
|
Long deptId = SecurityUtils.getDeptId();
|
||||||
|
|
||||||
|
JSONObject jsonStor = storTab.query("stor_id = '" + jsonObject.getString("stor_id") + "'").uniqueResult(0);
|
||||||
|
|
||||||
// 查找库内所有在库木箱
|
// 查找库内所有在库木箱
|
||||||
JSONArray dtlArr = WQL.getWO("QST_IVT_CHECK").addParam("flag", "11").addParam("stor_id", jsonObject.getString("stor_id")).process().getResultJSONArray(0);
|
JSONArray dtlArr = WQL.getWO("QST_IVT_CHECK").addParam("flag", "11")
|
||||||
|
.addParam("stor_id", jsonObject.getString("stor_id"))
|
||||||
|
.addParam("sect_id", jsonObject.getString("sect_id"))
|
||||||
|
.process().getResultJSONArray(0);
|
||||||
|
|
||||||
|
if (dtlArr.size() == 0) {
|
||||||
|
throw new BadRequestException("此库区没有要盘点的木箱");
|
||||||
|
}
|
||||||
|
|
||||||
// 插入主表
|
// 插入主表
|
||||||
JSONObject jsonMst = new JSONObject();
|
JSONObject jsonMst = new JSONObject();
|
||||||
@@ -811,8 +821,8 @@ public class CheckServiceImpl implements CheckService {
|
|||||||
jsonMst.put("check_code", CodeUtil.getNewCode("PD_CODE"));
|
jsonMst.put("check_code", CodeUtil.getNewCode("PD_CODE"));
|
||||||
jsonMst.put("buss_type", jsonObject.getString("check_type"));
|
jsonMst.put("buss_type", jsonObject.getString("check_type"));
|
||||||
jsonMst.put("check_type", jsonObject.getString("check_type"));
|
jsonMst.put("check_type", jsonObject.getString("check_type"));
|
||||||
jsonMst.put("stor_id", jsonObject.getLongValue("stor_id"));
|
jsonMst.put("stor_id", jsonStor.getLongValue("stor_id"));
|
||||||
jsonMst.put("stor_name", jsonObject.getString("stor_name"));
|
jsonMst.put("stor_name", jsonStor.getString("stor_name"));
|
||||||
jsonMst.put("dtl_num", dtlArr.size());
|
jsonMst.put("dtl_num", dtlArr.size());
|
||||||
jsonMst.put("create_mode", "01");
|
jsonMst.put("create_mode", "01");
|
||||||
jsonMst.put("is_nok", "0");
|
jsonMst.put("is_nok", "0");
|
||||||
@@ -859,4 +869,40 @@ public class CheckServiceImpl implements CheckService {
|
|||||||
|
|
||||||
mstTab.update(jsonMst);
|
mstTab.update(jsonMst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void repairSubmit(JSONObject whereJson) {
|
||||||
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||||
|
WQLObject mstTab = WQLObject.getWQLObject("st_ivt_checkmst");
|
||||||
|
WQLObject dtlTab = WQLObject.getWQLObject("st_ivt_checkdtl");
|
||||||
|
|
||||||
|
JSONObject jsonMst = mstTab.query("check_code = '" + whereJson.getString("check_code") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
JSONObject jsonMater = materTab.query("material_code = '" + whereJson.getString("material_code") + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料信息不存在!");
|
||||||
|
|
||||||
|
// 新增明细
|
||||||
|
JSONObject jsonDtl = new JSONObject();
|
||||||
|
jsonDtl.put("checkdtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonDtl.put("check_id", jsonMst.getLongValue("check_id"));
|
||||||
|
jsonDtl.put("check_code", jsonMst.getString("check_code"));
|
||||||
|
jsonDtl.put("seq_no", jsonMst.getIntValue("dtl_num") + 1);
|
||||||
|
jsonDtl.put("sect_id", 111111);
|
||||||
|
jsonDtl.put("sect_name", "补录库区");
|
||||||
|
jsonDtl.put("struct_id", 111111);
|
||||||
|
jsonDtl.put("struct_name", "补录货位");
|
||||||
|
jsonDtl.put("storagevehicle_code", whereJson.getString("storagevehicle_code"));
|
||||||
|
jsonDtl.put("material_id", jsonMater.getLongValue("material_id"));
|
||||||
|
jsonDtl.put("qty_unit_id", jsonMater.getLongValue("base_unit_id"));
|
||||||
|
jsonDtl.put("qty_unit_name", "KG");
|
||||||
|
jsonDtl.put("status", "1");
|
||||||
|
jsonDtl.put("base_qty", whereJson.getDoubleValue("base_qty"));
|
||||||
|
jsonDtl.put("remark", whereJson.getString("remark"));
|
||||||
|
dtlTab.insert(jsonDtl);
|
||||||
|
|
||||||
|
// 更新主表
|
||||||
|
jsonMst.put("dtl_num", jsonMst.getIntValue("dtl_num") + 1);
|
||||||
|
mstTab.update(jsonMst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -500,14 +500,17 @@
|
|||||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||||
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||||
WHERE
|
WHERE
|
||||||
attr.sect_code in ('XN01','XN11')
|
IFNULL(attr.storagevehicle_code,'') <> ''
|
||||||
AND IFNULL(attr.storagevehicle_code,'') <> ''
|
|
||||||
AND attr.lock_type = '1'
|
AND attr.lock_type = '1'
|
||||||
|
|
||||||
OPTION 输入.stor_id <> ""
|
OPTION 输入.stor_id <> ""
|
||||||
attr.stor_id = 输入.stor_id
|
attr.stor_id = 输入.stor_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.sect_id <> ""
|
||||||
|
attr.sect_id = 输入.sect_id
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
group by attr.struct_code
|
group by attr.struct_code
|
||||||
|
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
|
|||||||
@@ -9,9 +9,22 @@
|
|||||||
@close="close"
|
@close="close"
|
||||||
>
|
>
|
||||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||||
<el-col :span="18" style="border: 1px solid white">
|
<el-col :span="13" style="border: 1px solid white">
|
||||||
<span />
|
<span />
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form ref="form" :inline="true" :model="form" size="mini">
|
||||||
|
<el-form-item label="库区" prop="gender5">
|
||||||
|
<el-cascader
|
||||||
|
placeholder="请选择"
|
||||||
|
:options="sects"
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
|
clearable
|
||||||
|
@change="sectQueryChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<span>
|
<span>
|
||||||
<el-button icon="el-icon-check" size="mini" :loading="showLoading" type="primary" @click="allInsert">一键保存</el-button>
|
<el-button icon="el-icon-check" size="mini" :loading="showLoading" type="primary" @click="allInsert">一键保存</el-button>
|
||||||
@@ -141,6 +154,17 @@
|
|||||||
>
|
>
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
icon="el-icon-folder-add"
|
||||||
|
size="mini"
|
||||||
|
v-if="crud.status.view > 0"
|
||||||
|
@click="repairDialog"
|
||||||
|
>
|
||||||
|
补录信息
|
||||||
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -179,6 +203,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||||
<DtlViewDialog :dialog-show.sync="dtlViewShow" :open-param="paramDtlView"/>
|
<DtlViewDialog :dialog-show.sync="dtlViewShow" :open-param="paramDtlView"/>
|
||||||
|
<RepairDialog :dialog-show.sync="repairShow" :open-param="check_code" :father-method="queryDtlView" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -188,6 +213,7 @@ import AddDtl from '@/views/wms/st/inStor/check/AddDtl'
|
|||||||
import check from '@/views/wms/st/inStor/check/check'
|
import check from '@/views/wms/st/inStor/check/check'
|
||||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||||
import DtlViewDialog from '@/views/wms/st/inStor/check/DtlViewDialog'
|
import DtlViewDialog from '@/views/wms/st/inStor/check/DtlViewDialog'
|
||||||
|
import RepairDialog from '@/views/wms/st/inStor/check/RepairDialog'
|
||||||
import { download } from '@/api/data'
|
import { download } from '@/api/data'
|
||||||
import { downloadFile } from '@/utils'
|
import { downloadFile } from '@/utils'
|
||||||
|
|
||||||
@@ -205,7 +231,7 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'AddDialog',
|
name: 'AddDialog',
|
||||||
components: { AddDtl, DtlViewDialog },
|
components: { AddDtl, DtlViewDialog, RepairDialog },
|
||||||
mixins: [crud(), form(defaultForm)],
|
mixins: [crud(), form(defaultForm)],
|
||||||
props: {
|
props: {
|
||||||
dialogShow: {
|
dialogShow: {
|
||||||
@@ -223,11 +249,17 @@ export default {
|
|||||||
showDtlLoading: false,
|
showDtlLoading: false,
|
||||||
dtlShow: false,
|
dtlShow: false,
|
||||||
flagnow: false,
|
flagnow: false,
|
||||||
|
repairShow: false,
|
||||||
|
check_code: '',
|
||||||
paramType: '',
|
paramType: '',
|
||||||
storId: null,
|
storId: null,
|
||||||
nowrow: {},
|
nowrow: {},
|
||||||
nowindex: '',
|
nowindex: '',
|
||||||
storlist: [],
|
storlist: [],
|
||||||
|
sectProp: null,
|
||||||
|
stor_id: '',
|
||||||
|
sect_id: '',
|
||||||
|
sects: [],
|
||||||
rules: {
|
rules: {
|
||||||
stor_id: [
|
stor_id: [
|
||||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||||
@@ -250,6 +282,9 @@ export default {
|
|||||||
crudUserStor.getUserStor().then(res => {
|
crudUserStor.getUserStor().then(res => {
|
||||||
this.storlist = res
|
this.storlist = res
|
||||||
})
|
})
|
||||||
|
crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
|
||||||
|
this.sects = res.content
|
||||||
|
})
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('AddChanged')
|
this.$emit('AddChanged')
|
||||||
@@ -285,6 +320,11 @@ export default {
|
|||||||
this.showDtlLoading = false
|
this.showDtlLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
queryDtlView() {
|
||||||
|
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||||
|
this.form.tableData = res
|
||||||
|
})
|
||||||
|
},
|
||||||
bill_statusFormat(row) {
|
bill_statusFormat(row) {
|
||||||
return this.dict.label.check_dtl_status[row.status]
|
return this.dict.label.check_dtl_status[row.status]
|
||||||
},
|
},
|
||||||
@@ -360,7 +400,14 @@ export default {
|
|||||||
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (this.sect_id === '' && this.stor_id === '') {
|
||||||
|
this.crud.notify('请选择库区或者仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.showLoading = true
|
this.showLoading = true
|
||||||
|
this.form.sect_id = this.sect_id
|
||||||
|
this.form.stor_id = this.stor_id
|
||||||
|
debugger
|
||||||
check.allInsert(this.form).then(res => {
|
check.allInsert(this.form).then(res => {
|
||||||
this.crud.cancelCU()
|
this.crud.cancelCU()
|
||||||
this.showLoading = false
|
this.showLoading = false
|
||||||
@@ -378,6 +425,26 @@ export default {
|
|||||||
crud.downloadLoading = false
|
crud.downloadLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
sectQueryChange(val) {
|
||||||
|
this.sectProp = val
|
||||||
|
if (val.length === 1) {
|
||||||
|
this.stor_id = val[0]
|
||||||
|
this.sect_id = ''
|
||||||
|
}
|
||||||
|
if (val.length === 0) {
|
||||||
|
this.sect_id = ''
|
||||||
|
this.stor_id = ''
|
||||||
|
}
|
||||||
|
if (val.length === 2) {
|
||||||
|
this.stor_id = val[0]
|
||||||
|
this.sect_id = val[1]
|
||||||
|
}
|
||||||
|
this.form.stor_id = this.stor_id
|
||||||
|
},
|
||||||
|
repairDialog() {
|
||||||
|
this.check_code = this.form.check_code
|
||||||
|
this.repairShow = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
107
lms/nladmin-ui/src/views/wms/st/inStor/check/RepairDialog.vue
Normal file
107
lms/nladmin-ui/src/views/wms/st/inStor/check/RepairDialog.vue
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="补录明细"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="450px"
|
||||||
|
:before-close="handleClose"
|
||||||
|
destroy-on-close
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-form ref="form" :model="form1" :rules="rules" size="mini" label-width="110px">
|
||||||
|
<el-form-item label="箱号:" prop="storagevehicle_code">
|
||||||
|
<el-input v-model="form1.storagevehicle_code" style="width: 250px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="重量:" prop="base_qty">
|
||||||
|
<el-input-number v-model="form1.base_qty" :precision="2" min="0" :controls="false" style="width: 250px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编码:" prop="material_code">
|
||||||
|
<el-input v-model="form1.material_code" style="width: 250px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注:" prop="remark">
|
||||||
|
<el-input type="textarea" v-model="form1.remark" style="width: 250px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="repairSubmit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import CRUD, { header, presenter } from '@crud/crud'
|
||||||
|
import check from '@/views/wms/st/inStor/check/check'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProcessDialog',
|
||||||
|
mixins: [presenter(), header()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
openParam: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
fatherMethod: {
|
||||||
|
type: Function,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
form1: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClose(done) {
|
||||||
|
this.$confirm('确认关闭?')
|
||||||
|
.then(_ => {
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
.catch(_ => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.form1 = {}
|
||||||
|
},
|
||||||
|
repairSubmit() {
|
||||||
|
if (!this.form1.storagevehicle_code) {
|
||||||
|
this.crud.notify('木箱号不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.form1.base_qty) {
|
||||||
|
this.crud.notify('重量不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.form1.material_code) {
|
||||||
|
this.crud.notify('物料编码不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.form1.check_code = this.openParam
|
||||||
|
check.repairSubmit(this.form1).then(res => {
|
||||||
|
this.crud.notify('补录成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.fatherMethod()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -122,4 +122,11 @@ export function confirmBtn(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1, disposeConfirm, allInsert, confirmBtn }
|
export function repairSubmit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/check/repairSubmit',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1, disposeConfirm, allInsert, confirmBtn, repairSubmit }
|
||||||
|
|||||||
Reference in New Issue
Block a user