12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130 |
- <template>
- <el-row class="app-container zap-main">
- <el-row v-if="activeIndex === '0'" class="zap-table-search">
- <el-row style="padding-top: 16px;">
- <right-toolbar
- class="zap-right-toolbar"
- :showSearch.sync="showSearch"
- @queryTable="getList"
- >收起</right-toolbar>
- <span class="zap-table-search__title">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" @click="resetQuery" style="float: ;">重置00</el-button>
- <column-setting
- class="zap-column-setting"
- :checkList="checkList"
- :tableList="tableList"
- :selfDom="selfDom"
- :tableId="tableId"
- ></column-setting>
- </div>
- <hr style="margin-top: 16px;" />
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="auto"
- >
- <el-form-item label="融资编号" prop="zfrNumber" size="large">
- <el-input
- maxlength="30"
- v-model="queryParams.zfrNumber"
- placeholder="请输入融资编号"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="开立企业" prop="coreScyName" size="large">
- <el-input
- maxlength="30"
- v-model="queryParams.coreScyName"
- placeholder="请输入开立企业名称"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="融资企业" prop="supScyName" size="large">
- <el-input
- maxlength="30"
- v-model="queryParams.supScyName"
- placeholder="请输入融资企业名称"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="融资状态" prop="zfrStatus" size="large">
- <el-select v-model="queryParams.zfrStatus" placeholder="融资状态" clearable>
- <el-option
- v-for="dict in zfrStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="费用状态" prop="zciStatus" size="large">
- <el-select v-model="queryParams.zciStatus" placeholder="费用状态" clearable>
- <el-option
- v-for="dict in zciStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="发票状态" prop="zciInvoiceStatus" size="large">
- <el-select v-model="queryParams.zciInvoiceStatus" placeholder="发票状态" clearable>
- <el-option
- v-for="dict in invoiceStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="创建时间" size="large">
- <el-date-picker
- v-model="dateRange"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- </el-form>
- </el-row>
- </el-row>
- <el-row v-if="activeIndex === '1'" class="zap-table-search">
- <el-row style="padding-top: 16px;">
- <right-toolbar
- class="zap-right-toolbar"
- :showSearch.sync="showSearch"
- @queryTable="getInvoice"
- >收起</right-toolbar>
- <span class="zap-table-search__title">所选条件:</span>
- <div style="float: right;margin-right:1%">
- <el-button type="cyan" icon="el-icon-search" @click="handleInvoiceQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" @click="resetInvoiceQuery" style="float: ;">重置</el-button>
- <column-setting
- class="zap-column-setting"
- :checkList="checkList"
- :tableList="tableList"
- :selfDom="selfDom"
- :tableId="tableId"
- ></column-setting>
- </div>
- <hr style="margin-top: 16px;" />
- <el-form
- :model="invoiceParams"
- ref="queryInvoiceForm"
- :inline="true"
- v-show="showSearch"
- label-width="auto"
- >
- <el-form-item label="融资编号" prop="zfrNumber" size="large">
- <el-input
- maxlength="30"
- v-model="invoiceParams.zfrNumber"
- placeholder="请输入融资编号"
- clearable
- @keyup.enter.native="handleInvoiceQuery"
- />
- </el-form-item>
- <el-form-item label="开立企业" prop="coreScyName" size="large">
- <el-input
- maxlength="30"
- v-model="invoiceParams.coreScyName"
- placeholder="请输入开立企业名称"
- clearable
- @keyup.enter.native="handleInvoiceQuery"
- />
- </el-form-item>
- <el-form-item label="融资企业" prop="supScyName" size="large">
- <el-input
- maxlength="30"
- v-model="invoiceParams.supScyName"
- placeholder="请输入融资企业名称"
- clearable
- @keyup.enter.native="handleInvoiceQuery"
- />
- </el-form-item>
- <el-form-item label="创建时间" size="large">
- <el-date-picker
- v-model="dateInvoiceRange"
- size="small"
- style="width: 225px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- </el-form>
- </el-row>
- </el-row>
- <!-- ________________________________________平台用________________________________________________ -->
- <el-row class="zap-form zap-margin-top">
- <el-tabs v-model="activeIndex">
- <el-tab-pane label="费用列表">
- <div class="zap-content">
- <el-button
- type="warning"
- @click="handleExport"
- v-hasPermi="['service:cost:export']"
- :disabled="total == 0"
- >导出</el-button>
- </div>
- <el-table v-loading="loading" :data="costList" stripe>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="融资编号"
- align="center"
- prop="zfrNumber"
- v-if="uncheckList.zfrNumber"
- />
- <el-table-column
- label="融资企业"
- align="center"
- prop="supScyName"
- v-if="uncheckList.supScyName"
- />
- <el-table-column
- label="开立企业"
- align="center"
- prop="coreScyName"
- v-if="uncheckList.coreScyName"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资产品"
- align="center"
- prop="zfpName"
- v-if="uncheckList.zfpName"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资金额"
- align="center"
- prop="zfrAmount"
- :formatter="moneyFormat"
- v-if="uncheckList.zfrAmount"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资状态"
- align="center"
- prop="zfrStatus"
- :formatter="zfrStatusFormat"
- v-if="uncheckList.zfrStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="费用状态"
- align="center"
- prop="zciStatus"
- :formatter="zciStatusFormat"
- v-if="uncheckList.zciStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="创建时间"
- align="center"
- prop="createTime"
- v-if="uncheckList.createTime"
- show-overflow-tooltip
- />
- <el-table-column
- label="手续费"
- align="center"
- prop="zciAmount"
- :formatter="moneyFormat"
- v-if="uncheckList.zciAmount "
- show-overflow-tooltip
- />
- <el-table-column
- label="发票状态"
- align="center"
- prop="zciInvoiceStatus"
- :formatter="zciInvoiceStatusFormat"
- v-if="uncheckList.zciInvoiceStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="快递单号"
- align="center"
- prop="zciExpressNo"
- v-if="uncheckList.zciExpressNo"
- show-overflow-tooltip
- />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="150"
- >
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.zciInvoiceStatus != '0'"
- size="mini"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['service:cost:update']"
- >编辑</el-button>
- <el-button
- v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '4'"
- size="mini"
- type="text"
- @click="handleInvoiceDelete(scope.row)"
- v-hasPermi="['service:cost:update']"
- >作废</el-button>
- <el-button
- v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '3'"
- size="mini"
- type="text"
- @click="handleInvoiceFlush(scope.row)"
- v-hasPermi="['service:cost:update']"
- >冲红</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </el-tab-pane>
- <el-tab-pane label="开票列表">
- <div class="zap-content">
- <el-button
- type="warning"
- @click="handleExportInvoice"
- :disabled="invoiceTotal == 0"
- v-hasPermi="['service:cost:export']"
- >导出</el-button>
- </div>
- <!-- 开票列表 -->
- <el-table v-loading="loading" :data="invoiceList" stripe>
- <el-table-column label="序号" type="index" width="50" align="center">
- <template slot-scope="scope">
- <span>{{(invoiceParams.pageNum - 1) * invoiceParams.pageSize + scope.$index + 1}}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="融资编号"
- align="center"
- prop="zfrNumber"
- v-if="uncheckList.zfrNumber"
- />
- <el-table-column
- label="融资企业"
- align="center"
- prop="supScyName"
- v-if="uncheckList.supScyName"
- />
- <el-table-column
- label="开立企业"
- align="center"
- prop="coreScyName"
- v-if="uncheckList.coreScyName"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资产品"
- align="center"
- prop="zfpName"
- v-if="uncheckList.zfpName"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资金额"
- align="center"
- prop="zfrAmount"
- :formatter="moneyFormat"
- v-if="uncheckList.zfrAmount"
- show-overflow-tooltip
- />
- <el-table-column
- label="融资状态"
- align="center"
- prop="zfrStatus"
- :formatter="zfrStatusFormat"
- v-if="uncheckList.zfrStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="费用状态"
- align="center"
- prop="zciStatus"
- :formatter="zciStatusFormat"
- v-if="uncheckList.zciStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="创建时间"
- align="center"
- prop="createTime"
- v-if="uncheckList.createTime"
- show-overflow-tooltip
- />
- <el-table-column
- label="手续费"
- align="center"
- prop="zciAmount"
- :formatter="moneyFormat"
- v-if="uncheckList.zciAmount "
- show-overflow-tooltip
- />
- <el-table-column
- label="发票状态"
- align="center"
- prop="zciInvoiceStatus"
- :formatter="zciInvoiceStatusFormat"
- v-if="uncheckList.zciInvoiceStatus"
- show-overflow-tooltip
- />
- <el-table-column
- label="快递单号"
- align="center"
- prop="zciExpressNo"
- v-if="uncheckList.zciExpressNo"
- show-overflow-tooltip
- />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="150"
- >
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.zciInvoiceStatus == '1' && scope.row.zciStatus == '02' && (scope.row.zfrStatus == '01' || scope.row.zfrStatus == '03') "
- size="mini"
- type="text"
- @click="handleInvoiceOpen(scope.row)"
- v-hasPermi="['service:cost:update']"
- >开票</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="invoiceTotal > 0"
- :total="invoiceTotal"
- :page.sync="invoiceParams.pageNum"
- :limit.sync="invoiceParams.pageSize"
- @pagination="getInvoice"
- />
- </el-tab-pane>
- <!-- 发票框 -->
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="auto" :inline="true">
- <el-form-item label="企业名称" prop="scyName" size="large">
- <el-input v-model="form.scyName" disabled />
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode" size="large">
- <el-input v-model="form.scySocialCode" disabled />
- </el-form-item>
- <el-form-item label="企业注册电话" prop="scyPhone" size="large">
- <el-input v-model="form.scyPhone" disabled />
- </el-form-item>
- <el-form-item label="收件人" prop="ziaContacts" size="large">
- <el-input v-model="form.ziaContacts" disabled />
- </el-form-item>
- <el-form-item label="收件人电话" prop="ziaContactsPhone" size="large">
- <el-input v-model="form.ziaContactsPhone" disabled />
- </el-form-item>
- <el-form-item label="邮寄地址" prop="ziaAddress" size="large">
- <el-input v-model="form.ziaAddress" disabled />
- </el-form-item>
- <el-form-item label="快递单号" prop="zciExpressNo" size="large">
- <el-input
- v-model="form.zciExpressNo"
- placeholder="请输入快递单号"
- maxlength="30"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <el-row style="height: 109px;" type="flex" align="middle" justify="center">
- <el-button type="primary" plain @click="cancel">取 消</el-button>
- <el-button type="primary" @click="submitForm">确 定</el-button>
- </el-row>
- </el-dialog>
- <!-- 发票列表开票框 -->
- <el-dialog :title="openInvoiceTitle" :visible.sync="openInvoice" width="800px" append-to-body>
- <el-form
- ref="formInvoice"
- :model="formInvoice"
- :rules="rules"
- label-width="auto"
- :inline="true"
- >
- <el-form-item label="企业名称" prop="scyName" size="large">
- <el-input v-model="formInvoice.scyName" disabled />
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode" size="large">
- <el-input v-model="formInvoice.scySocialCode" disabled />
- </el-form-item>
- <el-form-item label="企业注册电话" prop="scyPhone" size="large">
- <el-input v-model="formInvoice.scyPhone" disabled />
- </el-form-item>
- <el-form-item label="收件人" prop="ziaContacts" size="large">
- <el-input v-model="formInvoice.ziaContacts" disabled />
- </el-form-item>
- <el-form-item label="收件人电话" prop="ziaContactsPhone" size="large">
- <el-input v-model="formInvoice.ziaContactsPhone" disabled />
- </el-form-item>
- <el-form-item label="邮寄地址" prop="ziaAddress" size="large">
- <el-input v-model="formInvoice.ziaAddress" disabled />
- </el-form-item>
- <el-form-item label="快递单号" prop="zciExpressNo" size="large">
- <el-input
- v-model="formInvoice.zciExpressNo"
- placeholder="请输入快递单号"
- maxlength="30"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <el-row style="height: 109px;" type="flex" align="middle" justify="center">
- <el-button type="primary" @click="submitFormInvoice">确 定</el-button>
- <el-button @click="cancelInvoice">取 消</el-button>
- </el-row>
- </el-dialog>
- <!-- 发票列表冲红框 -->
- <el-dialog :title="openFlushTitle" :visible.sync="openFlush" width="800px" append-to-body>
- <el-form
- ref="formFlush"
- :model="formFlush"
- :rules="rules"
- label-width="140px"
- :inline="true"
- >
- <el-form-item label="企业名称" prop="scyName">
- <el-input v-model="formFlush.scyName" disabled />
- </el-form-item>
- <el-form-item label="企业统一代码" prop="scySocialCode">
- <el-input v-model="formFlush.scySocialCode" disabled />
- </el-form-item>
- <el-form-item label="企业注册电话" prop="scyPhone">
- <el-input v-model="formFlush.scyPhone" disabled />
- </el-form-item>
- <el-form-item label="收件人" prop="ziaContacts">
- <el-input v-model="formFlush.ziaContacts" disabled />
- </el-form-item>
- <el-form-item label="收件人电话" prop="ziaContactsPhone">
- <el-input v-model="formFlush.ziaContactsPhone" disabled />
- </el-form-item>
- <el-form-item label="邮寄地址" prop="ziaAddress">
- <el-input v-model="formFlush.ziaAddress" disabled />
- </el-form-item>
- <el-form-item label="快递单号" prop="zciExpressNo">
- <el-input
- v-model="formFlush.zciExpressNo"
- placeholder="请输入快递单号"
- maxlength="30"
- show-word-limit
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFormFlush">确 定</el-button>
- <el-button @click="cancelFlush">取 消</el-button>
- </div>
- </el-dialog>
- </el-tabs>
- </el-row>
- </el-row>
- </template>
- <script>
- import {
- listCost,
- listInvoice,
- selectInvoiceList,
- applyInvoice,
- invoicing,
- daleteInvoice,
- getUser
- } from "@/api/service/cost/costManage";
- import { uploadFileNew } from "@/api/common/file";
- import { getToken } from "@/utils/auth";
- import { columnQuery, columnfilter } from "@/api/common/columnSetting";
- import ColumnSetting from "../../../components/Table/columnSetting.vue";
- import SearchBar from '@/components/SearchBar/index.vue'
- export default {
- name: "costManage",
- components: {
- ColumnSetting,
- SearchBar
- },
- data() {
- return {
- activeIndex: "",
- //费用列表
- costList: [],
- //开票列表
- invoiceList: [],
- //创建时间范围
- dateRange: [],
- dateInvoiceRange: [],
- //费用状态
- zciStatusOptions: [],
- //发票状态
- zciInvoiceStatusOptions: [],
- invoiceStatusOptions: [],
- //融资状态
- zfrStatusOptions: [],
- //操作员Id
- userId: "",
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- // 弹出层标题
- title: "",
- openInvoiceTitle: "",
- openFlushTitle: "",
- total: 0,
- invoiceTotal: 0,
- // 是否显示弹出层
- open: false,
- openInvoice: false,
- openFlush: false,
- // 链属查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- zfrNumber: null,
- coreScyName: null,
- supScyName: null,
- zciStatus: null,
- zfrStatus: null,
- zciInvoiceStatus: null
- },
- invoiceParams: {
- pageNum: 1,
- pageSize: 10,
- zfrNumber: null,
- supScyName: null,
- coreScyName: null,
- zciStatus: null,
- zfrStatus: null,
- zciInvoiceStatus: null
- },
- //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
- tableList: [
- {
- label: "zfrNumber",
- value: "融资编号"
- },
- {
- label: "supScyName",
- value: "融资企业"
- },
- {
- label: "coreScyName",
- value: "开立企业"
- },
- {
- label: "zfpName",
- value: "融资产品"
- },
- {
- label: "zfrAmount",
- value: "融资金额"
- },
- {
- label: "zciStatus",
- value: "费用状态"
- },
- {
- label: "zfrStatus",
- value: "融资状态"
- },
- {
- label: "createTime",
- value: "创建时间"
- },
- {
- label: "zciAmount",
- value: "手续费"
- },
- {
- label: "zciInvoiceStatus",
- value: "发票状态"
- },
- {
- label: "zciExpressNo",
- value: "快递单号"
- }
- ],
- checkList: [], //筛选列选中的数据列表--显示隐藏列用
- uncheckList: {}, //控制筛选列显示隐藏--显示隐藏列用
- selfDom: this,
- tableId: "/sc-service/cost/list",
- // 表单参数
- form: {
- zciId: null,
- scyId: null,
- scyName: null,
- scySocialCode: null,
- scyPhone: null,
- ziaContacts: null,
- ziaContactsPhone: null,
- ziaAddress: null,
- zciExpressNo: null,
- zciInvoiceStatus: null
- },
- formInvoice: {
- zciId: null,
- scyId: null,
- scyName: null,
- scySocialCode: null,
- scyPhone: null,
- ziaContacts: null,
- ziaContactsPhone: null,
- ziaAddress: null,
- zciExpressNo: null,
- zciInvoiceStatus: null
- },
- formFlush: {
- zciId: null,
- scyId: null,
- scyName: null,
- scySocialCode: null,
- scyPhone: null,
- ziaContacts: null,
- ziaContactsPhone: null,
- ziaAddress: null,
- zciExpressNo: null,
- zciInvoiceStatus: null
- },
- // 表单校验
- rules: {
- // zciExpressNo: [
- // { required: true, message: "快递单号不能为空", trigger: "blur" },
- // ]
- }
- };
- },
- activated() {
- this.getDicts("ser_zci_status").then(response => {
- this.zciStatusOptions = response.data;
- });
- this.getDicts("ser_zci_invoice_status").then(response => {
- this.zciInvoiceStatusOptions = response.data;
- });
- this.getDicts("ser_invoice_status").then(response => {
- this.invoiceStatusOptions = response.data;
- });
- this.getDicts("ser_zfr_status").then(response => {
- this.zfrStatusOptions = response.data;
- });
- this.getList();
- this.getInvoice();
- this.getUser();
- },
- // activated() {
- // this.getDicts("ser_zci_status").then(response => {
- // this.zciStatusOptions = response.data;
- // });
- // this.getDicts(" ser_zci_invoice_status").then(response => {
- // this.zciInvoiceStatusOptions = response.data;
- // });
- // this.getDicts(" ser_zfr_status").then(response => {
- // this.zfrStatusOptions = response.data;
- // });
- // this.getList();
- // this.getInvoice();
- // this.getUser();
- // },
- mounted() {
- this.columnQuery();
- },
- methods: {
- //列表格式化金额
- moneyFormat(row, column, cellValue) {
- if (cellValue == null || cellValue == undefined || cellValue == "") {
- cellValue = "0.00";
- }
- cellValue += "";
- if (!cellValue.includes(".")) {
- cellValue += ".00";
- }
- return cellValue
- .replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
- return $1 + ",";
- })
- .replace(/\.$/, "");
- },
- //获取当前客户是否之前设置过列展示隐藏
- columnQuery() {
- //获取页面路径
- var psfPagePath = window.location.pathname;
- //用请求后台的url作为唯一标识
- var psfTableName = this.tableId;
- var columnForm = {};
- columnForm.psfPagePath = psfPagePath;
- columnForm.psfTableName = psfTableName;
- columnQuery(columnForm).then(response => {
- if (response.data && response.data.psfShowData) {
- this.checkList = response.data.psfShowData;
- }
- this.filter();
- });
- },
- //控制隐藏显示的函数
- filter(checkList) {
- if (!!checkList) {
- this.checkList = checkList;
- }
- columnfilter(this.selfDom);
- },
- //菜单状态字典翻译
- zciStatusFormat(row, column) {
- return this.selectDictLabel(this.zciStatusOptions, row.zciStatus);
- },
- zciInvoiceStatusFormat(row, column) {
- return this.selectDictLabel(
- this.zciInvoiceStatusOptions,
- row.zciInvoiceStatus
- );
- },
- zfrStatusFormat(row, column) {
- return this.selectDictLabel(this.zfrStatusOptions, row.zfrStatus);
- },
- /** 查询链属列表 */
- getList() {
- this.loading = true;
- listCost(this.addDateRange(this.queryParams, this.dateRange)).then(
- response => {
- this.costList = response.data.records;
- this.total = response.data.total;
- this.loading = false;
- }
- );
- },
- getInvoice() {
- this.loading = true;
- selectInvoiceList(
- this.addDateRange(this.invoiceParams, this.dateInvoiceRange)
- ).then(response => {
- this.invoiceList = response.data.records;
- this.invoiceTotal = response.data.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.resetForm("form");
- this.resetForm("formInvoice");
- this.resetForm("formFlush");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.dateRange = [];
- this.handleQuery();
- },
- //发票列表
- handleInvoiceQuery() {
- this.invoiceParams.pageNum = 1;
- this.getInvoice();
- },
- resetInvoiceQuery() {
- this.resetForm("queryInvoiceForm");
- this.dateInvoiceRange = [];
- this.handleInvoiceQuery();
- },
- /** 编辑按钮操作 */
- handleUpdate(row) {
- this.reset();
- if (row.zciId) {
- } else {
- this.$message({
- type: "warning",
- message: "无费用数据"
- });
- return;
- }
- if (row.zfiSupplierId) {
- } else {
- this.$message({
- type: "warning",
- message: "无融资企业信息"
- });
- return;
- }
- const zciId = row.zciId || this.ids;
- const scyId = row.zfiSupplierId || this.ids;
- listInvoice(scyId, zciId).then(response => {
- this.form = response.data[0];
- this.form.zciId = zciId;
- });
- this.open = true;
- this.title = "发票信息";
- },
- /** 提交按钮 */
- submitForm() {
- var self = this;
- this.$refs["form"].validate(valid => {
- let fd = new FormData();
- for (var key in self.form) {
- fd.append(key, self.form[key]);
- }
- if (valid) {
- if (this.form.scyId != null) {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- invoicing(self.form).then(response => {
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- this.getInvoice();
- });
- loading.close();
- }
- }
- });
- },
- /* 开票作废 */
- handleInvoiceDelete(row) {
- const zciId = row.zciId || this.ids;
- const zciInvoiceStatus = "3";
- const data = { zciId, zciInvoiceStatus };
- this.$confirm("确认作废此发票?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(function() {
- return invoicing(data);
- })
- .then(() => {
- this.getList();
- this.getInvoice();
- this.msgSuccess("作废成功");
- })
- .catch(() => {
- this.$message({
- type: "warning",
- message: "已取消作废"
- });
- });
- },
- /* 发票列表开票按钮 */
- handleInvoiceOpen(row) {
- this.reset();
- if (row.zciId) {
- } else {
- this.$message({
- type: "warning",
- message: "无费用数据"
- });
- return;
- }
- if (row.zfiSupplierId) {
- } else {
- this.$message({
- type: "warning",
- message: "无融资企业信息"
- });
- return;
- }
- const zciId = row.zciId || this.ids;
- const scyId = row.zfiSupplierId || this.ids;
- listInvoice(scyId, zciId).then(response => {
- this.formInvoice = response.data[0];
- this.formInvoice.zciId = zciId;
- });
- this.openInvoice = true;
- this.openInvoiceTitle = "开票";
- },
- //发票列表开票取消
- cancelInvoice() {
- (this.openInvoice = false), this.reset();
- },
- //发票列表开票提交
- submitFormInvoice() {
- var self = this;
- this.$refs["formInvoice"].validate(valid => {
- let fd = new FormData();
- for (var key in self.formInvoice) {
- fd.append(key, self.formInvoice[key]);
- }
- if (valid) {
- if (this.formInvoice.scyId != null) {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- this.formInvoice.zciInvoiceStatus = "2";
- invoicing(self.formInvoice).then(response => {
- this.msgSuccess("开票成功");
- this.openInvoice = false;
- this.getList();
- this.getInvoice();
- });
- loading.close();
- }
- }
- });
- },
- //冲红按钮
- handleInvoiceFlush(row) {
- this.reset();
- if (row.zciId) {
- } else {
- this.$message({
- type: "warning",
- message: "无费用数据"
- });
- return;
- }
- if (row.zfiSupplierId) {
- } else {
- this.$message({
- type: "warning",
- message: "无融资企业信息"
- });
- return;
- }
- const zciId = row.zciId || this.ids;
- const scyId = row.zfiSupplierId || this.ids;
- listInvoice(scyId, zciId).then(response => {
- this.formFlush = response.data[0];
- this.formFlush.zciId = zciId;
- });
- this.openFlush = true;
- this.openFlushTitle = "开票";
- },
- //发票列表冲红取消
- cancelFlush() {
- (this.openFlush = false), this.reset();
- },
- //发票列表冲红提交
- submitFormFlush() {
- var self = this;
- this.$refs["formFlush"].validate(valid => {
- let fd = new FormData();
- for (var key in self.formFlush) {
- fd.append(key, self.formFlush[key]);
- }
- if (valid) {
- if (this.formFlush.scyId != null) {
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- this.formFlush.zciInvoiceStatus = "4";
- invoicing(self.formFlush).then(response => {
- this.msgSuccess("冲红成功");
- this.openFlush = false;
- this.getList();
- this.getInvoice();
- });
- loading.close();
- }
- }
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- // this.getList();
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- this.download(
- "/sc-service/cost/export",
- {
- ...this.queryParams,
- ...this.dateRange
- },
- "费用信息.xlsx"
- );
- setTimeout(() => {
- loading.close();
- }, 2000);
- },
- /** 导出按钮操作 */
- handleExportInvoice() {
- // this.getList();
- const loading = this.$loading({
- lock: true,
- text: "Loading",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- this.download(
- "/sc-service/cost/exportInvoice",
- {
- ...this.invoiceParams,
- ...this.dateInvoiceRange
- },
- "发票信息.xlsx"
- );
- setTimeout(() => {
- loading.close();
- }, 2000);
- },
- //获取操作员Id
- getUser() {
- getUser().then(response => {
- this.userId = response.data.userId;
- });
- }
- }
- };
- </script>
|