han\hanst 2 days ago
parent
commit
c835ba04b1
  1. 1
      src/api/ecss/ecss.js
  2. 260
      src/views/modules/ecss/declaration.vue

1
src/api/ecss/ecss.js

@ -96,6 +96,7 @@ export const searchPalletList = data => createAPI(`/ecss/coDel/searchPalletList`
export const searchPackageList = data => createAPI(`/ecss/coDel/searchPackageList`,'post',data)
export const getNotifyPartDetail = data => createAPI(`/ecss/coDel/getNotifyPartDetail`,'post',data)
export const getDeclarationPalletPartDetail = data => createAPI(`/ecss/coDel/getDeclarationPalletPartDetail`,'post',data)
export const saveOneClickPacking = data => createAPI(`/ecss/coDel/saveOneClickPacking`,'post',data)

260
src/views/modules/ecss/declaration.vue

@ -379,57 +379,48 @@
</el-row>
</el-form>
<!-- <el-table v-show="currentRow.buNo==='02-Hardtag' || currentRow.buNo==='04-MHM'"
:height="240"
:data="propertiesList"
stripe
<el-table v-show="currentRow.buNo==='03-RFID'"
:height="180"
:data="notifyPartDetailList"
stripe class="expClass"
highlight-current-row
border :row-style="{ height: '30px' }"
style="width: 100%;margin-top: 70px">
<el-table-column
prop="hsCode"
header-align="center"
align="center"
label="HS Code">
</el-table-column>
<el-table-column
prop="hsCodeDesc"
prop="pn"
header-align="center"
align="center"
label="品名">
label="PN">
</el-table-column>
<el-table-column
prop="ehundred"
header-align="center"
align="center"
label="品牌">
label="E100">
<template slot-scope="scope">
<el-select v-model="scope.row.brand" placeholder="请选择" style="width: 150px">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableList" :key="key"></el-option>
</el-select>
<el-input v-model="scope.row.ehundred" style="width: 100px;"></el-input>
</template>
</el-table-column>
</el-table>-->
<el-table v-show="currentRow.buNo==='03-RFID'"
:height="180"
:data="notifyPartDetailList"
stripe class="expClass"
highlight-current-row
border :row-style="{ height: '30px' }"
style="width: 100%;margin-top: 70px">
<el-table-column
prop="pn"
prop="calcFscWeight"
header-align="center"
align="center"
label="PN">
label="计算FSC纸重量">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.calcFscWeight"
:disabled="scope.row.fscFlag !== 'Y'"
@change="handleFscWeightCheckChange(scope.row)">
</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="ehundred"
prop="fscWeightValue"
header-align="center"
align="center"
label="E100">
label="FSC纸重量(KG)">
<template slot-scope="scope">
<el-input v-model="scope.row.ehundred" style="width: 100px;"></el-input>
<span>{{ scope.row.fscFlag === 'Y' ? scope.row.fscWeightValue : '-' }}</span>
</template>
</el-table-column>
<el-table-column
@ -438,7 +429,7 @@
align="center"
label="纯FSC纸重量损耗">
<template slot-scope="scope">
<el-input v-model="scope.row.lossratio" style="width: 100px;"></el-input>
<el-input v-model="scope.row.lossratio" style="width: 100px;" disabled></el-input>
</template>
</el-table-column>
</el-table>
@ -796,13 +787,35 @@
<el-input v-model="scope.row.ehundred" style="width: 100px;"></el-input>
</template>
</el-table-column>
<el-table-column
prop="calcFscWeight"
header-align="center"
align="center"
label="计算FSC纸重量">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.calcFscWeight"
:disabled="scope.row.fscFlag !== 'Y'"
@change="handleFscWeightCheckChange(scope.row)">
</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="fscWeightValue"
header-align="center"
align="center"
label="FSC纸重量(KG)">
<template slot-scope="scope">
<span>{{ scope.row.fscFlag === 'Y' ? scope.row.fscWeightValue : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="lossratio"
header-align="center"
align="center"
label="纯FSC纸重量损耗">
<template slot-scope="scope">
<el-input v-model="scope.row.lossratio" style="width: 100px;"></el-input>
<el-input v-model="scope.row.lossratio" style="width: 100px;" disabled></el-input>
</template>
</el-table-column>
</el-table>
@ -926,13 +939,35 @@
<el-input v-model="scope.row.ehundred" style="width: 100px;"></el-input>
</template>
</el-table-column>
<el-table-column
prop="calcFscWeight"
header-align="center"
align="center"
label="计算FSC纸重量">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.calcFscWeight"
:disabled="scope.row.fscFlag !== 'Y'"
@change="handleFscWeightCheckChange(scope.row)">
</el-checkbox>
</template>
</el-table-column>
<el-table-column
prop="fscWeightValue"
header-align="center"
align="center"
label="FSC纸重量(KG)">
<template slot-scope="scope">
<span>{{ scope.row.fscFlag === 'Y' ? scope.row.fscWeightValue : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="lossratio"
header-align="center"
align="center"
label="纯FSC纸重量损耗">
<template slot-scope="scope">
<el-input v-model="scope.row.lossratio" style="width: 100px;"></el-input>
<el-input v-model="scope.row.lossratio" style="width: 100px;" disabled></el-input>
</template>
</el-table-column>
</el-table>
@ -1086,7 +1121,7 @@
searchDeclarationDetail,
deleteDeclaration,
downloadDeclarationElements,
getNotifyPartDetail,
getDeclarationPalletPartDetail,
getCustomerInfo,
getEcssContactsList,
searchTemplateList,
@ -2250,7 +2285,7 @@
this.templateData.buNo = this.currentRow.buNo
this.templateData.customName = this.currentRow.customName
//this.templateData.shippingMode = this.currentRow.shippingMode
searchTemplateList(this.templateData).then(({data}) => {
return searchTemplateList(this.templateData).then(({data}) => {
if (data && data.code === 0){
if (data.rows && data.rows.length > 0) {
this.templateRowDblclick(data.rows[0]);
@ -2258,6 +2293,83 @@
}
})
},
loadDeclarationPalletPartDetail() {
return getDeclarationPalletPartDetail(this.currentRow).then(({data}) => {
if (data && data.code === 0) {
this.normalizeNotifyPartDetailList(data.rows)
} else {
this.notifyPartDetailList = []
}
}).catch(() => {
this.notifyPartDetailList = []
})
},
normalizeNotifyPartDetailList(rows) {
const rowList = Array.isArray(rows) ? rows : []
this.notifyPartDetailList = rowList.map(item => {
const row = Object.assign({}, item)
row.fscFlag = row.fscFlag ? String(row.fscFlag).toUpperCase() : 'N'
row.calcFscWeight = row.fscFlag === 'Y' && !!row.lossratio
this.refreshNotifyPartDetailRow(row)
return row
})
},
applyTemplateFscWeightConfig(enableFscWeight) {
this.notifyPartDetailList.forEach(row => {
if (row.fscFlag === 'Y') {
row.calcFscWeight = !!enableFscWeight
} else {
row.calcFscWeight = false
}
this.refreshNotifyPartDetailRow(row)
})
},
handleFscWeightCheckChange(row) {
this.refreshNotifyPartDetailRow(row)
},
refreshNotifyPartDetailRow(row) {
if (!row) {
return
}
if (row.fscFlag !== 'Y') {
row.calcFscWeight = false
row.lossratio = ''
row.fscWeightValue = ''
return
}
if (!row.calcFscWeight) {
row.lossratio = ''
row.fscWeightValue = ''
return
}
const qty = this.toNumber(row.qty)
const lossRatio = this.getFscLossRatio(qty)
row.lossratio = lossRatio.toFixed(2)
row.fscWeightValue = this.calculateFscWeight(qty, row.fscUnitWeight, lossRatio)
},
getFscLossRatio(totalQty) {
if (totalQty <= 1000000) {
return 1.05
}
if (totalQty <= 3000000) {
return 1.03
}
return 1.01
},
calculateFscWeight(totalQty, fscUnitWeight, lossRatio) {
const qty = this.toNumber(totalQty)
const unitWeight = this.toNumber(fscUnitWeight)
if (qty <= 0 || unitWeight <= 0) {
return '0.00'
}
const rawWeight = qty * lossRatio * (unitWeight / 1000)
const roundedDown = Math.floor(rawWeight * 100) / 100
return roundedDown.toFixed(2)
},
toNumber(value) {
const num = Number(value)
return Number.isFinite(num) ? num : 0
},
buildPickupAddressText(item) {
const company = item && item.company ? item.company : ''
const address = item && item.address ? item.address : ''
@ -2317,7 +2429,7 @@
this.pickupAddressList = []
})
},
exportInvoiceList() {
async exportInvoiceList() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择报关单!')
return
@ -2342,24 +2454,12 @@
this.notifyPartDetailList = [];
this.exportInvoiceFlag = true
if (this.currentRow.buNo==='03-RFID') {
getNotifyPartDetail(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.notifyPartDetailList = data.rows
this.notifyPartDetailList.forEach(o => {
if (!o.lossratio) {
o.lossratio = '1.05';
}
});
} else {
this.notifyPartDetailList = [];
}
});
await this.loadDeclarationPalletPartDetail()
}
this.templateData.type='发票'
this.searchTemplateOne();
},
exportPakingList() {
async exportPakingList() {
if (!this.currentRow || !this.currentRow.buNo) {
this.$message.warning('请选择报关单!')
return
@ -2390,19 +2490,7 @@
this.exportPaking.templateName=''
this.exportPakingFlag = true
if (this.currentRow.buNo==='03-RFID') {
getNotifyPartDetail(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.notifyPartDetailList = data.rows
this.notifyPartDetailList.forEach(o => {
if (!o.lossratio) {
o.lossratio = '1.05';
}
});
} else {
this.notifyPartDetailList = [];
}
});
await this.loadDeclarationPalletPartDetail()
}
this.templateData.type='箱单'
this.searchTemplateOne();
@ -2757,19 +2845,7 @@
this.exportPaking.templateName=''
if (this.currentRow.buNo==='03-RFID') {
await getNotifyPartDetail(this.currentRow).then(({data}) => {
//
if (data && data.code == 0) {
this.notifyPartDetailList = data.rows
this.notifyPartDetailList.forEach(o => {
if (!o.lossratio) {
o.lossratio = '1.05';
}
});
} else {
this.notifyPartDetailList = [];
}
});
await this.loadDeclarationPalletPartDetail()
}
this.templateData.type='箱单'
await searchTemplateList(this.templateData).then(({data}) => {
@ -2790,22 +2866,7 @@
this.exportPaking.material=this.currentRow.material?this.currentRow.material:row.material
this.exportPaking.hsCodeDescType=this.currentRow.hsCodeDescType?this.currentRow.hsCodeDescType:row.hsCodeDescType
this.exportPaking.goodsLabel=this.currentRow.goodsLabel?this.currentRow.goodsLabel:row.goodsLabel
this.notifyPartDetailList.forEach(o => {
// fsc
if (o.lossratio) {
if (row.fscWeight) {
o.lossratio = o.lossratio;
} else {
o.lossratio = '';
}
} else {
if (row.fscWeight) {
o.lossratio = '1.05';
} else {
o.lossratio = '';
}
}
});
this.applyTemplateFscWeightConfig(row.fscWeight)
}
}
})
@ -3045,22 +3106,7 @@
this.exportGoods.shipper=row.shipper
}
if (this.templateData.type!=='出口货物委托书') {
this.notifyPartDetailList.forEach(o => {
// fsc
if (o.lossratio) {
if (row.fscWeight) {
o.lossratio = o.lossratio;
} else {
o.lossratio = '';
}
} else {
if (row.fscWeight) {
o.lossratio = '1.05';
} else {
o.lossratio = '';
}
}
});
this.applyTemplateFscWeightConfig(row.fscWeight)
}
this.templateFlag = false
},

Loading…
Cancel
Save