1.开发各个类型磅的打回复磅逻辑。(出厂,入场,倒短,铁水)
This commit is contained in:
parent
ba9b622f06
commit
bc45e5231f
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除磅单信息
|
||||
|
|
|
@ -65,6 +65,9 @@ public interface IPoundBillService extends IService<PoundBill>
|
|||
|
||||
public int updateMolReWeightPoundBill(PoundBill poundBill);
|
||||
|
||||
|
||||
public int updateSteelPoundBill(PoundBill poundBill);
|
||||
|
||||
/**
|
||||
* 批量删除磅单信息
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除磅单信息
|
||||
*
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -1135,7 +1135,7 @@ export default {
|
|||
// 展示弹窗
|
||||
this.poundBillDetailFormData.poundBillDetailOpen = true;
|
||||
} catch (error) {
|
||||
console.error("称皮重:", error);
|
||||
console.error("称毛重:", error);
|
||||
this.$message.error("新增明细失败,请稍后重试!");
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue