1.完善倒短磅前端界面。

2.完善铁水磅前端界面。
3.完善钢材磅前端界面。
This commit is contained in:
xiaosuonian 2025-07-02 14:37:19 +08:00
parent 644f98b934
commit de7f4ff4a0
11 changed files with 508 additions and 79 deletions

View File

@ -9,14 +9,7 @@ import javax.servlet.http.HttpServletResponse;
import com.ruoyi.util.AllNumberUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -136,6 +129,16 @@ public class PoundBillController extends BaseController
{
return toAjax(poundBillService.insertTransPoundBill(poundBill));
}
/**
* 新增磅单信息成品磅
*/
@PreAuthorize("@ss.hasPermi('measurement:poundbill:add')")
@Log(title = "磅单信息", businessType = BusinessType.INSERT)
@PostMapping(value = "/steel")
public AjaxResult addSteel(@RequestBody PoundBill poundBill)
{
return toAjax(poundBillService.insertSteelPoundBill(poundBill));
}
/**
* 修改磅单信息
@ -181,4 +184,17 @@ public class PoundBillController extends BaseController
{
return toAjax(poundBillService.removeByIds(Arrays.asList(ids)));
}
/**
* 根据主榜单获取最新捆号
*/
@PreAuthorize("@ss.hasPermi('measurement:poundbill:query')")
@GetMapping(value = "/getMaxBundleNo")
public AjaxResult getMaxBundleNoByMst(@RequestParam(value = "mstId") String mstId)
{
String maxBundleNoByMst = poundBillService.getMaxBundleNoByMst(mstId);
return success((Object) maxBundleNoByMst);
}
}

View File

@ -69,6 +69,10 @@ public class Poundmst extends BaseEntity
@Excel(name = "规格")
private String specification;
/** 批号 */
@Excel(name = "批号")
private String batchno;
/** 计量单位 */
@Excel(name = "计量单位")
private String msrunit;
@ -394,7 +398,15 @@ public class Poundmst extends BaseEntity
return specification;
}
public void setMsrunit(String msrunit)
public String getBatchno() {
return batchno;
}
public void setBatchno(String batchno) {
this.batchno = batchno;
}
public void setMsrunit(String msrunit)
{
this.msrunit = msrunit;
}

View File

@ -60,4 +60,12 @@ public interface PoundBillMapper extends BaseMapper<PoundBill>
* @return 结果
*/
public int deletePoundBillByIds(String[] ids);
/**
* 根据主榜单获取最大捆号
*
*
*/
public String getMaxBundleNoByMst(String mstId);
}

View File

@ -44,6 +44,8 @@ public interface IPoundBillService extends IService<PoundBill>
public int insertTransPoundBill(PoundBill poundBill);
public int insertSteelPoundBill(PoundBill poundBill);
/**
* 修改磅单信息
*
@ -71,4 +73,6 @@ public interface IPoundBillService extends IService<PoundBill>
* @return 结果
*/
public int deletePoundBillById(String id);
public String getMaxBundleNoByMst(String mstId);
}

View File

@ -278,6 +278,30 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
poundBill.setBillstate("2");
}
boolean save = save(poundBill);
if(save){
return 1;
}
return 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int insertSteelPoundBill(PoundBill poundBill)
{
poundBill.initAddFields(poundBill);
poundBill.setBillstate("2");
//设置当前时间为过毛重时间
poundBill.setWghdt(new Date());
//设置当前登录人为毛重司磅员
String currentUser = "admin";
try {
currentUser = SecurityUtils.getUsername();
}catch (Exception e){
//Do nothing
}
poundBill.setWghdtoprname(currentUser);
boolean save = save(poundBill);
if(save){
return 1;
}
@ -406,4 +430,9 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
{
return poundBillMapper.deletePoundBillById(id);
}
@Override
public String getMaxBundleNoByMst(String mstId) {
return poundBillMapper.getMaxBundleNoByMst(mstId);
}
}

View File

