|
|
@@ -0,0 +1,960 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="customer-head">
|
|
|
+ <div class="customer-back">
|
|
|
+ <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
+ @click="goBack()">返回列表
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="add-customer-btn">
|
|
|
+ <el-button size="small" style="margin-right: 8px" :disabled="!form.id" @click="$refs.print.openDialog()">预 览
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="roleName.indexOf('admin') != -1" size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
+ @click="$refs.report.openDialog()">报表设计
|
|
|
+ </el-button>
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small" v-if="editButton"
|
|
|
+ :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)"
|
|
|
+ @click="inEdit">编 辑
|
|
|
+ </el-button>
|
|
|
+ <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 v-if="form.status == '审核提交'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
|
|
|
+ size="small" @click="revokeApplication">撤销单据请核
|
|
|
+ </el-button> -->
|
|
|
+ <!-- <el-dropdown style="line-height: 0">
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
|
|
|
+ size="small">
|
|
|
+ 审 批<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 50px">
|
|
|
+ <trade-card title="基础信息">
|
|
|
+ <avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
+ <tempalte slot="purchaseCompanyName">
|
|
|
+ <dic-select v-model="form.purchaseCompanyName" placeholder="USER" key="id" label="shortName" res="records"
|
|
|
+ @selectChange="dicChange('purchaseCompanyName', $event)" :disabled="form.whetherEnable == '是'"
|
|
|
+ url="/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=箱东" :filterable="true"
|
|
|
+ :remote="true" dataName="shortName" :slotRight="true" rightLabel="code">
|
|
|
+ </dic-select>
|
|
|
+ </tempalte>
|
|
|
+ <template slot="boxTypeQuantityOne">
|
|
|
+ <dic-select v-model="form.boxTypeQuantityOne" key="id" label="cnName" res="records"
|
|
|
+ url="/blade-los/bcntrtypes/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
|
|
|
+ dataName="cnName" @selectChange="dicChange('boxTypeQuantityOne', $event)"
|
|
|
+ :disabled="editDisabled"></dic-select>
|
|
|
+ </template>
|
|
|
+ <template slot="perDiemAfterFreeDays">
|
|
|
+ <el-button type="primary" size="small" @click.stop="openRtDialog" :disabled="editDisabled">箱租金条款</el-button>
|
|
|
+ <!-- <el-link type="primary" :underline="false" @click.stop="openRtDialog">箱租金条款</el-link> -->
|
|
|
+ </template>
|
|
|
+ <template slot="boxNumber">
|
|
|
+ <el-input-number v-model="form.boxNumber" :disabled="editDisabled" :min="1" :controls="false"
|
|
|
+ placeholder="请输入 箱量" style="width: 100%;"></el-input-number>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ </trade-card>
|
|
|
+ <trade-card title="操作记录">
|
|
|
+ <avue-form :option="optionForm2" v-model="form" ref="form2">
|
|
|
+ </avue-form>
|
|
|
+ </trade-card>
|
|
|
+ </div>
|
|
|
+ <business-reports :id="form.id" :itemIds="itemIds" ref="print" businessValue="OW-HY"
|
|
|
+ :type="true"></business-reports>
|
|
|
+ <business-reports :id="form.id" :itemIds="itemCIds" ref="printC" businessValue="OW-HY" classifyCode="费用"
|
|
|
+ groupCode="应付" :selecList="selectionfeecList"></business-reports>
|
|
|
+ <reports :id="form.id" :assemblyForm="form" businessValue="OW-HY" ref="report"></reports>
|
|
|
+ <!--审核弹窗-->
|
|
|
+ <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
|
|
|
+ :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
|
|
|
+ <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="箱租金条款" append-to-body :visible.sync="rtDialog" width="50%" :close-on-click-modal="false"
|
|
|
+ v-dialog-drag>
|
|
|
+ <avue-crud :option="rtOption" :data="form.rentTermList" id="out-table" ref="crud"
|
|
|
+ :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 || feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0" 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="rowEdit(row, index)"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">{{ row.$cellEdit ? '保存' :
|
|
|
+ '编辑'
|
|
|
+ }}</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="rtSubmit" size="mini"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">保 存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ detail,
|
|
|
+ submit,
|
|
|
+ pleaseCheck,
|
|
|
+ repealCancel,
|
|
|
+ tradingBoxItem,
|
|
|
+ tradingBoxFees,
|
|
|
+ submitItemList,
|
|
|
+ submitFeeList,
|
|
|
+ enable,
|
|
|
+ renttermRemove,
|
|
|
+ copyAgent,
|
|
|
+ countRent,
|
|
|
+ revokeCountRent,
|
|
|
+ submitRtList,
|
|
|
+ pleaseVerifyCost,
|
|
|
+ batchUpdatePodStation,
|
|
|
+ getAccurate
|
|
|
+} from "@/api/boxManagement/buyContainer";
|
|
|
+import dicSelect from "@/components/dicSelect/main";
|
|
|
+import checkSchedule from "@/components/checkH/checkSchedule.vue";
|
|
|
+import businessReports from "@/components/boxManagement/businessReports.vue";
|
|
|
+import reports from "@/components/boxManagement/reports.vue";
|
|
|
+import { bfeesList } from "@/api/iosBasicData/bfees";
|
|
|
+import {
|
|
|
+ dateFormat
|
|
|
+} from "@/util/date";
|
|
|
+import {
|
|
|
+ bcurrencyGetExrate
|
|
|
+} from "@/api/iosBasicData/rateManagement";
|
|
|
+import {
|
|
|
+ getToken
|
|
|
+} from "@/util/auth";
|
|
|
+import _ from "lodash";
|
|
|
+import {
|
|
|
+ Header
|
|
|
+} from "element-ui";
|
|
|
+export default {
|
|
|
+ name: "detailsPage",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ rtDialog: false,
|
|
|
+ itemCIds: null,
|
|
|
+ feeType: null,
|
|
|
+ selectionList: [],
|
|
|
+ selectionfeedList: [],
|
|
|
+ selectionfeecList: [],
|
|
|
+ checkId: '', // 审核需要的id
|
|
|
+ batchNo: '',
|
|
|
+ checkScheduleDialog: false, // 审核弹窗
|
|
|
+ editButton: false,
|
|
|
+ editDisabled: false,
|
|
|
+ form: {
|
|
|
+ type: "OW-HY",
|
|
|
+ dc: 'd',
|
|
|
+ pickupFee: 50,
|
|
|
+ boxCondition: '新',
|
|
|
+ conditions: 'CW',
|
|
|
+ freeDay: 30,
|
|
|
+ rentTermList: [{
|
|
|
+ curCode: 'USD',
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ curCode: 'USD',
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ curCode: 'USD',
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ curCode: 'USD',
|
|
|
+ $cellEdit: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ feeCenterListD: [],
|
|
|
+ feeCenterListC: [],
|
|
|
+ oldForm: {},
|
|
|
+ optionForm: {
|
|
|
+ menuBtn: false,
|
|
|
+ span: 6,
|
|
|
+ disabled: false,
|
|
|
+ labelWidth: 120,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: 'USER',
|
|
|
+ prop: 'purchaseCompanyName',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '地址',
|
|
|
+ prop: 'address',
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '电话',
|
|
|
+ prop: 'tel',
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '联系人',
|
|
|
+ prop: 'contacts',
|
|
|
+ disabled: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '箱型',
|
|
|
+ prop: 'boxTypeQuantityOne',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '箱量',
|
|
|
+ prop: 'boxNumber',
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Pickup fee',
|
|
|
+ prop: 'dc',
|
|
|
+ disabled: false,
|
|
|
+ placeholder: '请选择 收付',
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '收',
|
|
|
+ value: 'd',
|
|
|
+ }, {
|
|
|
+ label: '付',
|
|
|
+ value: 'c',
|
|
|
+ }],
|
|
|
+ span: 4
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ labelWidth: 0,
|
|
|
+ placeholder: '请输入 Pickup fee',
|
|
|
+ prop: 'pickupFee',
|
|
|
+ disabled: false,
|
|
|
+ span: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Condition',
|
|
|
+ prop: 'conditions',
|
|
|
+ type: 'select',
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=conditions",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Free day',
|
|
|
+ prop: 'freeDay',
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'LOLO-POL',
|
|
|
+ prop: 'loloPol',
|
|
|
+ type: 'select',
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=lolo",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'LOLO-POD',
|
|
|
+ prop: 'loloPod',
|
|
|
+ type: 'select',
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=lolo",
|
|
|
+ props: {
|
|
|
+ label: "dictValue",
|
|
|
+ value: "dictValue"
|
|
|
+ },
|
|
|
+ disabled: false,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Per Diem after free days',
|
|
|
+ prop: 'perDiemAfterFreeDays',
|
|
|
+ disabled: false,
|
|
|
+ labelWidth: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'DRV',
|
|
|
+ prop: 'drv',
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'DPP',
|
|
|
+ prop: 'dpp',
|
|
|
+ disabled: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'The rest as per our agreement',
|
|
|
+ prop: 'agreement',
|
|
|
+ disabled: false,
|
|
|
+ labelWidth: 180,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remarks',
|
|
|
+ type: 'textarea',
|
|
|
+ disabled: false,
|
|
|
+ minRows: 2,
|
|
|
+ span: 6
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ optionForm2: {
|
|
|
+ menuBtn: false,
|
|
|
+ span: 5,
|
|
|
+ disabled: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [{
|
|
|
+ label: '系统号',
|
|
|
+ prop: 'sysNo',
|
|
|
+ disabled: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '制单人',
|
|
|
+ prop: "createUserName",
|
|
|
+ disabled: true,
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '制单日期',
|
|
|
+ prop: "createTime",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '修改人',
|
|
|
+ prop: "updateUserName",
|
|
|
+ disabled: true,
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '修改日期',
|
|
|
+ prop: "updateTime",
|
|
|
+ disabled: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ sumData: [],
|
|
|
+ sumOption: {
|
|
|
+ border: true,
|
|
|
+ align: 'center',
|
|
|
+ menuAlign: 'center',
|
|
|
+ menu: false,
|
|
|
+ header: false,
|
|
|
+ addBtn: false,
|
|
|
+ // height: '100px',
|
|
|
+ column: [{
|
|
|
+ label: '客户',
|
|
|
+ prop: 'corpCnName',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '本币应收',
|
|
|
+ prop: 'rmbD',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '本币应付',
|
|
|
+ prop: 'rmbC',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '外币应收',
|
|
|
+ prop: 'usdD',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '外币应付',
|
|
|
+ prop: 'usdC',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '合计应收',
|
|
|
+ prop: 'sumD',
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '合计应付',
|
|
|
+ prop: 'sumC',
|
|
|
+ overHidden: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ 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: 'emptyRate',
|
|
|
+ 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,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ roleName: [],
|
|
|
+ deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ dicSelect,
|
|
|
+ checkSchedule,
|
|
|
+ businessReports,
|
|
|
+ reports
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ detailData: Object
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.roleName = localStorage.getItem('roleName').split(',')
|
|
|
+ if (this.detailData && this.detailData.id) {
|
|
|
+ // this.editButton = true
|
|
|
+ // this.editDisabled = true
|
|
|
+ // this.optionForm.disabled = true
|
|
|
+ this.getDetail(this.detailData.id)
|
|
|
+ }
|
|
|
+ // if (this.$route.query.params) {
|
|
|
+ // this.getDetail(this.$route.query.params)
|
|
|
+ // }
|
|
|
+ // if (this.detailData.copyId) {
|
|
|
+ // this.getCopydate(this.detailData.copyId)
|
|
|
+ // }
|
|
|
+ // this.saveLocalCurrency(this.deptId)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ verifyChange(name, row) {
|
|
|
+ if (row[name]) {
|
|
|
+ getAccurate({ accurate: row[name] }).then(res => {
|
|
|
+ if (res.data.data.records.length == 0) {
|
|
|
+ const regex = /^([a-zA-Z]{4})([0-9]{7})$/;
|
|
|
+ if (regex.test(row[name])) {
|
|
|
+ if (this.calculateCheckDigit(row[name]) == row[name][10]) {
|
|
|
+ // this.$message.success('集装箱校验正确!')
|
|
|
+ } else {
|
|
|
+ this.$confirm(`箱号:${row[name]}是否强制加入系统?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '删除成功!'
|
|
|
+ // });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$set(row, [name], null)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$confirm(`箱号:${row[name]}是否强制加入系统?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '删除成功!'
|
|
|
+ // });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$set(row, [name], null)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ calculateCheckDigit(containerNo) {
|
|
|
+ let charCode = "0123456789A?BCDEFGHIJK?LMNOPQRSTU?VWXYZ";
|
|
|
+ let num = 0;
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ let idx = charCode.indexOf(containerNo[i]);
|
|
|
+ idx = idx * Math.pow(2, i);
|
|
|
+ num += idx;
|
|
|
+ }
|
|
|
+ return num = (num % 11) % 10;
|
|
|
+ },
|
|
|
+ openRtDialog() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error("请保存数据");
|
|
|
+ }
|
|
|
+ this.rtDialog = true
|
|
|
+ },
|
|
|
+ getSum() {
|
|
|
+ let sumArr = []
|
|
|
+ let corpArr = []
|
|
|
+ let newArr = []
|
|
|
+ this.sumData = []
|
|
|
+ sumArr = this.feeCenterListD.concat(this.feeCenterListC)
|
|
|
+ sumArr.forEach(e => {
|
|
|
+ if (e.shortName) {
|
|
|
+ corpArr.push(e.shortName)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ newArr = [... new Set(corpArr)]
|
|
|
+ newArr.forEach(e => {
|
|
|
+ let rmbD = 0
|
|
|
+ let rmbC = 0
|
|
|
+ let usdD = 0
|
|
|
+ let usdC = 0
|
|
|
+ let sumD = 0
|
|
|
+ let sumC = 0
|
|
|
+ sumArr.forEach(item => {
|
|
|
+ if (e == item.shortName) {
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'D') {
|
|
|
+ rmbD += Number(item.amountCNY ? item.amountCNY : 0)
|
|
|
+ sumD += Number(item.amountCNY ? item.amountCNY : 0)
|
|
|
+ }
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'C') {
|
|
|
+ rmbC += Number(item.amountCNY ? item.amountCNY : 0)
|
|
|
+ sumC += Number(item.amountCNY ? item.amountCNY : 0)
|
|
|
+ }
|
|
|
+ if (item.curCode != this.getLocalCurrency() && item.dc == 'D') {
|
|
|
+ usdD += Number(item.amountUSD ? item.amountUSD : 0)
|
|
|
+ sumD += Number(item.amountUSD ? item.amountUSD : 0) * Number(item.exrate ? item.exrate : 0)
|
|
|
+ }
|
|
|
+ if (item.curCode != this.getLocalCurrency() && item.dc == 'C') {
|
|
|
+ usdC += Number(item.amountUSD ? item.amountUSD : 0)
|
|
|
+ sumC += Number(item.amountUSD ? item.amountUSD : 0) * Number(item.exrate ? item.exrate : 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.sumData.push({
|
|
|
+ corpCnName: e,
|
|
|
+ rmbD: _.round(rmbD, 2),
|
|
|
+ rmbC: _.round(rmbC, 2),
|
|
|
+ usdD: _.round(usdD, 2),
|
|
|
+ usdC: _.round(usdC, 2),
|
|
|
+ sumD: _.round(sumD, 2),
|
|
|
+ sumC: _.round(sumC, 2)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ countChange(row) {
|
|
|
+ if (row.curCode == this.getLocalCurrency()) {
|
|
|
+ row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
|
|
|
+ row.amountUSD = 0
|
|
|
+ } else {
|
|
|
+ row.amountCNY = 0
|
|
|
+ row.amountUSD = _.round(_.multiply(row.price, row.quantity), 2)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dicChange(name, row) {
|
|
|
+ if (name == 'purchaseCompanyName') {
|
|
|
+ if (row) {
|
|
|
+ this.form.purchaseCompanyId = row.id
|
|
|
+ } else {
|
|
|
+ this.form.purchaseCompanyId = null
|
|
|
+ this.form.purchaseCompanyName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowEdit(row) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ if (!row.riseDays || Number(row.riseDays) == 0) {
|
|
|
+ return this.$message.error("起必须大于0");
|
|
|
+ }
|
|
|
+ if (!row.stopDays || Number(row.stopDays) == 0) {
|
|
|
+ return this.$message.error("止必须大于0");
|
|
|
+ }
|
|
|
+ if (!row.curCode) {
|
|
|
+ return this.$message.error("请完善币别");
|
|
|
+ }
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rtAddRow() {
|
|
|
+ this.form.rentTermList.push({
|
|
|
+ pid: this.form.id,
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ rtSubmit() {
|
|
|
+ for (let row of this.form.rentTermList) {
|
|
|
+ if (Number(row.riseDays) == 0) {
|
|
|
+ return this.$message.error("起必须大于0");
|
|
|
+ }
|
|
|
+ if (Number(row.stopDays) == 0) {
|
|
|
+ return this.$message.error("止必须大于0");
|
|
|
+ }
|
|
|
+ if (!row.curCode) {
|
|
|
+ return this.$message.error("请完善币别");
|
|
|
+ }
|
|
|
+ if (this.form.rentTermList[0].curCode != row.curCode) {
|
|
|
+ return this.$message.error("币别要保持一致");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submitRtList(this.form.rentTermList).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.form.rentTermList = res.data.data
|
|
|
+ this.rtDialog = false
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ getDetail(id) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ detail({
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCopydate(id) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ copyAgent({
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ inEdit() {
|
|
|
+ this.editButton = false
|
|
|
+ if (this.form.status == '录入') {
|
|
|
+ this.editDisabled = false
|
|
|
+ this.optionForm.disabled = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowDel(row, index) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ renttermRemove({
|
|
|
+ ids: row.id
|
|
|
+ }).then(res => {
|
|
|
+ this.form.rentTermList.splice(index, 1);
|
|
|
+ this.$message.success("成功删除");
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.form.rentTermList.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submit(type) {
|
|
|
+ this.$refs["form"].validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ submit(this.form).then(res => {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ application() {
|
|
|
+ this.$confirm("确定请核数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {}
|
|
|
+ obj = {
|
|
|
+ id: this.form.id,
|
|
|
+ url: '/iosBasicData/costcenter/coc/index',
|
|
|
+ pageStatus: '',
|
|
|
+ pageLabel: '航线成本(COC)',
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ pleaseCheck(obj).then(res => {
|
|
|
+ this.$message.success("请核成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ revokeApplication() {
|
|
|
+ this.$confirm("确定撤销请核?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {}
|
|
|
+ obj = {
|
|
|
+ id: this.form.id,
|
|
|
+ }
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ repealCancel(obj).then(res => {
|
|
|
+ this.$message.success("撤销请核成功");
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ this.editDisabled = false
|
|
|
+ this.optionForm.disabled = false
|
|
|
+ }).finally(() => {
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //请核关闭
|
|
|
+ choceScheduleFun() {
|
|
|
+ this.checkScheduleDialog = false
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumn(ref, option, optionBack, code) {
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumn(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 更改表格颜色
|
|
|
+ headerClassName(tab) {
|
|
|
+ //颜色间隔
|
|
|
+ let back = ""
|
|
|
+ if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
|
+ if (tab.columnIndex % 2 === 0) {
|
|
|
+ back = "back-one"
|
|
|
+ } else if (tab.columnIndex % 2 === 1) {
|
|
|
+ back = "back-two"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return back;
|
|
|
+ },
|
|
|
+ goBack(type) {
|
|
|
+ this.$emit("goBack");
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听业务类型 如果不是分单 可以编辑分单号
|
|
|
+ 'feeCenterListD': {
|
|
|
+ // 执行方法
|
|
|
+ handler(oldValue, newValue) {
|
|
|
+ this.getSum()
|
|
|
+ },
|
|
|
+ deep: true, // 深度监听
|
|
|
+ immediate: true // 第一次改变就执行
|
|
|
+ },
|
|
|
+ // 监听箱信息数据 箱信息中有温度 自动切换 冻货
|
|
|
+ 'feeCenterListC': {
|
|
|
+ // 执行方法
|
|
|
+ handler(oldValue, newValue) {
|
|
|
+ this.getSum()
|
|
|
+ },
|
|
|
+ deep: true, // 深度监听
|
|
|
+ immediate: true // 第一次改变就执行,
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep .el-form-item__error {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-form-item {
|
|
|
+ margin-bottom: 8px !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-table .cell {
|
|
|
+ padding: 0 2px !important;
|
|
|
+
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 0px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .avue-crud .el-table .el-form-item__label {
|
|
|
+ left: -1px;
|
|
|
+}
|
|
|
+
|
|
|
+// ::v-deep#out-table .back-one {
|
|
|
+// background: #ecf5ff !important;
|
|
|
+// }
|
|
|
+
|
|
|
+// ::v-deep#out-table .back-two {
|
|
|
+// background: #ecf5ff !important;
|
|
|
+// }
|
|
|
+
|
|
|
+::v-deep #out-table .back-one {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep #out-table .back-two {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+::v-deep .el-table--small td,
|
|
|
+.el-table--small th {
|
|
|
+ padding: 2px !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-card__body {
|
|
|
+ padding: 3px 10px;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .box-card .el-card__body {
|
|
|
+ padding: 4px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.disabledBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.fontSize {
|
|
|
+ font-size: 16px;
|
|
|
+ color: #81B337;
|
|
|
+}
|
|
|
+
|
|
|
+.meetSize {
|
|
|
+ font-size: 16px;
|
|
|
+ color: #54BCBD;
|
|
|
+}
|
|
|
+</style>
|