1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198 |
- <template>
- <trade-card title="费用信息">
- <el-tabs v-model="activeNameTwo" @tab-click="handleClick">
- <el-tab-pane label="应收" name="first" :key="'first'" v-if="tabShow == 1 || tabShow == 2">
- </el-tab-pane>
- <el-tab-pane label="应付" name="second" :key="'second'" v-if="tabShow == 1 || tabShow == 3">
- </el-tab-pane>
- </el-tabs>
- <avue-crud
- :option="option"
- :data="dataList"
- v-model="form"
- @row-save="rowSave"
- ref="crud"
- :key="key"
- :search.sync="search"
- :page.sync="page"
- @on-load="onLoad"
- @search-change="searchChange"
- @selection-change="selectionChange"
- @row-update="rowUpdate"
- @resetColumn="resetColumn('crud','option','optionBack',codeValue)"
- @saveColumn="saveColumn('crud','option','optionBack',codeValue)">
- <template slot-scope="{type,size,row,index}" slot="menu">
- <el-button icon="el-icon-edit" :size="size" :type="type" :disabled="row.settlementAmount > 0 || row.submitPay > 0"
- @click="$refs.crud.rowEdit(row,index)">编辑
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :type="type" :disabled="row.settlementAmount > 0 || row.submitPay > 0"
- @click="rowDel(row,index)">删除
- </el-button>
- </template>
- <template slot="menuLeft">
- <el-button
- class="el-icon-download"
- type="info"
- size="small"
- :disabled="!id || listData.length === 0"
- @click="openReport">打印
- </el-button>
- <el-button
- class="el-icon-download"
- type="warning"
- size="small"
- v-if="type !== 'BG'"
- :disabled="(selectionList.length === 0 || !(selectionList.findIndex(item => item.submitPay == '1') == -1))"
- @click="generateBill">生成账单
- </el-button>
- <el-button
- class="el-icon-download"
- type="danger"
- size="small"
- v-if="type !== 'BG'"
- :disabled="(selectionList.length === 0 || !(selectionList.findIndex(item => item.submitPay == '0') == -1))"
- @click="revokeBill">撤销账单
- </el-button>
- </template>
- <template slot="itemNameForm">
- <breakdown-select v-model="form.itemId" @selectValue="selectValue"
- :configuration="breakConfiguration"></breakdown-select>
- </template>
- <template slot="corpNameForm">
- <crop-select v-model="form.corpId" @getCorpData="getGSDataTwo" corpType="KH"/>
- </template>
- </avue-crud>
- <report-dialog
- :switchDialog="switchDialog"
- :reportId="id"
- :reportName="reportName"
- @onClose="onClose()"
- />
- </trade-card>
- </template>
- <script>
- import {
- tradingBoxFees,
- generateBill,
- revokeBill,
- tradingBoxFeesList,
- transportItemFeesListdata,
- tradingBoxFeesSubmit,
- transportItemFeesSubmitdata
- } from "@/api/boxManagement";
- import reportDialog from "@/components/report-dialog/main.vue";
- import {getParities} from "@/api/basicData/customerInquiry";
- import {dateFormat} from "@/util/date";
- export default {
- name: "index",
- components: {reportDialog},
- data() {
- return {
- code: '',
- switchDialog: false,
- reportName: '',
- option: {},
- optionBack: {},
- page: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- search:{},
- leaseIn: {
- align: 'center',
- index: true,
- height: 500,
- addBtnText: "录入明细",
- refreshBtn: false,
- addBtn: true,
- selection: true,
- span: 6,
- searchMenuSpan: 18,
- dialogTop: "25%",
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogDrag: true,
- dialogWidth: "80%",
- showSummary: true,
- sumColumnList: [{
- name: 'quantity',
- type: 'sum',
- decimals: 0
- }, {
- name: 'amount',
- type: 'sum',
- decimals: 2
- }, {
- name: 'settlementAmount',
- type: 'sum',
- decimals: 2
- }],
- column: [{
- label: '账单状态',
- prop: 'submitPay',
- width: 100,
- overHidden: true,
- filterable: true,
- display:false,
- dataType: 'number',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=billing_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '收款对象',
- prop: 'corpName',
- overHidden: true,
- width: 160,
- rules: [{
- required: true,
- message: "请选择收款对象",
- trigger: "blur"
- }]
- }, {
- label: '箱号',
- prop: 'code',
- width: 140,
- search:true,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: `/api/blade-box-tube/archives/selectArchivesByCodeList?code=${this.code}`,
- props: {
- label: "code",
- value: "code"
- },
- }, {
- label: '费用名称',
- prop: 'itemName',
- overHidden: true,
- width: 120
- }, {
- label: '币别',
- prop: 'currency',
- width: 100,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- }, {
- label: '汇率',
- prop: 'exchangeRate',
- width: 100,
- type: 'number',
- disabled: true,
- overHidden: true,
- controls: false,
- precision: 4
- }, {
- label: '单价',
- prop: 'price',
- type: 'number',
- overHidden: true,
- precision: 2,
- controls: false,
- width: 140
- }, {
- label: '数量',
- prop: 'quantity',
- type: 'number',
- precision: 0,
- value: 1,
- controls: false,
- overHidden: true,
- width: 100
- }, {
- label: '金额',
- prop: 'amount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- }, {
- label: '日期起',
- prop: 'rentStartDate',
- width: 100,
- overHidden: true,
- type: "date",
- disabled: true,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '日期止',
- prop: 'rentEndDate',
- width: 100,
- disabled: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '结算金额',
- prop: 'settlementAmount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- }, {
- label: '结算时间',
- prop: 'settlementDate',
- width: 100,
- disabled: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '业务类型',
- prop: 'billType',
- display: false,
- width: 100
- }, {
- label: '生成账单日期',
- prop: 'expenseGenerationTime',
- width: 100,
- overHidden: true,
- type: "date",
- display: false,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '备注',
- prop: 'remarks',
- type: 'textarea',
- overHidden: true,
- minRows: 3,
- span: 24,
- width: 200
- }]
- },
- boxTube: {
- align: 'center',
- index: true,
- selection: true,
- height: 500,
- addBtnText: "录入明细",
- refreshBtn: false,
- addBtn: true,
- span: 6,
- searchMenuSpan: 18,
- dialogTop: "25%",
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogDrag: true,
- dialogWidth: "80%",
- showSummary: true,
- sumColumnList: [{
- name: 'quantity',
- type: 'sum',
- decimals: 0
- }, {
- name: 'amount',
- type: 'sum',
- decimals: 2
- }, {
- name: 'settlementAmount',
- type: 'sum',
- decimals: 2
- }],
- column: [{
- label: '账单状态',
- prop: 'submitPay',
- width: 100,
- overHidden: true,
- filterable: true,
- display: false,
- dataType: 'number',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=billing_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '收款对象',
- prop: 'corpName',
- overHidden: true,
- width: 160,
- rules: [{
- required: true,
- message: "请选择收款对象",
- trigger: "blur"
- }]
- }, {
- label: '箱号',
- prop: 'code',
- width: 140,
- search:true,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: `/api/blade-box-tube/archives/selectArchivesByCodeList?code=${this.code}`,
- props: {
- label: "code",
- value: "code"
- },
- }, {
- label: '费用名称',
- prop: 'itemName',
- overHidden: true,
- width: 120
- }, {
- label: '币别',
- prop: 'currency',
- width: 100,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- }, {
- label: '汇率',
- prop: 'exchangeRate',
- width: 100,
- type: 'number',
- disabled: true,
- overHidden: true,
- controls: false,
- precision: 4
- }, {
- label: '单价',
- prop: 'price',
- type: 'number',
- overHidden: true,
- precision: 2,
- controls: false,
- width: 140
- }, {
- label: '数量',
- prop: 'quantity',
- type: 'number',
- precision: 0,
- value: 1,
- controls: false,
- overHidden: true,
- width: 100
- }, {
- label: '金额',
- prop: 'amount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- }, {
- label: '结算金额',
- prop: 'settlementAmount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- }, {
- label: '结算时间',
- prop: 'settlementDate',
- width: 100,
- disabled: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '对账金额',
- prop: 'reconciliationAmount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- }, {
- label: '对账时间',
- prop: 'reconciliationDate',
- width: 100,
- disabled: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '业务类型',
- prop: 'billType',
- display: false,
- width: 100
- }, {
- label: '生成账单日期',
- prop: 'expenseGenerationTime',
- width: 100,
- overHidden: true,
- type: "date",
- display: false,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- }, {
- label: '备注',
- prop: 'remarks',
- type: 'textarea',
- overHidden: true,
- minRows: 3,
- span: 24,
- width: 200
- }]
- },
- customsList: {
- align: 'center',
- index: true,
- selection: true,
- height: 500,
- addBtnText: "录入明细",
- refreshBtn: false,
- addBtn: true,
- span: 6,
- searchMenuSpan: 18,
- dialogTop: "25%",
- addRowBtn: false,
- cellBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogDrag: true,
- dialogWidth: "80%",
- showSummary: true,
- sumColumnList: [{
- name: 'quantity',
- type: 'sum',
- decimals: 0
- },{
- name: 'amount',
- type: 'sum',
- decimals: 2
- },{
- name: 'settlementAmount',
- type: 'sum',
- decimals: 2
- }],
- column: [{
- label: '账单状态',
- prop: 'submitPay',
- width: 100,
- overHidden: true,
- filterable: true,
- display: false,
- dataType: 'number',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=billing_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '收款对象',
- prop: 'corpName',
- overHidden: true,
- width: 160,
- rules: [{
- required: true,
- message: "请选择收款对象",
- trigger: "blur"
- }]
- }, {
- label: '费用名称',
- prop: 'itemName',
- overHidden: true,
- width: 120
- }, {
- label: '币别',
- prop: 'currency',
- width: 100,
- overHidden: true,
- filterable: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- }, {
- label: '汇率',
- prop: 'exchangeRate',
- width: 100,
- type: 'number',
- disabled: true,
- overHidden: true,
- controls: false,
- precision: 4
- }, {
- label: '单价',
- prop: 'price',
- type: 'number',
- overHidden: true,
- precision: 2,
- controls: false,
- width: 140
- }, {
- label: '数量',
- prop: 'quantity',
- type: 'number',
- precision: 0,
- value: 1,
- controls: false,
- overHidden: true,
- width: 100
- }, {
- label: '金额',
- prop: 'amount',
- type: 'number',
- precision: 2,
- disabled: true,
- controls: false,
- overHidden: true,
- width: 140
- },
- // {
- // label: '结算金额',
- // prop: 'settlementAmount',
- // type: 'number',
- // precision: 2,
- // disabled: true,
- // controls: false,
- // overHidden: true,
- // width: 140
- // }, {
- // label: '结算时间',
- // prop: 'settlementDate',
- // width: 100,
- // disabled: true,
- // overHidden: true,
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss"
- // }, {
- // label: '业务类型',
- // prop: 'billType',
- // display:false,
- // width: 100
- // },
- {
- label: '生成账单日期',
- prop: 'expenseGenerationTime',
- width: 100,
- overHidden: true,
- type: "date",
- display: false,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: '备注',
- prop: 'remark',
- type: 'textarea',
- overHidden: true,
- minRows: 3,
- span: 24
- }]
- },
- dataList: [],
- form: {},
- key: 0,
- data_one: [],
- data_two: [],
- selectionList: [],
- breakConfiguration: {
- multipleChoices: false,
- multiple: false,
- disabled: false,
- searchShow: true,
- collapseTags: false,
- clearable: true,
- placeholder: "请点击右边按钮选择",
- dicData: []
- },
- onetotal:0,
- twototal:0,
- activeNameTwo: "first"
- }
- },
- watch: {
- listData(newVla, oldVal) {
- console.log(this.listData,625)
- if(this.type == 'CK' || this.type == 'JK') {
- console.log('出口')
- this.transportItemFeesListdatafun(1)
- this.transportItemFeesListdatafun(2)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- console.log('4ge')
- this.tradingBoxFeesListfun(1)
- this.tradingBoxFeesListfun(2)
- }else {
- this.data_one = newVla.filter(item => item.feesType === 1); //应收
- this.data_two = newVla.filter(item => item.feesType === 2); //应付
- if (this.activeNameTwo === "first") {
- this.dataList = this.data_one;
- } else {
- this.dataList = this.data_two;
- }
- this.key++
- }
- },
- // 分页
- "page.currentPage":{
- handler(newVla,oldVal) {
- if(this.type == 'CK' || this.type == 'JK') {
- this.transportItemFeesListdatafun(1)
- this.transportItemFeesListdatafun(2)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- this.tradingBoxFeesListfun(1)
- this.tradingBoxFeesListfun(2)
- }
- },
- },
- "page.pageSize":{
- handler(newVla,oldVal) {
- if(this.type == 'CK' || this.type == 'JK') {
- this.transportItemFeesListdatafun(1)
- this.transportItemFeesListdatafun(2)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- this.tradingBoxFeesListfun(1)
- this.tradingBoxFeesListfun(2)
- }
- },
- },
- "option.menu":{
- handler(newVla,oldVal) {
- if (newVla !== oldVal) {
- this.key++
- }
- },
- },
- code(newVla, oldVal) {
- if (this.code){
- this.findObject(this.option.column, "code").dicUrl = `/api/blade-box-tube/archives/selectArchivesByCodeList?code=${this.code}`
- }
- this.key++
- },
- activeNameTwo(newVla, oldVal) {
- if (newVla !== oldVal) {
- if (newVla === "first") {
- this.data_two = this.dataList;
- this.dataList = this.data_one;
- } else {
- this.data_one = this.dataList;
- this.dataList = this.data_two;
- }
- }
- }
- },
- model: {
- prop: "listData",
- event: "callBack"
- },
- props: {
- listData: {
- type: Array,
- default: function () {
- return [];
- }
- },
- codeValue: {
- type: String
- },
- type:{
- type: String
- },
- url: {
- type: String
- },
- // 1.显示全部 2.收费 3.付费
- tabShow: {
- type: Number,
- default: 1
- },
- activeName: {
- type: String,
- default: 'first'
- },
- id: {
- type: String
- }
- },
- async created() {
- if (this.type === 'BG'){
- this.optionBack = this.customsList
- }else if (this.type === 'ZR' || this.type === 'ZC' || this.type === 'DCF'){
- this.optionBack = this.leaseIn
- }else {
- this.optionBack = this.boxTube
- }
- if (!this.codeValue) this.codeValue = 235.2
- // 判断activeNameTwo默认的显示
- this.activeNameTwo = this.activeName
- this.option = await this.getColumnData(this.getColumnName(this.codeValue), this.optionBack);
- if (this.activeNameTwo === "first") {
- this.findObject(this.option.column, "corpName").label = "收款对象"
- } else {
- this.findObject(this.option.column, "corpName").label = "付款对象"
- }
- this.findObject(this.option.column, "price").change = ({value, column}) => {
- console.log(value,this.form.quantity,this.form.exchangeRate,702)
- if (value && this.form.quantity) {
- if (this.form.exchangeRate) {
- // 之前的金额要乘汇率
- // this.form.amount = value * this.form.quantity * this.form.exchangeRate
- // 现在的金额计算不需要乘汇率
- this.form.amount = value * this.form.quantity
- } else {
- this.form.amount = value * this.form.quantity
- }
- }
- }
- this.findObject(this.option.column, "currency").change = ({value, column}) => {
- for (let item of this.$refs.crud.DIC.currency) {
- if (item.dictValue == value) {
- getParities({
- currency: value,
- businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
- }).then(res => {
- this.form.exchangeRate = res.data.data.receiptsParities
- })
- if (this.form.price && this.form.quantity) {
- this.form.amount = this.form.price * this.form.quantity * item.remark
- }
- }
- }
- }
- this.findObject(this.option.column, "quantity").change = ({value, column}) => {
- if (this.form.price && value) {
- if (this.form.exchangeRate) {
- this.form.amount = this.form.price * value * this.form.exchangeRate
- } else {
- this.form.amount = this.form.price * value
- }
- }
- }
- this.key++
- this.option.selectable = (row, index) => {
- return row.id;
- }
- },
- methods: {
- onLoad(page, params = {}){
- this.page.currentPage = page.currentPage
- this.page.pageSize = page.pageSize
- },
- // 搜索
- searchChange(form,dome){
- console.log(form,809)
- this.page.currentPage = 1
- this.page.pageSize = 20
- let feesType = null
- if (this.activeNameTwo === "first"){
- feesType = 1
- }else {
- feesType = 2
- }
- if(this.type == 'CK' || this.type == 'JK') {
- this.transportItemFeesListdatafun(feesType,form)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- this.tradingBoxFeesListfun(feesType,form)
- }
- dome()
- },
- // 租出,租入,卖箱,买箱的接口
- tradingBoxFeesListfun(feesType,params = {}){
- if (!this.id) {
- return
- }
- tradingBoxFeesList({
- ...params,
- current: this.page.currentPage,
- size: this.page.pageSize,
- pid:this.id,
- feesType:feesType
- }).then(res=>{
- if (feesType == 1) {
- // this.page.total = res.data.data.total
- this.onetotal = res.data.data.total
- this.data_one = res.data.data.records
- }else {
- // this.page.total = res.data.data.total
- this.twototal = res.data.data.total
- this.data_two = res.data.data.records
- }
- if (this.activeNameTwo === "first") {
- this.page.total = this.onetotal
- this.dataList = this.data_one;
- } else {
- this.page.total = this.twototal
- this.dataList = this.data_two;
- }
- this.key++
- })
- },
- // 出口进口的费用接口
- transportItemFeesListdatafun(feesType,params = {}){
- if (!this.id) {
- return
- }
- transportItemFeesListdata({
- ...params,
- current: this.page.currentPage,
- size: this.page.pageSize,
- pid:this.id,
- feesType:feesType
- }).then(res=>{
- if (feesType == 1) {
- // this.page.total = res.data.data.total
- this.onetotal = res.data.data.total
- this.data_one = res.data.data.records
- }else {
- // this.page.total = res.data.data.total
- this.twototal = res.data.data.total
- this.data_two = res.data.data.records
- }
- if (this.activeNameTwo === "first") {
- this.page.total = this.onetotal
- this.dataList = this.data_one;
- } else {
- this.page.total = this.twototal
- this.dataList = this.data_two;
- }
- this.key++
- })
- },
- //生成账单
- generateBill(){
- 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)'
- });
- const data = {
- id: this.id,
- type:this.type,
- transportItemFeesList:this.selectionList,
- tradingBoxFeesList:this.selectionList
- }
- generateBill(data).then(rest => {
- loading.close();
- this.$message.success('生成成功')
- this.$parent.refresh(this.id)
- this.selectionList = []
- this.$emit("generateBill")
- }).catch(() => {
- loading.close();
- })
- })
- },
- //撤销账单
- revokeBill(){
- 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)'
- });
- const data = {
- id: this.id,
- type:this.type,
- transportItemFeesList:this.selectionList,
- tradingBoxFeesList:this.selectionList
- }
- revokeBill(data).then(rest => {
- loading.close();
- this.$message.success('撤销成功')
- this.$parent.refresh(this.id)
- this.selectionList = []
- this.$emit("generateBill")
- }).catch(() => {
- loading.close();
- })
- })
- },
- // 选中表格的时候触发 反的是选中的数组
- selectionChange(list) {
- this.selectionList = list
- },
- // 打印
- openReport() {
- for (let item of this.listData) {
- if (!item.id) {
- this.$confirm("有未保存的费用,是否继续打印?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (this.type === "CK" || this.type === "JK") {
- if (this.activeNameTwo === "first") {
- this.reportName = "收款费用详情(进出口)"
- }else {
- this.reportName = "付款费用详情(进出口)"
- }
- }else {
- if (this.activeNameTwo === "first"){
- this.reportName = "收款费用详情(箱管)"
- }else {
- this.reportName = "付款费用详情(箱管)"
- }
- }
- this.switchDialog = true
- })
- }
- }
- if (this.type === "CK" || this.type === "JK"){
- if (this.activeNameTwo === "first"){
- this.reportName = "收款费用详情(进出口)"
- }else {
- this.reportName = "付款费用详情(进出口)"
- }
- }else {
- if (this.activeNameTwo === "first"){
- this.reportName = "收款费用详情(箱管)"
- }else {
- this.reportName = "付款费用详情(箱管)"
- }
- }
- this.switchDialog = true
- },
- // 报表关闭
- onClose(val) {
- this.switchDialog = val;
- },
- handleClick(tab, event) {
- this.activeNameTwo = tab.name
- if (tab.name === "first") {
- this.findObject(this.option.column, "corpName").label = "收款对象"
- this.page.total = this.onetotal
- } else {
- this.findObject(this.option.column, "corpName").label = "付款对象"
- this.page.total = this.twototal
- }
- },
- // 新增按钮事件
- rowSave(form, done, loading) {
- done({
- ...form,
- feesType: this.activeNameTwo === "first" ? 1 : 2,
- sort: this.dataList.length
- })
- console.log(form,976)
- if(this.type == 'CK' || this.type == 'JK') {
- this.transportItemFeesSubmitdatafun(form)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- this.tradingBoxFeesSubmitfun(form)
- }
- // if (this.activeNameTwo === "first") {
- // this.dataList = this.dataList.concat(this.data_two)
- // this.$emit("callBack", this.dataList);
- // } else {
- // this.dataList = this.dataList.concat(this.data_one)
- // this.$emit("callBack", this.dataList);
- // }
- },
- // 买箱,卖箱,租入,租出,堆存管理 添加和保存
- tradingBoxFeesSubmitfun(form){
- let feesType = null
- if (this.activeNameTwo === "first") {
- feesType = 1
- } else {
- feesType = 2
- }
- tradingBoxFeesSubmit({
- ...form,
- pid:this.id,
- feesType:feesType
- }).then(res=>{
- if (res.data.code == 200) {
- this.$message.success("操作成功!");
- this.tradingBoxFeesListfun(feesType)
- }
- })
- },
- // 出口装运,进口装运的接口
- transportItemFeesSubmitdatafun(form){
- let feesType = null
- if (this.activeNameTwo === "first") {
- feesType = 1
- } else {
- feesType = 2
- }
- transportItemFeesSubmitdata({
- ...form,
- pid:this.id,
- feesType:feesType
- }).then(res=>{
- if (res.data.code == 200) {
- this.$message.success("操作成功!");
- this.transportItemFeesListdatafun(feesType)
- }
- })
- },
- // 费用信息编辑
- rowUpdate(form, index, done, loading) {
- done(form)
- if(this.type == 'CK' || this.type == 'JK') {
- this.transportItemFeesSubmitdatafun(form)
- }else if (this.type == 'ZR' || this.type == 'ZC' || this.type == 'SELL' || this.type == 'BUY' || this.type == 'DCF') {
- this.tradingBoxFeesSubmitfun(form)
- }
- // if (this.activeNameTwo === "first") {
- // this.$emit("callBack", this.dataList.concat(this.data_two));
- // } else {
- // this.$emit("callBack", this.data_one.concat(this.dataList));
- // }
- },
- // 明细删除
- rowDel(row, index) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxFees(row.id, this.url ? this.url : "/api/blade-box-tube/tradingBoxFees/remove").then(res => {
- if (res.data.success) {
- this.dataList.splice(index, 1);
- this.$message.success("操作成功!");
- if (this.activeNameTwo === "first") {
- this.$emit("callBack", this.dataList.concat(this.data_two));
- } else {
- this.$emit("callBack", this.data_one.concat(this.dataList));
- }
- }
- });
- } else {
- this.dataList.splice(index, 1);
- this.$message.success("操作成功!");
- if (this.activeNameTwo === "first") {
- this.$emit("callBack", this.dataList.concat(this.data_two));
- } else {
- this.$emit("callBack", this.data_one.concat(this.dataList));
- }
- }
- });
- },
- //选择费用名称
- selectValue(value) {
- this.form.itemName = value.cname
- },
- getGSDataTwo(row) {
- this.form.corpName = row.cname
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- this.option.selectable = (row, index) => {
- return row.id;
- }
- //关闭窗口
- 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]);
- this.$emit("resetTrigger")
- if (inSave) {
- this.findObject(this.option.column, "price").change = ({value, column}) => {
- if (value && this.form.quantity) {
- if (this.form.exchangeRate) {
- this.form.amount = value * this.form.quantity * this.form.exchangeRate
- } else {
- this.form.amount = value * this.form.quantity
- }
- }
- }
- this.findObject(this.option.column, "currency").change = ({value, column}) => {
- for (let item of this.$refs.crud.DIC.currency) {
- if (item.dictValue == value) {
- getParities({
- currency: value,
- businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
- }).then(res => {
- this.form.exchangeRate = res.data.data.receiptsParities
- })
- if (this.form.price && this.form.quantity) {
- this.form.amount = this.form.price * this.form.quantity * item.remark
- }
- }
- }
- }
- this.findObject(this.option.column, "quantity").change = ({value, column}) => {
- if (this.form.price && value) {
- if (this.form.exchangeRate) {
- this.form.amount = this.form.price * value * this.form.exchangeRate
- } else {
- this.form.amount = this.form.price * value
- }
- }
- }
- if (this.activeNameTwo === "first") {
- this.findObject(this.option.column, "corpName").label = "收款对象"
- } else {
- this.findObject(this.option.column, "corpName").label = "付款对象"
- }
- this.option.selectable = (row, index) => {
- return row.id;
- }
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- }
- }
- }
- </script>
- <style scoped>
- </style>
|