receivable_list.vue 13 KB

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