userCostManage.vue 20 KB

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