userCostManage.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <template>
  2. <!-- ________________________________________融资企业用________________________________________________ -->
  3. <div class="app-container">
  4. <el-card class="fiche">
  5. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
  6. <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
  7. <div style="float: right;margin-right:1%">
  8. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  9. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" style="float: ;">重置</el-button>
  10. <column-setting :checkList="checkList" :tableList="tableList" :selfDom="selfDom" :tableId="tableId" style="margin-left:5px"></column-setting>
  11. </div>
  12. <hr style="margin-top: 16px;">
  13. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  14. <el-form-item label="融信编号" prop="zfiNumber">
  15. <el-input
  16. maxlength="30"
  17. v-model="queryParams.zfiNumber"
  18. placeholder="请输入融信编号"
  19. clearable
  20. size="small"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="融资状态" prop="zfrStatus">
  25. <el-select v-model="queryParams.zfrStatus"
  26. placeholder="发票状态"
  27. clearable
  28. size="small"
  29. style="width: 215px">
  30. <el-option
  31. v-for="dict in zfrStatusOptions"
  32. :key="dict.dictValue"
  33. :label="dict.dictLabel"
  34. :value="dict.dictValue"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="费用状态" prop="zciStatus">
  39. <el-select v-model="queryParams.zciStatus"
  40. placeholder="费用状态"
  41. clearable
  42. size="small"
  43. style="width: 215px">
  44. <el-option
  45. v-for="dict in zciStatusOptions"
  46. :key="dict.dictValue"
  47. :label="dict.dictLabel"
  48. :value="dict.dictValue"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item label="发票状态" prop="zciInvoiceStatus">
  53. <el-select v-model="queryParams.zciInvoiceStatus"
  54. placeholder="发票状态"
  55. clearable
  56. size="small"
  57. style="width: 215px">
  58. <el-option
  59. v-for="dict in zciInvoiceStatusOptions"
  60. :key="dict.dictValue"
  61. :label="dict.dictLabel"
  62. :value="dict.dictValue"
  63. ></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item label="创建时间">
  67. <el-date-picker v-model="dateRange" size="small" style="width: 225px"
  68. value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期"
  69. end-placeholder="结束日期"></el-date-picker>
  70. </el-form-item>
  71. </el-form>
  72. </el-card>
  73. <el-row :gutter="10" class="mb8">
  74. <el-col :span="1.5">
  75. <el-button
  76. type="warning"
  77. size="mini"
  78. @click="handleExport"
  79. v-hasPermi="['service:cost:export']"
  80. :disabled="total == 0"
  81. >导出</el-button>
  82. </el-col>
  83. </el-row>
  84. <el-table v-loading="loading" :data="costList" stripe border>
  85. <el-table-column label="序号" type="index" width="50" align="center">
  86. <template slot-scope="scope">
  87. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="融资编号" align="center" prop="zfrNumber" v-if="uncheckList.zfiNumber" />
  91. <el-table-column label="开立企业" align="center" prop="coreScyName" v-if="uncheckList.coreScyName" show-overflow-tooltip />
  92. <el-table-column label="融资产品" align="center" prop="zfpName" v-if="uncheckList.zfpName" show-overflow-tooltip />
  93. <el-table-column label="融资金额" align="center" prop="zfrAmount" :formatter="moneyFormat" v-if="uncheckList.zfrAmount" show-overflow-tooltip />
  94. <el-table-column label="融资状态" align="center" prop="zfrStatus" :formatter="zfrStatusFormat" v-if="uncheckList.zfrStatus" show-overflow-tooltip />
  95. <el-table-column label="费用状态" align="center" prop="zciStatus" :formatter="zciStatusFormat" v-if="uncheckList.zciStatus" show-overflow-tooltip />
  96. <el-table-column label="创建时间" align="center" prop="createTime" v-if="uncheckList.createTime" show-overflow-tooltip />
  97. <el-table-column label="手续费" align="center" prop="zciAmount" :formatter="moneyFormat" v-if="uncheckList.zciAmount " show-overflow-tooltip />
  98. <el-table-column label="发票状态" align="center" prop="zciInvoiceStatus" :formatter="zciInvoiceStatusFormat" v-if="uncheckList.zciInvoiceStatus" show-overflow-tooltip />
  99. <el-table-column label="快递单号" align="center" prop="zciExpressNo" v-if="uncheckList.zciExpressNo" show-overflow-tooltip />
  100. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  101. <template slot-scope="scope">
  102. <el-button
  103. v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '4'"
  104. size="mini"
  105. type="text"
  106. @click="handleUpdate(scope.row)"
  107. v-hasPermi="['service:cost:update']"
  108. >发票</el-button>
  109. <el-button
  110. v-if="scope.row.zciStatus == '00'"
  111. size="mini"
  112. type="text"
  113. @click="handlePay(scope.row)"
  114. v-hasPermi="['service:cost:pay']"
  115. >去缴费</el-button>
  116. <el-button
  117. v-if="scope.row.zciInvoiceStatus == '0' && scope.row.zciStatus == '02'"
  118. size="mini"
  119. type="text"
  120. @click="handleApply(scope.row)"
  121. v-hasPermi="['service:cost:update']"
  122. >申请开票</el-button>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <pagination
  127. v-show="total > 0"
  128. :total="total"
  129. :page.sync="queryParams.pageNum"
  130. :limit.sync="queryParams.pageSize"
  131. @pagination="getList"
  132. />
  133. <!-- 发票框 -->
  134. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  135. <el-form ref="form" :model="form" label-width="140px" :inline="true">
  136. <el-form-item label="企业名称" prop="scyName">
  137. <el-input v-model="form.scyName" disabled />
  138. </el-form-item>
  139. <el-form-item label="企业统一代码" prop="scySocialCode">
  140. <el-input v-model="form.scySocialCode" disabled />
  141. </el-form-item>
  142. <el-form-item label="企业注册电话" prop="scyPhone">
  143. <el-input v-model="form.scyPhone" disabled />
  144. </el-form-item>
  145. <el-form-item label="收件人" prop="ziaContacts">
  146. <el-input v-model="form.ziaContacts" disabled />
  147. </el-form-item>
  148. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  149. <el-input v-model="form.ziaContactsPhone" disabled />
  150. </el-form-item>
  151. <el-form-item label="邮寄地址" prop="ziaAddress">
  152. <el-input v-model="form.ziaAddress" disabled />
  153. </el-form-item>
  154. <el-form-item label="快递单号" prop="zciExpressNo">
  155. <el-input v-model="form.zciExpressNo" disabled/>
  156. </el-form-item>
  157. </el-form>
  158. <div slot="footer" class="dialog-footer">
  159. <el-button @click="cancel">取 消</el-button>
  160. </div>
  161. </el-dialog>
  162. <!-- 申请开票框 -->
  163. <el-dialog :title="titleApply" :visible.sync="openApply" width="800px" append-to-body>
  164. <el-form ref="formApply" :model="formApply" :rules="rulesApply" label-width="140px" :inline="true">
  165. <el-form-item label="企业名称" prop="scyName">
  166. <el-input v-model="formApply.scyName" disabled />
  167. </el-form-item>
  168. <el-form-item label="企业统一代码" prop="scySocialCode">
  169. <el-input v-model="formApply.scySocialCode" disabled />
  170. </el-form-item>
  171. <el-form-item label="企业注册电话" prop="scyPhone">
  172. <el-input v-model="formApply.scyPhone" disabled />
  173. </el-form-item>
  174. <el-form-item label="收件人" prop="ziaContacts">
  175. <el-input v-model="formApply.ziaContacts" placeholder="请输入收件人" maxlength="20" show-word-limit />
  176. </el-form-item>
  177. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  178. <el-input v-model="formApply.ziaContactsPhone" placeholder="请输入收件人电话" maxlength="11" show-word-limit />
  179. </el-form-item>
  180. <el-form-item label="邮寄地址" prop="ziaAddress">
  181. <el-input v-model="formApply.ziaAddress" placeholder="请输入邮寄地址" maxlength="30" show-word-limit />
  182. </el-form-item>
  183. </el-form>
  184. <div slot="footer" class="dialog-footer">
  185. <el-button type="primary" @click="submitForm">确 定</el-button>
  186. <el-button @click="cancel">取 消</el-button>
  187. </div>
  188. </el-dialog>
  189. </div>
  190. </template>
  191. <script>
  192. import { listCost, listInvoice, selectInvoiceList, applyInvoice, invoicing, daleteInvoice, getUser, changeZfiStatus } from "@/api/service/cost/costManage";
  193. import { uploadFileNew } from "@/api/common/file";
  194. import { getToken } from "@/utils/auth";
  195. import {columnQuery,columnfilter} from "@/api/common/columnSetting";
  196. import ColumnSetting from '../../../components/Table/columnSetting.vue';
  197. export default {
  198. name: "userCostManage",
  199. components: {
  200. ColumnSetting
  201. },
  202. data() {
  203. return {
  204. //费用列表
  205. costList:[],
  206. //创建时间范围
  207. dateRange: [],
  208. //费用状态
  209. zciStatusOptions:[],
  210. //发票状态
  211. zciInvoiceStatusOptions:[],
  212. //融资状态
  213. zfrStatusOptions:[],
  214. //操作员Id
  215. userId : "",
  216. // 遮罩层
  217. loading: true,
  218. // 选中数组
  219. ids: [],
  220. // 非多个禁用
  221. multiple: true,
  222. // 显示搜索条件
  223. showSearch: true,
  224. // 总条数
  225. // 弹出层标题
  226. title: "",
  227. openInvoiceTitle:"",
  228. titleApply:"",
  229. total: 0,
  230. // 是否显示弹出层
  231. open: false,
  232. openInvoice:false,
  233. openApply:false,
  234. // 链属查询参数
  235. queryParams: {
  236. pageNum: 1,
  237. pageSize: 10,
  238. zfiNumber: null,
  239. zciStatus: null,
  240. zfrStatus:null,
  241. zciInvoiceStatus: null
  242. },
  243. //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
  244. tableList: [
  245. {
  246. label: 'zfiNumber',
  247. value: '融资编号'
  248. },
  249. {
  250. label: 'supScyName',
  251. value: '融资企业'
  252. },
  253. {
  254. label: 'coreScyName',
  255. value: '开立企业'
  256. },
  257. {
  258. label: 'zfpName',
  259. value: '融资产品'
  260. },
  261. {
  262. label: 'zfrAmount',
  263. value: '融资金额'
  264. },
  265. {
  266. label: 'zciStatus',
  267. value: '费用状态'
  268. },
  269. {
  270. label: 'zfrStatus',
  271. value: '融资状态'
  272. },
  273. {
  274. label: 'createTime',
  275. value: '创建时间'
  276. },
  277. {
  278. label: 'zciAmount',
  279. value: '手续费'
  280. },
  281. {
  282. label: 'zciInvoiceStatus',
  283. value: '发票状态'
  284. },
  285. {
  286. label: 'zciExpressNo',
  287. value: '快递单号'
  288. },
  289. ],
  290. checkList: [],//筛选列选中的数据列表--显示隐藏列用
  291. uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
  292. selfDom : this,
  293. tableId:"/sc-service/cost/list",
  294. // 表单参数
  295. form: {
  296. zciId:null,
  297. scyId:null,
  298. scyName:null,
  299. scySocialCode:null,
  300. scyPhone:null,
  301. ziaContacts:null,
  302. ziaContactsPhone:null,
  303. ziaAddress:null,
  304. zciExpressNo:null,
  305. zciInvoiceStatus:null
  306. },
  307. formApply:{
  308. zciId:null,
  309. scyId:null,
  310. scyName:null,
  311. scySocialCode:null,
  312. scyPhone:null,
  313. ziaContacts:null,
  314. ziaContactsPhone:null,
  315. ziaAddress:null,
  316. zciExpressNo:null,
  317. zciInvoiceStatus:null
  318. },
  319. // 表单校验
  320. rulesApply: {
  321. ziaContacts: [
  322. { required: true, message: "收件人不能为空", trigger: "blur" },
  323. ],
  324. ziaContactsPhone: [
  325. { required: true, message: "收件人电话不能为空", trigger: "blur" },
  326. {
  327. pattern: /^((\d{3}-\d{7,8}|\d{4}-\d{7,8})|(1[3465789]\d{9}))$/,
  328. message: "电话格式不正确",
  329. trigger: "blur",
  330. }
  331. ],
  332. ziaAddress: [
  333. { required: true, message: "邮寄地址不能为空", trigger: "blur" },
  334. ]
  335. },
  336. };
  337. },
  338. created() {
  339. this.getDicts("ser_zci_status").then(response => {
  340. this.zciStatusOptions = response.data;
  341. });
  342. this.getDicts(" ser_zci_invoice_status").then(response => {
  343. this.zciInvoiceStatusOptions = response.data;
  344. });
  345. this.getDicts(" ser_zfr_status").then(response => {
  346. this.zfrStatusOptions = response.data;
  347. });
  348. this.getList();
  349. this.getUser();
  350. },
  351. activated() {
  352. this.getDicts("ser_zci_status").then(response => {
  353. this.zciStatusOptions = response.data;
  354. });
  355. this.getDicts(" ser_zci_invoice_status").then(response => {
  356. this.zciInvoiceStatusOptions = response.data;
  357. });
  358. this.getDicts(" ser_zfr_status").then(response => {
  359. this.zfrStatusOptions = response.data;
  360. });
  361. this.getList();
  362. this.getUser();
  363. },
  364. mounted() {
  365. this.columnQuery();
  366. },
  367. methods: {
  368. //列表格式化金额
  369. moneyFormat(row, column, cellValue) {
  370. if(cellValue == null || cellValue== undefined || cellValue == ''){
  371. cellValue = '0.00'
  372. }
  373. cellValue += '';
  374. if (!cellValue.includes('.')) {
  375. cellValue += '.00';
  376. }
  377.     return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
  378.         return $1 + ',';
  379.       }).replace(/\.$/, '');
  380. },
  381. //获取当前客户是否之前设置过列展示隐藏
  382. columnQuery(){
  383. //获取页面路径
  384. var psfPagePath = window.location.pathname;
  385. //用请求后台的url作为唯一标识
  386. var psfTableName = this.tableId;
  387. var columnForm = {};
  388. columnForm.psfPagePath = psfPagePath;
  389. columnForm.psfTableName = psfTableName;
  390. columnQuery(columnForm).then(response => {
  391. if(response.data && response.data.psfShowData){
  392. this.checkList = response.data.psfShowData;
  393. }
  394. this.filter();
  395. })
  396. },
  397. //控制隐藏显示的函数
  398. filter(checkList) {
  399. if (!!checkList) {
  400. this.checkList = checkList;
  401. }
  402. columnfilter(this.selfDom);
  403. },
  404. //菜单状态字典翻译
  405. zciStatusFormat(row, column) {
  406. return this.selectDictLabel(this.zciStatusOptions, row.zciStatus);
  407. },
  408. zciInvoiceStatusFormat(row, column) {
  409. return this.selectDictLabel(this.zciInvoiceStatusOptions, row.zciInvoiceStatus);
  410. },
  411. zfrStatusFormat(row, column) {
  412. return this.selectDictLabel(this.zfrStatusOptions, row.zfrStatus);
  413. },
  414. /** 查询链属列表 */
  415. getList() {
  416. this.loading = true;
  417. listCost(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  418. this.costList = response.data.records;
  419. this.total = response.data.total;
  420. this.loading = false;
  421. }
  422. );
  423. },
  424. // 取消按钮
  425. cancel() {
  426. this.open = false;
  427. this.reset();
  428. },
  429. // 表单重置
  430. reset() {
  431. this.resetForm("form");
  432. },
  433. /** 搜索按钮操作 */
  434. handleQuery() {
  435. this.queryParams.pageNum = 1;
  436. this.getList();
  437. },
  438. /** 重置按钮操作 */
  439. resetQuery() {
  440. this.resetForm("queryForm");
  441. this.dateRange = [];
  442. this.handleQuery();
  443. },
  444. /** 发票按钮操作 */
  445. handleUpdate(row) {
  446. this.reset();
  447. if(row.zciId){
  448. }else{
  449. this.$message({
  450. type: "warning",
  451. message: "无费用数据",
  452. });
  453. return;
  454. }
  455. if(row.zfiSupplierId){
  456. }else{
  457. this.$message({
  458. type: "warning",
  459. message: "无融资企业信息",
  460. });
  461. return;
  462. }
  463. const zciId = row.zciId || this.ids;
  464. const scyId = row.zfiSupplierId || this.ids;
  465. listInvoice(scyId,zciId).then(response => {
  466. this.form = response.data[0];
  467. this.form.zciId = zciId;
  468. });
  469. this.open = true;
  470. this.title = "发票信息";
  471. },
  472. /** 发票按钮操作 */
  473. handleApply(row) {
  474. this.reset();
  475. if(row.zciId){
  476. }else{
  477. this.$message({
  478. type: "warning",
  479. message: "无费用数据",
  480. });
  481. return;
  482. }
  483. if(row.zfiSupplierId){
  484. }else{
  485. this.$message({
  486. type: "warning",
  487. message: "无融资企业信息",
  488. });
  489. return;
  490. }
  491. const zciId = row.zciId || this.ids;
  492. const scyId = row.zfiSupplierId || this.ids;
  493. listInvoice(scyId,zciId).then(response => {
  494. this.formApply = response.data[0];
  495. this.formApply.zciId = zciId;
  496. });
  497. this.openApply = true;
  498. this.titleApply = "申请开票信息";
  499. },
  500. //去缴费
  501. handlePay(row){
  502. const zciId = row.zciId || this.ids;
  503. const maney = row.zfrAmount || this.ids;
  504. debugger
  505. this.$confirm('是否缴费融资金额"' + maney + '"元?', "警告", {
  506. confirmButtonText: "确定",
  507. cancelButtonText: "取消",
  508. type: "warning"
  509. }).then(function() {
  510. return changeZfiStatus(zciId);
  511. }).then(() => {
  512. this.getList();
  513. this.msgSuccess("缴费成功");
  514. })
  515. .catch(() => {
  516. this.$message({
  517. type: "warning",
  518. message: "已取消缴费",
  519. });
  520. });
  521. },
  522. /** 提交按钮 */
  523. submitForm() {
  524. var self = this;
  525. this.$refs["formApply"].validate(valid => {
  526. let fd = new FormData();
  527. for(var key in self.formApply){
  528. fd.append(key, self.formApply[key]);
  529. }
  530. if (valid) {
  531. if (this.formApply.scyId != null) {
  532. const loading = this.$loading({
  533. lock: true,
  534. text: "Loading",
  535. spinner: "el-icon-loading",
  536. background: "rgba(0, 0, 0, 0.7)",
  537. })
  538. applyInvoice(self.formApply).then(response => {
  539. this.msgSuccess("申请成功");
  540. this.openApply = false;
  541. this.getList();
  542. });
  543. loading.close();
  544. }
  545. }
  546. });
  547. },
  548. /** 导出按钮操作 */
  549. handleExport() {
  550. this.getList();
  551. const loading = this.$loading({
  552. lock: true,
  553. text: 'Loading',
  554. spinner: 'el-icon-loading',
  555. background: 'rgba(0, 0, 0, 0.7)'
  556. });
  557. this.download('/sc-service/cost/export', {
  558. ...this.queryParams, ...this.dateRange
  559. },'费用信息.xlsx')
  560. setTimeout(() => {
  561. loading.close();
  562. }, 2000);
  563. },
  564. //获取操作员Id
  565. getUser(){
  566. getUser().then(response => {
  567. this.userId = response.data;
  568. })
  569. }
  570. }
  571. };
  572. </script>