costManage.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. <template>
  2. <!-- ________________________________________平台用________________________________________________ -->
  3. <el-tabs type="border-card">
  4. <el-tab-pane label="费用列表">
  5. <el-card class="fiche">
  6. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
  7. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  8. <div style="float: right;margin-right:1%">
  9. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  10. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
  11. <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
  12. </div>
  13. <hr style="margin-top: 16px;">
  14. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  15. <el-form-item label="融资编号" prop="zfrNumber">
  16. <el-input
  17. maxlength="30"
  18. v-model="queryParams.zfrNumber"
  19. placeholder="请输入融资编号"
  20. clearable
  21. size="small"
  22. @keyup.enter.native="handleQuery"
  23. />
  24. </el-form-item>
  25. <el-form-item label="开立企业" prop="coreScyName">
  26. <el-input
  27. maxlength="30"
  28. v-model="queryParams.coreScyName"
  29. placeholder="请输入开立企业名称"
  30. clearable
  31. size="small"
  32. @keyup.enter.native="handleQuery"
  33. />
  34. </el-form-item>
  35. <el-form-item label="融资企业" prop="supScyName">
  36. <el-input
  37. maxlength="30"
  38. v-model="queryParams.supScyName"
  39. placeholder="请输入融资企业名称"
  40. clearable
  41. size="small"
  42. @keyup.enter.native="handleQuery"
  43. />
  44. </el-form-item>
  45. <el-form-item label="融资状态" prop="zfrStatus">
  46. <el-select v-model="queryParams.zfrStatus"
  47. placeholder="融资状态"
  48. clearable
  49. size="small"
  50. style="width: 215px">
  51. <el-option
  52. v-for="dict in zfrStatusOptions"
  53. :key="dict.dictValue"
  54. :label="dict.dictLabel"
  55. :value="dict.dictValue"
  56. ></el-option>
  57. </el-select>
  58. </el-form-item>
  59. <el-form-item label="费用状态" prop="zciStatus">
  60. <el-select v-model="queryParams.zciStatus"
  61. placeholder="费用状态"
  62. clearable
  63. size="small"
  64. style="width: 215px">
  65. <el-option
  66. v-for="dict in zciStatusOptions"
  67. :key="dict.dictValue"
  68. :label="dict.dictLabel"
  69. :value="dict.dictValue"
  70. ></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item label="发票状态" prop="zciInvoiceStatus">
  74. <el-select v-model="queryParams.zciInvoiceStatus"
  75. placeholder="发票状态"
  76. clearable
  77. size="small"
  78. style="width: 215px">
  79. <el-option
  80. v-for="dict in invoiceStatusOptions"
  81. :key="dict.dictValue"
  82. :label="dict.dictLabel"
  83. :value="dict.dictValue"
  84. ></el-option>
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item label="创建时间">
  88. <el-date-picker v-model="dateRange" size="small" style="width: 225px"
  89. value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期"
  90. end-placeholder="结束日期"></el-date-picker>
  91. </el-form-item>
  92. </el-form>
  93. </el-card>
  94. <el-row :gutter="10" class="mb8">
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. size="mini"
  99. @click="handleExport"
  100. v-hasPermi="['service:cost:export']"
  101. :disabled="total == 0"
  102. >导出</el-button>
  103. </el-col>
  104. </el-row>
  105. <el-table v-loading="loading" :data="costList" stripe border>
  106. <el-table-column label="序号" type="index" width="50" align="center">
  107. <template slot-scope="scope">
  108. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="融资编号" align="center" prop="zfrNumber" v-if="uncheckList.zfrNumber" />
  112. <el-table-column label="融资企业" align="center" prop="supScyName" v-if="uncheckList.supScyName" />
  113. <el-table-column label="开立企业" align="center" prop="coreScyName" v-if="uncheckList.coreScyName" show-overflow-tooltip />
  114. <el-table-column label="融资产品" align="center" prop="zfpName" v-if="uncheckList.zfpName" show-overflow-tooltip />
  115. <el-table-column label="融资金额" align="center" prop="zfrAmount" :formatter="moneyFormat" v-if="uncheckList.zfrAmount" show-overflow-tooltip />
  116. <el-table-column label="融资状态" align="center" prop="zfrStatus" :formatter="zfrStatusFormat" v-if="uncheckList.zfrStatus" show-overflow-tooltip />
  117. <el-table-column label="费用状态" align="center" prop="zciStatus" :formatter="zciStatusFormat" v-if="uncheckList.zciStatus" show-overflow-tooltip />
  118. <el-table-column label="创建时间" align="center" prop="createTime" v-if="uncheckList.createTime" show-overflow-tooltip />
  119. <el-table-column label="手续费" align="center" prop="zciAmount" :formatter="moneyFormat" v-if="uncheckList.zciAmount " show-overflow-tooltip />
  120. <el-table-column label="发票状态" align="center" prop="zciInvoiceStatus" :formatter="zciInvoiceStatusFormat" v-if="uncheckList.zciInvoiceStatus" show-overflow-tooltip />
  121. <el-table-column label="快递单号" align="center" prop="zciExpressNo" v-if="uncheckList.zciExpressNo" show-overflow-tooltip />
  122. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  123. <template slot-scope="scope">
  124. <el-button
  125. v-if="scope.row.zciInvoiceStatus != '0'"
  126. size="mini"
  127. type="text"
  128. @click="handleUpdate(scope.row)"
  129. v-hasPermi="['service:cost:update']"
  130. >编辑</el-button>
  131. <el-button
  132. v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '4'"
  133. size="mini"
  134. type="text"
  135. @click="handleInvoiceDelete(scope.row)"
  136. v-hasPermi="['service:cost:update']"
  137. >作废</el-button>
  138. <el-button
  139. v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '3'"
  140. size="mini"
  141. type="text"
  142. @click="handleInvoiceFlush(scope.row)"
  143. v-hasPermi="['service:cost:update']"
  144. >冲红</el-button>
  145. </template>
  146. </el-table-column>
  147. </el-table>
  148. <pagination
  149. v-show="total > 0"
  150. :total="total"
  151. :page.sync="queryParams.pageNum"
  152. :limit.sync="queryParams.pageSize"
  153. @pagination="getList"
  154. />
  155. </el-tab-pane>
  156. <el-tab-pane label="开票列表">
  157. <el-card class="fiche">
  158. <right-toolbar :showSearch.sync="showSearch" @queryTable="getInvoice">收起</right-toolbar>
  159. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  160. <div style="float: right;margin-right:1%">
  161. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleInvoiceQuery">搜索</el-button>
  162. <el-button icon="el-icon-refresh" size="mini" @click="resetInvoiceQuery" style="float: ;">重置</el-button>
  163. <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
  164. </div>
  165. <hr style="margin-top: 16px;">
  166. <el-form :model="invoiceParams" ref="queryInvoiceForm" :inline="true" v-show="showSearch" label-width="100px">
  167. <el-form-item label="融资编号" prop="zfrNumber">
  168. <el-input
  169. maxlength="30"
  170. v-model="invoiceParams.zfrNumber"
  171. placeholder="请输入融资编号"
  172. clearable
  173. size="small"
  174. @keyup.enter.native="handleInvoiceQuery"
  175. />
  176. </el-form-item>
  177. <el-form-item label="开立企业" prop="coreScyName">
  178. <el-input
  179. maxlength="30"
  180. v-model="invoiceParams.coreScyName"
  181. placeholder="请输入开立企业名称"
  182. clearable
  183. size="small"
  184. @keyup.enter.native="handleInvoiceQuery"
  185. />
  186. </el-form-item>
  187. <el-form-item label="融资企业" prop="supScyName">
  188. <el-input
  189. maxlength="30"
  190. v-model="invoiceParams.supScyName"
  191. placeholder="请输入融资企业名称"
  192. clearable
  193. size="small"
  194. @keyup.enter.native="handleInvoiceQuery"
  195. />
  196. </el-form-item>
  197. <!-- <el-form-item label="融资状态" prop="zfrStatus">
  198. <el-select v-model="invoiceParams.zfrStatus"
  199. placeholder="融资状态"
  200. clearable
  201. size="small"
  202. style="width: 215px">
  203. <el-option
  204. v-for="dict in zfrStatusOptions"
  205. :key="dict.dictValue"
  206. :label="dict.dictLabel"
  207. :value="dict.dictValue"
  208. ></el-option>
  209. </el-select>
  210. </el-form-item> -->
  211. <!-- <el-form-item label="费用状态" prop="zciStatus">
  212. <el-select v-model="invoiceParams.zciStatus"
  213. placeholder="费用状态"
  214. clearable
  215. size="small"
  216. style="width: 215px">
  217. <el-option
  218. v-for="dict in zciStatusOptions"
  219. :key="dict.dictValue"
  220. :label="dict.dictLabel"
  221. :value="dict.dictValue"
  222. ></el-option>
  223. </el-select>
  224. </el-form-item> -->
  225. <!-- <el-form-item label="发票状态" prop="zciInvoiceStatus">
  226. <el-select v-model="invoiceParams.zciInvoiceStatus"
  227. placeholder="发票状态"
  228. clearable
  229. size="small"
  230. style="width: 215px">
  231. <el-option
  232. v-for="dict in zciInvoiceStatusOptions"
  233. :key="dict.dictValue"
  234. :label="dict.dictLabel"
  235. :value="dict.dictValue"
  236. ></el-option>
  237. </el-select>
  238. </el-form-item> -->
  239. <el-form-item label="创建时间">
  240. <el-date-picker v-model="dateInvoiceRange" size="small" style="width: 225px"
  241. value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期"
  242. end-placeholder="结束日期"></el-date-picker>
  243. </el-form-item>
  244. </el-form>
  245. </el-card>
  246. <el-row :gutter="10" class="mb8">
  247. <el-col :span="1.5">
  248. <el-button
  249. type="warning"
  250. size="mini"
  251. @click="handleExportInvoice"
  252. :disabled="invoiceTotal == 0"
  253. v-hasPermi="['service:cost:export']"
  254. >导出</el-button>
  255. </el-col>
  256. </el-row>
  257. <!-- 开票列表 -->
  258. <el-table v-loading="loading" :data="invoiceList" stripe border>
  259. <el-table-column label="序号" type="index" width="50" align="center">
  260. <template slot-scope="scope">
  261. <span>{{(invoiceParams.pageNum - 1) * invoiceParams.pageSize + scope.$index + 1}}</span>
  262. </template>
  263. </el-table-column>
  264. <el-table-column label="融资编号" align="center" prop="zfrNumber" v-if="uncheckList.zfrNumber" />
  265. <el-table-column label="融资企业" align="center" prop="supScyName" v-if="uncheckList.supScyName" />
  266. <el-table-column label="开立企业" align="center" prop="coreScyName" v-if="uncheckList.coreScyName" show-overflow-tooltip />
  267. <el-table-column label="融资产品" align="center" prop="zfpName" v-if="uncheckList.zfpName" show-overflow-tooltip />
  268. <el-table-column label="融资金额" align="center" prop="zfrAmount" :formatter="moneyFormat" v-if="uncheckList.zfrAmount" show-overflow-tooltip />
  269. <el-table-column label="融资状态" align="center" prop="zfrStatus" :formatter="zfrStatusFormat" v-if="uncheckList.zfrStatus" show-overflow-tooltip />
  270. <el-table-column label="费用状态" align="center" prop="zciStatus" :formatter="zciStatusFormat" v-if="uncheckList.zciStatus" show-overflow-tooltip />
  271. <el-table-column label="创建时间" align="center" prop="createTime" v-if="uncheckList.createTime" show-overflow-tooltip />
  272. <el-table-column label="手续费" align="center" prop="zciAmount" :formatter="moneyFormat" v-if="uncheckList.zciAmount " show-overflow-tooltip />
  273. <el-table-column label="发票状态" align="center" prop="zciInvoiceStatus" :formatter="zciInvoiceStatusFormat" v-if="uncheckList.zciInvoiceStatus" show-overflow-tooltip />
  274. <el-table-column label="快递单号" align="center" prop="zciExpressNo" v-if="uncheckList.zciExpressNo" show-overflow-tooltip />
  275. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  276. <template slot-scope="scope">
  277. <el-button
  278. v-if="scope.row.zciInvoiceStatus == '1' && scope.row.zciStatus == '02' && scope.row.zfrStatus == '01' "
  279. size="mini"
  280. type="text"
  281. @click="handleInvoiceOpen(scope.row)"
  282. v-hasPermi="['service:cost:update']"
  283. >开票</el-button>
  284. </template>
  285. </el-table-column>
  286. </el-table>
  287. <pagination
  288. v-show="invoiceTotal > 0"
  289. :total="invoiceTotal"
  290. :page.sync="invoiceParams.pageNum"
  291. :limit.sync="invoiceParams.pageSize"
  292. @pagination="getInvoice"
  293. />
  294. </el-tab-pane>
  295. <!-- 发票框 -->
  296. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  297. <el-form ref="form" :model="form" :rules="rules" label-width="140px" :inline="true">
  298. <el-form-item label="企业名称" prop="scyName">
  299. <el-input v-model="form.scyName" disabled />
  300. </el-form-item>
  301. <el-form-item label="企业统一代码" prop="scySocialCode">
  302. <el-input v-model="form.scySocialCode" disabled />
  303. </el-form-item>
  304. <el-form-item label="企业注册电话" prop="scyPhone">
  305. <el-input v-model="form.scyPhone" disabled />
  306. </el-form-item>
  307. <el-form-item label="收件人" prop="ziaContacts">
  308. <el-input v-model="form.ziaContacts" disabled />
  309. </el-form-item>
  310. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  311. <el-input v-model="form.ziaContactsPhone" disabled />
  312. </el-form-item>
  313. <el-form-item label="邮寄地址" prop="ziaAddress">
  314. <el-input v-model="form.ziaAddress" disabled />
  315. </el-form-item>
  316. <el-form-item label="快递单号" prop="zciExpressNo">
  317. <el-input v-model="form.zciExpressNo" placeholder="请输入快递单号" maxlength="30" show-word-limit />
  318. </el-form-item>
  319. </el-form>
  320. <div slot="footer" class="dialog-footer">
  321. <el-button type="primary" @click="submitForm">确 定</el-button>
  322. <el-button @click="cancel">取 消</el-button>
  323. </div>
  324. </el-dialog>
  325. <!-- 发票列表开票框 -->
  326. <el-dialog :title="openInvoiceTitle" :visible.sync="openInvoice" width="800px" append-to-body>
  327. <el-form ref="formInvoice" :model="formInvoice" :rules="rules" label-width="140px" :inline="true">
  328. <el-form-item label="企业名称" prop="scyName">
  329. <el-input v-model="formInvoice.scyName" disabled />
  330. </el-form-item>
  331. <el-form-item label="企业统一代码" prop="scySocialCode">
  332. <el-input v-model="formInvoice.scySocialCode" disabled />
  333. </el-form-item>
  334. <el-form-item label="企业注册电话" prop="scyPhone">
  335. <el-input v-model="formInvoice.scyPhone" disabled />
  336. </el-form-item>
  337. <el-form-item label="收件人" prop="ziaContacts">
  338. <el-input v-model="formInvoice.ziaContacts" disabled />
  339. </el-form-item>
  340. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  341. <el-input v-model="formInvoice.ziaContactsPhone" disabled />
  342. </el-form-item>
  343. <el-form-item label="邮寄地址" prop="ziaAddress">
  344. <el-input v-model="formInvoice.ziaAddress" disabled />
  345. </el-form-item>
  346. <el-form-item label="快递单号" prop="zciExpressNo">
  347. <el-input v-model="formInvoice.zciExpressNo" placeholder="请输入快递单号" maxlength="30" show-word-limit />
  348. </el-form-item>
  349. </el-form>
  350. <div slot="footer" class="dialog-footer">
  351. <el-button type="primary" @click="submitFormInvoice">确 定</el-button>
  352. <el-button @click="cancelInvoice">取 消</el-button>
  353. </div>
  354. </el-dialog>
  355. <!-- 发票列表冲红框 -->
  356. <el-dialog :title="openFlushTitle" :visible.sync="openFlush" width="800px" append-to-body>
  357. <el-form ref="formFlush" :model="formFlush" :rules="rules" label-width="140px" :inline="true">
  358. <el-form-item label="企业名称" prop="scyName">
  359. <el-input v-model="formFlush.scyName" disabled />
  360. </el-form-item>
  361. <el-form-item label="企业统一代码" prop="scySocialCode">
  362. <el-input v-model="formFlush.scySocialCode" disabled />
  363. </el-form-item>
  364. <el-form-item label="企业注册电话" prop="scyPhone">
  365. <el-input v-model="formFlush.scyPhone" disabled />
  366. </el-form-item>
  367. <el-form-item label="收件人" prop="ziaContacts">
  368. <el-input v-model="formFlush.ziaContacts" disabled />
  369. </el-form-item>
  370. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  371. <el-input v-model="formFlush.ziaContactsPhone" disabled />
  372. </el-form-item>
  373. <el-form-item label="邮寄地址" prop="ziaAddress">
  374. <el-input v-model="formFlush.ziaAddress" disabled />
  375. </el-form-item>
  376. <el-form-item label="快递单号" prop="zciExpressNo">
  377. <el-input v-model="formFlush.zciExpressNo" placeholder="请输入快递单号" maxlength="30" show-word-limit />
  378. </el-form-item>
  379. </el-form>
  380. <div slot="footer" class="dialog-footer">
  381. <el-button type="primary" @click="submitFormFlush">确 定</el-button>
  382. <el-button @click="cancelFlush">取 消</el-button>
  383. </div>
  384. </el-dialog>
  385. </el-tabs>
  386. </template>
  387. <script>
  388. import { listCost, listInvoice, selectInvoiceList, applyInvoice, invoicing, daleteInvoice, getUser } from "@/api/service/cost/costManage";
  389. import { uploadFileNew } from "@/api/common/file";
  390. import { getToken } from "@/utils/auth";
  391. import {columnQuery,columnfilter} from "@/api/common/columnSetting";
  392. import ColumnSetting from '../../../components/Table/columnSetting.vue';
  393. export default {
  394. name: "costManage",
  395. components: {
  396. ColumnSetting
  397. },
  398. data() {
  399. return {
  400. //费用列表
  401. costList:[],
  402. //开票列表
  403. invoiceList:[],
  404. //创建时间范围
  405. dateRange: [],
  406. dateInvoiceRange:[],
  407. //费用状态
  408. zciStatusOptions:[],
  409. //发票状态
  410. zciInvoiceStatusOptions:[],
  411. invoiceStatusOptions : [],
  412. //融资状态
  413. zfrStatusOptions:[],
  414. //操作员Id
  415. userId : "",
  416. // 遮罩层
  417. loading: true,
  418. // 选中数组
  419. ids: [],
  420. // 非多个禁用
  421. multiple: true,
  422. // 显示搜索条件
  423. showSearch: true,
  424. // 总条数
  425. // 弹出层标题
  426. title: "",
  427. openInvoiceTitle:"",
  428. openFlushTitle:"",
  429. total: 0,
  430. invoiceTotal: 0,
  431. // 是否显示弹出层
  432. open: false,
  433. openInvoice:false,
  434. openFlush:false,
  435. // 链属查询参数
  436. queryParams: {
  437. pageNum: 1,
  438. pageSize: 10,
  439. zfrNumber: null,
  440. coreScyName: null,
  441. supScyName: null,
  442. zciStatus: null,
  443. zfrStatus:null,
  444. zciInvoiceStatus: null
  445. },
  446. invoiceParams:{
  447. pageNum: 1,
  448. pageSize: 10,
  449. zfrNumber: null,
  450. supScyName: null,
  451. coreScyName: null,
  452. zciStatus: null,
  453. zfrStatus:null,
  454. zciInvoiceStatus: null
  455. },
  456. //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
  457. tableList: [
  458. {
  459. label: 'zfrNumber',
  460. value: '融资编号'
  461. },
  462. {
  463. label: 'supScyName',
  464. value: '融资企业'
  465. },
  466. {
  467. label: 'coreScyName',
  468. value: '开立企业'
  469. },
  470. {
  471. label: 'zfpName',
  472. value: '融资产品'
  473. },
  474. {
  475. label: 'zfrAmount',
  476. value: '融资金额'
  477. },
  478. {
  479. label: 'zciStatus',
  480. value: '费用状态'
  481. },
  482. {
  483. label: 'zfrStatus',
  484. value: '融资状态'
  485. },
  486. {
  487. label: 'createTime',
  488. value: '创建时间'
  489. },
  490. {
  491. label: 'zciAmount',
  492. value: '手续费'
  493. },
  494. {
  495. label: 'zciInvoiceStatus',
  496. value: '发票状态'
  497. },
  498. {
  499. label: 'zciExpressNo',
  500. value: '快递单号'
  501. },
  502. ],
  503. checkList: [],//筛选列选中的数据列表--显示隐藏列用
  504. uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
  505. selfDom : this,
  506. tableId:"/sc-service/cost/list",
  507. // 表单参数
  508. form: {
  509. zciId:null,
  510. scyId:null,
  511. scyName:null,
  512. scySocialCode:null,
  513. scyPhone:null,
  514. ziaContacts:null,
  515. ziaContactsPhone:null,
  516. ziaAddress:null,
  517. zciExpressNo:null,
  518. zciInvoiceStatus:null
  519. },
  520. formInvoice: {
  521. zciId:null,
  522. scyId:null,
  523. scyName:null,
  524. scySocialCode:null,
  525. scyPhone:null,
  526. ziaContacts:null,
  527. ziaContactsPhone:null,
  528. ziaAddress:null,
  529. zciExpressNo:null,
  530. zciInvoiceStatus:null
  531. },
  532. formFlush:{
  533. zciId:null,
  534. scyId:null,
  535. scyName:null,
  536. scySocialCode:null,
  537. scyPhone:null,
  538. ziaContacts:null,
  539. ziaContactsPhone:null,
  540. ziaAddress:null,
  541. zciExpressNo:null,
  542. zciInvoiceStatus:null
  543. },
  544. // 表单校验
  545. rules: {
  546. // zciExpressNo: [
  547. // { required: true, message: "快递单号不能为空", trigger: "blur" },
  548. // ]
  549. },
  550. };
  551. },
  552. activated() {
  553. this.getDicts("ser_zci_status").then(response => {
  554. this.zciStatusOptions = response.data;
  555. });
  556. this.getDicts("ser_zci_invoice_status").then(response => {
  557. this.zciInvoiceStatusOptions = response.data;
  558. });
  559. this.getDicts("ser_invoice_status").then(response => {
  560. this.invoiceStatusOptions = response.data;
  561. });
  562. this.getDicts("ser_zfr_status").then(response => {
  563. this.zfrStatusOptions = response.data;
  564. });
  565. this.getList();
  566. this.getInvoice();
  567. this.getUser();
  568. },
  569. // activated() {
  570. // this.getDicts("ser_zci_status").then(response => {
  571. // this.zciStatusOptions = response.data;
  572. // });
  573. // this.getDicts(" ser_zci_invoice_status").then(response => {
  574. // this.zciInvoiceStatusOptions = response.data;
  575. // });
  576. // this.getDicts(" ser_zfr_status").then(response => {
  577. // this.zfrStatusOptions = response.data;
  578. // });
  579. // this.getList();
  580. // this.getInvoice();
  581. // this.getUser();
  582. // },
  583. mounted() {
  584. this.columnQuery();
  585. },
  586. methods: {
  587. //列表格式化金额
  588. moneyFormat(row, column, cellValue) {
  589. if(cellValue == null || cellValue== undefined || cellValue == ''){
  590. cellValue = '0.00'
  591. }
  592. cellValue += '';
  593. if (!cellValue.includes('.')) {
  594. cellValue += '.00';
  595. }
  596.     return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  597.         return $1 + ',';
  598.       }).replace(/\.$/, '');
  599. },
  600. //获取当前客户是否之前设置过列展示隐藏
  601. columnQuery(){
  602. //获取页面路径
  603. var psfPagePath = window.location.pathname;
  604. //用请求后台的url作为唯一标识
  605. var psfTableName = this.tableId;
  606. var columnForm = {};
  607. columnForm.psfPagePath = psfPagePath;
  608. columnForm.psfTableName = psfTableName;
  609. columnQuery(columnForm).then(response => {
  610. if(response.data && response.data.psfShowData){
  611. this.checkList = response.data.psfShowData;
  612. }
  613. this.filter();
  614. })
  615. },
  616. //控制隐藏显示的函数
  617. filter(checkList) {
  618. if (!!checkList) {
  619. this.checkList = checkList;
  620. }
  621. columnfilter(this.selfDom);
  622. },
  623. //菜单状态字典翻译
  624. zciStatusFormat(row, column) {
  625. return this.selectDictLabel(this.zciStatusOptions, row.zciStatus);
  626. },
  627. zciInvoiceStatusFormat(row, column) {
  628. return this.selectDictLabel(this.zciInvoiceStatusOptions, row.zciInvoiceStatus);
  629. },
  630. zfrStatusFormat(row, column) {
  631. return this.selectDictLabel(this.zfrStatusOptions, row.zfrStatus);
  632. },
  633. /** 查询链属列表 */
  634. getList() {
  635. this.loading = true;
  636. listCost(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  637. this.costList = response.data.records;
  638. this.total = response.data.total;
  639. this.loading = false;
  640. }
  641. );
  642. },
  643. getInvoice() {
  644. this.loading = true;
  645. selectInvoiceList(this.addDateRange(this.invoiceParams, this.dateInvoiceRange)).then(response => {
  646. this.invoiceList = response.data.records;
  647. this.invoiceTotal = response.data.total;
  648. this.loading = false;
  649. }
  650. );
  651. },
  652. // 取消按钮
  653. cancel() {
  654. this.open = false;
  655. this.reset();
  656. },
  657. // 表单重置
  658. reset() {
  659. this.resetForm("form");
  660. this.resetForm("formInvoice");
  661. this.resetForm("formFlush");
  662. },
  663. /** 搜索按钮操作 */
  664. handleQuery() {
  665. this.queryParams.pageNum = 1;
  666. this.getList();
  667. },
  668. /** 重置按钮操作 */
  669. resetQuery() {
  670. this.resetForm("queryForm");
  671. this.dateRange = [];
  672. this.handleQuery();
  673. },
  674. //发票列表
  675. handleInvoiceQuery() {
  676. this.invoiceParams.pageNum = 1;
  677. this.getInvoice();
  678. },
  679. resetInvoiceQuery(){
  680. this.resetForm("queryInvoiceForm");
  681. this.dateInvoiceRange = [];
  682. this.handleInvoiceQuery();
  683. },
  684. /** 编辑按钮操作 */
  685. handleUpdate(row) {
  686. this.reset();
  687. if(row.zciId){
  688. }else{
  689. this.$message({
  690. type: "warning",
  691. message: "无费用数据",
  692. });
  693. return;
  694. }
  695. if(row.zfiSupplierId){
  696. }else{
  697. this.$message({
  698. type: "warning",
  699. message: "无融资企业信息",
  700. });
  701. return;
  702. }
  703. const zciId = row.zciId || this.ids;
  704. const scyId = row.zfiSupplierId || this.ids;
  705. listInvoice(scyId,zciId).then(response => {
  706. this.form = response.data[0];
  707. this.form.zciId = zciId;
  708. });
  709. this.open = true;
  710. this.title = "发票信息";
  711. },
  712. /** 提交按钮 */
  713. submitForm() {
  714. var self = this;
  715. this.$refs["form"].validate(valid => {
  716. let fd = new FormData();
  717. for(var key in self.form){
  718. fd.append(key, self.form[key]);
  719. }
  720. if (valid) {
  721. if (this.form.scyId != null) {
  722. const loading = this.$loading({
  723. lock: true,
  724. text: "Loading",
  725. spinner: "el-icon-loading",
  726. background: "rgba(0, 0, 0, 0.7)",
  727. })
  728. invoicing(self.form).then(response => {
  729. this.msgSuccess("修改成功");
  730. this.open = false;
  731. this.resetQuery();
  732. this.resetInvoiceQuery();
  733. });
  734. loading.close();
  735. }
  736. }
  737. });
  738. },
  739. /* 开票作废 */
  740. handleInvoiceDelete(row) {
  741. const zciId = row.zciId || this.ids;
  742. const zciInvoiceStatus = '3';
  743. const data = {zciId,zciInvoiceStatus};
  744. this.$confirm('确认作废此发票?', "警告", {
  745. confirmButtonText: "确定",
  746. cancelButtonText: "取消",
  747. type: "warning"
  748. }).then(function() {
  749. return invoicing(data);
  750. }).then(() => {
  751. this.getList();
  752. this.getInvoice();
  753. this.msgSuccess("作废成功");
  754. })
  755. .catch(() => {
  756. this.$message({
  757. type: "warning",
  758. message: "已取消作废",
  759. });
  760. });
  761. },
  762. /* 发票列表开票按钮 */
  763. handleInvoiceOpen(row) {
  764. this.reset();
  765. if(row.zciId){
  766. }else{
  767. this.$message({
  768. type: "warning",
  769. message: "无费用数据",
  770. });
  771. return;
  772. }
  773. if(row.zfiSupplierId){
  774. }else{
  775. this.$message({
  776. type: "warning",
  777. message: "无融资企业信息",
  778. });
  779. return;
  780. }
  781. const zciId = row.zciId || this.ids;
  782. const scyId = row.zfiSupplierId || this.ids;
  783. listInvoice(scyId,zciId).then(response => {
  784. this.formInvoice = response.data[0];
  785. this.formInvoice.zciId = zciId;
  786. });
  787. this.openInvoice = true;
  788. this.openInvoiceTitle = "开票";
  789. },
  790. //发票列表开票取消
  791. cancelInvoice(){
  792. this.openInvoice = false,
  793. this.reset();
  794. },
  795. //发票列表开票提交
  796. submitFormInvoice() {
  797. var self = this;
  798. this.$refs["formInvoice"].validate(valid => {
  799. let fd = new FormData();
  800. for(var key in self.formInvoice){
  801. fd.append(key, self.formInvoice[key]);
  802. }
  803. if (valid) {
  804. if (this.formInvoice.scyId != null) {
  805. const loading = this.$loading({
  806. lock: true,
  807. text: "Loading",
  808. spinner: "el-icon-loading",
  809. background: "rgba(0, 0, 0, 0.7)",
  810. })
  811. this.formInvoice.zciInvoiceStatus = '2';
  812. invoicing(self.formInvoice).then(response => {
  813. this.msgSuccess("开票成功");
  814. this.openInvoice = false;
  815. this.resetQuery();
  816. this.resetInvoiceQuery();
  817. });
  818. loading.close();
  819. }
  820. }
  821. });
  822. },
  823. //冲红按钮
  824. handleInvoiceFlush(row) {
  825. this.reset();
  826. if(row.zciId){
  827. }else{
  828. this.$message({
  829. type: "warning",
  830. message: "无费用数据",
  831. });
  832. return;
  833. }
  834. if(row.zfiSupplierId){
  835. }else{
  836. this.$message({
  837. type: "warning",
  838. message: "无融资企业信息",
  839. });
  840. return;
  841. }
  842. const zciId = row.zciId || this.ids;
  843. const scyId = row.zfiSupplierId || this.ids;
  844. listInvoice(scyId,zciId).then(response => {
  845. this.formFlush = response.data[0];
  846. this.formFlush.zciId = zciId;
  847. });
  848. this.openFlush = true;
  849. this.openFlushTitle = "开票";
  850. },
  851. //发票列表冲红取消
  852. cancelFlush(){
  853. this.openFlush = false,
  854. this.reset();
  855. },
  856. //发票列表冲红提交
  857. submitFormFlush() {
  858. var self = this;
  859. this.$refs["formFlush"].validate(valid => {
  860. let fd = new FormData();
  861. for(var key in self.formFlush){
  862. fd.append(key, self.formFlush[key]);
  863. }
  864. if (valid) {
  865. if (this.formFlush.scyId != null) {
  866. const loading = this.$loading({
  867. lock: true,
  868. text: "Loading",
  869. spinner: "el-icon-loading",
  870. background: "rgba(0, 0, 0, 0.7)",
  871. })
  872. this.formFlush.zciInvoiceStatus = '4';
  873. invoicing(self.formFlush).then(response => {
  874. this.msgSuccess("冲红成功");
  875. this.openFlush = false;
  876. this.resetQuery();
  877. this.resetInvoiceQuery();
  878. });
  879. loading.close();
  880. }
  881. }
  882. });
  883. },
  884. /** 导出按钮操作 */
  885. handleExport() {
  886. // this.getList();
  887. const loading = this.$loading({
  888. lock: true,
  889. text: 'Loading',
  890. spinner: 'el-icon-loading',
  891. background: 'rgba(0, 0, 0, 0.7)'
  892. });
  893. this.download('/sc-service/cost/export', {
  894. ...this.queryParams, ...this.dateRange
  895. },'费用信息.xlsx')
  896. setTimeout(() => {
  897. loading.close();
  898. }, 2000);
  899. },
  900. /** 导出按钮操作 */
  901. handleExportInvoice() {
  902. // this.getList();
  903. const loading = this.$loading({
  904. lock: true,
  905. text: 'Loading',
  906. spinner: 'el-icon-loading',
  907. background: 'rgba(0, 0, 0, 0.7)'
  908. });
  909. this.download('/sc-service/cost/exportInvoice', {
  910. ...this.invoiceParams, ...this.dateInvoiceRange
  911. },'发票信息.xlsx')
  912. setTimeout(() => {
  913. loading.close();
  914. }, 2000);
  915. },
  916. //获取操作员Id
  917. getUser(){
  918. getUser().then(response => {
  919. this.userId = response.data.userId;
  920. })
  921. }
  922. }
  923. };
  924. </script>