receivable_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <Collapse :screen-form="searchForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="clearFn">清空</el-button>
  9. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  10. </template>
  11. <template #left_btn>
  12. <el-radio-group @change="changeRadioGroupFn" v-model="examine" size="mini">
  13. <el-radio-button label="">全部</el-radio-button>
  14. <el-radio-button label="WAIT">待审核</el-radio-button>
  15. <el-radio-button label="OK">审核通过</el-radio-button>
  16. <!-- <el-radio-button label="FAIL">审核驳回</el-radio-button> -->
  17. </el-radio-group>
  18. </template>
  19. <template #search>
  20. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  21. <el-row :gutter="20">
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="单据来源" prop="source">
  24. <el-select v-model="searchForm.source" class="selectStyle" placeholder="请选择" filterable>
  25. <el-option value="工程押金"> </el-option>
  26. <el-option value="保证金"> </el-option>
  27. <el-option value="工程价差"> </el-option>
  28. <el-option value="仓储费"> </el-option>
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="单据编号" prop="code">
  34. <el-input v-model="searchForm.code" placeholder="请输入"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :xs="24" :sm="12" :lg="6">
  38. <el-form-item label="往来单位" prop="userName">
  39. <!-- <el-input v-model="searchForm.userName" placeholder="请输入"></el-input> -->
  40. <el-select class="selectStyle" v-model="searchForm.userName" placeholder="请选择" filterable>
  41. <el-option v-for="(v, i) in customerList" :key="i" :label="v.name" :value="v.name"> </el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :xs="24" :sm="12" :lg="6">
  46. <el-form-item label="业务开始时间" prop="startTime">
  47. <el-date-picker
  48. class="dateStyle"
  49. v-model="searchForm.startTime"
  50. placeholder="选择日期"
  51. type="datetime"
  52. default-time="00:00:00"
  53. value-format="yyyy-MM-dd HH:mm:ss"
  54. >
  55. </el-date-picker>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="12" :lg="6">
  59. <el-form-item label="业务结束时间" prop="endTime">
  60. <el-date-picker
  61. class="dateStyle"
  62. v-model="searchForm.endTime"
  63. placeholder="选择日期"
  64. type="datetime"
  65. default-time="23:59:59"
  66. value-format="yyyy-MM-dd HH:mm:ss"
  67. >
  68. </el-date-picker>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :xs="24" :sm="12" :lg="6">
  72. <el-form-item label="审核人" prop="confirmName">
  73. <el-input v-model="searchForm.confirmName" placeholder="请输入审核人" />
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. </el-form>
  78. </template>
  79. </Collapse>
  80. </div>
  81. <!-- 按钮 -->
  82. <div class="btn-group clearfix">
  83. <div class="fl">
  84. <el-button
  85. v-if="$checkBtnRole('add', $route.meta.roles)"
  86. type="primary"
  87. icon="el-icon-plus"
  88. size="mini"
  89. @click="addFn"
  90. >新建</el-button
  91. >
  92. <el-popconfirm
  93. v-if="$checkBtnRole('del', $route.meta.roles)"
  94. class="delClass"
  95. @onConfirm="deleFn"
  96. title="这是一段内容确定删除吗?"
  97. >
  98. <el-button :disabled="deleList.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
  99. >批量删除</el-button
  100. >
  101. </el-popconfirm>
  102. </div>
  103. <div class="fr">
  104. <ExportButton :exUrl="'finance/other/rece/listExport'" :exParams="exParams" />
  105. </div>
  106. </div>
  107. <!-- 列表 -->
  108. <div class="mymain-container">
  109. <div class="table">
  110. <el-table
  111. v-loading="listLoading"
  112. :data="dataList"
  113. element-loading-text="Loading"
  114. border
  115. fit
  116. highlight-current-row
  117. stripe
  118. @selection-change="selectionChangeFn"
  119. show-summary
  120. :summary-method="$getSummaries"
  121. >
  122. <el-table-column align="center" type="selection" width="51"> </el-table-column>
  123. <el-table-column
  124. align="left"
  125. label="单据类型"
  126. prop="billType"
  127. min-width="100"
  128. show-overflow-tooltip
  129. ></el-table-column>
  130. <el-table-column
  131. align="left"
  132. label="单据来源"
  133. prop="source"
  134. min-width="100"
  135. show-overflow-tooltip
  136. ></el-table-column>
  137. <el-table-column align="left" label="单据编码" prop="code" min-width="190" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <CopyButton :copyText="scope.row.code" />
  140. <span>{{ scope.row.code }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column
  144. align="left"
  145. label="业务日期"
  146. prop="theTime"
  147. min-width="160"
  148. show-overflow-tooltip
  149. ></el-table-column>
  150. <el-table-column align="left" label="往来单位类型" prop="userType" min-width="140" show-overflow-tooltip>
  151. <template slot-scope="scope">
  152. {{ scope.row.userType == 'BD_Customer' ? '客户' : '' }}
  153. </template>
  154. </el-table-column>
  155. <el-table-column align="left" label="往来单位" prop="userName" min-width="260" show-overflow-tooltip>
  156. <template slot-scope="scope">
  157. <CopyButton :copyText="scope.row.userName" />
  158. <span>{{ scope.row.userName }}</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. align="left"
  163. label="币别"
  164. prop="amountType"
  165. min-width="100"
  166. show-overflow-tooltip
  167. ></el-table-column>
  168. <el-table-column align="left" label="单据状态" prop="examineStatus" min-width="160" show-overflow-tooltip>
  169. <template slot-scope="scope">
  170. <el-tag size="mini" v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  171. <el-tag size="mini" v-show="scope.row.examineStatus == 'WAIT'" type="warning">待审核</el-tag>
  172. <el-tag size="mini" v-show="scope.row.examineStatus == 'OK'" type="success">通过</el-tag>
  173. <el-tag size="mini" v-show="scope.row.examineStatus == 'FAIL'" type="danger">不通过</el-tag>
  174. <el-tag size="mini" v-show="scope.row.examineStatus == 'CLOSE'" type="info">已关闭</el-tag>
  175. </template>
  176. </el-table-column>
  177. <el-table-column align="right" label="总金额" prop="itemAmount" min-width="120" show-overflow-tooltip>
  178. <template slot-scope="scope">
  179. {{ scope.row.itemAmount | numToFixed }}
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. align="left"
  184. label="项目费用名称"
  185. prop="projectName"
  186. min-width="160"
  187. show-overflow-tooltip
  188. ></el-table-column>
  189. <el-table-column
  190. align="left"
  191. label="审核人"
  192. prop="examineBy"
  193. min-width="160"
  194. show-overflow-tooltip
  195. ></el-table-column>
  196. <el-table-column
  197. align="left"
  198. label="审核时间"
  199. prop="examineTime"
  200. min-width="160"
  201. show-overflow-tooltip
  202. ></el-table-column>
  203. <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
  204. <template slot-scope="scope">
  205. <el-button
  206. v-if="
  207. (scope.row.examineStatus == 'WAIT' || scope.row.examineStatus == 'FAIL') &&
  208. $checkBtnRole('examine', $route.meta.roles)
  209. "
  210. type="text"
  211. @click="approvalFn(scope.row.id)"
  212. >审批</el-button
  213. >
  214. <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="bringFn(scope.row.id)"
  215. >提审</el-button
  216. >
  217. <el-button
  218. type="text"
  219. v-if="scope.row.examineStatus == 'OK' || scope.row.examineStatus == 'FAIL'"
  220. @click="unApprovalFn(scope.row.id)"
  221. >弃审</el-button
  222. >
  223. <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="detailFn(scope.row.id, 'edit')"
  224. >编辑</el-button
  225. >
  226. <el-button type="text" @click="detailFn(scope.row.id, 'detail')">详情</el-button>
  227. </template>
  228. </el-table-column>
  229. </el-table>
  230. </div>
  231. <!-- 分页 -->
  232. <div class="fr">
  233. <el-pagination
  234. @size-change="handleSizeChange"
  235. @current-change="handleCurrentChange"
  236. :current-page="currentPage"
  237. :page-sizes="[10, 20, 30, 50]"
  238. :page-size="pageSize"
  239. layout="total, sizes, prev, pager, next, jumper"
  240. :total="listTotal"
  241. >
  242. </el-pagination>
  243. </div>
  244. </div>
  245. </div>
  246. <ReceivableListAdd @updateList="updateList" v-else-if="showPage == 2" />
  247. <ReceivableListApproval :approvalId="approvalId" @updateList="updateList" v-else-if="showPage == 3" />
  248. <ReceivableListDetail :approvalId="approvalId" :czType="czType" v-else-if="showPage == 4" />
  249. </div>
  250. </template>
  251. <script>
  252. import { getCustomerList } from '@/api/finance/wallet'
  253. import {
  254. getFinanceOtherReceList,
  255. getFinanceOtherReceDelete,
  256. getFinanceOtherReceApply,
  257. getFinanceOtherReceAbandon
  258. } from '@/api/finance/receivable_list'
  259. import ReceivableListAdd from './components/receivable_list-add'
  260. import ReceivableListApproval from './components/receivable_list-approval'
  261. import ReceivableListDetail from './components/receivable_list-detail'
  262. export default {
  263. components: {
  264. ReceivableListAdd,
  265. ReceivableListApproval,
  266. ReceivableListDetail
  267. },
  268. data() {
  269. return {
  270. customerList: [],
  271. currentPage: 1, // 当前页码
  272. pageSize: 10, // 每页数量
  273. listTotal: 0, // 列表总数
  274. dataList: [], // 列表数据
  275. searchForm: {
  276. source: '',
  277. code: '',
  278. userName: '',
  279. startTime: '',
  280. endTime: '',
  281. confirmName: ''
  282. }, //搜索表单
  283. listLoading: false, // 列表加载loading
  284. examine: '',
  285. showPage: 1,
  286. approvalId: null,
  287. czType: '',
  288. isCollapse: true,
  289. deleList: []
  290. }
  291. },
  292. computed: {
  293. exParams() {
  294. return {
  295. source: this.searchForm.source,
  296. code: this.searchForm.code,
  297. userName: this.searchForm.userName,
  298. startTime: this.searchForm.startTime,
  299. endTime: this.searchForm.endTime,
  300. examineStatus: this.examine
  301. }
  302. }
  303. },
  304. created() {
  305. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage })
  306. this.getCustomerDataList()
  307. },
  308. methods: {
  309. //获取经销商列表
  310. async getCustomerDataList() {
  311. let res = await getCustomerList({
  312. pageNum: 1,
  313. pageSize: -1
  314. })
  315. this.customerList = res.data.records
  316. },
  317. //提审
  318. async bringFn(id) {
  319. await getFinanceOtherReceApply({ id })
  320. this.$message.success('提审成功')
  321. this.getDataList({
  322. pageNum: this.currentPage,
  323. pageSize: this.pageSize,
  324. examineStatus: this.examine
  325. })
  326. },
  327. //弃审
  328. async unApprovalFn(id) {
  329. await getFinanceOtherReceAbandon({ id })
  330. this.$message.success('弃审成功')
  331. this.getDataList({
  332. pageNum: this.currentPage,
  333. pageSize: this.pageSize,
  334. examineStatus: this.examine
  335. })
  336. },
  337. //radio切换'
  338. changeRadioGroupFn(v) {
  339. this.getDataList({
  340. pageSize: this.pageSize,
  341. pageNum: this.currentPage,
  342. examineStatus: v
  343. })
  344. },
  345. // 更改每页数量
  346. handleSizeChange(val) {
  347. this.pageSize = val
  348. this.currentPage = 1
  349. this.getDataList({
  350. pageNum: 1,
  351. pageSize: this.pageSize,
  352. examineStatus: this.examine
  353. })
  354. },
  355. // 更改当前页
  356. handleCurrentChange(val) {
  357. this.currentPage = val
  358. this.getDataList({
  359. pageNum: val,
  360. pageSize: 10,
  361. examineStatus: this.examine
  362. })
  363. },
  364. //清除
  365. async clearFn() {
  366. await this.$refs.searchForm.resetFields()
  367. this.examine = ''
  368. },
  369. //搜索
  370. searchFn() {
  371. this.getDataList({
  372. ...this.searchForm,
  373. // examineStatus: this.examine,
  374. pageSize: this.pageSize,
  375. pageNum: this.currentPage
  376. })
  377. },
  378. //删除
  379. async deleFn() {
  380. let res = this.deleList.toString()
  381. console.log(res)
  382. await getFinanceOtherReceDelete({ ids: res })
  383. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage })
  384. this.$message.success('删除成功')
  385. this.deleList = []
  386. },
  387. selectionChangeFn(value) {
  388. // console.log(value);
  389. const res = value.map(v => v.itemId)
  390. // console.log(res);
  391. this.deleList = res
  392. },
  393. //新建后更新列表
  394. updateList() {
  395. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage })
  396. },
  397. //获取来列表数据
  398. async getDataList(data) {
  399. let res = await getFinanceOtherReceList(data)
  400. // console.log(res);
  401. res.data.records.forEach(item => {
  402. item.sums2 = ['itemAmount']
  403. item.sums1 = ['itemAmount']
  404. })
  405. this.dataList = res.data.records
  406. this.listTotal = res.data.total
  407. },
  408. //详情
  409. detailFn(id, type) {
  410. this.czType = type
  411. this.approvalId = id
  412. this.showPage = 4
  413. },
  414. //审批
  415. approvalFn(id) {
  416. this.approvalId = id
  417. this.showPage = 3
  418. },
  419. //新建
  420. addFn() {
  421. this.showPage = 2
  422. }
  423. }
  424. }
  425. </script>
  426. <style lang="scss" scoped>
  427. .selectStyle {
  428. width: 100%;
  429. }
  430. .dateStyle {
  431. width: 100%;
  432. }
  433. .delClass {
  434. margin-left: 10px;
  435. }
  436. </style>