123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- <template>
- <div>
- <avue-crud :option="optionD" :table-loading="loading" :data="form.feeCenterListD" id="out-table" ref="crudD"
- @selection-change="selectionDChange" @resetColumn="resetColumn('crudD', 'optionD', 'optionDBack', 381)"
- @saveColumn="saveColumn('crudD', 'optionD', 'optionDBack', 381)">
- <template slot="menuLeft">
- <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
- <i class="el-icon-coin"></i>
- <span>应收费用</span>
- </div>
- <el-button type="info" plain size="small" :disabled="disabled"
- @click="allClick('一键保存', 'D')">一键保存</el-button>
- <el-button type="info" plain size="small" :disabled="disabled"
- @click="allClick('一键编辑', 'D')">一键编辑</el-button>
- <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
- @click="allClick('批量删除', 'D')">批量删除</el-button>
- <el-button type="primary" plain size="small" :disabled="disabled || selectionDList.length == 0"
- @click="allClick('生成账单', 'D')">生成账单</el-button>
- <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
- @click="allClick('撤销账单', 'D')">撤销账单</el-button>
- <!-- <el-button type="primary" plain size="small" :disabled="disabled"
- @click="allClick('打印账单', 'D')">打印账单</el-button>
- <el-button type="success" plain size="small" :disabled="disabled"
- @click="allClick('应收模板', 'D')">应收模板</el-button>
- <el-button type="primary" plain size="small" :disabled="disabled"
- @click="allClick('生成应收', 'D')">生成应收</el-button> -->
- </template>
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('D')">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="corpCnName" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
- res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
- <span v-else>{{ row.corpCnName }}</span>
- </template>
- <template slot="feeCnName" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
- res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="unitNo" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
- url="/blade-los/bunits/selectList" :filterable="true"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <span v-else>{{ row.unitNo }}</span>
- </template>
- <tempalte slot="quantity" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
- placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.quantity }}</span>
- </tempalte>
- <tempalte slot="price" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
- placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.price }}</span>
- </tempalte>
- <template slot="curCode" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
- :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
- @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
- <span v-else>{{ row.curCode }}</span>
- </template>
- <tempalte slot="exrate" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
- placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.exrate }}</span>
- </tempalte>
- <tempalte slot="stlExrate" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" :controls="false" placeholder="请输入 结算汇率"
- size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.stlExrate }}</span>
- </tempalte>
- </avue-crud>
- <avue-crud style="margin-top: 10px;" :option="optionC" :table-loading="loading" :data="form.feeCenterListC"
- id="out-table" ref="crudC" @selection-change="selectionCChange"
- @resetColumn="resetColumn('crudC', 'optionC', 'optionCBack', 382)"
- @saveColumn="saveColumn('crudC', 'optionC', 'optionCBack', 382)">
- <template slot="menuLeft">
- <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
- <i class="el-icon-coin"></i>
- <span>应付费用</span>
- </div>
- <el-button type="info" plain size="small" :disabled="disabled"
- @click="allClick('一键保存', 'C')">一键保存</el-button>
- <el-button type="info" plain size="small" :disabled="disabled"
- @click="allClick('一键编辑', 'C')">一键编辑</el-button>
- <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
- @click="allClick('批量删除', 'C')">批量删除</el-button>
- <el-button type="primary" plain size="small" :disabled="disabled || selectionCList.length == 0"
- @click="allClick('生成账单', 'C')">生成账单</el-button>
- <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
- @click="allClick('撤销账单', 'C')">撤销账单</el-button>
- <!-- <el-button type="primary" plain size="small" :disabled="disabled"
- @click="allClick('打印账单', 'C')">打印账单</el-button>
- <el-button type="success" plain size="small" :disabled="disabled"
- @click="allClick('应付模板', 'C')">应付模板</el-button>
- <el-button type="primary" plain size="small" :disabled="disabled"
- @click="allClick('生成应付', 'C')">生成应付</el-button> -->
- </template>
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('C')">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="corpCnName" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
- res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
- <span v-else>{{ row.corpCnName }}</span>
- </template>
- <template slot="feeCnName" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
- res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="unitNo" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
- url="/blade-los/bunits/selectList" :filterable="true"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <span v-else>{{ row.unitNo }}</span>
- </template>
- <tempalte slot="quantity" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
- placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.quantity }}</span>
- </tempalte>
- <tempalte slot="price" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
- placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.price }}</span>
- </tempalte>
- <template slot="curCode" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
- :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
- @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
- <span v-else>{{ row.curCode }}</span>
- </template>
- <tempalte slot="exrate" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
- placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.exrate }}</span>
- </tempalte>
- <tempalte slot="stlExrate" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" :controls="false" placeholder="请输入 结算汇率"
- size="small" style="width: 100%;"></el-input-number>
- <span v-else>{{ row.stlExrate }}</span>
- </tempalte>
- </avue-crud>
- </div>
- </template>
- <script>
- import dicSelect from "@/components/dicSelect/main";
- import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
- import { submitListTrade, feeRemove, generateBill, revokeBill } from "@/api/tradeAgency/tradeAgency";
- import _ from "lodash";
- export default {
- components: {
- dicSelect
- },
- props: {
- detailData: {},
- disabled: {
- type: Boolean,
- default: false,
- },
- form: {
- type: Object,
- default: () => {
- }
- }
- },
- data() {
- return {
- optionD: {},
- optionDBack: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 140,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- menu: false,
- refreshBtn: false,
- selection: true,
- align: 'center',
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: "账单",
- prop: "accStatus",
- width: '80',
- overHidden: true,
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }]
- },
- {
- label: "往来单位",
- prop: "corpCnName",
- width: '160',
- overHidden: true,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: '120',
- overHidden: true,
- },
- {
- label: "收费标准",
- prop: "unitNo",
- width: '120',
- overHidden: true,
- },
- {
- label: "单价",
- prop: "price",
- overHidden: true,
- },
- {
- label: "数量",
- prop: "quantity",
- overHidden: true,
- },
- {
- label: "金额",
- prop: "amount",
- overHidden: true,
- },
- {
- label: "币别",
- prop: "curCode",
- overHidden: true,
- },
- {
- label: "外币金额",
- prop: "amountLoc",
- overHidden: true,
- },
- {
- label: "汇率",
- prop: "exrate",
- overHidden: true,
- },
- {
- label: "结算汇率",
- prop: "stlExrate",
- overHidden: true,
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- width: '200',
- overHidden: true,
- },
- ]
- },
- optionC: {},
- optionCBack: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 140,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- menu: false,
- refreshBtn: false,
- selection: true,
- align: 'center',
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: "账单",
- prop: "accStatus",
- width: '80',
- overHidden: true,
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }]
- },
- {
- label: "往来单位",
- prop: "corpCnName",
- width: '160',
- overHidden: true,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: '120',
- overHidden: true,
- },
- {
- label: "收费标准",
- prop: "unitNo",
- width: '120',
- overHidden: true,
- },
- {
- label: "单价",
- prop: "price",
- overHidden: true,
- },
- {
- label: "数量",
- prop: "quantity",
- overHidden: true,
- },
- {
- label: "金额",
- prop: "amount",
- overHidden: true,
- },
- {
- label: "币别",
- prop: "curCode",
- overHidden: true,
- },
- {
- label: "外币金额",
- prop: "amountLoc",
- overHidden: true,
- },
- {
- label: "汇率",
- prop: "exrate",
- overHidden: true,
- },
- {
- label: "结算汇率",
- prop: "stlExrate",
- overHidden: true,
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- width: '200',
- overHidden: true,
- },
- ]
- },
- selectionDList: [],
- selectionCList: []
- }
- },
- async created() {
- this.optionD = await this.getColumnData(this.getColumnName(381), this.optionDBack);
- this.optionC = await this.getColumnData(this.getColumnName(382), this.optionCBack);
- },
- methods: {
- addRow(type) {
- if (!this.form.id) return this.$message.error('请保存数据');
- if (type == 'D') {
- this.form.feeCenterListD.push({
- $cellEdit: true,
- pid: this.form.id,
- dc: type,
- accStatus: 0,
- businessType: this.form.businessType,
- billNo: this.form.businessNo,
- billDate: this.form.businessDate
- })
- }
- if (type == 'C') {
- this.form.feeCenterListC.push({
- $cellEdit: true,
- pid: this.form.id,
- dc: type,
- accStatus: 0,
- businessType: this.form.businessType,
- billNo: this.form.businessNo,
- billDate: this.form.businessDate
- })
- }
- },
- countChange(row) {
- row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
- if (row.feeCnName == '首付款' || row.feeCnName == '尾款') {
- row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.exrate ? row.exrate : 0))
- }
- },
- selectionDChange(list) {
- this.selectionDList = list
- },
- selectionCChange(list) {
- this.selectionCList = list
- },
- rowDicChange(name, row, el) {
- if (name == 'corpCnName') {
- if (row) {
- el.corpId = row.id
- el.corpEnName = row.enName
- el.billCorpId = row.id
- el.billCorpCnName = row.cnName
- } else {
- el.corpId = null
- el.corpEnName = null
- el.billCorpId = null
- el.billCorpCnName = null
- }
- }
- if (name == 'feeCnName') {
- if (row) {
- el.feeId = row.id
- el.feeCode = row.code
- el.feeEnName = row.enName
- el.curCode = row.curNo
- el.elementsId = row.accElementId
- el.elementsCode = row.elementsCode
- el.elementsCnName = row.accElementName
- el.elementsEnName = row.elementsEnName
- bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
- res.data.data.forEach(e => {
- if (row.curNo == e.code) {
- this.$set(el, 'exrate', e.exrate)
- }
- })
- })
- } else {
- el.feeId = null
- el.feeCode = null
- el.feeEnName = null
- el.curCode = null
- el.elementsId = null
- el.elementsCode = null
- el.elementsCnName = null
- el.elementsEnName = null
- }
- }
- if (name == 'curCode') {
- if (row) {
- bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
- res.data.data.forEach(e => {
- if (el.curCode == e.code) {
- this.$set(el, 'exrate', e.exrate)
- }
- })
- })
- } else {
- el.exrate = null
- }
- }
- },
- allClick(name, type) {
- if (name == '一键保存') {
- if (type == 'D') {
- this.form.feeCenterListD.forEach(e => {
- this.$set(e, '$cellEdit', false)
- })
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitListTrade(this.form.feeCenterListD).then(res => {
- this.form.feeCenterListD = res.data.data
- this.$message.success("保存成功");
- }).finally(() => {
- loading.close();
- })
- }
- if (type == 'C') {
- this.form.feeCenterListC.forEach(e => {
- this.$set(e, '$cellEdit', false)
- })
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitListTrade(this.form.feeCenterListC).then(res => {
- this.form.feeCenterListC = res.data.data
- this.$message.success("保存成功");
- }).finally(() => {
- loading.close();
- })
- }
- }
- if (name == '一键编辑') {
- if (type == 'D') {
- this.form.feeCenterListD.forEach(e => {
- this.$set(e, '$cellEdit', true)
- })
- }
- if (type == 'C') {
- this.form.feeCenterListC.forEach(e => {
- this.$set(e, '$cellEdit', true)
- })
- }
- }
- if (name == '批量删除') {
- let multiList = []
- let arr = []
- for (let index in this.selectionDList) {
- if (this.selectionDList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionDList[index].$index) + 1) + "行不允许删除");
- }
- for (let index in this.selectionCList) {
- if (this.selectionCList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionCList[index].$index) + 1) + "行不允许删除");
- }
- if (type == 'D') {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- multiList = this.selectionDList
- arr = this.form.feeCenterListD
- // 获取有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)'
- });
- feeRemove({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("删除成功");
- }).finally(() => {
- loading.close();
- })
- }
- })
- }
- if (type == 'C') {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- multiList = this.selectionCList
- arr = this.form.feeCenterListC
- // 获取有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)'
- });
- feeRemove({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("删除成功");
- }).finally(() => {
- loading.close();
- })
- }
- })
- }
- }
- if (name == '生成账单') {
- if (type == 'D') {
- for (let index in this.selectionDList) {
- if (this.selectionDList[index].accStatus != 0) {
- return this.$message.error("已生成账单");
- }
- }
- 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)'
- });
- generateBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
- this.$message.success("成功生成账单");
- this.$emit('getDetails', this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- if (type == 'C') {
- for (let index in this.selectionCList) {
- if (this.selectionCList[index].accStatus != 0) {
- return this.$message.error("已生成账单");
- }
- }
- 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)'
- });
- generateBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
- this.$message.success("成功生成账单");
- this.$emit('getDetails', this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- }
- if (name == '撤销账单') {
- if (type == 'D') {
- for (let index in this.selectionDList) {
- if (this.selectionDList[index].accStatus != 1) {
- return this.$message.error("未生成账单");
- }
- }
- 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)'
- });
- revokeBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
- this.$message.success("成功撤销账单");
- this.$emit('getDetails', this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- if (type == 'C') {
- for (let index in this.selectionCList) {
- if (this.selectionCList[index].accStatus != 1) {
- return this.$message.error("未生成账单");
- }
- }
- 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)'
- });
- revokeBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
- this.$message.success("成功撤销账单");
- this.$emit('getDetails', this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- }
- },
- //自定义列保存
- 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]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .disabledBox {
- display: flex;
- align-items: center;
- }
- .fontSize {
- font-size: 16px;
- color: #81B337;
- }
- .meetSize {
- font-size: 16px;
- color: #54BCBD;
- }
- ::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;
- }
- </style>
|