磅单信息添加打回复磅

This commit is contained in:
ptt 2025-07-07 15:28:02 +08:00
parent de50c86d59
commit 0b0eea4eae
5 changed files with 66 additions and 1 deletions

View File

@ -185,6 +185,15 @@ public class PoundBillController extends BaseController
return toAjax(poundBillService.removeByIds(Arrays.asList(ids)));
}
/**
* 打回复磅
*/
@GetMapping("/returnPound/{ids}")
public AjaxResult returnPound(@PathVariable String[] ids)
{
return toAjax(poundBillService.returnPound(ids[0]));
}
/**
* 根据主榜单获取最新捆号

View File

@ -75,4 +75,6 @@ public interface IPoundBillService extends IService<PoundBill>
public int deletePoundBillById(String id);
public String getMaxBundleNoByMst(String mstId);
public boolean returnPound(String id);
}

View File

@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.basedata.domain.Empwgtdata;
import com.ruoyi.basedata.service.impl.EmpwgtdataServiceImpl;
import com.ruoyi.bill.domain.Poundappli;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysConfigService;
@ -462,4 +463,22 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
public String getMaxBundleNoByMst(String mstId) {
return poundBillMapper.getMaxBundleNoByMst(mstId);
}
public boolean returnPound(String id){
//接口
//接口通了之后走这个逻辑
PoundBill poundBill = selectPoundBillById(id);
poundBill.setAgngrossmqty(poundBill.getWghmqty());
poundBill.setAgntaremqty(poundBill.getEmpmqty());
poundBill.setAgnnetmqty(poundBill.getNetmqty());
poundBill.setAgnstatus("ing");
poundBill.setBillstate("1");
poundBill.setWghmqty(BigDecimal.ZERO);
poundBill.setEmpmqty(BigDecimal.ZERO);
poundBill.setNetmqty(BigDecimal.ZERO);
updateById(poundBill);
return true;
}
}

View File

@ -111,3 +111,12 @@ export function delPoundbill(id) {
method: 'delete'
})
}
// 打回复磅
export function returnPound(id) {
return request({
url: '/measurement/poundbill/returnPound/'+id,
method: 'get'
})
}

View File

@ -198,6 +198,14 @@
v-hasPermi="['measurement:poundbill:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
size="mini"
@click="handleReturnPound"
>打回复磅</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -616,7 +624,7 @@
</template>
<script>
import { listPoundbill,getNumber, getPoundbill, delPoundbill, addPoundbill, updatePoundbill } from "@/api/measurement/bill/poundbill"
import { listPoundbill,getNumber, getPoundbill, delPoundbill, addPoundbill, updatePoundbill, returnPound } from "@/api/measurement/bill/poundbill"
export default {
name: "Poundbill",
@ -627,6 +635,8 @@ export default {
loading: true,
//
ids: [],
//
billstates: [],
//
single: true,
//
@ -806,6 +816,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.billstates = selection.map(item => item.billstate)
this.single = selection.length!==1
this.multiple = !selection.length
},
@ -864,6 +875,21 @@ export default {
...this.queryParams
}, `poundbill_${new Date().getTime()}.xlsx`)
},
/** 打回复磅按钮操作 */
handleReturnPound() {
let billstates = this.billstates;
let ids = this.ids;
if(ids.length!=1){
this.$modal.msgWarning("请选择一条数据!")
}else if(billstates[0] == "2"){
returnPound(ids).then(response => {
this.$modal.msgSuccess("打回成功")
this.getList()
})
}else{
this.$modal.msgWarning("只能打回已完成的状态!")
}
},
//
handleRowClick(row) {