payDetailList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <div class="custom-tree-container">
  3. <el-row class="handle-box" :gutter="10" style="margin-bottom: 10px">
  4. <el-form
  5. ref="elForm"
  6. :model="search"
  7. :rules="rules"
  8. size="medium"
  9. >
  10. <el-col :span="4">
  11. <el-form-item label="" prop="name" style="margin-bottom: 0">
  12. <el-input
  13. size="small"
  14. v-model="search.name"
  15. :style="{ width: '100%' }"
  16. clearable
  17. placeholder="请输入项目名"
  18. />
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="4">
  22. <el-form-item label="" prop="name" style="margin-bottom: 0">
  23. <el-input
  24. size="small"
  25. v-model="search.supplierName"
  26. :style="{ width: '100%' }"
  27. clearable
  28. placeholder="请输入供应商"
  29. />
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="4">
  33. <el-form-item label="" prop="name" style="margin-bottom: 0">
  34. <el-date-picker
  35. id="datePicker"
  36. v-model="timeValue"
  37. size="small"
  38. type="daterange"
  39. align="right"
  40. unlink-panels
  41. range-separator="-"
  42. start-placeholder="流程开始日期"
  43. end-placeholder="流程结束日期"
  44. value-format="yyyy-MM-dd"
  45. :picker-options="pickerOptions"
  46. @change="pickerChange"
  47. />
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="16">
  51. <div style="width: auto;float: right">
  52. <el-button class="ch-button-warning" plain size="small" @click="handleReset()"><i
  53. class="el-icon-aim"
  54. />&nbsp;重置
  55. </el-button>
  56. <el-button class="ch-button" size="small" @click="handleSearch()"><i class="el-icon-search"/>&nbsp;搜索
  57. </el-button>
  58. <el-button size="small" type="success" @click="confirmOutput()"><i class="el-icon-download"/>&nbsp;导出
  59. </el-button>
  60. </div>
  61. </el-col>
  62. </el-form>
  63. </el-row>
  64. <el-row class="handle-box">
  65. <el-col :span="24">
  66. <el-table
  67. v-loading="loading"
  68. :cell-style="styleBack"
  69. :data="tableData"
  70. row-class-name="g_table_row"
  71. stripe
  72. fit
  73. style="width: 100%"
  74. >
  75. <el-table-column label="序号" fixed type="index" width="60"/>
  76. <el-table-column label="付款申请单号" fixed prop="form_id" width="175"/>
  77. <el-table-column label="申请人" prop="truename" width="100"/>
  78. <el-table-column label="所在部门" prop="dept_name" width="100"/>
  79. <el-table-column label="流程发起时间" prop="created_at" width="125"/>
  80. <el-table-column label="流程结束时间" prop="last_update_time" width="125"/>
  81. <el-table-column label="关联采购单号" prop="order_no" width="125"/>
  82. <el-table-column label="关联项目名称" prop="pro_name" width="175"/>
  83. <el-table-column label="采购内容" prop="remark" width="170">
  84. <template scope="scope">
  85. <el-tooltip class="item" effect="dark" :content="scope.row.remark" placement="top">
  86. <div class="chaochuyingcang">{{ scope.row.remark }}</div>
  87. </el-tooltip>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="付款名称" prop="pay_name" width="125"/>
  91. <el-table-column label="支付金额(元)" prop="pay_money" width="125"/>
  92. <el-table-column label="供应商" prop="biz_name"/>
  93. <el-table-column label="支付方式" prop="pay_type"/>
  94. <el-table-column label="发票号" prop="bill_number" width="200"/>
  95. <el-table-column label="税率%" prop="bill_rate"/>
  96. <el-table-column label="制单日期" prop="createCardTime" width="125"/>
  97. <el-table-column label="实际支付日期" prop="pay_time" width="125"/>
  98. <el-table-column label="当前流程状态" prop="flow_status" width="125"/>
  99. <el-table-column label="发票附件" prop="file_data_ids" min-width="175">
  100. <template scope="scope">
  101. <el-button
  102. style="padding: 0;margin: 0"
  103. v-for="file in scope.row.file_data_ids"
  104. type="text"
  105. @click="downLoadFile(file.id)"
  106. >
  107. {{ file.fileName }}
  108. </el-button>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <div class="table-page">
  113. <el-pagination
  114. :current-page.sync="currentPage"
  115. :page-size="pageSize"
  116. :total="allpage"
  117. background
  118. layout="total, prev, pager, next"
  119. @current-change="handleCurrentChange"
  120. />
  121. </div>
  122. </el-col>
  123. </el-row>
  124. </div>
  125. </template>
  126. <script>
  127. import common from '@/static/utils/common'
  128. import Base from '../base/base'
  129. import BaseData from '../base/baseData'
  130. import BaseDept from '../base/baseDept'
  131. export default {
  132. mixins: [Base, BaseData, BaseDept],
  133. data() {
  134. return {
  135. timeValue: '',
  136. // 查询数据的内容
  137. search: {},
  138. departmentIds: '',
  139. deptAttr: '',
  140. // 通用字典项
  141. AUDIT_TYPE: [],
  142. dc_key: ['PAY_TYPE'],
  143. dc_map: {},
  144. // 列表相关
  145. cusName: '',
  146. auditStatus: '',
  147. auditType: '',
  148. proName: '',
  149. applyBy: '',
  150. tableData: [],
  151. loading: false,
  152. UserMap: {},
  153. // 分页
  154. currentPage: 1,
  155. allpage: 0,
  156. pageSize: 12,
  157. // 弹框相关
  158. currAuditId: '',
  159. dialogVisible: false,
  160. dialogTitle: '新增',
  161. isAdd: true,
  162. detailList: [],
  163. rules: {},
  164. OutData: []
  165. }
  166. },
  167. mounted() {
  168. const _this = this
  169. _this.getData()
  170. this.initDict().then(() => {
  171. if (this.DeptAttrData.length > 0) {
  172. this.deptAttr = this.DeptAttrData[0].value
  173. this.initDepartment({ deptAttr: this.deptAttr })
  174. }
  175. })
  176. },
  177. methods: {
  178. pickerChange: function(val) {
  179. if(val){
  180. this.search.startTime = val[0]
  181. this.search.endTime = val[1]
  182. }else{
  183. this.search.startTime = ''
  184. this.search.endTime = ''
  185. }
  186. },
  187. downLoadFile(id) {
  188. window.open(this.$constant.BASE_URI + '/FileController/download/' + id)
  189. },
  190. styleBack({ row, column, rowIndex, columnIndex }) {
  191. if (row.isFirst == 1) return { backgroundColor: '#FDBABB' }
  192. },
  193. addAttrDept: function() {
  194. if (!this.form.selectDepts) this.form.selectDepts = []
  195. this.form.selectDepts.push({
  196. userId: this.form.id,
  197. attrId: '',
  198. deptAttrs: this.DeptAttrData,
  199. deptId: '',
  200. depts: [],
  201. postIds: []
  202. })
  203. },
  204. dlgOpen: function() {
  205. const _this = this
  206. if (this.form.id) {
  207. this.baseRequest('getById', {
  208. id: this.form.id
  209. }).then((res) => {
  210. if (res.data) {
  211. _this.form.groupId = res.data.groupId
  212. _this.form.username = res.data.username
  213. _this.form.truename = res.data.truename
  214. _this.form.staffCode = res.data.staffCode
  215. _this.form.gender = res.data.gender
  216. _this.form.leader = res.data.leader
  217. _this.form.position = res.data.position
  218. _this.form.posts = res.data.posts ? res.data.posts.split(',') : []
  219. if (_this.form.posts.length) {
  220. _this.initPosition2(_this.form.posts)
  221. }
  222. _this.form.sequenceNo = res.data.sequenceNo
  223. _this.form.phone = res.data.phone
  224. _this.form.secretKey = res.data.secretKey
  225. _this.form.comment = res.data.comment
  226. _this.form.selectDepartment = res.data.department
  227. _this.form.selectDepts = []
  228. _this.userDeptRequest('listByUserId', {
  229. userId: _this.form.id
  230. }).then(resDept => {
  231. if (resDept.data) {
  232. resDept.data.forEach(dept => {
  233. dept.postIds = dept.posts ? dept.posts.split(',') : []
  234. dept.deptAttrs = _this.DeptAttrData
  235. if (dept.attrId) {
  236. dept.depts = _this.TempDepts.filter(tempDept => {
  237. return tempDept.deptAttr === dept.attrId
  238. })
  239. }
  240. _this.form.selectDepts.push(dept)
  241. })
  242. }
  243. // console.log('listByUserId', _this.form.selectDepts)
  244. })
  245. }
  246. }).catch(() => {
  247. })
  248. }
  249. },
  250. handleDeptAttrChange: function(val) {
  251. this.selectDeptNode = this.getDeptDefaultTopNode()
  252. this.deptAttr = val
  253. this.initDepartment({ deptAttr: val })
  254. this.handleSearch()
  255. },
  256. handleDeptNodeClick(data, node, ocx) {
  257. this.departmentIds = data.id
  258. this.getData()
  259. },
  260. handleCloseDept: function() {
  261. this.selectDeptNode = this.getDeptDefaultTopNode()
  262. this.handleSearch()
  263. },
  264. confirmOutput() {
  265. const OutSize = [
  266. { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
  267. { wch: 15 }, { wch: 15 }, { wch: 25 }, { wch: 25 }, { wch: 15 }, { wch: 15 }, { wch: 15 }
  268. , { wch: 15 }, { wch: 15 }, { wch: 15 }]
  269. const fileName = '付款申请明细' + new Date().Format('yyyy-MM-dd')
  270. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  271. },
  272. getPostData: function() {
  273. const postData = {
  274. departmentIds: this.departmentIds,
  275. name: this.search.name,
  276. startTime: this.search.startTime,
  277. endTime: this.search.endTime,
  278. supplierName: this.search.supplierName,
  279. pageNum: this.currentPage,
  280. pageSize: this.pageSize
  281. }
  282. const currUser = this.$common.currUser()
  283. if (currUser && currUser.groupId) {
  284. postData.groupId = common.currUser().groupId
  285. }
  286. if (!this.$common.isAdmin()) {
  287. postData.chargedby = this.$common.currUser().id
  288. }
  289. return postData
  290. },
  291. initOutData: function() {
  292. const _this = this
  293. this.OutData = [[
  294. '付款申请单', '申请人', '所在部门', '流程发起时间', '流程结束时间', '关联采购单号',
  295. '关联项目名称', '采购内容', '付款名称', '支付金额', '供应商'
  296. , '支付方式', '发票号', '税率%', '制单日期', '实际支付日期', '当前流程状态'
  297. ]]
  298. const postData = this.getPostData()
  299. this.baseRequest1('findAllApplyPaymentListByInfo', postData).then((res) => {
  300. try {
  301. if (res.data) {
  302. res.data.forEach(function(item) {
  303. const jsonMap = _this.getItemJson(item)
  304. const jsonArray = [
  305. jsonMap.form_id,
  306. jsonMap.truename,
  307. jsonMap.dept_name,
  308. jsonMap.created_at,
  309. jsonMap.last_update_time,
  310. jsonMap.order_no,
  311. jsonMap.pro_name,
  312. jsonMap.remark,
  313. jsonMap.pay_name,
  314. jsonMap.pay_money,
  315. jsonMap.biz_name,
  316. jsonMap.pay_type,
  317. jsonMap.bill_number,
  318. jsonMap.bill_rate,
  319. jsonMap.createCardTime,
  320. jsonMap.pay_time,
  321. jsonMap.flow_status
  322. ]
  323. console.log(jsonArray)
  324. _this.OutData.push(jsonArray)
  325. })
  326. }
  327. } catch (e) {
  328. }
  329. }).catch(() => {
  330. })
  331. },
  332. async changeStatus(row) {
  333. let status = row.status == 0 ? 2 : row.status == 2 ? 0 : null
  334. this.loading = true
  335. let { data } = await this.baseRequest1('noOrUse', { id: row.id, status })
  336. if (data.code == 200) {
  337. this.loading = false
  338. this.getData()
  339. this.$message.success('状态修改成功')
  340. }
  341. },
  342. async openHolidayDialog(status, row) {
  343. this.$refs.addOrEditHoliiday.setVisible(status, row)
  344. },
  345. handleCurrentChange: function(val) {
  346. this.currentPage = val
  347. this.getData()
  348. },
  349. recallApply: function(row, type) {
  350. const _this = this
  351. _this.$confirm('该流程已经在审核中,撤回后原审核内容将作废确认撤回吗?', '提示', {
  352. confirmButtonText: '确定',
  353. cancelButtonText: '取消',
  354. type: 'warning'
  355. }).then(function() {
  356. const deleting = _this.$notify({
  357. title: '正在撤回,请稍等',
  358. type: 'warning'
  359. })
  360. const postData = {
  361. flowMainid: row.id
  362. }
  363. _this.baseRequest2(
  364. 'FlowMainController',
  365. 'recallApply',
  366. postData).then(res => {
  367. if (res.data.code === 200) {
  368. _this.getData()
  369. deleting.close()
  370. _this.$notify({
  371. title: '撤回成功',
  372. type: 'info'
  373. })
  374. } else {
  375. deleting.close()
  376. _this.dialogVisible = false
  377. _this.$notify({
  378. title: '撤回失败',
  379. type: 'info'
  380. })
  381. }
  382. }).catch((err) => {
  383. deleting.close()
  384. _this.$alert(err)
  385. })
  386. }).catch(function(error) {
  387. console.error(error)
  388. })
  389. },
  390. // 初始化获取数据
  391. getData() {
  392. const _this = this
  393. const postData = {
  394. name: _this.search.name,
  395. supplierName: _this.search.supplierName,
  396. startTime: _this.search.startTime,
  397. endTime: this.search.endTime,
  398. pageNum: _this.currentPage,
  399. pageSize: _this.pageSize
  400. }
  401. this.loading = true
  402. _this.baseRequest1('findApplyPaymentListByInfo', postData).then(res => {
  403. if (res.data) {
  404. this.loading = false
  405. _this.tableData = []
  406. res.data.rows.forEach(item => {
  407. item.noUseDate = item.noUseDate ? this.$common.transDate(item.noUseDate) : null
  408. item.restHolidayDate = item.restHolidayDate ? this.$common.transDate(item.restHolidayDate) : null
  409. item.joinDay = item.joinDay ? this.$common.transDate(item.joinDay) : null
  410. item.socialPayDay = item.socialPayDay ? this.$common.transDate(item.socialPayDay) : null
  411. _this.tableData.push(_this.getItemJson(item))
  412. })
  413. _this.allpage = res.data.total
  414. } else {
  415. _this.tableData = []
  416. }
  417. })
  418. this.initOutData()
  419. },
  420. getItemJson(item) {
  421. item.created_at = this.$common.transDate(item.created_at)
  422. item.last_update_time = this.$common.transDate(item.last_update_time)
  423. item.pay_time = this.$common.transDate(item.pay_time)
  424. item.createCardTime = this.$common.transDate(item.createCardTime)
  425. item.flow_status = item.flow_status == 1 ? '审批中' : '结束'
  426. item.xxx = '111'
  427. return item
  428. },
  429. handleSearch: function() {
  430. this.getData()
  431. },
  432. handleReset: function() {
  433. for (const i in this.search) {
  434. if (i !== 'pageNum' && i !== 'pageSize') {
  435. this.search[i] = ''
  436. }
  437. }
  438. this.handleSearch()
  439. },
  440. // 打开流程发起菜单
  441. handleClick(tab, event) {
  442. this.getData()
  443. },
  444. // 请求封装,继承类中调用,必须存在
  445. baseRequest1(opUrl, postData) {
  446. return this.$channel.globleRequest(
  447. 'ApplyPaymentController',
  448. opUrl,
  449. postData,
  450. 'project task'
  451. )
  452. },
  453. baseRequest2(controller, opUrl, postData) {
  454. return this.$channel.globleRequest(
  455. controller,
  456. opUrl,
  457. postData,
  458. 'project task'
  459. )
  460. }
  461. }
  462. }
  463. </script>
  464. <style lang="scss">
  465. .chaochuyingcang {
  466. width: 100%;
  467. white-space: nowrap;
  468. overflow: hidden;
  469. text-overflow: ellipsis;
  470. }
  471. .custom-tree-container .block-l {
  472. /*flex-grow: 2 ;*/
  473. float: left;
  474. width: 20%;
  475. padding: 0 8px 0 0;
  476. }
  477. .custom-tree-container .block-r {
  478. /*flex-grow: 10;*/
  479. float: left;
  480. width: 80%;
  481. /*padding: 0 0 0 8px;*/
  482. }
  483. .holidayRow {
  484. .el-select {
  485. width: 100%;
  486. }
  487. }
  488. .el-dropdown-link {
  489. cursor: pointer;
  490. color: rgba(39, 78, 219, 1);
  491. }
  492. .demonstration {
  493. display: block;
  494. color: #8492a6;
  495. font-size: 14px;
  496. margin-bottom: 20px;
  497. }
  498. .labeldom {
  499. .el-tabs__nav-wrap::after {
  500. background: none;
  501. }
  502. }
  503. .w200px {
  504. width: 200px;
  505. }
  506. </style>
  507. <style scoped>
  508. .ch-input .el-input__inner {
  509. border-radius: 0px;
  510. border-color: #32323a;
  511. }
  512. .ch-input-size {
  513. width: 150px;
  514. }
  515. .ch-button {
  516. borderund-color: #32323a;
  517. color: #fff;
  518. }
  519. .ch-button-warning {
  520. margin-left: 10px;
  521. border-radius: 0px;
  522. border-color: #E75B5B;
  523. background-color: #E75B5B;
  524. color: #fff;
  525. }
  526. </style>