|
|
@@ -35,10 +35,15 @@
|
|
|
<trade-card title="基础信息">
|
|
|
<avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
<tempalte slot="purchaseCompanyName">
|
|
|
- <dic-select v-model="form.purchaseCompanyName" placeholder="出售方" key="id" label="cnName" res="records"
|
|
|
- url="/blade-los/bcorps/selectList?corpTypeName=箱东" :filterable="true" :remote="true" dataName="cnName"
|
|
|
+ <dic-select v-model="form.purchaseCompanyName" placeholder="代理名称" key="id" label="cnName" res="records"
|
|
|
+ url="/blade-los/bcorps/selectList?corpTypeName=国外同行及代理" :filterable="true" :remote="true" dataName="cnName"
|
|
|
@selectChange="dicChange('purchaseCompanyName', $event)"></dic-select>
|
|
|
</tempalte>
|
|
|
+ <tempalte slot="podCname">
|
|
|
+ <dic-select v-model="form.podCname" placeholder="目的港" key="id" label="cnName" res="records"
|
|
|
+ url="/blade-los/blocations/list" :filterable="true" :remote="true" dataName="cnName"
|
|
|
+ @selectChange="dicChange('podCname', $event)"></dic-select>
|
|
|
+ </tempalte>
|
|
|
<tempalte slot="stationCname">
|
|
|
<dic-select v-model="form.stationCname" placeholder="场站" key="id" label="cnName" res="records"
|
|
|
url="/blade-los/blocations/list" :filterable="true" :remote="true" dataName="cnName"
|
|
|
@@ -51,13 +56,68 @@
|
|
|
</tempalte>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
+ <trade-card title="箱型箱量">
|
|
|
+ <avue-crud ref="crudBox" :option="boxOption" :data="form.boxTypeList"
|
|
|
+ @selection-change="boxSelectionChange">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="info" plain size="small" :disabled="editDisabled || !form.id"
|
|
|
+ @click="allClick('box一键保存')">一键保存</el-button>
|
|
|
+ <el-button type="info" plain size="small" :disabled="editDisabled || form.boxTypeList.length == 0"
|
|
|
+ @click="allClick('box一键编辑')">一键编辑</el-button>
|
|
|
+ <el-button type="danger" plain size="small" :disabled="editDisabled || boxSelectionList.length == 0"
|
|
|
+ @click="allClick('box批量删除')">批量删除</el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="indexHeader" slot-scope="{row,index}">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
+ @click="boxAddRow()">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <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="rentTermList" slot-scope="{ row,index }">
|
|
|
+ <div>
|
|
|
+ <el-link type="primary" :underline="false" @click.stop="openRtDialog(row, index)">阶梯计算</el-link>
|
|
|
+ <el-dialog title="阶梯计算" append-to-body :visible.sync="rtDialog" width="50%"
|
|
|
+ :close-on-click-modal="false">
|
|
|
+ <avue-crud :option="rtOption" :data="rulesList" id="out-table"
|
|
|
+ :header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
|
|
|
+ :cell-style="{ height: '20px', padding: '0px' }">
|
|
|
+ <template slot="indexHeader" slot-scope="{row,index}">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
+ @click="rtAddRow()">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="index" slot-scope="{row,index}">
|
|
|
+ <span>{{ index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="menu" slot-scope="{ row, index }">
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowItemEdit(row)">编辑</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="text"
|
|
|
+ @click="rowItemDel(row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="rowSave(row, rulesList)" size="mini">保 存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+ </avue-crud>
|
|
|
+ </trade-card>
|
|
|
<trade-card title="基础明细">
|
|
|
<avue-crud :option="option" :data="form.tradingBoxItemsList" 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', 235.1)"
|
|
|
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 235.1)">
|
|
|
+ @resetColumn="resetColumn('crud', 'option', 'optionBack', 475)"
|
|
|
+ @saveColumn="saveColumn('crud', 'option', 'optionBack', 475)">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="info" plain size="small" :disabled="editDisabled || !form.id"
|
|
|
@click="allClick('一键保存')">一键保存</el-button>
|
|
|
@@ -70,9 +130,9 @@
|
|
|
<el-button type="info" size="small" @click="allClick('启用')"
|
|
|
:disabled="selectionList.length == 0">启用</el-button>
|
|
|
<!-- <el-button type="primary" size="small" @click="allClick('卖箱')">卖箱</el-button> -->
|
|
|
- <!-- <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
+ <el-button size="small" style="margin-right: 8px" :disabled="!form.id || true"
|
|
|
@click="$refs.print.openDialog()">打印账单
|
|
|
- </el-button> -->
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
|
|
|
@@ -88,9 +148,16 @@
|
|
|
dataName="cnName" @selectChange="rowDicChange('boxType', $event, row)"></dic-select>
|
|
|
<span v-else>{{ row.boxType }}</span>
|
|
|
</template>
|
|
|
+ <tempalte slot="agentNameForm" slot-scope="{ row }">
|
|
|
+ <dic-select v-if="row.$cellEdit" v-model="row.agentName" placeholder="代理名称" key="id" label="cnName"
|
|
|
+ res="records" url="/blade-los/bcorps/selectList?corpTypeName=国外同行及代理" :filterable="true"
|
|
|
+ :remote="true" dataName="cnName">
|
|
|
+ </dic-select>
|
|
|
+ <span v-else>{{ row.agentName }}</span>
|
|
|
+ </tempalte>
|
|
|
<template slot="currencyForm" slot-scope="{ row }">
|
|
|
<dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
|
|
|
- :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
|
|
|
+ :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
|
|
|
@selectChange="rowDicChange('currency', $event, row)"></dic-select>
|
|
|
<span v-else>{{ row.currency }}</span>
|
|
|
</template>
|
|
|
@@ -171,8 +238,8 @@
|
|
|
<span v-else>{{ row.cntrNo }}</span>
|
|
|
</template>
|
|
|
<template slot="corpCnNameForm" slot-scope="{ row,index }">
|
|
|
- <dic-select v-if="row.$cellEdit" :key="updateSearchKey" v-model="row.corpCnName"
|
|
|
- placeholder="付费对象" label="cnName" res="records"
|
|
|
+ <dic-select v-if="row.$cellEdit" :key="updateSearchKey" v-model="row.corpCnName" placeholder="付费对象"
|
|
|
+ label="cnName" res="records"
|
|
|
:url="'/blade-los/bcorps/selectList?status=0¤t=1&size=20&corpTypeName=' + row.billType"
|
|
|
:filterable="true" :remote="true" dataName="cnName"
|
|
|
@selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
|
|
|
@@ -191,7 +258,7 @@
|
|
|
</template>
|
|
|
<template slot="curCodeForm" slot-scope="{ row }">
|
|
|
<dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
|
|
|
- :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
|
|
|
+ :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
|
|
|
@selectChange="rowDicChange('curCode', $event, row)"></dic-select>
|
|
|
<span v-else>{{ row.curCode }}</span>
|
|
|
</template>
|
|
|
@@ -286,7 +353,9 @@ import {
|
|
|
tradingBoxFees,
|
|
|
submitItemList,
|
|
|
submitFeeList,
|
|
|
- enable
|
|
|
+ enable,
|
|
|
+ submitBoxList,
|
|
|
+ boxRemove
|
|
|
} from "@/api/boxManagement/buyContainer/index.js";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
import checkSchedule from "@/components/checkH/checkSchedule.vue";
|
|
|
@@ -300,6 +369,127 @@ export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ boxSelectionList: [],
|
|
|
+ rulesList: [],
|
|
|
+ rtOption: {
|
|
|
+ border: true,
|
|
|
+ align: 'center',
|
|
|
+ menuWidth: 120,
|
|
|
+ // menu: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ header: false,
|
|
|
+ addBtn: false,
|
|
|
+ height: '400px',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "index",
|
|
|
+ prop: "index",
|
|
|
+ width: "55",
|
|
|
+ headerslot: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '起',
|
|
|
+ prop: 'riseDays',
|
|
|
+ cell: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '止',
|
|
|
+ prop: 'stopDays',
|
|
|
+ cell: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '费率',
|
|
|
+ prop: 'rate',
|
|
|
+ cell: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '币别',
|
|
|
+ prop: 'curCode',
|
|
|
+ cell: true,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: 'CNY',
|
|
|
+ value: 'CNY',
|
|
|
+ }, {
|
|
|
+ label: 'USD',
|
|
|
+ value: 'USD',
|
|
|
+ }],
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ rtDialog: false,
|
|
|
+ boxOption: {
|
|
|
+ calcHeight: 30,
|
|
|
+ menuWidth: 120,
|
|
|
+ menu: false,
|
|
|
+ tip: false,
|
|
|
+ border: true,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ // header: false,
|
|
|
+ columnBtn: false,
|
|
|
+ refreshBtn: false,
|
|
|
+ selection: true,
|
|
|
+ align: 'center',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "index",
|
|
|
+ prop: "index",
|
|
|
+ width: "55",
|
|
|
+ headerslot: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "箱型",
|
|
|
+ prop: "boxType",
|
|
|
+ cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ overHidden: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请选择箱型",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "箱量",
|
|
|
+ prop: "number",
|
|
|
+ cell: true,
|
|
|
+ overHidden: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入箱量",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "箱/天",
|
|
|
+ prop: "price",
|
|
|
+ cell: true,
|
|
|
+ type: 'number',
|
|
|
+ controls: false,
|
|
|
+ overHidden: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "请输入箱/天",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
excelBox: false,
|
|
|
excelForm: {},
|
|
|
excelLoading: false,
|
|
|
@@ -390,10 +580,11 @@ export default {
|
|
|
editButton: false,
|
|
|
editDisabled: false,
|
|
|
form: {
|
|
|
- type: "BUY",
|
|
|
+ type: "DL",
|
|
|
agreement: '到协议场站',
|
|
|
boxCondition: '新',
|
|
|
log: '否',
|
|
|
+ boxTypeList: [],
|
|
|
tradingBoxItemsList: [],
|
|
|
feeCenterList: [],
|
|
|
tradingBoxFilesList: [],
|
|
|
@@ -406,7 +597,7 @@ export default {
|
|
|
labelWidth: 100,
|
|
|
column: [
|
|
|
{
|
|
|
- label: '出售方',
|
|
|
+ label: '代理名称',
|
|
|
prop: 'purchaseCompanyName',
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
@@ -426,8 +617,8 @@ export default {
|
|
|
disabled: false
|
|
|
},
|
|
|
{
|
|
|
- label: '购买日期',
|
|
|
- prop: 'purchaseDate',
|
|
|
+ label: '日期',
|
|
|
+ prop: 'effectiveDate',
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
@@ -439,30 +630,22 @@ export default {
|
|
|
disabled: false
|
|
|
},
|
|
|
{
|
|
|
- label: '箱型箱量',
|
|
|
- prop: 'boxTypeQuantityOne',
|
|
|
- disabled: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: '箱型箱量2',
|
|
|
- prop: 'boxTypeQuantityTwo',
|
|
|
- disabled: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: '提/送箱',
|
|
|
- prop: 'agreement',
|
|
|
- disabled: false,
|
|
|
- type: 'select',
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=agreement",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictValue"
|
|
|
- },
|
|
|
+ label: '到期日期',
|
|
|
+ prop: 'expiryDate',
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
|
trigger: "blur"
|
|
|
- }]
|
|
|
+ }],
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '放箱号',
|
|
|
+ prop: 'containerNumber',
|
|
|
+ disabled: false,
|
|
|
},
|
|
|
{
|
|
|
label: '场站',
|
|
|
@@ -485,35 +668,9 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: '箱况',
|
|
|
- prop: 'boxCondition',
|
|
|
- disabled: false,
|
|
|
- type: 'select',
|
|
|
- dicData: [{
|
|
|
- label: '新',
|
|
|
- value: '新',
|
|
|
- }, {
|
|
|
- label: '旧',
|
|
|
- value: '旧',
|
|
|
- }],
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'LOGO',
|
|
|
- prop: 'log',
|
|
|
+ label: '目的港',
|
|
|
+ prop: 'podCname',
|
|
|
disabled: false,
|
|
|
- type: 'select',
|
|
|
- dicData: [{
|
|
|
- label: '是',
|
|
|
- value: '是',
|
|
|
- }, {
|
|
|
- label: '否',
|
|
|
- value: '否',
|
|
|
- }]
|
|
|
},
|
|
|
{
|
|
|
label: '备注',
|
|
|
@@ -608,6 +765,15 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
+ label: '代理名称',
|
|
|
+ prop: 'agentName',
|
|
|
+ cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ overHidden: true,
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '箱型',
|
|
|
prop: 'boxType',
|
|
|
width: 100,
|
|
|
@@ -1099,7 +1265,7 @@ export default {
|
|
|
},
|
|
|
async created() {
|
|
|
this.roleName = localStorage.getItem('roleName').split(',')
|
|
|
- this.option = await this.getColumnData(this.getColumnName(235.1), this.optionBack);
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(475), this.optionBack);
|
|
|
this.feecOption = await this.getColumnData(this.getColumnName(235.2), this.feecOptionBack);
|
|
|
if (this.detailData.id) {
|
|
|
// this.editButton = true
|
|
|
@@ -1115,6 +1281,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ openRtDialog(row) {
|
|
|
+ this.rulesList = row.rentTermList
|
|
|
+ this.rtDialog = true
|
|
|
+ },
|
|
|
+ rowSave(row, list) {
|
|
|
+ console.log(row)
|
|
|
+ row.rentTermList = list
|
|
|
+ this.rtDialog = false
|
|
|
+ },
|
|
|
countChange(row) {
|
|
|
if (row.curCode == 'CNY') {
|
|
|
row.amount = _.round(_.multiply(row.price, row.quantity), 2)
|
|
|
@@ -1192,6 +1367,18 @@ export default {
|
|
|
this.form.addressCname = null
|
|
|
}
|
|
|
}
|
|
|
+ if (name == 'podCname') {
|
|
|
+ if (row) {
|
|
|
+ this.form.podId = row.id
|
|
|
+ this.form.podCode = row.code
|
|
|
+ this.form.podEname = row.enName
|
|
|
+ } else {
|
|
|
+ this.form.podId = null
|
|
|
+ this.form.podCode = null
|
|
|
+ this.form.podEname = null
|
|
|
+ this.form.podCname = null
|
|
|
+ }
|
|
|
+ }
|
|
|
if (name == 'stationCname') {
|
|
|
if (row) {
|
|
|
this.form.stationId = row.id
|
|
|
@@ -1252,7 +1439,7 @@ export default {
|
|
|
rowDicChange(name, row, el, index) {
|
|
|
if (name == 'currency') {
|
|
|
if (row) {
|
|
|
- bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
|
|
|
+ bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
|
|
|
res.data.data.forEach(e => {
|
|
|
if (el.currency == e.code) {
|
|
|
this.$set(el, 'exrate', e.exrate)
|
|
|
@@ -1265,7 +1452,7 @@ export default {
|
|
|
}
|
|
|
if (name == 'curCode') {
|
|
|
if (row) {
|
|
|
- bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
|
|
|
+ bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
|
|
|
res.data.data.forEach(e => {
|
|
|
if (el.curCode == e.code) {
|
|
|
this.$set(el, 'exrate', e.exrate)
|
|
|
@@ -1355,13 +1542,52 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
rowEdit(row) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowItemEdit(row) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowItemDel(row, index) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ tradingBoxItem({ ids: row.id }).then(res => {
|
|
|
+ this.rulesList.splice(index, 1);
|
|
|
+ this.$message.success("成功删除");
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.rulesList.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ boxAddRow() {
|
|
|
+ this.form.boxTypeList.push(
|
|
|
+ {
|
|
|
+ pid: this.form.id ? this.form.id : null,
|
|
|
+ $cellEdit: true
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ rtAddRow() {
|
|
|
+ this.rulesList.push({ curCode: 'CNY', $cellEdit: true })
|
|
|
},
|
|
|
addRow() {
|
|
|
if (!this.form.id) {
|
|
|
return this.$message.error("请保存数据");
|
|
|
}
|
|
|
this.$refs.crud.dicInit();
|
|
|
- bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
|
|
|
+ bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
|
|
|
res.data.data.forEach(e => {
|
|
|
if (e.code == 'USD') {
|
|
|
this.form.tradingBoxItemsList.push({
|
|
|
@@ -1402,6 +1628,9 @@ export default {
|
|
|
selectionChange(list) {
|
|
|
this.selectionList = list;
|
|
|
},
|
|
|
+ boxSelectionChange(list) {
|
|
|
+ this.boxSelectionList = list;
|
|
|
+ },
|
|
|
feecChange(list) {
|
|
|
let ids = []
|
|
|
list.forEach(e => {
|
|
|
@@ -1505,6 +1734,75 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
allClick(name) {
|
|
|
+ if (name == 'box一键保存') {
|
|
|
+ if (!this.form.boxTypeList.length) {
|
|
|
+ return this.$message.error("请添加数据");
|
|
|
+ }
|
|
|
+ for (let row of this.form.boxTypeList) {
|
|
|
+ if (!row.boxType || !row.number || !row.price) {
|
|
|
+ this.$refs.crudBox.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)'
|
|
|
+ });
|
|
|
+ submitBoxList(this.form.boxTypeList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.form.boxTypeList = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (name == 'box一键编辑') {
|
|
|
+ for (let row of this.form.boxTypeList) {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'box批量删除') {
|
|
|
+ for (let item of this.selectionList) {
|
|
|
+ if (item.whetherEnable == '是') {
|
|
|
+ return this.$message.error("启用状态不能删除!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let multiList = []
|
|
|
+ let arr = []
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ multiList = this.boxSelectionList
|
|
|
+ arr = this.form.boxTypeList
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
+ 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)'
|
|
|
+ });
|
|
|
+ boxRemove({ ids: arrIds.join(',') }).then(res => {
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (name == '一键保存') {
|
|
|
if (!this.form.tradingBoxItemsList.length) {
|
|
|
return this.$message.error("请添加数据");
|
|
|
@@ -1577,6 +1875,33 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (name == '起租') {
|
|
|
+ this.$confirm('是否起租?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (name == '生成租金') {
|
|
|
+ this.$confirm('是否生成租金?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (name == '退租') {
|
|
|
+ this.$confirm('是否退租?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
if (name == '导入') {
|
|
|
this.excelBox = true
|
|
|
}
|
|
|
@@ -1659,6 +1984,12 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
+ for (let row of this.form.boxTypeList) {
|
|
|
+ if (!row.boxType || !row.number || !row.price) {
|
|
|
+ this.$refs.crudBox.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善箱型箱量");
|
|
|
+ }
|
|
|
+ }
|
|
|
for (let row of this.form.tradingBoxItemsList) {
|
|
|
if (!row.code || !row.boxType || !row.boxBelongsTo || !row.boxCategory || !row.boxStatus || !row.boxCondition || !row.amount || !row.currency || !row.exrate || !row.stationCname || !row.restrictedPortsName || !row.restrictingShippingCompaniesName || !row.status) {
|
|
|
this.$refs.crud.rowCell(row, row.$index)
|