123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977 |
- <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"
- @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} 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: {},
- leaseIn: {
- align: 'center',
- index: true,
- height: 500,
- addBtnText: "录入明细",
- refreshBtn: false,
- addBtn: true,
- selection: true,
- span: 6,
- 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,
- 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,
- 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,
- 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,
- 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: []
- },
- activeNameTwo: "first"
- }
- },
- watch: {
- listData(newVla, oldVal) {
- 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++
- },
- "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}) => {
- 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
- }
- }
- }
- this.key++
- },
- methods: {
- //生成账单
- 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.$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.$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 = "收款对象"
- } else {
- this.findObject(this.option.column, "corpName").label = "付款对象"
- }
- },
- rowSave(form, done, loading) {
- done({
- ...form,
- feesType: this.activeNameTwo === "first" ? 1 : 2,
- sort: this.dataList.length
- })
- 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);
- }
- },
- rowUpdate(form, index, done, loading) {
- done(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.$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.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- }
- }
- }
- </script>
- <style scoped>
- </style>
|