1.开发各个类型磅的打回复磅逻辑。(出厂,入场,倒短,铁水)

This commit is contained in:
xiaosuonian 2025-07-18 15:51:58 +08:00
parent ba9b622f06
commit bc45e5231f
7 changed files with 205 additions and 33 deletions

View File

@ -214,6 +214,16 @@ public class PoundBillController extends BaseController
{
return toAjax(poundBillService.updateMolReWeightPoundBill(poundBill));
}
/**
* 修改磅单信息(钢材磅复磅)
*/
@PreAuthorize("@ss.hasPermi('measurement:poundbill:edit')")
@Log(title = "磅单信息", businessType = BusinessType.UPDATE)
@PutMapping(value = "/steelReWeight")
public AjaxResult editSteelReWeight(@RequestBody PoundBill poundBill)
{
return toAjax(poundBillService.updateSteelPoundBill(poundBill));
}
/**
* 删除磅单信息

View File

@ -65,6 +65,9 @@ public interface IPoundBillService extends IService<PoundBill>
public int updateMolReWeightPoundBill(PoundBill poundBill);
public int updateSteelPoundBill(PoundBill poundBill);
/**
* 批量删除磅单信息
*

View File

@ -620,6 +620,30 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
return 0;
}
@Override
public int updateSteelPoundBill(PoundBill poundBill) {
//设置状态为完成
poundBill.setBillstate("2");
//设置复磅状态为复磅完成
poundBill.setAgnstatus("completed");
//设置当前时间为过毛重时间
poundBill.setWghdt(new Date());
//设置当前登录人为毛重司磅员
String currentUser = "admin";
try {
currentUser = SecurityUtils.getUsername();
}catch (Exception e){
//Do nothing
}
poundBill.setWghdtoprname(currentUser);
boolean save = updateById(poundBill);
//
if(save){
return 1;
}
return 0;
}
/**
* 批量删除磅单信息
*

View File

@ -128,7 +128,7 @@ export function updateMoltenironPoundbill(data) {
})
}
// 修改磅单信息(铁水
// 修改磅单信息(铁水复磅
export function updateMolReWeightPoundbill(data) {
return request({
url: '/measurement/poundbill/molReWeight',
@ -137,6 +137,15 @@ export function updateMolReWeightPoundbill(data) {
})
}
// 修改磅单信息(铁水复磅)
export function updateSteelReWeightPoundbill(data) {
return request({
url: '/measurement/poundbill/steelReWeight',
method: 'put',
data: data
})
}
// 删除磅单信息
export function delPoundbill(id) {
return request({

View File

@ -1135,7 +1135,7 @@ export default {
//
this.poundBillDetailFormData.poundBillDetailOpen = true;
} catch (error) {
console.error("称重:", error);
console.error("称重:", error);
this.$message.error("新增明细失败,请稍后重试!");
}
},

View File

@ -20,7 +20,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="类型" prop="poundclass">
<el-form-item label="类型" prop="poundclass" label-width="40">
<el-select v-model="queryParams.poundclass" placeholder="类型">
<el-option
v-for="dict in dict.type.weighttype"

View File

@ -67,13 +67,13 @@
<el-row>
<el-col :span="18">
<el-button type="primary" size="mini">主磅单信息</el-button>
<el-button size="mini" @click = "getMstBillData">新增</el-button>
<el-button size="mini" @click = "getMstBillDataById">修改</el-button>
<el-button size="mini" @click="handleSearchMstBillFirst">查询</el-button>
<el-button size="mini" @click="finishMstBill">完成</el-button>
<el-button size="mini" @click="unFinishMstBill">取消完成</el-button>
<el-button size="mini" @click = "getMstBillData" :disabled = "this.autoPoundParams.autoPound">新增</el-button>
<el-button size="mini" @click = "getMstBillDataById" :disabled = "this.autoPoundParams.autoPound">修改</el-button>
<el-button size="mini" @click="handleSearchMstBillFirst" :disabled = "this.autoPoundParams.autoPound">查询</el-button>
<el-button size="mini" @click="finishMstBill" :disabled = "this.autoPoundParams.autoPound">完成</el-button>
<el-button size="mini" @click="unFinishMstBill" :disabled = "this.autoPoundParams.autoPound">取消完成</el-button>
<!-- <el-button type="primary" size="mini" @click="handleSearchMstBillFirst">查询</el-button>-->
<el-button size="mini" @click="handleSearchMstBillFirst">打印</el-button>
<el-button size="mini" @click="handleSearchMstBillFirst" :disabled = "this.autoPoundParams.autoPound">打印</el-button>
<el-table v-loading="mstBillLoading"
:data="mstBillList"
border
@ -82,7 +82,7 @@
ref = "mstBillTable"
@row-click="handleMstBillClick"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="单号" align="center" prop="usrcode" width="180"/>
<el-table-column label="序号" align="center" prop="indexid" width="180"/>
<el-table-column label="榜单日期" align="center" prop="bsndt" width="180">
@ -165,6 +165,7 @@
v-if="activeTab === 'weighingRequest'"
border
stripe
ref="poundBillTable"
@selection-change="handlePoundBillDetailSelectionChange"
height="500"
@row-click="handlePoundBillClick"
@ -201,7 +202,7 @@
</el-col>
<el-col :span="18">
<el-form-item prop="poundid" label-width="40">
<el-button type="info" style="width: 200px;font-size: 20px" @click="addPoundBillDetail">增明细</el-button>
<el-button type="info" style="width: 200px;font-size: 20px" @click="addPoundBillDetail" :disabled = "this.mstBillFormData.isCompleted || this.autoPoundParams.autoPound">增明细</el-button>
</el-form-item>
</el-col>
</el-row>
@ -221,6 +222,18 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item prop="poundid" label-width="40">-->
<!-- <p></p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="18">-->
<!-- <el-form-item prop="poundname" label-width="40">-->
<!-- <el-button type="info" style="width: 200px;font-size: 20px">修改</el-button>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="6">
<el-form-item prop="poundid" label-width="40">
@ -229,7 +242,7 @@
</el-col>
<el-col :span="18">
<el-form-item prop="poundname" label-width="40">
<el-button type="info" style="width: 200px;font-size: 20px">修改</el-button>
<el-button type="info" style="width: 200px;font-size: 20px" @click = "updateWgtPoundBillDetail" :disabled = "this.mstBillFormData.isCompleted || this.autoPoundParams.autoPound">称重</el-button>
</el-form-item>
</el-col>
</el-row>
@ -241,7 +254,7 @@
</el-col>
<el-col :span="18">
<el-form-item prop="poundname" label-width="40">
<el-button type="info" style="width: 200px;font-size: 20px">删除</el-button>
<el-button type="info" style="width: 200px;font-size: 20px" @click = "deletePoundBill" :disabled = "this.mstBillFormData.isCompleted || this.autoPoundParams.autoPound">删除</el-button>
</el-form-item>
</el-col>
</el-row>
@ -253,7 +266,7 @@
</el-col>
<el-col :span="18">
<el-form-item prop="poundname" label-width="40">
<el-button type="info" style="width: 200px;font-size: 20px">打回复磅</el-button>
<el-button type="info" style="width: 200px;font-size: 20px" @click = "handleReturnPound" :disabled = "this.mstBillFormData.isCompleted || this.autoPoundParams.autoPound">打回复磅</el-button>
</el-form-item>
</el-col>
</el-row>
@ -432,13 +445,23 @@
import { listSteelpound, getSteelpound, delSteelpound, addSteelpound, updateSteelpound } from "@/api/measurement/operation/steelpound"
import {getTruepound} from "@/api/measurement/basedata/truepound";
import SearchSelect from "@/components/SearchSelect";
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst,complete} from "@/api/measurement/bill/poundmst";
import {addTransPoundbill, getNumber as getPoundBillNumber,getMaxBundleNo, listPoundbill,addSteelPoundbill} from "@/api/measurement/bill/poundbill";
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst,complete,unComplete} from "@/api/measurement/bill/poundmst";
import {
addTransPoundbill,
getPoundbill,
getNumber as getPoundBillNumber,
getMaxBundleNo,
listPoundbill,
addSteelPoundbill,
updateSteelReWeightPoundbill,
delPoundbill, returnPound
} from "@/api/measurement/bill/poundbill";
import Decimal from "decimal.js";
//searchSelect
import { getSearchSelectData } from "@/api/tool/gen.js";
//searchData
import {selectConfigs} from "@/components/SearchSelect/searchdata.js";
import {Message} from "element-ui";
export default {
name: "Steelpound",
@ -540,10 +563,12 @@ export default {
mstBillTitle:"主榜单信息",
mstBillOpen:false,
thisSelectedRow:{},
isCompleted:false,
},
//
poundBillDetailFormData:{
selectedIds:[],
reWeighingStatus:[],
poundBillDetailForm:{
boilerno: null,
carno: null,
@ -555,6 +580,7 @@ export default {
thisSelectedRow:{},
isWght:true,
mstAndbundleNo:{},
isReweighing:false,
},
//
autoPoundParams:{
@ -694,6 +720,9 @@ export default {
//
//
handleMstBillClick(row) {
if (this.autoPoundParams.autoPound){
return;
}
//
this.$refs.mstBillTable.clearSelection();
//
@ -708,9 +737,6 @@ export default {
//
this.$refs.poundBillTable.toggleRowSelection(row, true);
this.poundBillDetailFormData.thisSelectedRow = row;
//
this.queryParams.carno = row.carno;
this.queryParams.boilerno = row.boilerno;
},
//
@ -718,6 +744,13 @@ export default {
if (selection.length > 0){
this.mstBillFormData.selectedIds = selection.map(item => item.id)
this.mstBillFormData.selectedUsrcodes = selection.map(item => item.usrcode)
//
const mstCompletedStatus = selection[selection.length - 1].bllstt;
if ("1" === mstCompletedStatus) {
this.mstBillFormData.isCompleted = false;
} else {
this.mstBillFormData.isCompleted = true;
}
var mstId = this.mstBillFormData.selectedIds[0];
this.queryPoundBillDetail(mstId);
}else {
@ -730,8 +763,10 @@ export default {
handlePoundBillDetailSelectionChange(selection) {
if (selection.length > 0){
this.poundBillDetailFormData.selectedIds = selection.map(item => item.id)
this.poundBillDetailFormData.reWeighingStatus = selection.map(item => item.agnstatus)
}else {
this.poundBillDetailFormData.selectedIds = [];
this.poundBillDetailFormData.reWeighingStatus = [];
}
},
//
@ -828,6 +863,7 @@ export default {
this.$message.error("请先选择主榜单!");
return;
}
this.poundBillDetailFormData.isReweighing = false;
//
this.resetPoundBillDetailForm();
try {
@ -863,6 +899,43 @@ export default {
this.$message.error("新增明细失败,请稍后重试!");
}
},
//
async updateWgtPoundBillDetail() {
//
if (this.poundBillDetailFormData.selectedIds.length === 0) {
this.$message.error("请先选择过磅明细!");
return;
}
console.log(this.poundBillDetailFormData.reWeighingStatus[0]);
//
if ("ing" !== this.poundBillDetailFormData.reWeighingStatus[0]){
//
this.$message.error("只有复磅单据才允许单独称重!");
return;
}
//
if (this.queryParams.weight == null || this.queryParams.weight === "") {
this.$message.error("请先获取重量!");
return;
}
this.poundBillDetailFormData.isReweighing = true;
//
this.resetPoundBillDetailForm();
try {
//id
const response = await getPoundbill(this.poundBillDetailFormData.selectedIds[0]);
this.poundBillDetailFormData.poundBillDetailForm = response.data;
const form = this.poundBillDetailFormData.poundBillDetailForm;
//
form.netmqty = this.queryParams.weight;
//
this.poundBillDetailFormData.poundBillDetailOpen = true;
} catch (error) {
console.error("称皮重:", error);
this.$message.error("新增明细失败,请稍后重试!");
}
},
//
poundBillDetailForNetwgt() {
@ -873,17 +946,27 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
addSteelPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
this.$message.success("新增榜单明细成功!");
this.poundBillDetailFormData.poundBillDetailOpen = false;
//
this.queryPoundBillDetailFirst();
//1
const appliId = this.poundBillDetailFormData.poundBillDetailForm.appliid;
const bundleNo = this.poundBillDetailFormData.poundBillDetailForm.bundleNo;
//queryPageParams
this.poundBillDetailFormData.mstAndbundleNo[appliId] = parseInt(bundleNo) + 1;
})
//
if (this.poundBillDetailFormData.isReweighing) {
updateSteelReWeightPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
this.$message.success("称重成功!");
this.poundBillDetailFormData.poundBillDetailOpen = false;
//
this.queryPoundBillDetailFirst();
})
} else {
addSteelPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
this.$message.success("新增榜单明细成功!");
this.poundBillDetailFormData.poundBillDetailOpen = false;
//
this.queryPoundBillDetailFirst();
//1
const appliId = this.poundBillDetailFormData.poundBillDetailForm.appliid;
const bundleNo = this.poundBillDetailFormData.poundBillDetailForm.bundleNo;
//queryPageParams
this.poundBillDetailFormData.mstAndbundleNo[appliId] = parseInt(bundleNo) + 1;
})
}
}).catch(() => {});
}
@ -926,7 +1009,6 @@ export default {
}
this.poundBillDetailLoading = true;
var thisQueryParams = {
billstate:"2",
isinuse:"Y"
}
thisQueryParams.appliid = this.mstBillFormData.selectedIds[0];
@ -998,6 +1080,7 @@ export default {
this.$message.success("完成主榜单成功!");
//
this.handleSearchMstBillFirst();
this.mstBillFormData.isCompleted = true;
} else {
this.$message.error("完成主榜单失败!");
}
@ -1019,7 +1102,7 @@ export default {
}
const res = await unComplete(data);
if (res.code === 200) {
this.$message.success("完成主榜单成功!");
this.$message.success("取消完成主榜单成功!");
//
this.handleSearchMstBillFirst();
} else {
@ -1051,7 +1134,50 @@ export default {
const cfg = this.searchData.selectConfigs.find(c => c.key === key);
return this.searchData.optionsMap[this.buildCacheKey(cfg)] || [];
},
//
deletePoundBill() {
//
if (this.poundBillDetailFormData.selectedIds.length === 0) {
this.$message.error("请先选择过磅明细!");
return;
}
//
if (this.mstBillFormData.isCompleted){
this.$message.error("主磅单已完成,不能删除!");
return;
}
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
delPoundbill(this.poundBillDetailFormData.selectedIds[0]).then(response => {
this.$message.success("删除成功!");
//
this.queryPoundBillDetailFirst();
})
}).catch(() => {});
},
//
/** 打回复磅按钮操作 */
handleReturnPound() {
//
if(this.poundBillDetailFormData.selectedIds.length!==1){
this.$message.error("请选择一条数据!")
return;
}
if ("ing" === this.poundBillDetailFormData.reWeighingStatus[0]){
//
this.$message.error("该单据已经打回复磅!");
return;
}
let ids = this.poundBillDetailFormData.selectedIds;
Message("打回中...")
returnPound(ids).then(response => {
this.$modal.msgSuccess("打回成功")
this.queryPoundBillDetailFirst();
})
},
}
}
</script>