costManage.vue 35 KB

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