@ -449,4 +449,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getMaxBundleNoByMst" resultType="String" parameterType="String">
select max(bundleNo) from t_data_poundbill where appliid = #{mstcode}
</select>
</mapper>

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="itmcode" column="itmcode" />
<result property="itmname" column="itmname" />
<result property="specification" column="specification" />
<result property="batchno" column="batchno" />
<result property="msrunit" column="msrunit" />
<result property="trnunitid" column="trnunitid" />
<result property="trnunitname" column="trnunitname" />
@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPoundmstVo">
select id, usrcode, srcbllknd, srcbllid, bsndt, bsnid, bllstt, itmno, itmcode, itmname, specification, msrunit, trnunitid, trnunitname, bsunitid, bsunitname, sendunitid, sendunitname, recunitid, recunitname, poundid, poundname, boilerno, steeno, unitlen, carnosum, carmqtysum, qty, resQty, indexid, steeltype, linetype, lzno, bbno, crtorgid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr, remark, zgsId, zgsName, fid, fentity_fentryid, oabilltype, oaOrgNumber, cangKuName, cangKuNumber, sccjNum from t_data_poundmst
select id, usrcode, srcbllknd, srcbllid, bsndt, bsnid, bllstt, itmno, itmcode, itmname, specification,batchno, msrunit, trnunitid, trnunitname, bsunitid, bsunitname, sendunitid, sendunitname, recunitid, recunitname, poundid, poundname, boilerno, steeno, unitlen, carnosum, carmqtysum, qty, resQty, indexid, steeltype, linetype, lzno, bbno, crtorgid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr, remark, zgsId, zgsName, fid, fentity_fentryid, oabilltype, oaOrgNumber, cangKuName, cangKuNumber, sccjNum from t_data_poundmst
</sql>
<select id="selectPoundmstList" parameterType="Poundmst" resultMap="PoundmstResult">
@ -74,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itmcode != null and itmcode != ''"> and itmcode = #{itmcode}</if>
<if test="itmname != null and itmname != ''"> and itmname like concat('%', #{itmname}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="batchno != null and batchno != ''"> and batchno = #{batchno}</if>
<if test="msrunit != null and msrunit != ''"> and msrunit = #{msrunit}</if>
<if test="trnunitid != null and trnunitid != ''"> and trnunitid = #{trnunitid}</if>
<if test="trnunitname != null and trnunitname != ''"> and trnunitname like concat('%', #{trnunitname}, '%')</if>
@ -132,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itmcode != null">itmcode,</if>
<if test="itmname != null">itmname,</if>
<if test="specification != null">specification,</if>
<if test="batchno != null">batchno,</if>
<if test="msrunit != null">msrunit,</if>
<if test="trnunitid != null">trnunitid,</if>
<if test="trnunitname != null">trnunitname,</if>
@ -185,6 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itmcode != null">#{itmcode},</if>
<if test="itmname != null">#{itmname},</if>
<if test="specification != null">#{specification},</if>
<if test="batchno != null">#{batchno},</if>
<if test="msrunit != null">#{msrunit},</if>
<if test="trnunitid != null">#{trnunitid},</if>
<if test="trnunitname != null">#{trnunitname},</if>
@ -246,6 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="itmcode != null">itmcode = #{itmcode},</if>
<if test="itmname != null">itmname = #{itmname},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="batchno != null">batchno = #{batchno},</if>
<if test="msrunit != null">msrunit = #{msrunit},</if>
<if test="trnunitid != null">trnunitid = #{trnunitid},</if>
<if test="trnunitname != null">trnunitname = #{trnunitname},</if>

View File

@ -16,6 +16,14 @@ export function getNumber() {
method: 'get'
})
}
// 获取最大捆号
export function getMaxBundleNo(mstId) {
return request({
url: '/measurement/poundbill/getMaxBundleNo',
method: 'get',
params: {mstId}
})
}
// 查询磅单信息详细
@ -53,7 +61,7 @@ export function addInPoundbill(data) {
})
}
// 新增磅单信息(入厂磅)
// 新增磅单信息(倒短)
export function addTransPoundbill(data) {
return request({
url: '/measurement/poundbill/trans',
@ -61,6 +69,14 @@ export function addTransPoundbill(data) {
data: data
})
}
// 新增磅单信息(倒短)
export function addSteelPoundbill(data) {
return request({
url: '/measurement/poundbill/steel',
method: 'post',
data: data
})
}
// 修改磅单信息
export function updatePoundbill(data) {

View File

@ -187,7 +187,7 @@
></search-select>
</template>
</el-table-column>
<el-table-column label="承运单位" align="center" prop="trnunitid" width="200px" >
<el-table-column label="生产班组" align="center" prop="trnunitid" width="200px" >
<template slot-scope="scope">
<search-select
:disabled = "true"
@ -892,7 +892,7 @@ export default {
},
//
resetPoundBillDetailForm() {
this.form = {
this.poundBillDetailFormData.poundBillDetailForm = {
id: null,
appliid: null,
usrcode: null,
@ -928,7 +928,11 @@ export default {
},
//
handlePoundBillDetailSelectionChange(selection) {
this.poundBillDetailFormData.selectedIds = selection.map(item => item.id)
if (selection.length > 0){
this.poundBillDetailFormData.selectedIds = selection.map(item => item.id)
}else {
this.poundBillDetailFormData.selectedIds = [];
}
},
//
handleGetweight() {
@ -1190,6 +1194,7 @@ export default {
this.$message.error("请先选择主榜单!");
return;
}
this.poundBillDetailLoading = true;
var thisQueryParams = {
billstate:"1",
isinuse:"Y"
@ -1198,6 +1203,7 @@ export default {
listPoundbill(thisQueryParams).then(response => {
this.queryPageParams.poundBillDetail.total = response.total;
this.poundBillDetailList = response.rows;
this.poundBillDetailLoading = false;
})
},

View File

@ -922,7 +922,9 @@ export default {
//
poundBillDetailFormData:{
selectedIds:[],
poundBillDetailForm:{},
poundBillDetailForm:{
carno: null,
},
poundBillDetailRules:{
//
carno: [
@ -1227,6 +1229,7 @@ watch: {
this.$message.error("请先选择主榜单!");
return;
}
this.poundBillDetailLoading = true;
var thisQueryParams = {
billstate:"1",
isinuse:"Y"
@ -1235,6 +1238,7 @@ watch: {
listPoundbill(thisQueryParams).then(response => {
this.queryPageParams.poundBillDetail.total = response.total;
this.poundBillDetailList = response.rows;
this.poundBillDetailLoading = false;
})
},
//

View File

@ -7,7 +7,7 @@
<el-form-item label="磅点" prop="poundid" label-width="40">
<search-select v-model="queryParams.poundid"
params = "t_data_truepound;id;concat(name,' ',usrcode)"
where="poundtype = '3'"
where="poundtype = '5'"
orderby="usrcode asc"
></search-select>
</el-form-item>
@ -33,12 +33,17 @@
</el-form-item>
<el-form-item label="实时重量" prop="1aaa" label-width="90px">
<el-input
v-model="queryParams.weight"
style=""
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleGetweight">获取重量</el-button>
</el-form-item>
<el-form-item label="稳定重量" prop="1aaa">
<el-input
v-model="queryParams.stableWeight"
style=""
clearable
/>
@ -65,14 +70,71 @@
stripe
@selection-change="handleMstSelectionChange"
ref = "mstBillTable"
@row-click="handleMstBillClick"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="单号" align="center" prop="usrcode" />
<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">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.bsndt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="品名" align="center" prop="itmcode" width="200px">
<template slot-scope="scope">
<search-select
:disabled = "true"
v-model="scope.row.itmcode"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'productName'"
orderby="usrcode asc"
class="search-select-custom-disabled"
></search-select>
</template>
</el-table-column>
<el-table-column label="规格" align="center" prop="specification" />
<el-table-column label="单位" align="center" prop="msrunit" />
<el-table-column label="发货单位" align="center" prop="sendunitid" width="200px">
<template slot-scope="scope">
<search-select
:disabled = "true"
v-model="scope.row.sendunitid"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'shippingCompany'"
orderby="usrcode asc"
class="search-select-custom-disabled"
></search-select>
</template>
</el-table-column>
<el-table-column label="收货单位" align="center" prop="recunitid" width="200px" >
<template slot-scope="scope">
<search-select
:disabled = "true"
v-model="scope.row.recunitid"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'receivingCompany'"
orderby="usrcode asc"
class="search-select-custom-disabled"
></search-select>
</template>
</el-table-column>
<el-table-column label="生产班组" align="center" prop="trnunitid" width="200px" >
<template slot-scope="scope">
<search-select
:disabled = "true"
v-model="scope.row.trnunitid"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'teamOrCarrier'"
orderby="usrcode asc"
class="search-select-custom-disabled"
></search-select>
</template>
</el-table-column>
<el-table-column label="炉号" align="center" prop="boilerno" />
<el-table-column label="钢号" align="center" prop="steeno" />
<el-table-column label="线材类型" align="center" prop="linetype" />
<el-table-column label="批号" align="center" prop="batchno" />
<el-table-column label="班别" align="center" prop="bbno" />
</el-table>
</el-col>
<el-col :span="6">
@ -83,12 +145,7 @@
stripe
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="按钮1" align="center" prop="id" />
<el-table-column label="状态" align="center" prop="billstate">
<template slot-scope="scope">
<dict-tag :options="dict.type.pound_status" :value="scope.row.billstate"/>
</template>
</el-table-column>
<el-table-column label="主榜单号" align="center" prop="usrcode" />
</el-table>
</el-col>
</el-row>
@ -101,19 +158,36 @@
<el-button v-for="tab in tabs" :key="tab.name" :type="activeTab === tab.name ? 'primary' : 'default'"
@click="activeTab = tab.name" size="mini" > {{ tab.label }}</el-button>
<el-table
v-loading="loading"
:data="operationpoundList"
v-loading="poundBillDetailLoading"
:data="poundBillDetailList"
v-if="activeTab === 'weighingRequest'"
border
stripe
@selection-change="handlePoundBillDetailSelectionChange"
height="500"
@row-click="handlePoundBillClick"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="按钮1" align="center" prop="id" />
<el-table-column label="状态" align="center" prop="billstate">
<el-table-column label="主榜单号" align="center" prop="appliid" width="200px">
<template slot-scope="scope">
<dict-tag :options="dict.type.pound_status" :value="scope.row.billstate"/>
<search-select
:disabled = "true"
v-model="scope.row.appliid"
params = "t_data_poundmst;id;usrcode"
where=""
orderby="usrcode asc"
class="search-select-custom-disabled"
></search-select>
</template>
</el-table-column>
<el-table-column label="捆号" align="center" prop="bundleNo" width="180px"/>
<el-table-column label="重量" align="center" prop="netmqty" width="180px"/>
<el-table-column label="称重时间" align="center" prop="wghdt">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.wghdt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="司磅员" align="center" prop="wghdtoprname" width="180px"/>
</el-table>
</el-col>
<el-col :span="4">
@ -127,19 +201,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">增明细</el-button>
</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-button type="info" style="width: 200px;font-size: 20px" @click="addPoundBillDetail">增明细</el-button>
</el-form-item>
</el-col>
</el-row>
@ -154,23 +216,11 @@
<el-input
v-model="queryParams.poundname" style="width: 200px"
clearable
@keyup.enter.native="handleSearchMstBillFirst"
@keyup.enter.native=""
/>
</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="poundid" 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">
@ -280,25 +330,33 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="炉次" prop="boilerno">
<el-input v-model="mstBillFormData.mstBillForm.boilerno" placeholder="请输入炉次" />
<el-form-item label="规格" prop="specification">
<el-input v-model="mstBillFormData.mstBillForm.specification" placeholder="" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item label="承运单位" prop="trnunitid">
<search-select v-model="mstBillFormData.mstBillForm.trnunitid"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'teamOrCarrier'"
orderby="usrcode asc"
clearable
></search-select>
<el-col :span="8">
<el-form-item label="批号" prop="batchno">
<el-input v-model="mstBillFormData.mstBillForm.batchno" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计量单位" prop="msrunit">
<el-input v-model="mstBillFormData.mstBillForm.msrunit" placeholder="请输入计量单位" />
<!-- <el-form-item label="班组" prop="trnunitid">-->
<!-- <search-select v-model="mstBillFormData.mstBillForm.trnunitid"-->
<!-- params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"-->
<!-- where="type = 'teamOrCarrier'"-->
<!-- orderby="usrcode asc"-->
<!-- clearable-->
<!-- ></search-select>-->
<!-- </el-form-item>-->
<el-form-item label="班别" prop="bbno">
<el-input v-model="mstBillFormData.mstBillForm.bbno" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="钢号" prop="steeno">
<el-input v-model="mstBillFormData.mstBillForm.steeno" placeholder="" />
</el-form-item>
</el-col>
</el-row>
@ -315,6 +373,71 @@
<el-button @click="mstBillFormCancel"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改榜单信息对话框 -->
<el-dialog :title="poundBillDetailFormData.poundBillDetailTitle" :visible.sync="poundBillDetailFormData.poundBillDetailOpen" width="1500px" append-to-body>
<el-form ref="poundBillDetailFormData.poundBillDetailForm" :model="poundBillDetailFormData.poundBillDetailForm" :rules="poundBillDetailFormData.poundBillDetailRules" label-width="80px">
<el-row>
<el-col :span="8">
<el-form-item label="主榜单编号" prop="usrcode" readonly>
<!-- <el-input v-model="mstBillFormData.mstBillForm.usrcode" placeholder="请输入主榜单编号" />-->
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.appliid"
params = "t_data_poundmst;id;usrcode"
where=""
orderby="usrcode asc"
disabled
class="search-select-custom-disabled"
></search-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="明细号" prop="usrcode">
<el-input v-model="poundBillDetailFormData.poundBillDetailForm.usrcode" placeholder="" readonly/>
</el-form-item>
</el-col>
<el-col :span="8">
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="品名" prop="itmcode">
<search-select v-model="poundBillDetailFormData.poundBillDetailForm.itmcode"
params = "t_data_pounddata;usrcode;concat(name,' ',usrcode)"
where="type = 'productName'"
orderby="usrcode asc"
></search-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格" prop="specification">
<el-input v-model="poundBillDetailFormData.poundBillDetailForm.specification" placeholder="" readonly/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="钢号" prop="steeno">
<el-input v-model="poundBillDetailFormData.poundBillDetailForm.steeno" placeholder="" readonly/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="捆号" prop="bundleNo">
<el-input v-model="poundBillDetailFormData.poundBillDetailForm.bundleNo" placeholder="" readonly/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="重量" prop="netmqty">
<el-input v-model="poundBillDetailFormData.poundBillDetailForm.netmqty" placeholder="" readonly/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="poundBillDetailForNetwgt">称重</el-button>
<el-button @click="poundBillDetailFormCancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -323,7 +446,8 @@ import { listSteelpound, getSteelpound, delSteelpound, addSteelpound, updateStee
import {getTruepound} from "@/api/measurement/basedata/truepound";
import SearchSelect from "@/components/SearchSelect";
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst} from "@/api/measurement/bill/poundmst";
import {listPoundbill} from "@/api/measurement/bill/poundbill";
import {addTransPoundbill, getNumber as getPoundBillNumber,getMaxBundleNo, listPoundbill,addSteelPoundbill} from "@/api/measurement/bill/poundbill";
import Decimal from "decimal.js";
export default {
name: "Steelpound",
@ -335,6 +459,10 @@ export default {
loading: false,
//
mstBillLoading:false,
//
poundBillDetailLoading:false,
//
poundBillFullLoading:false,
//
ids: [],
//
@ -347,6 +475,10 @@ export default {
total: 0,
//
operationpoundList: [],
//
mstBillList:[],
//
poundBillDetailList:[],
//
title: "",
//
@ -360,6 +492,8 @@ export default {
poundtype: "",//,
poundclass:"",//
timeoutId:null,//2
weight:0,//
stableWeight:0,//
},
//
form: {},
@ -405,8 +539,6 @@ export default {
},
},
//
mstBillList:[],
//
mstBillFormData:{
selectedIds:[],
@ -416,6 +548,21 @@ export default {
mstBillOpen:false,
thisSelectedRow:{},
},
//
poundBillDetailFormData:{
selectedIds:[],
poundBillDetailForm:{
boilerno: null,
carno: null,
},
poundBillDetailRules:{
},
poundBillDetailTitle:"榜单明细信息",
poundBillDetailOpen:false,
thisSelectedRow:{},
isWght:true,
mstAndbundleNo:{},
},
}
},
created() {
@ -483,25 +630,71 @@ export default {
}
this.resetForm("mstBillFormData.mstBillForm");
},
//
resetPoundBillDetailForm() {
this.poundBillDetailFormData.poundBillDetailForm = {
id: null,
appliid: null,
usrcode: null,
sendunitid: null,
recunitid: null,
netmqty: null,
itmcode: null,
bundleNo:null,
}
this.resetForm("poundBillDetailFormData.poundBillDetailForm")
},
//
handleGetweight() {
//
if (!this.checkPoundSelected())return;
// 100 10000 1.00 100.00
const randomInt = Math.floor(Math.random() * 9900 + 100);
//
this.queryParams.weight = new Decimal(randomInt / 100);
},
//
//
handleMstBillClick(row) {
//
this.$refs.mstBillTable.clearSelection();
//
this.$refs.mstBillTable.toggleRowSelection(row, true);
this.mstBillFormData.thisSelectedRow = row;
},
//
handlePoundBillClick(row) {
//
this.$refs.poundBillTable.clearSelection();
//
this.$refs.poundBillTable.toggleRowSelection(row, true);
this.poundBillDetailFormData.thisSelectedRow = row;
//
this.queryParams.carno = row.carno;
this.queryParams.boilerno = row.boilerno;
},
//
handleMstSelectionChange(selection) {
if (selection.length > 0){
this.mstBillFormData.selectedIds = selection.map(item => item.id)
var mstId = this.mstBillFormData.selectedIds[0];
this.queryPoundBillDetail(mstId);
}else {
this.mstBillFormData.selectedIds = [];
}
},
//ID
queryPoundBillDetail(id){
var thisQueryParams = {
billstate:"1",
isinuse:"Y"
//
handlePoundBillDetailSelectionChange(selection) {
if (selection.length > 0){
this.poundBillDetailFormData.selectedIds = selection.map(item => item.id)
}else {
this.poundBillDetailFormData.selectedIds = [];
}
thisQueryParams.appliid = id;
listPoundbill(thisQueryParams).then(response => {
this.queryPageParams.poundBillDetail.total = response.total;
this.poundBillDetailList = response.rows;
})
},
//
checkPoundSelected() {
@ -585,6 +778,139 @@ export default {
mstBillFormCancel(){
this.mstBillFormData.mstBillOpen = false;
},
//
async addPoundBillDetail() {
//
if (this.mstBillFormData.selectedIds.length === 0) {
this.$message.error("请先选择主榜单!");
return;
}
//
this.resetPoundBillDetailForm();
try {
//
await this.handleGetweight();
//
const response = await getPoundBillNumber();
this.poundBillDetailFormData.poundBillDetailForm.usrcode = response.data.number;
//
const mainRow = this.mstBillFormData.thisSelectedRow;
const form = this.poundBillDetailFormData.poundBillDetailForm;
form.appliid = this.mstBillFormData.selectedIds[0];
form.sendunitid = mainRow.sendunitid;
form.recunitid = mainRow.recunitid;
form.itmcode = mainRow.itmcode;
form.specification = mainRow.specification;
form.steeno = mainRow.steeno;
//
form.netmqty = this.queryParams.weight;
//
//
form.poundid = this.truepoundData.id;
form.poundname = this.truepoundData.name;
//
await this.getMaxBundleNo();
//
this.poundBillDetailFormData.poundBillDetailOpen = true;
} catch (error) {
console.error("新增明细失败:", error);
this.$message.error("新增明细失败,请稍后重试!");
}
},
//
poundBillDetailForNetwgt() {
this.$refs["poundBillDetailFormData.poundBillDetailForm"].validate(valid => {
if (valid) {
this.$confirm(`称重,重量为:${this.poundBillDetailFormData.poundBillDetailForm.netmqty}`, "提示", {
confirmButtonText: "确定",
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;
})
}).catch(() => {});
}
})
},
//
poundBillDetailFormCancel() {
this.poundBillDetailFormData.poundBillDetailOpen = false;
},
//ID,
queryPoundBillDetailFirst(){
this.queryPageParams.poundBillDetail.pageNum = 1;
this.queryPoundBillDetail();
},
//ID
queryPoundBillDetail(){
//
if (this.mstBillFormData.selectedIds.length === 0) {
this.$message.error("请先选择主榜单!");
return;
}
this.poundBillDetailLoading = true;
var thisQueryParams = {
billstate:"2",
isinuse:"Y"
}
thisQueryParams.appliid = this.mstBillFormData.selectedIds[0];
listPoundbill(thisQueryParams).then(response => {
this.queryPageParams.poundBillDetail.total = response.total;
this.poundBillDetailList = response.rows;
this.poundBillDetailLoading = false;
})
},
//
getMaxBundleNo() {
//
if (this.mstBillFormData.selectedIds.length === 0) {
this.$message.error("请先选择主榜单!");
return;
}
//
var mstId = this.mstBillFormData.selectedIds[0];
//
if (this.poundBillDetailFormData.mstAndbundleNo[mstId]) {
//
this.poundBillDetailFormData.poundBillDetailForm.bundleNo = this.poundBillDetailFormData.mstAndbundleNo[mstId];
return;
}else {
//
debugger
getMaxBundleNo(mstId).then(response => {
var bundleNo = response.data;
if (bundleNo == null){
this.poundBillDetailFormData.poundBillDetailForm.bundleNo = 1;
//queryPageParams
this.poundBillDetailFormData.mstAndbundleNo[mstId] = 1;
}else {
//StringNumber
var bundleNoNumber = parseInt(bundleNo) + 1;
//
this.poundBillDetailFormData.poundBillDetailForm.bundleNo = bundleNoNumber;
//queryPageParams
this.poundBillDetailFormData.mstAndbundleNo[mstId] = bundleNoNumber;
}
});
}
},
}
}
</script>