parent
644f98b934
commit
de7f4ff4a0
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -60,4 +60,12 @@ public interface PoundBillMapper extends BaseMapper<PoundBill>
|
|||
* @return 结果
|
||||
*/
|
||||
public int deletePoundBillByIds(String[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主榜单获取最大捆号
|
||||
*
|
||||
*
|
||||
*/
|
||||
public String getMaxBundleNoByMst(String mstId);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
},
|
||||
//点击增明细,打开榜单明细弹窗。
|
||||
|
|
|
@ -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 {
|
||||
//将String类型转换为Number类型
|
||||
var bundleNoNumber = parseInt(bundleNo) + 1;
|
||||
//将捆号数据赋值到表单中
|
||||
this.poundBillDetailFormData.poundBillDetailForm.bundleNo = bundleNoNumber;
|
||||
//将捆号数据缓存到queryPageParams中
|
||||
this.poundBillDetailFormData.mstAndbundleNo[mstId] = bundleNoNumber;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue