代码更新
This commit is contained in:
@@ -182,4 +182,10 @@ public interface CheckOutBillService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONObject getDisNum(Map whereJson);
|
||||
|
||||
/**
|
||||
* 新增物料库存条件过滤
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONArray queryBox(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -218,4 +218,11 @@ public class CheckOutBillController {
|
||||
public ResponseEntity<Object> getDisNum(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.getDisNum(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryBox")
|
||||
@Log("新增物料库存条件过滤")
|
||||
@ApiOperation("新增物料库存条件过滤")
|
||||
public ResponseEntity<Object> queryBox(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.queryBox(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "");
|
||||
JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt.struct_code ASC");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -204,6 +204,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//明细另一种写法
|
||||
//JSONArray jsonArr = JSONArray.fromObject(whereJson.get("tableData"));
|
||||
JSONArray rows = map.getJSONArray("tableData");
|
||||
// 过滤相同箱号的明细
|
||||
HashSet<String> boxSet = new HashSet<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
boxSet.add(json.getString("box_no"));
|
||||
}
|
||||
rows.clear();
|
||||
// 遍历
|
||||
for (String box_no : boxSet) {
|
||||
JSONObject jsonObject = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "7").addParam("box_no", box_no).process().uniqueResult(0);
|
||||
rows.add(jsonObject);
|
||||
}
|
||||
|
||||
map.remove("tableData");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -300,7 +313,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jsonDtl2.put("qty_unit_id", jsonIvt.get("qty_unit_id"));
|
||||
jsonDtl2.put("qty_unit_name", jsonIvt.getString("qty_unit_name"));
|
||||
jsonDtl2.put("plan_qty", jsonIvt.get("canuse_qty"));
|
||||
jsonDtl2.put("remark", "通过明细创建");
|
||||
jsonDtl2.put("remark", "");
|
||||
jsonDtl2.put("assign_qty", "0");
|
||||
jsonDtl2.put("unassign_qty", jsonIvt.get("canuse_qty"));
|
||||
jsonDtl2.put("source_billdtl_id", jsonDtl.getString("iostorinvdtl_id"));
|
||||
@@ -379,11 +392,29 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
|
||||
wo.update(whereJson);
|
||||
//先删除该单据下的所有明细
|
||||
String iostorinv_id = (String) whereJson.get("iostorinv_id");
|
||||
wo_dtl.delete("iostorinv_id = '" + iostorinv_id + "'");
|
||||
|
||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
// 过滤相同箱号的明细
|
||||
HashSet<String> boxSet = new HashSet<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
boxSet.add(json.getString("box_no"));
|
||||
}
|
||||
rows.clear();
|
||||
// 遍历
|
||||
for (String box_no : boxSet) {
|
||||
JSONObject jsonObject = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "7").addParam("box_no", box_no).process().uniqueResult(0);
|
||||
rows.add(jsonObject);
|
||||
}
|
||||
|
||||
double qty = 0.0; // 主表重量
|
||||
int num = rows.size(); // 明细数
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
@@ -399,9 +430,54 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jsonDtl.put("qty_unit_name", row.getString("qty_unit_name"));
|
||||
jsonDtl.put("plan_qty", row.get("plan_qty"));
|
||||
jsonDtl.put("remark", row.getString("remark"));
|
||||
jsonDtl.put("source_bill_code", row.getString("source_bill_code"));
|
||||
jsonDtl.put("assign_qty", "0");
|
||||
jsonDtl.put("unassign_qty", row.get("plan_qty"));
|
||||
jsonDtl.put("vbeln", row.getString("vbeln"));
|
||||
jsonDtl.put("posnr", row.getString("posnr"));
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(jsonDtl);
|
||||
qty += jsonDtl.getDoubleValue("plan_qty");
|
||||
|
||||
// 判断此明细子卷是否存在,存在则将此木箱下的子卷全部生成明细
|
||||
String pcsn = row.getString("pcsn");
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) {
|
||||
JSONObject json = ivtTab.query("pcsn = '" + pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json)) continue;
|
||||
|
||||
JSONObject jsonMap = new JSONObject();
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("pcsn", pcsn);
|
||||
jsonMap.put("struct_id", json.getString("struct_id"));
|
||||
|
||||
JSONArray ivtArr = WQL.getWO("ST_OUTIVT02").addParamMap(jsonMap).process().getResultJSONArray(0);
|
||||
for (int j = 0; j < ivtArr.size(); j++) {
|
||||
JSONObject jsonIvt = ivtArr.getJSONObject(j);
|
||||
JSONObject jsonDtl2 = new JSONObject();
|
||||
|
||||
jsonDtl2.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
jsonDtl2.put("iostorinv_id", iostorinv_id);
|
||||
jsonDtl2.put("seq_no", i + 2 + j);
|
||||
jsonDtl2.put("material_id", jsonIvt.getString("material_id"));
|
||||
jsonDtl2.put("pcsn", jsonIvt.getString("pcsn"));
|
||||
jsonDtl2.put("box_no", jsonIvt.getString("box_no"));
|
||||
jsonDtl2.put("quality_scode", "01");
|
||||
jsonDtl2.put("bill_status", "10");
|
||||
jsonDtl2.put("qty_unit_id", jsonIvt.get("qty_unit_id"));
|
||||
jsonDtl2.put("qty_unit_name", jsonIvt.getString("qty_unit_name"));
|
||||
jsonDtl2.put("plan_qty", jsonIvt.get("canuse_qty"));
|
||||
jsonDtl2.put("remark", "");
|
||||
jsonDtl2.put("assign_qty", "0");
|
||||
jsonDtl2.put("unassign_qty", jsonIvt.get("canuse_qty"));
|
||||
jsonDtl2.put("source_billdtl_id", jsonDtl.getString("iostorinvdtl_id"));
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(jsonDtl2);
|
||||
|
||||
qty += jsonDtl2.getDoubleValue("plan_qty");
|
||||
}
|
||||
num += ivtArr.size();
|
||||
}
|
||||
whereJson.put("total_qty", qty);
|
||||
whereJson.put("detail_count", num);
|
||||
wo.update(whereJson);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2290,6 +2366,26 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryBox(JSONObject whereJson) {
|
||||
|
||||
JSONArray data = whereJson.getJSONArray("data");
|
||||
// 先过滤相同的箱号
|
||||
HashSet<String> boxSet = new HashSet<>();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
boxSet.add(json.getString("box_no"));
|
||||
}
|
||||
|
||||
JSONArray array = new JSONArray();
|
||||
// 遍历
|
||||
for (String box_no : boxSet) {
|
||||
JSONArray boxArr = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "7").addParam("box_no", box_no).process().getResultJSONArray(0);
|
||||
array.addAll(boxArr);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新主表状态
|
||||
*
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
输入.task_status TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
输入.sale_order_name TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
@@ -479,6 +480,11 @@
|
||||
OPTION 输入.end_time <> ""
|
||||
ivt.instorage_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
attr.storagevehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />-->
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
|
||||
<template scope="scope">
|
||||
@@ -230,7 +230,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged" />
|
||||
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged5" />
|
||||
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -379,32 +379,52 @@ export default {
|
||||
})*/
|
||||
},
|
||||
tableChanged(rows) {
|
||||
const tablemap = new Map()
|
||||
rows.forEach((item) => {
|
||||
debugger
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].material_id === item.material_id) {
|
||||
if (this.form.tableData[i].box_no === item.box_no && this.form.tableData[i].pcsn === item.pcsn) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
item.edit = true
|
||||
item.quality_scode = '00'
|
||||
tablemap.set(item.material_id, item)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = true
|
||||
item.quality_scode = '00'
|
||||
tablemap.set(item.material_id, item)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
for (const value of tablemap.values()) {
|
||||
this.form.tableData.push(value)
|
||||
}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
tableChanged5(rows) {
|
||||
const data = {
|
||||
'data': rows
|
||||
}
|
||||
checkoutbill.queryBox(data).then(res => {
|
||||
res.forEach((item) => {
|
||||
debugger
|
||||
if (this.form.tableData.length !== 0) {
|
||||
this.flagnow = false
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].box_no === item.box_no && this.form.tableData[i].pcsn === item.pcsn) {
|
||||
this.flagnow = true
|
||||
}
|
||||
}
|
||||
if (!this.flagnow) {
|
||||
item.edit = true
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
} else {
|
||||
item.edit = true
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
})
|
||||
},
|
||||
setMaterValue(row) {
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
if (this.form.tableData[i].material_id === row.material_id) {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库日期" />
|
||||
<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="struct_name" label="仓位" />
|
||||
<el-table-column show-overflow-tooltip prop="box_no" label="箱号" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" />
|
||||
|
||||
@@ -176,4 +176,11 @@ export function getDisNum(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum }
|
||||
export function queryBox(data) {
|
||||
return request({
|
||||
url: '/api/checkoutbill/queryBox',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, setPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox }
|
||||
|
||||
@@ -108,18 +108,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudIostordaily from '@/api/wms/statistics/iostordaily'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import crudIostordaily from '@/views/wms/statistics/sendReceiveQuery/iostordaily'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
|
||||
import crudBucketrecord from "@/api/wms/basedata/master/bucketrecord";
|
||||
import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
|
||||
|
||||
const defaultForm = {
|
||||
stordaily_id: null,
|
||||
@@ -143,7 +139,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'SendReceiveQuery',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect},
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -182,51 +178,23 @@ export default {
|
||||
const param = {
|
||||
'materOpt_code': '00'
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
/* crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
crudBucketrecord.getQualityList().then(res => {
|
||||
})*/
|
||||
/* crudBucketrecord.getQualityList().then(res => {
|
||||
this.QualityList = res
|
||||
})
|
||||
crudBucketrecord.getIvtList().then(res => {
|
||||
this.IvtList = res
|
||||
})
|
||||
})*/
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
loadClass({ action, parentNode, callback}) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({pid: parentNode.id}).then(res => {
|
||||
parentNode.children = res.content.map(function (obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/iostordaily/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStor() {
|
||||
return request({
|
||||
url: 'api/iostordaily/getStor',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStor }
|
||||
Reference in New Issue
Block a user