12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217 |
- <template>
- <div>
- <basic-container v-show="isShow">
- <div style="margin-top: 10px">
- <el-tabs type="card" v-model="tabsValue" @tab-click="handleClick">
- <el-tab-pane label="任务列表" name="申请">
- <span slot="label">任务列表</span>
- </el-tab-pane>
- <el-tab-pane label="业务单据" name="销项">
- <span slot="label" style="color: #4c9e44">单据列表</span>
- </el-tab-pane>
- <el-tab-pane label="已完成" name="已完成"></el-tab-pane>
- </el-tabs>
- </div>
- <avue-crud v-show="tabsValue == '申请'" :option="applyOption" :table-loading="loading" :data="applyData"
- :page.sync="applyPage" ref="applyCrud" id="out-table" @search-change="searchChange"
- @selection-change="selectionChange" @search-reset="searchReset" @current-change="currentChange"
- @size-change="sizeChange" @refresh-change="refreshChange" :header-cell-class-name="headerClassName"
- @resetColumn="resetColumnTwo('applyCrud', 'applyOption', 'applyOptionBack', 319)" :search.sync="query"
- @saveColumn="saveColumnTwo('applyCrud', 'applyOption', 'applyOptionBack', 319)" @on-load="onLoad">
- <template slot="menuLeft" slot-scope="{row}">
- <el-button type="success" size="small" @click="multipleInvoicing">选择开票</el-button>
- <span style="font-size: 24px;font-weight: 600;">
- <span style="color: #67C23A;margin-right: 10px;">
- CNY:¥{{ amountSubSum }}元
- </span>
- <span style="color: #E6A23C;">
- USD:${{ amountSubUsdSum }}元
- </span>
- </span>
- </template>
- <template slot="menu" slot-scope="{row}">
- <el-button type="text" size="small"
- :disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1 ? saberUserInfo.user_id != row.createUser : false"
- @click="invoicingfun(row)">开票
- </el-button>
- </template>
- <tempalte slot="feeCnNameSearch">
- <dic-select v-model="query.feeCnName" placeholder="费用名称" key="id" label="cnName" res="records"
- url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"></dic-select>
- </tempalte>
- </avue-crud>
- <avue-crud v-show="tabsValue == '销项' || tabsValue == '已完成'" :option="option" :table-loading="loading"
- :data="data" :page.sync="page" :permission="permissionList" v-model="form" ref="crud" id="out-table"
- :header-cell-class-name="headerClassName" @row-del="rowDel" @search-change="searchChange"
- @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
- @size-change="sizeChange" @refresh-change="refreshChange"
- @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 319.1)"
- @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 319.1)" @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="success" size="small" icon="el-icon-plus" plain @click="newbillFun">新建发票
- </el-button>
- <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">一键删除
- </el-button>
- <span style="font-size: 24px;font-weight: 600;">
- <span style="color: #67C23A;margin-right: 10px;">
- CNY:¥{{ amountSubSum }}元
- </span>
- <span style="color: #E6A23C;">
- USD:${{ amountSubUsdSum }}元
- </span>
- </span>
- </template>
- <template slot="menu" slot-scope="{row}">
- <el-button type="text" size="small" @click="editFun(row)">编辑
- </el-button>
- <!--:disabled="saberUserInfo.role_name.indexOf('允许修改他人业务') == -1?saberUserInfo.user_id != row.createUser:false"-->
- <el-button type="text" size="small"
- :disabled="row.status == 3
- || (saberUserInfo.role_name.indexOf('admin') == -1 ? saberUserInfo.role_name.indexOf('允许修改他人业务') == -1 ? saberUserInfo.user_id != row.createUser : false : false)"
- @click="rowDel(row)">删除
- </el-button>
- </template>
- <template slot-scope="{ row }" slot="billNo">
- <span class="pointerClick" @click="editFun(row)">{{ row.billNo }}
- </span>
- </template>
- <template slot-scope="{ row }" slot="billDate">
- {{ row.billDate ? row.billDate.slice(0, 10) : '' }}
- </template>
- <template slot-scope="{ row }" slot="invoiceDate">
- {{ row.invoiceDate ? row.invoiceDate.slice(0, 10) : '' }}
- </template>
- <tempalte slot="feeCnNameSearch">
- <dic-select v-model="query.feeCnName" placeholder="费用名称" key="id" label="cnName" res="records"
- url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"></dic-select>
- </tempalte>
- </avue-crud>
- </basic-container>
- <fininvoicesDetails ref="fininvoicesDetails" :editSave="editSave" v-if="!isShow" @goBack="goBack"
- @toAddEdit="toAddEdit" :key="datekey">
- </fininvoicesDetails>
- </div>
- </template>
- <script>
- import {
- fininvoicesList,
- fininvoicesDetail,
- fininvoicesRemove, fininvoicesSubmit
- } from "@/api/iosBasicData/fininvoices";
- import fininvoicesDetails from "@/views/iosBasicData/fininvoicesOutput/fininvoicesDetails.vue";
- import { mapGetters } from "vuex";
- import finstlbillsDetails from "@/views/iosBasicData/finstlbills/finstlbillsDetails.vue";
- import { getRateList } from "@/api/iosBasicData/rateManagement";
- import fa from "element-ui/src/locale/lang/fa";
- import dicSelect from "@/components/dicSelect/main";
- export default {
- components: { finstlbillsDetails, fininvoicesDetails, dicSelect },
- data() {
- return {
- amountSubSum: 0,
- amountSubUsdSum: 0,
- datekey: Date.now(),
- tabsValue: '申请',
- // 详情页面和列表切换
- isShow: true,
- editSave: false, // 编辑还是保存
- form: {},
- applyQuery: {}, // 任务列表
- query: {}, // 单据列表
- loading: true,
- // 业务单据
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- // 任务列表数据
- applyPage: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- applySelectionList: [], // 任务列表多选
- // 业务单据 多选
- selectionList: [],
- // 任务列表
- applyOption: {},
- applyOptionBack: {
- height: 'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 24,
- border: true,
- index: true,
- selection: true,
- dialogClickModal: false,
- menuWidth: 100,
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: false,
- searchIcon: true,
- searchIndex: 3,
- column: [
- {
- label: "客户名称",
- prop: "corpCnName",
- width: "120",
- search: true,
- searchOrder: 1,
- overHidden: true,
- },
- {
- label: "MB/L NO",
- prop: "mblno",
- search: true,
- searchOrder: 2,
- overHidden: true
- },
- {
- label: "HB/L NO",
- prop: "hblno",
- search: true,
- searchOrder: 4,
- overHidden: true
- },
- {
- label: "单据编号",
- prop: "billNo",
- search: true,
- overHidden: true,
- },
- {
- label: "单据日期",
- prop: "billDate",
- overHidden: true,
- },
- // {
- // label: "单据开始日期",
- // prop: "invoiceDateStart",
- // search: true,
- // overHidden: true,
- // hide: true,
- // searchLabelWidth: "100",
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
- // },
- // {
- // label: "单据结束日期",
- // prop: "invoiceDateEnd",
- // search: true,
- // overHidden: true,
- // hide: true,
- // searchLabelWidth: "100",
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
- // },
- {
- label: "开票日期",
- prop: "date",
- search: true,
- overHidden: true,
- hide: true,
- // searchLabelWidth: "100",
- type: "date",
- searchProp: "dateList",
- unlinkPanels: true,
- searchRange: true,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- searchDefaultTime: ["00:00:00", "23:59:59"],
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: "140",
- search: true,
- overHidden: true,
- },
- {
- label: "发票抬头",
- prop: "invCorpCnName",
- width: "160",
- search: true,
- overHidden: true,
- },
- {
- label: "发票币种",
- prop: "invCurCode",
- search: true,
- type: 'select',
- dicData: [],
- dicUrl: '/api/blade-los/bcurrency/page?current=1&size=20',
- props: {
- label: "code",
- value: "code"
- },
- dicFormatter: (res => {
- return res.data.records
- }),
- overHidden: true,
- },
- {
- label: "业务单号",
- prop: "businessNo",
- width: "100",
- search: true,
- searchOrder: 5,
- overHidden: true
- },
- {
- label: "对账单号",
- prop: "checkNo",
- search: true,
- width: "100",
- searchOrder: 6,
- overHidden: true
- },
- {
- label: "船名",
- prop: "vesselCnName",
- search: true,
- searchOrder: 7,
- overHidden: true
- },
- {
- label: "航次",
- prop: "voyageNo",
- search: true,
- searchOrder: 8,
- overHidden: true
- },
- {
- label: "开票金额",
- prop: "amountLoc",
- width: "120",
- overHidden: true,
- },
- {
- label: "申请人",
- prop: "applicantName",
- overHidden: true,
- },
- {
- label: "备注",
- prop: "remarks",
- overHidden: true,
- },
- ]
- },
- // 业务单据
- option: {},
- optionBack: {
- height: 'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 24,
- border: true,
- index: true,
- selection: true,
- dialogClickModal: false,
- menuWidth: 100,
- addBtn: false,
- viewBtn: false,
- delBtn: false,
- editBtn: false,
- searchIcon: true,
- searchIndex: 3,
- column: [
- {
- label: "客户名称",
- prop: "corpCnName",
- width: "120",
- search: true,
- searchOrder: 1,
- overHidden: true,
- },
- {
- label: "MB/L NO",
- prop: "mblno",
- search: true,
- searchOrder: 2,
- overHidden: true
- },
- {
- label: "HB/L NO",
- prop: "hblno",
- search: true,
- searchOrder: 4,
- overHidden: true
- },
- {
- label: "单据编号",
- prop: "billNo",
- search: true,
- rules: [{
- required: true,
- message: "请输入单据编号",
- trigger: "blur"
- }],
- overHidden: true,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: "140",
- search: true,
- overHidden: true,
- },
- {
- label: "发票抬头",
- prop: "invCorpCnName",
- width: "160",
- search: true,
- overHidden: true,
- },
- {
- label: "合计本位币(CNY)",
- prop: "amountLoc",
- width: "120",
- overHidden: true,
- },
- {
- label: "单据日期",
- prop: "billDate",
- overHidden: true,
- },
- {
- label: "制单人",
- prop: "createUserName",
- overHidden: true,
- }, {
- label: "制单日期",
- prop: "createTime",
- overHidden: true,
- },
- {
- label: "发票号码",
- prop: "invoiceNo",
- search: true,
- rules: [{
- required: true,
- message: "请输入发票号码",
- trigger: "blur"
- }],
- overHidden: true,
- },
- {
- label: "发票日期",
- prop: "invoiceDate",
- overHidden: true,
- },
- // {
- // label: "单据开始日期",
- // prop: "invoiceDateStart",
- // search: true,
- // overHidden: true,
- // hide: true,
- // searchLabelWidth: "100",
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
- // },
- // {
- // label: "单据结束日期",
- // prop: "invoiceDateEnd",
- // search: true,
- // overHidden: true,
- // hide: true,
- // searchLabelWidth: "100",
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd HH:mm:ss",
- // },
- {
- label: "开票日期",
- prop: "date",
- search: true,
- overHidden: true,
- hide: true,
- // searchLabelWidth: "100",
- type: "date",
- searchProp: "dateList",
- unlinkPanels: true,
- searchRange: true,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- searchDefaultTime: ["00:00:00", "23:59:59"],
- },
- // {
- // label: "原发票号码",
- // prop: "origInvoiceNo",
- // width: "120",
- // overHidden: true,
- // },
- {
- label: "税务发票号码",
- prop: "taxInvoiceNo",
- width: "150",
- overHidden: true,
- },
- // {
- // label: "全电发票",
- // prop: "invType",
- // overHidden: true,
- // },
- {
- label: "发票类型",
- prop: "invType",
- width: "160",
- search: true,
- overHidden: true,
- },
- {
- label: "税率 %",
- prop: "taxRate",
- rules: [{
- required: true,
- message: "请输入税率 %",
- trigger: "blur"
- }],
- overHidden: true,
- },
- {
- label: "结算方式",
- prop: "stlMode",
- overHidden: true,
- },
- {
- label: "发票币种",
- prop: "invCurCode",
- rules: [{
- required: true,
- message: "请输入发票币种",
- trigger: "blur"
- }],
- overHidden: true,
- },
- {
- label: "业务单号",
- prop: "businessNo",
- width: "100",
- search: true,
- searchOrder: 5,
- overHidden: true
- },
- {
- label: "对账单号",
- prop: "checkNo",
- search: true,
- width: "100",
- searchOrder: 6,
- overHidden: true
- },
- {
- label: "船名/航次",
- prop: "vesselVoyno",
- search: true,
- searchOrder: 7,
- overHidden: true
- },
- {
- label: "客户英文名称",
- prop: "corpEnName",
- width: "120",
- overHidden: true,
- },
- // {
- // label: "开票单位英文名称",
- // prop: "invCorpEnName",
- // width: "150",
- // overHidden: true,
- // },
- {
- label: "开票单位税号",
- prop: "invCorpTaxNo",
- width: "140",
- overHidden: true,
- },
- {
- label: "开票单位CNY开户银行",
- prop: "invCorpAccountBankCny",
- width: "160",
- overHidden: true,
- },
- {
- label: "开票单位CNY银行账号",
- prop: "invCorpAccountNoCny",
- width: "160",
- overHidden: true,
- },
- {
- label: "开票单位USD开户银行",
- prop: "invCorpAccountBankUsd",
- width: "160",
- overHidden: true,
- },
- {
- label: "开票单位USD银行账号",
- prop: "invCorpAccountNoUsd",
- width: "160",
- overHidden: true,
- },
- {
- label: "船名/航次",
- prop: "vesselVoyno",
- width: "100",
- overHidden: true,
- },
- {
- label: "开船日",
- prop: "etd",
- overHidden: true,
- },
- {
- label: "装货港",
- prop: "pol",
- overHidden: true,
- },
- {
- label: "卸货港",
- prop: "pod",
- overHidden: true,
- },
- {
- label: "目的地",
- prop: "destination",
- overHidden: true,
- },
- {
- label: "箱型/箱量",
- prop: "containers",
- width: "100",
- overHidden: true,
- },
- {
- label: "币种",
- prop: "curCode",
- overHidden: true,
- },
- {
- label: "原汇率",
- prop: "exrate",
- overHidden: true,
- },
- {
- label: "是否转换为人民币",
- prop: "isExchangeToCny",
- width: "140",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "业务类型",
- prop: "businessTypes",
- overHidden: true,
- },
- {
- label: "业务单据编号",
- prop: "businessNo",
- width: "120",
- overHidden: true,
- },
- {
- label: "对账单编号",
- prop: "checkNo",
- width: "120",
- overHidden: true,
- },
- {
- label: "订舱",
- prop: "bookingNo",
- overHidden: true,
- },
- // {
- // label: "中文船名",
- // prop: "vesselCnName",
- // overHidden: true,
- // },
- // {
- // label: "英文船名",
- // prop: "vesselEnName",
- // overHidden: true,
- // },
- // {
- // label: "航次",
- // prop: "voyageNo",
- // overHidden: true,
- // },
- {
- label: "财务开始日期",
- prop: "accountDateFrom",
- width: "100",
- overHidden: true,
- },
- {
- label: "财务结束日期",
- prop: "accountDateTo",
- width: "100",
- overHidden: true,
- },
- {
- label: "申请人",
- prop: "applicantName",
- overHidden: true,
- },
- {
- label: "审核人",
- prop: "approverName",
- overHidden: true,
- },
- {
- label: "是否代理发票",
- prop: "isAgent",
- width: "120",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "是否DK",
- prop: "isDk",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "是否RP",
- prop: "isRp",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "RP名称",
- prop: "rpName",
- overHidden: true,
- },
- {
- label: "导出日期",
- prop: "exportDate",
- width: "100",
- overHidden: true,
- },
- {
- label: "导出人",
- prop: "exportName",
- overHidden: true,
- },
- {
- label: "是否导出船名航次",
- prop: "isExportVslvoy",
- width: "140",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "是否导出主单号",
- prop: "isExportMblno",
- width: "140",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "是否导出分单号",
- prop: "isExportHblno",
- width: "140",
- dicData: [{
- label: '否',
- value: 0
- }, {
- label: '是',
- value: 1
- }],
- overHidden: true,
- },
- {
- label: "发票本位币(CNY)",
- prop: "amountCny",
- width: "140",
- overHidden: true,
- },
- {
- label: "发票USD",
- prop: "amountUsd",
- width: "100",
- overHidden: true,
- },
- {
- label: "税额(CNY)",
- prop: "amountTax",
- width: "100",
- overHidden: true,
- },
- {
- label: "全电发票备注",
- prop: "elecRemarks",
- width: "120",
- overHidden: true,
- },
- // {
- // label: "银行进账单出票人名称",
- // prop: "bankReceiptCorpName",
- // width: "160",
- // overHidden: true,
- // },
- {
- label: "银行进账单出票银行",
- prop: "bankReceiptBankName",
- width: "160",
- overHidden: true,
- },
- {
- label: "银行进账单出票银行账号",
- prop: "bankReceiptAccountNo",
- width: "160",
- overHidden: true,
- },
- // {
- // label: "银行进账单票据种类",
- // prop: "bankReceiptBillType",
- // width: "160",
- // overHidden: true,
- // },
- {
- label: "银行进账单票据张数",
- prop: "bankReceiptBillCount",
- width: "160",
- overHidden: true,
- },
- {
- label: "银行进账单是否已进账(收款)",
- prop: "bankReceiptIsIncome",
- width: "180",
- overHidden: true,
- },
- {
- label: "备注",
- prop: "remarks",
- rules: [{
- required: true,
- message: "请输入备注",
- trigger: "blur"
- }],
- overHidden: true,
- },
- ]
- },
- data: [], // 业务单据数据
- applyData: [], // 任务列表数据
- saberUserInfo: {}, // 当前登录人个人信息
- };
- },
- watch: {},
- computed: {
- fa() {
- return fa
- },
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.fininvoices_add, false),
- viewBtn: this.vaildData(this.permission.fininvoices_view, false),
- delBtn: this.vaildData(this.permission.fininvoices_delete, false),
- editBtn: this.vaildData(this.permission.fininvoices_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- async created() {
- // 获取当前登录人个人信息
- this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
- this.applyOption = await this.getColumnData(this.getColumnName(319), this.applyOptionBack);
- this.option = await this.getColumnData(this.getColumnName(319.1), this.optionBack);
- this.getRateListfun()
- },
- activated() {
- if (this.$route.query.id) {
- setTimeout(() => {
- if (!this.$store.getters.finOutStatus) {
- this.editFun(this.$route.query)
- }
- }, 200);
- }
- },
- methods: {
- // 获取币别数据
- getRateListfun() {
- getRateList({ current: 1, size: 20 }).then(res => {
- this.findObject(this.applyOptionBack.column, "invCurCode").dicData = res.data.data.records
- })
- },
- // 单个开票
- invoicingfun(row) {
- this.isShow = false
- this.editSave = false
- this.$nextTick(() => {
- this.$refs.fininvoicesDetails.fininvoicesGenerateFinInvoicesfun(row.id)
- })
- this.$store.commit("IN_FINOUT_DETAIL");
- },
- // 多个开票
- multipleInvoicing() {
- if (this.applySelectionList.length == 0) {
- this.$message.warning('请选择要开票的数据')
- return
- }
- // 判断是否可以编辑别人业务 true 就没有权限
- if (this.ModifyOthersfun()) return;
- let arrId = this.applySelectionList.map(item => {
- return item.id
- })
- this.isShow = false
- this.editSave = false
- this.$nextTick(() => {
- this.$refs.fininvoicesDetails.fininvoicesGenerateFinInvoicesfun(arrId.join(','))
- })
- this.$store.commit("IN_FINOUT_DETAIL");
- },
- // 新建发票
- newbillFun() {
- this.isShow = false;
- this.$store.commit("IN_FINOUT_DETAIL");
- },
- toAddEdit() {
- this.editSave = false
- this.datekey = Date.now()
- },
- // 编辑
- editFun(row) {
- this.isShow = false
- this.editSave = true
- this.$nextTick(() => {
- this.$refs.fininvoicesDetails.fininvoicesDetailfun(row.id)
- })
- this.$store.commit("IN_FINOUT_DETAIL");
- },
- // 详情的返回列表
- goBack() {
- // 初始化数据
- // this.detailData = this.$options.data().detailData;
- if (JSON.stringify(this.$route.query) != "{}") {
- this.$router.$avueRouter.closeTag();
- this.$router.push({
- path: "/iosBasicData/fininvoicesOutput/index"
- });
- }
- this.isShow = true;
- this.onLoad(this.page, this.search);
- this.$store.commit("OUT_FINOUT_DETAIL");
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return fininvoicesRemove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- // 一键删除
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- // 判断是否可以编辑别人业务 true 就没有权限
- if (this.ModifyOthersfun()) return;
- // 已经提交请核的提示不让删除
- let sumArr = []
- const h = this.$createElement
- for (let item of this.selectionList) {
- if (item.status == 3) {
- sumArr.push(h('p', `序号${item.$index + 1}的数据已经确认提交请勿删除`))
- }
- }
- if (sumArr.length != 0) {
- this.$confirm('提示', {
- message: h('div', sumArr),
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return fininvoicesRemove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- // 判断是否可以编辑别人业务
- ModifyOthersfun() {
- let sumArr = []
- const h = this.$createElement
- // 判断是否有权限
- if (this.saberUserInfo.role_name.indexOf('允许修改他人业务') != -1) return false
- // 当前登录人和选择的创建人对比是不是一个人
- for (let item of this.selectionList) {
- if (this.saberUserInfo.user_id != item.createUser) {
- sumArr.push(h('p', `你没有"允许修改他人业务"权限,请重新选择数据`))
- }
- }
- if (sumArr.length != 0) {
- this.$confirm('提示', {
- message: h('div', sumArr),
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).catch(err => { })
- return true
- }
- },
- // tabs 切换
- handleClick() {
- this.amountSubSum = 0
- this.amountSubUsdSum = 0
- if (this.tabsValue == '申请') {
- this.applyPage.currentPage = 1;
- this.onLoad(this.applyPage);
- } else {
- this.page.currentPage = 1;
- this.onLoad(this.page);
- }
- },
- // 清除
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- // 搜索
- searchChange(params, done) {
- if (this.tabsValue == '申请') {
- this.applyQuery = params;
- this.applyPage.currentPage = 1;
- this.applyQuery.billDateList = []
- this.onLoad(this.applyPage, params);
- } else {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- }
- done();
- },
- // 多选反的数据
- selectionChange(list) {
- this.amountSubSum = 0
- this.amountSubUsdSum = 0
- if (list.length) {
- list.forEach(e => {
- this.amountSubSum += Number(e.amountSub)
- this.amountSubUsdSum += Number(e.amountSubUsd)
- })
- }
- if (this.tabsValue == '申请') {
- this.applySelectionList = list;
- } else {
- this.selectionList = list;
- }
- },
- selectionClear() {
- if (this.tabsValue == '申请') {
- this.applySelectionList = [];
- this.$refs.applyCrud.toggleSelection();
- this.$refs.applyCrud.refreshTable();
- } else {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- this.$refs.crud.refreshTable();
- }
- },
- // 分页
- currentChange(currentPage) {
- if (this.tabsValue == '申请') {
- this.applyPage.currentPage = currentPage;
- } else {
- this.page.currentPage = currentPage;
- }
- },
- sizeChange(pageSize) {
- if (this.tabsValue == '申请') {
- this.applyPage.pageSize = pageSize;
- } else {
- this.page.pageSize = pageSize;
- }
- },
- // 刷新
- refreshChange() {
- if (this.tabsValue == '申请') {
- this.onLoad(this.applyPage, this.applyQuery);
- } else {
- this.onLoad(this.page, this.query);
- }
- },
- // 获取列表数据
- onLoad(page, params = {}) {
- let type = null
- let status = null
- let billStatus = null
- if (this.tabsValue == '申请') {
- type = '申请'
- status = 3
- billStatus = 0
- } else if (this.tabsValue == '销项') {
- type = '销项'
- status = 0
- } else if (this.tabsValue == '已完成') {
- type = '销项'
- status = 3
- }
- if (!this.query.dateList) {
- this.query.invoiceDateStart = null
- this.query.invoiceDateEnd = null
- } else {
- this.query.invoiceDateStart = this.query.dateList[0]
- this.query.invoiceDateEnd = this.query.dateList[1]
- }
- this.loading = true;
- fininvoicesList(page.currentPage, page.pageSize, {
- ...Object.assign(params, this.query),
- type: type,
- status: status,
- billStatus: billStatus
- }).then(res => {
- const data = res.data.data;
- if (this.tabsValue == '申请') {
- this.applyPage.total = data.total;
- this.applyData = data.records;
- } else {
- this.page.total = data.total;
- this.data = data.records;
- }
- this.loading = false;
- this.selectionClear();
- });
- },
- //自定义列保存
- async saveColumnTwo(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 resetColumnTwo(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;
- },
- }
- };
- </script>
- <style scoped>
- ::v-deep#out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- }
- ::v-deep#out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- }
- /deep/ .el-col-md-8 {
- width: 24.33333%;
- }
- .pointerClick {
- cursor: pointer;
- color: #1e9fff;
- }
- </style>
|