|
|
@@ -14,6 +14,9 @@
|
|
|
<el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
|
|
|
:disabled="isSaveBtn" @click="submit">保 存
|
|
|
</el-button>
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
|
|
|
+ :disabled="isSaveBtn" @click="submitUseBoxPlan">提 交
|
|
|
+ </el-button>
|
|
|
<!-- <el-button v-if="form.status == '审核提交'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
|
|
|
size="small" @click="revokeApplication">撤销单据请核
|
|
|
</el-button> -->
|
|
|
@@ -32,27 +35,33 @@
|
|
|
<div style="margin-top: 50px">
|
|
|
<trade-card title="基础信息">
|
|
|
<avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
+ <tempalte slot="branchName">
|
|
|
+ <dic-select v-model="form.branchName" placeholder="所属公司" key="id" label="deptName"
|
|
|
+ url="/blade-system/dept/top-list" :filterable="true" :remote="true" dataName="deptName"
|
|
|
+ @selectChange="dicChange('branchName', $event)" :default="true"
|
|
|
+ :disabled="editDisabled || roleName.includes('secondaryAdmin')"></dic-select>
|
|
|
+ </tempalte>
|
|
|
<tempalte slot="year">
|
|
|
- <el-date-picker v-model="form.year" type="year" placeholder="选择日期" format="yyyy" value-format="yyyy"
|
|
|
- @change="dicChange('year', $event)">
|
|
|
+ <el-date-picker v-model="form.year" type="year" @input="yearChange" format="yyyy" value-format="yyyy"
|
|
|
+ placeholder="选择年" :disabled="editDisabled">
|
|
|
</el-date-picker>
|
|
|
</tempalte>
|
|
|
<tempalte slot="week">
|
|
|
<el-input-number style="width: 100%;" v-model="form.week" @change="dicChange('week', $event)"
|
|
|
- placeholder="请输入 周" size="small" :controls="false"></el-input-number>
|
|
|
+ placeholder="请输入 周" size="small" :controls="false" :disabled="editDisabled"></el-input-number>
|
|
|
</tempalte>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
- <trade-card title="箱型明细">
|
|
|
- <avue-crud :option="option" :data="form.boxAdjustmentCostList" id="out-table" ref="crud"
|
|
|
+ <trade-card title="箱明细">
|
|
|
+ <avue-crud :option="option" :data="form.useBoxPlanItemList" id="out-table" ref="crud"
|
|
|
:header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
|
|
|
:cell-style="{ height: '20px', padding: '0px' }" @selection-change="selectionChange" @select="selectHandle"
|
|
|
- @row-update="rowUpdate" @resetColumn="resetColumn('crud', 'option', 'optionBack', 483)"
|
|
|
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 483)">
|
|
|
+ @row-update="rowUpdate" @resetColumn="resetColumn('crud', 'option', 'optionBack', 505)"
|
|
|
+ @saveColumn="saveColumn('crud', 'option', 'optionBack', 505)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled || !form.id"
|
|
|
@click="allClick('一键保存')">一键保存</el-button>
|
|
|
- <el-button type="info" plain size="small" :disabled="editDisabled || form.boxAdjustmentCostList.length == 0"
|
|
|
+ <el-button type="info" plain size="small" :disabled="editDisabled || form.useBoxPlanItemList.length == 0"
|
|
|
@click="allClick('一键编辑')">一键编辑</el-button>
|
|
|
<el-button type="danger" plain size="small" :disabled="editDisabled || selectionList.length == 0"
|
|
|
@click="allClick('批量删除')">批量删除</el-button>
|
|
|
@@ -64,32 +73,12 @@
|
|
|
<template slot="index" slot-scope="{row,index}">
|
|
|
<span>{{ index + 1 }}</span>
|
|
|
</template>
|
|
|
- <template slot="boxTypeForm" slot-scope="{ row }">
|
|
|
- <dic-select v-if="row.$cellEdit" v-model="row.boxType" key="id" label="cnName" res="records"
|
|
|
- url="/blade-los/bcntrtypes/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
|
|
|
- dataName="cnName" @selectChange="rowDicChange('boxType', $event, row)"></dic-select>
|
|
|
- <span v-else>{{ row.boxType }}</span>
|
|
|
- </template>
|
|
|
- <template slot="oceanFreightForm" slot-scope="{ row }">
|
|
|
- <el-input-number v-if="row.$cellEdit" v-model="row.oceanFreight" :controls="false" placeholder="请输入 海运费"
|
|
|
- size="small" style="width: 100%;" :precision="2" @change="countChange(row)"></el-input-number>
|
|
|
- <span v-else>{{ row.oceanFreight }}</span>
|
|
|
- </template>
|
|
|
- <template slot="inlandFreightForm" slot-scope="{ row }">
|
|
|
- <el-input-number v-if="row.$cellEdit" v-model="row.inlandFreight" :controls="false" placeholder="请输入 陆运费"
|
|
|
- size="small" style="width: 100%;" :precision="2" @change="countChange(row)"></el-input-number>
|
|
|
- <span v-else>{{ row.inlandFreight }}</span>
|
|
|
- </template>
|
|
|
- <template slot="loloForm" slot-scope="{ row }">
|
|
|
- <el-input-number v-if="row.$cellEdit" v-model="row.lolo" :controls="false" placeholder="请输入 LOLO"
|
|
|
- size="small" style="width: 100%;" :precision="2" @change="countChange(row)"></el-input-number>
|
|
|
- <span v-else>{{ row.lolo }}</span>
|
|
|
- </template>
|
|
|
- <template slot="otherAmountForm" slot-scope="{ row }">
|
|
|
- <el-input-number v-if="row.$cellEdit" v-model="row.otherAmount" :controls="false" placeholder="请输入 其他金额"
|
|
|
- size="small" style="width: 100%;" :precision="2" @change="countChange(row)"></el-input-number>
|
|
|
- <span v-else>{{ row.otherAmount }}</span>
|
|
|
- </template>
|
|
|
+ <tempalte slot="podCname" slot-scope="{ row }">
|
|
|
+ <dic-select v-if="row.$cellEdit" v-model="row.podCname" placeholder="港口" label="cnName" res="records"
|
|
|
+ url="/blade-los/bports/list?status=0¤t=1&size=5" :filterable="true" :remote="true" dataName="cnName"
|
|
|
+ @selectChange="rowDicChange('podCname', $event, row)"></dic-select>
|
|
|
+ <span v-else>{{ row.podCname }}</span>
|
|
|
+ </tempalte>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
<trade-card title="操作记录">
|
|
|
@@ -129,26 +118,35 @@ import {
|
|
|
submit,
|
|
|
pleaseCheck,
|
|
|
repealCancel,
|
|
|
- tradingBoxFees,
|
|
|
- submitFeeList,
|
|
|
copyAgent,
|
|
|
- confirm,
|
|
|
- revoke,
|
|
|
- submitJustmenttList,
|
|
|
- justmentRemove
|
|
|
-} from "@/api/boxManagement/buyContainer/index.js";
|
|
|
+ submitItemList,
|
|
|
+ itemRemove,
|
|
|
+ submitUseBoxPlan
|
|
|
+} from "@/api/iosBasicData/businessCenter/customerLetter.js";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
import checkSchedule from "@/components/checkH/checkSchedule.vue";
|
|
|
import businessReports from "@/components/tradeAgency/businessReports.vue";
|
|
|
import reports from "@/components/tradeAgency/reports.vue";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
-import { getWeekNumber, getWeeksInYear, getYearDate } from "@/util/date";
|
|
|
+import { getWeekNumber, getWeeksInYear, getYearDate, getWeekRange } from "@/util/date";
|
|
|
import _ from "lodash";
|
|
|
import { Header } from "element-ui";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ years: [
|
|
|
+ {
|
|
|
+ value: '2024',
|
|
|
+ label: '2024'
|
|
|
+ }, {
|
|
|
+ value: '2025',
|
|
|
+ label: '2025'
|
|
|
+ }, {
|
|
|
+ value: '2026',
|
|
|
+ label: '2026'
|
|
|
+ }
|
|
|
+ ],
|
|
|
weekMax: 1,
|
|
|
boxSelectionList: [],
|
|
|
rulesList: [],
|
|
|
@@ -191,8 +189,10 @@ export default {
|
|
|
editButton: false,
|
|
|
editDisabled: false,
|
|
|
form: {
|
|
|
- boxAdjustmentCostList: [],
|
|
|
- year: getWeekNumber().year,
|
|
|
+ useBoxPlanItemList: [],
|
|
|
+ branchId: JSON.parse(localStorage.getItem('sysitemData')).deptId,
|
|
|
+ branchName: JSON.parse(localStorage.getItem('sysitemData')).deptName,
|
|
|
+ year: getYearDate().toString(),
|
|
|
week: getWeekNumber().weekNumber,
|
|
|
startDate: getWeekNumber().mondayDate,
|
|
|
endDate: getWeekNumber().sundayDate
|
|
|
@@ -309,84 +309,26 @@ export default {
|
|
|
headerslot: true,
|
|
|
},
|
|
|
{
|
|
|
- label: '箱型',
|
|
|
- prop: 'boxType',
|
|
|
- cell: true,
|
|
|
- slot: true,
|
|
|
- formslot: true,
|
|
|
- overHidden: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请选择箱型",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '币别',
|
|
|
- prop: 'curCode',
|
|
|
- cell: true,
|
|
|
- type: 'select',
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictValue"
|
|
|
- },
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请选择币别",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '海运费',
|
|
|
- prop: 'oceanFreight',
|
|
|
- cell: true,
|
|
|
- type: 'number',
|
|
|
- controls: false,
|
|
|
+ label: '目的港',
|
|
|
+ prop: 'podCname',
|
|
|
overHidden: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入海运费",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
- label: '陆运费',
|
|
|
- prop: 'inlandFreight',
|
|
|
+ label: '20GP',
|
|
|
+ prop: 'price20gp',
|
|
|
cell: true,
|
|
|
- type: 'number',
|
|
|
- controls: false,
|
|
|
overHidden: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入陆运费",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
- label: 'LOLO',
|
|
|
- prop: 'lolo',
|
|
|
+ label: '40GP',
|
|
|
+ prop: 'price40gp',
|
|
|
cell: true,
|
|
|
- type: 'number',
|
|
|
- controls: false,
|
|
|
overHidden: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入LOLO",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
- label: '其他金额',
|
|
|
- prop: 'otherAmount',
|
|
|
+ label: '40HC',
|
|
|
+ prop: 'price40hc',
|
|
|
cell: true,
|
|
|
- type: 'number',
|
|
|
- controls: false,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "合计金额",
|
|
|
- prop: "totalAmount",
|
|
|
overHidden: true,
|
|
|
},
|
|
|
{
|
|
|
@@ -886,8 +828,9 @@ export default {
|
|
|
detailData: Object
|
|
|
},
|
|
|
async created() {
|
|
|
+
|
|
|
this.roleName = localStorage.getItem('roleName').split(',')
|
|
|
- this.option = await this.getColumnData(this.getColumnName(483), this.optionBack);
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(505), this.optionBack);
|
|
|
this.weekMax = getWeeksInYear(getYearDate())
|
|
|
if (this.detailData && this.detailData.id) {
|
|
|
// this.editButton = true
|
|
|
@@ -903,6 +846,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ yearChange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.weekMax = getWeeksInYear(val)
|
|
|
+ this.form.week = 0
|
|
|
+ } else {
|
|
|
+ this.form.week = 0
|
|
|
+ }
|
|
|
+ },
|
|
|
countChange(row) {
|
|
|
row.totalAmount = _.round(_.add(_.add(Number(row.oceanFreight ? row.oceanFreight : 0), Number(row.inlandFreight ? row.inlandFreight : 0)), _.add(Number(row.lolo ? row.lolo : 0), Number(row.otherAmount ? row.otherAmount : 0))), 2)
|
|
|
},
|
|
|
@@ -928,26 +879,42 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
dicChange(name, row) {
|
|
|
- if (name == 'year') {
|
|
|
+ if (name == 'branchName') {
|
|
|
if (row) {
|
|
|
- this.weekMax = getWeeksInYear(row)
|
|
|
- this.form.week =0
|
|
|
- console.log(this.form)
|
|
|
+ this.form.branchId = row.id
|
|
|
} else {
|
|
|
- this.form.week =0
|
|
|
+ this.form.branchId = null
|
|
|
+ this.form.branchName = null
|
|
|
}
|
|
|
}
|
|
|
- if(name=='week'){
|
|
|
-
|
|
|
+ if (name == 'week') {
|
|
|
+ if (row) {
|
|
|
+ if (row > this.weekMax) {
|
|
|
+ this.form.week = 0
|
|
|
+ this.form.startDate = null
|
|
|
+ this.form.endDate = null
|
|
|
+ return this.$message.error(this.form.year + '年最多有' + this.weekMax + '周');
|
|
|
+ } else {
|
|
|
+ this.form.startDate = getWeekRange(this.form.year, this.form.week).start
|
|
|
+ this.form.endDate = getWeekRange(this.form.year, this.form.week).end
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.form.startDate = null
|
|
|
+ this.form.endDate = null
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
rowDicChange(name, row, el, index) {
|
|
|
- if (name == 'boxType') {
|
|
|
+ if (name == 'podCname') {
|
|
|
if (row) {
|
|
|
- el.boxTypeId = row.id
|
|
|
+ el.podId = row.id
|
|
|
+ el.podCode = row.code
|
|
|
+ el.podEname = row.enName
|
|
|
} else {
|
|
|
- el.boxTypeId = null
|
|
|
- el.boxType = null
|
|
|
+ el.podId = null
|
|
|
+ el.podCode = null
|
|
|
+ el.podEname = null
|
|
|
+ el.podCname = null
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -971,71 +938,15 @@ export default {
|
|
|
if (!this.form.id) {
|
|
|
return this.$message.error("请保存数据");
|
|
|
}
|
|
|
-
|
|
|
this.$refs.crud.dicInit();
|
|
|
- this.form.boxAdjustmentCostList.push({
|
|
|
- pid: this.form.id,
|
|
|
- $cellEdit: true
|
|
|
- })
|
|
|
- },
|
|
|
- feedAddRow() {
|
|
|
- if (!this.form.id) {
|
|
|
- return this.$message.error("请保存数据");
|
|
|
- }
|
|
|
- this.feeCenterListD.push({
|
|
|
+ this.form.useBoxPlanItemList.push({
|
|
|
pid: this.form.id,
|
|
|
- feesType: 1,
|
|
|
- dc: 'D',
|
|
|
- billType: '箱东',
|
|
|
- curCode: 'CNY',
|
|
|
- exrate: 1,
|
|
|
- $cellEdit: true
|
|
|
- })
|
|
|
- },
|
|
|
- feecAddRow() {
|
|
|
- if (!this.form.id) {
|
|
|
- return this.$message.error("请保存数据");
|
|
|
- }
|
|
|
- this.feeCenterListC.push({
|
|
|
- pid: this.form.id,
|
|
|
- feesType: 1,
|
|
|
- dc: 'C',
|
|
|
- billType: '箱东',
|
|
|
- curCode: 'CNY',
|
|
|
- exrate: 1,
|
|
|
$cellEdit: true
|
|
|
})
|
|
|
},
|
|
|
selectionChange(list) {
|
|
|
this.selectionList = list;
|
|
|
},
|
|
|
- boxSelectionChange(list) {
|
|
|
- this.boxSelectionList = list;
|
|
|
- },
|
|
|
- feedChange(list) {
|
|
|
- let ids = []
|
|
|
- list.forEach(e => {
|
|
|
- ids.push(e.id)
|
|
|
- })
|
|
|
- if (ids.length) {
|
|
|
- this.itemCIds = ids.join(',')
|
|
|
- } else {
|
|
|
- this.itemCIds = null
|
|
|
- }
|
|
|
- this.selectionfeedList = list;
|
|
|
- },
|
|
|
- feecChange(list) {
|
|
|
- let ids = []
|
|
|
- list.forEach(e => {
|
|
|
- ids.push(e.id)
|
|
|
- })
|
|
|
- if (ids.length) {
|
|
|
- this.itemCIds = ids.join(',')
|
|
|
- } else {
|
|
|
- this.itemCIds = null
|
|
|
- }
|
|
|
- this.selectionfeecList = list;
|
|
|
- },
|
|
|
getDetail(id) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
@@ -1044,6 +955,13 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
detail({ id: id }).then(res => {
|
|
|
+ if (res.data.data.status > 0) {
|
|
|
+ this.editDisabled = true
|
|
|
+ this.optionForm.disabled = true
|
|
|
+ } else {
|
|
|
+ this.editDisabled = false
|
|
|
+ this.optionForm.disabled = false
|
|
|
+ }
|
|
|
this.form = res.data.data
|
|
|
}).finally(() => {
|
|
|
loading.close()
|
|
|
@@ -1069,48 +987,15 @@ export default {
|
|
|
this.optionForm.disabled = false
|
|
|
}
|
|
|
},
|
|
|
- polRowDel(row, index) {
|
|
|
- this.$confirm("确定删除数据?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- if (row.id) {
|
|
|
- tradingBoxFees({ ids: row.id }).then(res => {
|
|
|
- this.form.feeCenterList.splice(index, 1);
|
|
|
- this.$message.success("成功删除");
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.form.feeCenterList.splice(index, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- podRowDel(row, index) {
|
|
|
- this.$confirm("确定删除数据?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- if (row.id) {
|
|
|
- tradingBoxFees({ ids: row.id }).then(res => {
|
|
|
- this.podFeeList.splice(index, 1);
|
|
|
- this.$message.success("成功删除");
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.podFeeList.splice(index, 1);
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- },
|
|
|
allClick(name) {
|
|
|
if (name == '一键保存') {
|
|
|
- if (!this.form.boxAdjustmentCostList.length) {
|
|
|
+ if (!this.form.useBoxPlanItemList.length) {
|
|
|
return this.$message.error("请添加数据");
|
|
|
}
|
|
|
- for (let row of this.form.boxAdjustmentCostList) {
|
|
|
- if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo) {
|
|
|
- this.$refs.crud.rowCell(row, row.$index)
|
|
|
- return this.$message.error("请完善箱明细信息");
|
|
|
+ for (let row of this.form.useBoxPlanItemList) {
|
|
|
+ if (!row.podCname) {
|
|
|
+ // this.$refs.crud.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("明细信息的目的港必填");
|
|
|
}
|
|
|
}
|
|
|
const loading = this.$loading({
|
|
|
@@ -1119,15 +1004,15 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- submitJustmenttList(this.form.boxAdjustmentCostList).then(res => {
|
|
|
+ submitItemList(this.form.useBoxPlanItemList).then(res => {
|
|
|
this.$message.success("保存成功");
|
|
|
- this.form.boxAdjustmentCostList = res.data.data
|
|
|
+ this.form.useBoxPlanItemList = res.data.data
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
})
|
|
|
}
|
|
|
if (name == '一键编辑') {
|
|
|
- for (let row of this.form.boxAdjustmentCostList) {
|
|
|
+ for (let row of this.form.useBoxPlanItemList) {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
}
|
|
|
this.$refs.crud.dicInit();
|
|
|
@@ -1146,7 +1031,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
multiList = this.selectionList
|
|
|
- arr = this.form.boxAdjustmentCostList
|
|
|
+ arr = this.form.useBoxPlanItemList
|
|
|
// 获取有id 的数据
|
|
|
const itemsWithId = multiList.filter(item => item.id != null);
|
|
|
let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
@@ -1165,7 +1050,7 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- justmentRemove({ ids: arrIds.join(',') }).then(res => {
|
|
|
+ itemRemove({ ids: arrIds.join(',') }).then(res => {
|
|
|
this.$message.success("删除成功");
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
@@ -1212,176 +1097,15 @@ export default {
|
|
|
this.activationForm = {}
|
|
|
this.activationDialog = true
|
|
|
}
|
|
|
-
|
|
|
- if (name == 'D费用一键保存') {
|
|
|
- if (!this.feeCenterListD.length) {
|
|
|
- return this.$message.error("请添加数据");
|
|
|
- }
|
|
|
- for (let row of this.feeCenterListD) {
|
|
|
- row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
|
|
|
- if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
|
|
|
- this.$refs.crud2.rowCell(row, row.$index)
|
|
|
- return this.$message.error("请完善费用明细");
|
|
|
- }
|
|
|
- }
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- submitFeeList(this.feeCenterListD).then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- res.data.data.forEach(row => {
|
|
|
- if (row.curCode == this.getLocalCurrency()) {
|
|
|
- row.amountCNY = row.amount
|
|
|
- row.amountUSD = 0
|
|
|
- }
|
|
|
- if (row.curCode != this.getLocalCurrency()) {
|
|
|
- row.amountUSD = row.amount
|
|
|
- row.amountCNY = 0
|
|
|
- }
|
|
|
- })
|
|
|
- this.feeCenterListD = res.data.data
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- }
|
|
|
- if (name == 'D费用一键编辑') {
|
|
|
- for (let row of this.feeCenterListD) {
|
|
|
- this.$set(row, "$cellEdit", true);
|
|
|
- }
|
|
|
- }
|
|
|
- if (name == 'D费用批量删除') {
|
|
|
- for (let row of this.selectionfeedList) {
|
|
|
- if (row.automaticGenerated == 1) {
|
|
|
- return this.$message.error("系统自动生成的费用不允许删除");
|
|
|
- }
|
|
|
- }
|
|
|
- let multiList = []
|
|
|
- let arr = []
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- multiList = this.selectionfeedList
|
|
|
- arr = this.feeCenterListD
|
|
|
- // 获取有id 的数据
|
|
|
- const itemsWithId = multiList.filter(item => item.id != null);
|
|
|
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
- // 把选中的删除掉
|
|
|
- multiList.forEach((item) => {
|
|
|
- for (let index in arr) {
|
|
|
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
- arr.splice(Number(index), 1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- if (itemsWithId.length != 0) {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- tradingBoxFees({ ids: arrIds.join(',') }).then(res => {
|
|
|
- this.$message.success("删除成功");
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (name == 'C费用一键保存') {
|
|
|
- if (!this.feeCenterListC.length) {
|
|
|
- return this.$message.error("请添加数据");
|
|
|
- }
|
|
|
- for (let row of this.feeCenterListC) {
|
|
|
- row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
|
|
|
- if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
|
|
|
- this.$refs.crud2.rowCell(row, row.$index)
|
|
|
- return this.$message.error("请完善费用明细");
|
|
|
- }
|
|
|
- }
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- submitFeeList(this.feeCenterListC).then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- res.data.data.forEach(row => {
|
|
|
- if (row.curCode == this.getLocalCurrency()) {
|
|
|
- row.amountCNY = row.amount
|
|
|
- row.amountUSD = 0
|
|
|
- }
|
|
|
- if (row.curCode != this.getLocalCurrency()) {
|
|
|
- row.amountUSD = row.amount
|
|
|
- row.amountCNY = 0
|
|
|
- }
|
|
|
- })
|
|
|
- this.feeCenterListC = res.data.data
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- }
|
|
|
- if (name == 'C费用一键编辑') {
|
|
|
- for (let row of this.feeCenterListC) {
|
|
|
- this.$set(row, "$cellEdit", true);
|
|
|
- }
|
|
|
- }
|
|
|
- if (name == 'C费用批量删除') {
|
|
|
- for (let row of this.selectionfeecList) {
|
|
|
- if (row.automaticGenerated == 1) {
|
|
|
- return this.$message.error("系统自动生成的费用不允许删除");
|
|
|
- }
|
|
|
- }
|
|
|
- let multiList = []
|
|
|
- let arr = []
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- multiList = this.selectionfeecList
|
|
|
- arr = this.feeCenterListC
|
|
|
- // 获取有id 的数据
|
|
|
- const itemsWithId = multiList.filter(item => item.id != null);
|
|
|
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
- // 把选中的删除掉
|
|
|
- multiList.forEach((item) => {
|
|
|
- for (let index in arr) {
|
|
|
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
- arr.splice(Number(index), 1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- if (itemsWithId.length != 0) {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- tradingBoxFees({ ids: arrIds.join(',') }).then(res => {
|
|
|
- this.$message.success("删除成功");
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
},
|
|
|
submit(type) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- for (let row of this.form.boxAdjustmentCostList) {
|
|
|
- if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo) {
|
|
|
- this.$refs.crud.rowCell(row, row.$index)
|
|
|
- return this.$message.error("请完善箱明细信息");
|
|
|
+ for (let row of this.form.useBoxPlanItemList) {
|
|
|
+ if (!row.podCname) {
|
|
|
+ // this.$refs.crud.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("明细信息的目的港必填");
|
|
|
}
|
|
|
}
|
|
|
const loading = this.$loading({
|
|
|
@@ -1402,28 +1126,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- confirm() {
|
|
|
- this.$confirm("确定调箱?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- });
|
|
|
- confirm(this.form).then(res => {
|
|
|
- this.$message.success("操作成功");
|
|
|
- this.getDetail(res.data.data.id)
|
|
|
- }).finally(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- revoke() {
|
|
|
- this.$confirm("确定撤销调箱?", {
|
|
|
+ submitUseBoxPlan() {
|
|
|
+ this.$confirm("确定提交用箱计划?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
@@ -1434,7 +1138,7 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- revoke(this.form).then(res => {
|
|
|
+ submitUseBoxPlan(this.form).then(res => {
|
|
|
this.$message.success("操作成功");
|
|
|
this.getDetail(res.data.data.id)
|
|
|
}).finally(() => {
|