This commit is contained in:
2022-12-29 13:53:01 +08:00
10 changed files with 220 additions and 42 deletions

View File

@@ -44,7 +44,7 @@
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<!--Spring boot 核心-->
<!--Spring boot 核心 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>

View File

@@ -75,6 +75,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (StrUtil.isNotEmpty(map.get("io_type"))) {
map.put("io_type", map.get("io_type"));
}
if (StrUtil.isNotEmpty(map.get("is_upload"))) {
map.put("is_upload", map.get("is_upload"));
}
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
map.put("pcsn", "%" + map.get("pcsn") + "%");
}
@@ -768,6 +771,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jsonMap.put("material_id", dtl.getString("material_id"));
jsonMap.put("sale_order_name", dtl.getString("source_bill_code"));
jsonMap.put("sect_id", whereJson.getString("sect_id"));
jsonMap.put("stor_id", whereJson.getString("stor_id"));
JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足");
@@ -846,6 +850,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jsonMap.put("material_id", dtl.getString("material_id"));
jsonMap.put("pcsn", dtl.getString("pcsn"));
jsonMap.put("sect_id", whereJson.getString("sect_id"));
jsonMap.put("stor_id", whereJson.getString("stor_id"));
JSONObject jsonIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("库存不足");
@@ -985,6 +990,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jsonMap.put("material_id", dtl.getString("material_id"));
jsonMap.put("sale_order_name", dtl.getString("source_bill_code"));
jsonMap.put("sect_id", whereJson.getString("sect_id"));
jsonMap.put("stor_id", whereJson.getString("stor_id"));
JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足");
@@ -1063,6 +1069,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jsonMap.put("material_id", dtl.getString("material_id"));
jsonMap.put("pcsn", dtl.getString("pcsn"));
jsonMap.put("sect_id", whereJson.getString("sect_id"));
jsonMap.put("stor_id", whereJson.getString("stor_id"));
JSONObject jsonIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("库存不足");
@@ -1371,6 +1378,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
} else {
jo_dtl.put("bill_status", "30");
}
if (jo_dtl.getDoubleValue("unassign_qty") == 0) {
jo_dtl.put("bill_status", "40");
}
wo_dtl.update(jo_dtl);
//更新主表状态
this.updateMststatus(iostorinv_id);
@@ -1871,7 +1883,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
assign_qty = NumberUtil.add(assign_qty,canuse_qty);
if (unassign_qty >= canuse_qty) {
unassign_qty = unassign_qty - canuse_qty;
// unassign_qty = unassign_qty - canuse_qty;
unassign_qty = NumberUtil.sub(unassign_qty,canuse_qty);
ivt.put("change_qty", canuse_qty + "");
} else {
ivt.put("change_qty", canuse_qty + "");
@@ -1913,11 +1926,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
break;
}
}
HashMap<String, String> map_dtl = new HashMap<String, String>();
// HashMap<String, String> map_dtl = new HashMap<String, String>();
JSONObject map_dtl = new JSONObject();
//更新明细
map_dtl.put("unassign_qty", unassign_qty + "");
map_dtl.put("assign_qty", assign_qty + "");
if (unassign_qty == 0) {
if (map_dtl.getDoubleValue("unassign_qty") <= 0) {
map_dtl.put("bill_status", "40");
} else {
map_dtl.put("bill_status", "30");

View File

@@ -49,6 +49,7 @@
输入.sap_pcsn TYPEAS s_string
输入.cust_code TYPEAS s_string
输入.package_box_sn TYPEAS s_string
输入.is_upload TYPEAS s_string
输入.in_stor_id TYPEAS f_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@@ -108,6 +109,10 @@
dis.pcsn like 输入.pcsn
ENDOPTION
OPTION 输入.is_upload <> ""
ios.is_upload = 输入.is_upload
ENDOPTION
OPTION 输入.io_type <> ""
ios.io_type = 输入.io_type
ENDOPTION

View File

@@ -23,6 +23,7 @@
输入.pcsn TYPEAS s_string
输入.iostorinv_id TYPEAS s_string
输入.iostorinvdtl_id TYPEAS s_string
输入.stor_id TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@@ -84,6 +85,10 @@
ivt.pcsn = 输入.pcsn
ENDOPTION
OPTION 输入.stor_id <> ""
attr.stor_id = 输入.stor_id
ENDOPTION
order by ivt.instorage_time ASC
ENDSELECT

View File

@@ -220,18 +220,21 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column show-overflow-tooltip prop="is_upload" label="是否回传" :formatter="formatIsUpload" />
<el-table-column show-overflow-tooltip prop="upload_mes" label="回传MES" :formatter="formatUploadMes" />
<el-table-column show-overflow-tooltip prop="upload_sap" label="回传SAP" :formatter="formatUploadSap" />
<!-- <el-table-column type="index" label="序号" width="50" align="center" />-->
<el-table-column show-overflow-tooltip prop="is_upload" label="是否回传" :formatter="formatIsUpload" width="80" />
<el-table-column show-overflow-tooltip prop="upload_mes" label="回传MES" :formatter="formatUploadMes" width="80" />
<el-table-column show-overflow-tooltip prop="upload_sap" label="回传SAP" :formatter="formatUploadSap" width="80" />
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column min-width="130" show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column min-width="100" show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip width="100" prop="vbeln" label="交货单" />
<el-table-column prop="total_qty" label="总重量" width="100" :formatter="crud.formatNum3" />
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="100" />
<el-table-column
show-overflow-tooltip
:formatter="create_modeFormat"
@@ -240,8 +243,6 @@
width="100"
/>
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
<el-table-column prop="total_qty" label="总重量" width="100" :formatter="crud.formatNum3" />
<el-table-column show-overflow-tooltip prop="remark" label="备注" width="100" />
<el-table-column prop="input_optname" label="制单人" width="100" />
<el-table-column show-overflow-tooltip prop="input_time" label="制单时间" width="150" />
<el-table-column prop="update_optname" label="修改人" width="100" />

View File

@@ -304,7 +304,7 @@ export default {
rowmst: {
handler(newValue, oldValue) {
this.mstrow = newValue
this.mstrow.stor_id = ''
// this.mstrow.stor_id = ''
}
}
},
@@ -447,20 +447,20 @@ export default {
}
},
allDiv() {
if (!this.mstrow.sect_id) {
this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// if (!this.mstrow.sect_id) {
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
// return
// }
checkoutbill.allDiv(this.mstrow).then(res => {
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
this.queryTableDtl()
})
},
oneDiv() {
if (!this.mstrow.sect_id) {
this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// if (!this.mstrow.sect_id) {
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
// return
// }
if (this.currentRow.iostorinvdtl_id !== null) {
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
checkoutbill.allDivOne(this.mstrow).then(res => {
@@ -496,7 +496,6 @@ export default {
// 根据此仓位的 ‘相同块、相同排、相同层’ 判断上一个任务是否生成
const tab = this.tabledis
for (let i = 0; i < tab.length; i++) {
debugger
const item = tab[i]
if (this.currentDis.block_num === item.block_num && this.currentDis.row_num === item.row_num && this.currentDis.layer_num === item.layer_num) {
const out_order_seq = parseInt(this.currentDis.out_order_seq) - 1
@@ -529,7 +528,6 @@ export default {
})
},
cellStyle({ row, column, rowIndex, columnIndex }) {
debugger
const assign_qty = parseFloat(row.assign_qty)
const plan_qty = parseFloat(row.plan_qty)

View File

@@ -231,11 +231,20 @@ export default {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
if (this.queryrow.unassign_qty > this.goal_unassign_qty){
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
// 如果待分配重量等于0则 明细重量 - 已分配重量
if (parseInt(this.queryrow.unassign_qty) === 0) {
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
} else {
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
}
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
}
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
// 如果已分配汇总量 > 明细重量 则待分配重量为0
if (this.queryrow.assign_qty > this.goal_unassign_qty) {
this.queryrow.unassign_qty = parseFloat('0')
}
}
this.tableDtl.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
},

View File

@@ -128,6 +128,23 @@
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="是否回传">
<el-select
v-model="query.is_upload"
clearable
size="mini"
placeholder="是否回传"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.is_upload"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="query.createTime"
@@ -228,16 +245,17 @@
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="100" prop="bill_status" label="单据状态" />
<el-table-column prop="stor_name" label="仓库" width="100" />
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="80" prop="bill_status" label="单据状态" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" width="80" />
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
<el-table-column label="总重量" align="center" prop="total_qty" width="100" />
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
<el-table-column show-overflow-tooltip label="总重量" align="center" prop="total_qty" width="100" />
<el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" />
<el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" />
<el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" />
<el-table-column show-overflow-tooltip label="是否回传" align="center" prop="is_upload" width="80" :formatter="formatIsUpload"/>
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="input_optname" />
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="input_time" width="140" />
@@ -290,7 +308,7 @@ export default {
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE'],
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_OUT_TYPE', 'is_upload'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -424,6 +442,13 @@ export default {
this.openParamMoney = row
this.openMoneyDialog = true
},
formatIsUpload(row) {
if (row.is_upload === '0') {
return '否'
} else if (row.is_upload === '1') {
return '是'
}
},
printExcel(jo) {
if (jo.shd_dtl_num === '') {
return this.crud.notify('客户为空!', CRUD.NOTIFICATION_TYPE.INFO)