userCostManage.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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. >导出</el-button>
  81. </el-col>
  82. </el-row>
  83. <el-table v-loading="loading" :data="costList" stripe border>
  84. <el-table-column label="序号" type="index" width="55" align="center" />
  85. <el-table-column label="融资编号" align="center" prop="zfrNumber" v-if="uncheckList.zfiNumber" />
  86. <el-table-column label="开立企业" align="center" prop="coreScyName" v-if="uncheckList.coreScyName" show-overflow-tooltip />
  87. <el-table-column label="融资产品" align="center" prop="zfpName" v-if="uncheckList.zfpName" show-overflow-tooltip />
  88. <el-table-column label="融资金额" align="center" prop="zfrAmount" v-if="uncheckList.zfrAmount" show-overflow-tooltip />
  89. <el-table-column label="融资状态" align="center" prop="zfrStatus" :formatter="zfrStatusFormat" v-if="uncheckList.zfrStatus" show-overflow-tooltip />
  90. <el-table-column label="费用状态" align="center" prop="zciStatus" :formatter="zciStatusFormat" v-if="uncheckList.zciStatus" show-overflow-tooltip />
  91. <el-table-column label="创建时间" align="center" prop="createTime" v-if="uncheckList.createTime" show-overflow-tooltip />
  92. <el-table-column label="手续费" align="center" prop="zciAmount" v-if="uncheckList.zciAmount " show-overflow-tooltip />
  93. <el-table-column label="发票状态" align="center" prop="zciInvoiceStatus" :formatter="zciInvoiceStatusFormat" v-if="uncheckList.zciInvoiceStatus" show-overflow-tooltip />
  94. <el-table-column label="快递单号" align="center" prop="zciExpressNo" v-if="uncheckList.zciExpressNo" show-overflow-tooltip />
  95. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
  96. <template slot-scope="scope">
  97. <el-button
  98. v-if="scope.row.zciInvoiceStatus == '2' || scope.row.zciInvoiceStatus == '4'"
  99. size="mini"
  100. type="text"
  101. @click="handleUpdate(scope.row)"
  102. v-hasPermi="['service:cost:update']"
  103. >发票</el-button>
  104. <el-button
  105. v-if="scope.row.zciInvoiceStatus == '0' && scope.row.zciStatus == '02'"
  106. size="mini"
  107. type="text"
  108. @click="handleApply(scope.row)"
  109. v-hasPermi="['service:cost:update']"
  110. >申请开票</el-button>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <pagination
  115. v-show="total > 0"
  116. :total="total"
  117. :page.sync="queryParams.pageNum"
  118. :limit.sync="queryParams.pageSize"
  119. @pagination="getList"
  120. />
  121. <!-- 发票框 -->
  122. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  123. <el-form ref="form" :model="form" label-width="140px" :inline="true">
  124. <el-form-item label="企业名称" prop="scyName">
  125. <el-input v-model="form.scyName" disabled />
  126. </el-form-item>
  127. <el-form-item label="企业统一代码" prop="scySocialCode">
  128. <el-input v-model="form.scySocialCode" disabled />
  129. </el-form-item>
  130. <el-form-item label="企业注册电话" prop="scyPhone">
  131. <el-input v-model="form.scyPhone" disabled />
  132. </el-form-item>
  133. <el-form-item label="收件人" prop="ziaContacts">
  134. <el-input v-model="form.ziaContacts" disabled />
  135. </el-form-item>
  136. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  137. <el-input v-model="form.ziaContactsPhone" disabled />
  138. </el-form-item>
  139. <el-form-item label="邮寄地址" prop="ziaAddress">
  140. <el-input v-model="form.ziaAddress" disabled />
  141. </el-form-item>
  142. <el-form-item label="快递单号" prop="zciExpressNo">
  143. <el-input v-model="form.zciExpressNo" disabled/>
  144. </el-form-item>
  145. </el-form>
  146. <div slot="footer" class="dialog-footer">
  147. <el-button @click="cancel">取 消</el-button>
  148. </div>
  149. </el-dialog>
  150. <!-- 申请开票框 -->
  151. <el-dialog :title="titleApply" :visible.sync="openApply" width="800px" append-to-body>
  152. <el-form ref="formApply" :model="formApply" :rules="rulesApply" label-width="140px" :inline="true">
  153. <el-form-item label="企业名称" prop="scyName">
  154. <el-input v-model="formApply.scyName" disabled />
  155. </el-form-item>
  156. <el-form-item label="企业统一代码" prop="scySocialCode">
  157. <el-input v-model="formApply.scySocialCode" disabled />
  158. </el-form-item>
  159. <el-form-item label="企业注册电话" prop="scyPhone">
  160. <el-input v-model="formApply.scyPhone" disabled />
  161. </el-form-item>
  162. <el-form-item label="收件人" prop="ziaContacts">
  163. <el-input v-model="formApply.ziaContacts" placeholder="请输入收件人" maxlength="20" show-word-limit />
  164. </el-form-item>
  165. <el-form-item label="收件人电话" prop="ziaContactsPhone">
  166. <el-input v-model="formApply.ziaContactsPhone" placeholder="请输入收件人电话" maxlength="11" show-word-limit />
  167. </el-form-item>
  168. <el-form-item label="邮寄地址" prop="ziaAddress">
  169. <el-input v-model="formApply.ziaAddress" placeholder="请输入邮寄地址" maxlength="30" show-word-limit />
  170. </el-form-item>
  171. </el-form>
  172. <div slot="footer" class="dialog-footer">
  173. <el-button type="primary" @click="submitForm">确 定</el-button>
  174. <el-button @click="cancel">取 消</el-button>
  175. </div>
  176. </el-dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import { listCost, listInvoice, selectInvoiceList, applyInvoice, invoicing, daleteInvoice, getUser } from "@/api/service/cost/costManage";
  181. import { uploadFileNew } from "@/api/common/file";
  182. import { getToken } from "@/utils/auth";
  183. import {columnQuery,columnfilter} from "@/api/common/columnSetting";
  184. import ColumnSetting from '../../../components/Table/columnSetting.vue';
  185. export default {
  186. name: "userCostManage",
  187. components: {
  188. ColumnSetting
  189. },
  190. data() {
  191. return {
  192. //费用列表
  193. costList:[],
  194. //创建时间范围
  195. dateRange: [],
  196. //费用状态
  197. zciStatusOptions:[],
  198. //发票状态
  199. zciInvoiceStatusOptions:[],
  200. //融资状态
  201. zfrStatusOptions:[],
  202. //操作员Id
  203. userId : "",
  204. // 遮罩层
  205. loading: true,
  206. // 选中数组
  207. ids: [],
  208. // 非多个禁用
  209. multiple: true,
  210. // 显示搜索条件
  211. showSearch: true,
  212. // 总条数
  213. // 弹出层标题
  214. title: "",
  215. openInvoiceTitle:"",
  216. titleApply:"",
  217. total: 0,
  218. // 是否显示弹出层
  219. open: false,
  220. openInvoice:false,
  221. openApply:false,
  222. // 链属查询参数
  223. queryParams: {
  224. pageNum: 1,
  225. pageSize: 10,
  226. zfiNumber: null,
  227. zciStatus: null,
  228. zfrStatus:null,
  229. zciInvoiceStatus: null
  230. },
  231. //筛选按钮的数据列表,与table表头的数据一致 --显示隐藏列用
  232. tableList: [
  233. {
  234. label: 'zfiNumber',
  235. value: '融资编号'
  236. },
  237. {
  238. label: 'supScyName',
  239. value: '融资企业'
  240. },
  241. {
  242. label: 'coreScyName',
  243. value: '开立企业'
  244. },
  245. {
  246. label: 'zfpName',
  247. value: '融资产品'
  248. },
  249. {
  250. label: 'zfrAmount',
  251. value: '融资金额'
  252. },
  253. {
  254. label: 'zciStatus',
  255. value: '费用状态'
  256. },
  257. {
  258. label: 'zfrStatus',
  259. value: '融资状态'
  260. },
  261. {
  262. label: 'createTime',
  263. value: '创建时间'
  264. },
  265. {
  266. label: 'zciAmount',
  267. value: '手续费'
  268. },
  269. {
  270. label: 'zciInvoiceStatus',
  271. value: '发票状态'
  272. },
  273. {
  274. label: 'zciExpressNo',
  275. value: '快递单号'
  276. },
  277. ],
  278. checkList: [],//筛选列选中的数据列表--显示隐藏列用
  279. uncheckList: {},//控制筛选列显示隐藏--显示隐藏列用
  280. selfDom : this,
  281. tableId:"/sc-service/cost/list",
  282. // 表单参数
  283. form: {
  284. zciId:null,
  285. scyId:null,
  286. scyName:null,
  287. scySocialCode:null,
  288. scyPhone:null,
  289. ziaContacts:null,
  290. ziaContactsPhone:null,
  291. ziaAddress:null,
  292. zciExpressNo:null,
  293. zciInvoiceStatus:null
  294. },
  295. formApply:{
  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. // 表单校验
  308. rulesApply: {
  309. ziaContacts: [
  310. { required: true, message: "收件人不能为空", trigger: "blur" },
  311. ],
  312. ziaContactsPhone: [
  313. { required: true, message: "收件人电话不能为空", trigger: "blur" },
  314. {
  315. pattern: /^((\d{3}-\d{7,8}|\d{4}-\d{7,8})|(1[3465789]\d{9}))$/,
  316. message: "电话格式不正确",
  317. trigger: "blur",
  318. }
  319. ],
  320. ziaAddress: [
  321. { required: true, message: "邮寄地址不能为空", trigger: "blur" },
  322. ]
  323. },
  324. };
  325. },
  326. created() {
  327. this.getDicts("ser_zci_status").then(response => {
  328. this.zciStatusOptions = response.data;
  329. });
  330. this.getDicts(" ser_zci_invoice_status").then(response => {
  331. this.zciInvoiceStatusOptions = response.data;
  332. });
  333. this.getDicts(" ser_zfr_status").then(response => {
  334. this.zfrStatusOptions = response.data;
  335. });
  336. this.getList();
  337. this.getUser();
  338. },
  339. activated() {
  340. this.getDicts("ser_zci_status").then(response => {
  341. this.zciStatusOptions = response.data;
  342. });
  343. this.getDicts(" ser_zci_invoice_status").then(response => {
  344. this.zciInvoiceStatusOptions = response.data;
  345. });
  346. this.getDicts(" ser_zfr_status").then(response => {
  347. this.zfrStatusOptions = response.data;
  348. });
  349. this.getList();
  350. this.getUser();
  351. },
  352. mounted() {
  353. this.columnQuery();
  354. },
  355. methods: {
  356. //获取当前客户是否之前设置过列展示隐藏
  357. columnQuery(){
  358. //获取页面路径
  359. var psfPagePath = window.location.pathname;
  360. //用请求后台的url作为唯一标识
  361. var psfTableName = this.tableId;
  362. var columnForm = {};
  363. columnForm.psfPagePath = psfPagePath;
  364. columnForm.psfTableName = psfTableName;
  365. columnQuery(columnForm).then(response => {
  366. if(response.data && response.data.psfShowData){
  367. this.checkList = response.data.psfShowData;
  368. }
  369. this.filter();
  370. })
  371. },
  372. //控制隐藏显示的函数
  373. filter(checkList) {
  374. if (!!checkList) {
  375. this.checkList = checkList;
  376. }
  377. columnfilter(this.selfDom);
  378. },
  379. //菜单状态字典翻译
  380. zciStatusFormat(row, column) {
  381. return this.selectDictLabel(this.zciStatusOptions, row.zciStatus);
  382. },
  383. zciInvoiceStatusFormat(row, column) {
  384. return this.selectDictLabel(this.zciInvoiceStatusOptions, row.zciInvoiceStatus);
  385. },
  386. zfrStatusFormat(row, column) {
  387. return this.selectDictLabel(this.zfrStatusOptions, row.zfrStatus);
  388. },
  389. /** 查询链属列表 */
  390. getList() {
  391. this.loading = true;
  392. listCost(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  393. this.costList = response.data.records;
  394. this.total = response.data.total;
  395. this.loading = false;
  396. }
  397. );
  398. },
  399. // 取消按钮
  400. cancel() {
  401. this.open = false;
  402. this.reset();
  403. },
  404. // 表单重置
  405. reset() {
  406. this.resetForm("form");
  407. },
  408. /** 搜索按钮操作 */
  409. handleQuery() {
  410. this.queryParams.pageNum = 1;
  411. this.getList();
  412. },
  413. /** 重置按钮操作 */
  414. resetQuery() {
  415. this.resetForm("queryForm");
  416. this.dateRange = [];
  417. this.handleQuery();
  418. },
  419. /** 发票按钮操作 */
  420. handleUpdate(row) {
  421. const zciId = row.zciId || this.ids;
  422. const scyId = row.zfiSupplierId || this.ids;
  423. listInvoice(scyId,zciId).then(response => {
  424. this.form = response.data[0];
  425. this.form.zciId = zciId;
  426. });
  427. this.open = true;
  428. this.title = "发票信息";
  429. },
  430. /** 发票按钮操作 */
  431. handleApply(row) {
  432. const zciId = row.zciId || this.ids;
  433. const scyId = row.zfiSupplierId || this.ids;
  434. listInvoice(scyId,zciId).then(response => {
  435. this.formApply = response.data[0];
  436. this.formApply.zciId = zciId;
  437. });
  438. this.openApply = true;
  439. this.titleApply = "申请开票信息";
  440. },
  441. /** 提交按钮 */
  442. submitForm() {
  443. var self = this;
  444. this.$refs["formApply"].validate(valid => {
  445. let fd = new FormData();
  446. for(var key in self.formApply){
  447. fd.append(key, self.formApply[key]);
  448. }
  449. if (valid) {
  450. if (this.formApply.scyId != null) {
  451. const loading = this.$loading({
  452. lock: true,
  453. text: "Loading",
  454. spinner: "el-icon-loading",
  455. background: "rgba(0, 0, 0, 0.7)",
  456. })
  457. applyInvoice(self.formApply).then(response => {
  458. this.msgSuccess("申请成功");
  459. this.openApply = false;
  460. this.getList();
  461. });
  462. loading.close();
  463. }
  464. }
  465. });
  466. },
  467. /** 导出按钮操作 */
  468. handleExport() {
  469. this.getList();
  470. const loading = this.$loading({
  471. lock: true,
  472. text: 'Loading',
  473. spinner: 'el-icon-loading',
  474. background: 'rgba(0, 0, 0, 0.7)'
  475. });
  476. this.download('/sc-service/cost/export', {
  477. ...this.queryParams, ...this.dateRange
  478. },'费用信息.xlsx')
  479. setTimeout(() => {
  480. loading.close();
  481. }, 2000);
  482. },
  483. //获取操作员Id
  484. getUser(){
  485. getUser().then(response => {
  486. this.userId = response.data;
  487. })
  488. }
  489. }
  490. };
  491. </script>