This commit is contained in:
linfso 2024-11-20 10:31:43 +08:00
parent c3e9eb9855
commit 7a07f046cc
4 changed files with 43 additions and 58 deletions

View File

@ -6,11 +6,11 @@
<el-tab-pane label="货物组批次列表" name="billList" > <el-tab-pane label="货物组批次列表" name="billList" >
<BigBatchListPanel ref="refBatchList" @onCreate="onCreateBatch" @onUpdate="onUpdateBatch" @onView="onViewBatch"> </BigBatchListPanel> <BigBatchListPanel ref="refBatchList" @onCreate="onCreateBatch" @onUpdate="onUpdateBatch" @onView="onViewBatch"> </BigBatchListPanel>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="批次编辑" name="batchEdit" v-if="openEditForm" closable="" > <el-tab-pane label="批次编辑" name="batchEdit" v-if="openEditForm" closable="" >
<BigBatchEditForm :batchId="batchId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></BigBatchEditForm> <BigBatchEditForm :key="'batchEdit_'+batchId" :batchId="batchId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></BigBatchEditForm>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="批次查看" name="batchView" v-if="openViewForm" closable > <el-tab-pane label="批次查看" name="batchView" v-if="openViewForm" closable >
<BigBatchEditForm :batchId="batchId" disabled ></BigBatchEditForm> <BigBatchEditForm :key="'batchView_'+batchId" :batchId="batchId" disabled ></BigBatchEditForm>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -62,7 +62,6 @@ export default {
this.batchId=batchId; this.batchId=batchId;
this.openViewForm=true; this.openViewForm=true;
this.activeTab='batchView'; this.activeTab='batchView';
}, },
onSelectBill(item) { onSelectBill(item) {
let old=this.billTabs.find(mItem=>mItem.settleBillNo==item.settleBillNo); let old=this.billTabs.find(mItem=>mItem.settleBillNo==item.settleBillNo);

View File

@ -4,17 +4,17 @@
<el-row :gutter="20" style="display: flex;flex-wrap: wrap;"> <el-row :gutter="20" style="display: flex;flex-wrap: wrap;">
<el-col :span="16" style="border-right: 1px solid #e4e1e1;"> <el-col :span="16" style="border-right: 1px solid #e4e1e1;">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;"> <el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<!-- <el-col :span="6"> <el-col :span="6">
<el-form-item :label="$t('批次号')" prop="batchNo"> <el-form-item :label="$t('批次号')" prop="batchNo">
<el-input v-model="coData.batchNo" placeholder="可不填自动生成" /> <el-input v-model="coData.batchNo" placeholder="自动生成" disabled />
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<el-col :span="16"> <el-col :span="12">
<el-form-item :label="$t('批次名称')" prop="batchName"> <el-form-item :label="$t('批次名称')" prop="batchName">
<el-input v-model="coData.batchName" clearable="" placeholder=""></el-input> <el-input v-model="coData.batchName" clearable="" placeholder=""></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item :label="$t('批次类型')" prop="batchType"> <el-form-item :label="$t('批次类型')" prop="batchType">
<el-select v-model="coData.batchType" placeholder="" style="width:100%"> <el-select v-model="coData.batchType" placeholder="" style="width:100%">
<el-option key="1" label="一程批次" value="1"></el-option> <el-option key="1" label="一程批次" value="1"></el-option>
@ -706,26 +706,25 @@ export default {
created() { created() {
this.initData(); this.initData();
}, },
mounted() {
const end = new Date()
const start = new Date()
start.setHours(0,0,0,0)
end.setHours(23,59,59,0)
this.dateTimeRange=[start,end];
// this.activeName="third";
},
methods: { methods: {
initData() { async initData() {
if(this.batchId !=null) { if(this.batchId !=null) {
this.showBatchInfo(this.batchId); this.showBatchInfo(this.batchId);
this.coPackType = "edit"; this.coPackType = "edit";
}else{ }else{
this.reset(); this.reset();
this.coData.startSiteCode=this.$store.getters.ownerSiteCode; this.coData.startSiteCode=this.$store.getters.ownerSiteCode;
this.coData.batchType='1'; this.coData.batchType='1';
this.coPackType = "add"; this.coPackType = "add";
let resPack = await getTmsGroupBatchNo();
this.coData.batchNo = resPack.data;
this.coData.batchDate=parseTime(new Date());
} }
}, },
// 表单重置 // 表单重置
@ -772,18 +771,13 @@ export default {
this.$modal.msgError(response && response.msg || "未知错误"); this.$modal.msgError(response && response.msg || "未知错误");
return; return;
} }
let resData = response.data; // let resData = response.data;
let time = {}; // let time = {};
// if(resData.transType == 2){ // time.carTime = resData.etd;
// time.airTime = resData.etd; // this.coData = {...resData, ...{batchDate:resData.createTime}, ...time};
// }else if(resData.transType == 4){
// time.shipTime = resData.etd;
// }else{
// } this.coData = {...response.data};
time.carTime = resData.etd;
this.coData = {...resData, ...{batchDate:resData.createTime}, ...time};
this.emisCoPackDetail=[]; this.emisCoPackDetail=[];
let resList = await listEmisTmsSiteBatchDtl({batchNo: resData.batchNo}); let resList = await listEmisTmsSiteBatchDtl({batchNo: resData.batchNo});
@ -1033,12 +1027,6 @@ export default {
// 新增 // 新增
if(this.coPackType == "add") if(this.coPackType == "add")
{ {
let resPack = await getTmsGroupBatchNo();
if(!resPack || resPack.code != 200){
this.$modal.msgError(resPack && resPack.msg || "未知错误");
return;
}
this.coData.batchNo = resPack.data;
let response = await addEmisTmsSiteBatch(this.coData); let response = await addEmisTmsSiteBatch(this.coData);
if(!response || response.code != 200){ if(!response || response.code != 200){
@ -1048,16 +1036,15 @@ export default {
for(let i = 0; i< this.emisCoPackDetail.length;i++){ for(let i = 0; i< this.emisCoPackDetail.length;i++){
let packDetail = { let packDetail = {
batchNo:resPack.data, batchNo:this.coData.batchNo,
billCode: this.emisCoPackDetail[i].billCode, billCode: this.emisCoPackDetail[i].billCode,
scanDate: this.emisCoPackDetail[i].scanDate, scanDate: this.emisCoPackDetail[i].scanDate,
scanStatus: this.emisCoPackDetail[i].scanStatus, scanStatus: this.emisCoPackDetail[i].scanStatus,
groupStatus: "1",//已组批次 groupStatus: "1",//已组批次
scanMan: this.emisCoPackDetail[i].scanMan, scanMan: this.emisCoPackDetail[i].scanMan,
scanSite: this.emisCoPackDetail[i].scanSite, scanSite: this.emisCoPackDetail[i].scanSite,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
}; };
let response = await addEmisTmsSiteBatchDtl(packDetail); let response = await addEmisTmsSiteBatchDtl(packDetail);
if(!response || response.code != 200){ if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '组批次明细新增失败') this.$modal.msgError(response && response.msg || '组批次明细新增失败')
@ -1070,7 +1057,7 @@ export default {
for(let lr = 0; lr < 3; lr++){ for(let lr = 0; lr < 3; lr++){
for(let ll = 0; ll < 6; ll++){ for(let ll = 0; ll < 6; ll++){
let batchLoadingData = { let batchLoadingData = {
batchNo: resPack.data, batchNo: this.coData.batchNo,
posNo:lr+":"+ll+":1", posNo:lr+":"+ll+":1",
row: lr, row: lr,
col: ll, col: ll,
@ -1370,8 +1357,8 @@ export default {
}) })
this.coData.totalWaybillQty=this.emisCoPackDetail.length; this.coData.totalWaybillQty=this.emisCoPackDetail.length;
this.coData.totalParcelQty=totalParcelQty; this.coData.totalParcelQty=totalParcelQty;
this.coData.totalWeight=totalWeight; this.coData.totalWeight=totalWeight.toFixed(2);
this.coData.totalVolume=parseFloat(totalVolume.toFixed(5)); this.coData.totalVolume=totalVolume.toFixed(4);
}, },
// 排序 查询字段是表格中字段名字 动态取值排序顺序 // 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) { handleSortChange(column) {

View File

@ -397,12 +397,14 @@ export default {
handleAdd() { handleAdd() {
this.$emit("onCreate"); this.$emit("onCreate");
}, },
async handleDelete(){ handleDelete(row){
for(let i = 0; i< this.ids.length;i++){ const ids = row.id || this.ids;
await delEmisTmsSiteBatch(this.ids[i]); this.$modal.confirm('是否确认删除').then(function() {
} return delEmisTmsSiteBatch(ids);
this.$modal.msgSuccess('操作成功'); }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}, },
handleDown(){ handleDown(){

View File

@ -658,20 +658,18 @@ export default {
}, },
}; };
}, },
watch: {
batchId(newVal,oldVal) {
this.initData();
},
},
created() { created() {
this.initData(); this.initData();
}, },
mounted() {
const end = new Date()
const start = new Date()
start.setHours(0,0,0,0)
end.setHours(23,59,59,0)
this.dateTimeRange=[start,end];
},
methods: { methods: {
initData() { initData() {
if(this.batchId !=null) { if(this.batchId !=null) {
this.showBatchInfo(this.batchId); this.showBatchInfo(this.batchId);
this.coPackType = "edit"; this.coPackType = "edit";
@ -681,7 +679,6 @@ export default {
this.coData.startSiteCode=this.$store.getters.ownerSiteCode; this.coData.startSiteCode=this.$store.getters.ownerSiteCode;
this.coData.batchType='1'; this.coData.batchType='1';
this.coData.transType='1'; this.coData.transType='1';
this.coPackType = "add"; this.coPackType = "add";
} }