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" >
<BigBatchListPanel ref="refBatchList" @onCreate="onCreateBatch" @onUpdate="onUpdateBatch" @onView="onViewBatch"> </BigBatchListPanel>
</el-tab-pane>
<el-tab-pane label="批次编辑" name="batchEdit" v-if="openEditForm" closable="" >
<BigBatchEditForm :batchId="batchId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></BigBatchEditForm>
<el-tab-pane label="批次编辑" name="batchEdit" v-if="openEditForm" closable="" >
<BigBatchEditForm :key="'batchEdit_'+batchId" :batchId="batchId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></BigBatchEditForm>
</el-tab-pane>
<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-tabs>
@ -62,7 +62,6 @@ export default {
this.batchId=batchId;
this.openViewForm=true;
this.activeTab='batchView';
},
onSelectBill(item) {
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-col :span="16" style="border-right: 1px solid #e4e1e1;">
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
<!-- <el-col :span="6">
<el-form-item :label="$t('批次号')" prop="batchNo">
<el-input v-model="coData.batchNo" placeholder="可不填自动生成" />
</el-form-item>
</el-col> -->
<el-col :span="16">
<el-col :span="6">
<el-form-item :label="$t('批次号')" prop="batchNo">
<el-input v-model="coData.batchNo" placeholder="自动生成" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('批次名称')" prop="batchName">
<el-input v-model="coData.batchName" clearable="" placeholder=""></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item :label="$t('批次类型')" prop="batchType">
<el-select v-model="coData.batchType" placeholder="" style="width:100%">
<el-option key="1" label="一程批次" value="1"></el-option>
@ -706,26 +706,25 @@ export default {
created() {
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: {
initData() {
async initData() {
if(this.batchId !=null) {
this.showBatchInfo(this.batchId);
this.coPackType = "edit";
}else{
this.reset();
this.coData.startSiteCode=this.$store.getters.ownerSiteCode;
this.coData.batchType='1';
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 || "未知错误");
return;
}
let resData = response.data;
let time = {};
// if(resData.transType == 2){
// time.airTime = resData.etd;
// }else if(resData.transType == 4){
// time.shipTime = resData.etd;
// }else{
// let resData = response.data;
// let time = {};
// time.carTime = resData.etd;
// this.coData = {...resData, ...{batchDate:resData.createTime}, ...time};
// }
this.coData = {...response.data};
time.carTime = resData.etd;
this.coData = {...resData, ...{batchDate:resData.createTime}, ...time};
this.emisCoPackDetail=[];
let resList = await listEmisTmsSiteBatchDtl({batchNo: resData.batchNo});
@ -1033,12 +1027,6 @@ export default {
// 新增
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);
if(!response || response.code != 200){
@ -1048,16 +1036,15 @@ export default {
for(let i = 0; i< this.emisCoPackDetail.length;i++){
let packDetail = {
batchNo:resPack.data,
batchNo:this.coData.batchNo,
billCode: this.emisCoPackDetail[i].billCode,
scanDate: this.emisCoPackDetail[i].scanDate,
scanStatus: this.emisCoPackDetail[i].scanStatus,
groupStatus: "1",//已组批次
scanMan: this.emisCoPackDetail[i].scanMan,
scanSite: this.emisCoPackDetail[i].scanSite,
createBy: this.$store.getters.empCode,
createTime: parseTime(new Date())
};
let response = await addEmisTmsSiteBatchDtl(packDetail);
if(!response || response.code != 200){
this.$modal.msgError(response && response.msg || '组批次明细新增失败')
@ -1070,7 +1057,7 @@ export default {
for(let lr = 0; lr < 3; lr++){
for(let ll = 0; ll < 6; ll++){
let batchLoadingData = {
batchNo: resPack.data,
batchNo: this.coData.batchNo,
posNo:lr+":"+ll+":1",
row: lr,
col: ll,
@ -1370,8 +1357,8 @@ export default {
})
this.coData.totalWaybillQty=this.emisCoPackDetail.length;
this.coData.totalParcelQty=totalParcelQty;
this.coData.totalWeight=totalWeight;
this.coData.totalVolume=parseFloat(totalVolume.toFixed(5));
this.coData.totalWeight=totalWeight.toFixed(2);
this.coData.totalVolume=totalVolume.toFixed(4);
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {

View File

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

View File

@ -658,20 +658,18 @@ export default {
},
};
},
watch: {
batchId(newVal,oldVal) {
this.initData();
},
},
created() {
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: {
initData() {
if(this.batchId !=null) {
this.showBatchInfo(this.batchId);
this.coPackType = "edit";
@ -681,7 +679,6 @@ export default {
this.coData.startSiteCode=this.$store.getters.ownerSiteCode;
this.coData.batchType='1';
this.coData.transType='1';
this.coPackType = "add";
}