receivable_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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="totalAmount" min-width="120" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. {{ scope.row.totalAmount | numToFixed }}
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip fixed="right">
  114. <template slot-scope="scope">
  115. <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>
  116. <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="bringFn(scope.row.id)">提审</el-button>
  117. <el-button type="text" v-if="scope.row.examineStatus == 'OK' || scope.row.examineStatus == 'FAIL'" @click="unApprovalFn(scope.row.id)">弃审</el-button>
  118. <el-button type="text" v-if="scope.row.examineStatus == 'SAVE'" @click="detailFn(scope.row.id,'edit')">编辑</el-button>
  119. <el-button type="text" @click="detailFn(scope.row.id,'detail')">详情</el-button>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. </div>
  124. <!-- 分页 -->
  125. <div class="fr">
  126. <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">
  127. </el-pagination>
  128. </div>
  129. </div>
  130. </div>
  131. <ReceivableListAdd @updateList="updateList" v-else-if="showPage == 2" />
  132. <ReceivableListApproval :approvalId="approvalId" @updateList="updateList" v-else-if="showPage == 3" />
  133. <ReceivableListDetail :approvalId="approvalId" :czType='czType' v-else-if="showPage == 4" />
  134. </div>
  135. </template>
  136. <script>
  137. import { getCustomerList } from "@/api/finance/wallet";
  138. import {
  139. getFinanceOtherReceList,
  140. getFinanceOtherReceDelete,
  141. getFinanceOtherReceApply,
  142. getFinanceOtherReceAbandon,
  143. } from "@/api/finance/receivable_list";
  144. import ReceivableListAdd from "./components/receivable_list-add";
  145. import ReceivableListApproval from "./components/receivable_list-approval";
  146. import ReceivableListDetail from "./components/receivable_list-detail";
  147. export default {
  148. components: {
  149. ReceivableListAdd,
  150. ReceivableListApproval,
  151. ReceivableListDetail,
  152. },
  153. data() {
  154. return {
  155. customerList: [],
  156. currentPage: 1, // 当前页码
  157. pageSize: 10, // 每页数量
  158. listTotal: 0, // 列表总数
  159. dataList: [], // 列表数据
  160. searchForm: {
  161. source: "",
  162. code: "",
  163. userName: "",
  164. startTime: "",
  165. endTime: "",
  166. }, //搜索表单
  167. listLoading: false, // 列表加载loading
  168. examine: "",
  169. showPage: 1,
  170. approvalId: null,
  171. czType: "",
  172. deleList: [],
  173. };
  174. },
  175. computed: {
  176. exParams() {
  177. return {
  178. source: this.searchForm.source,
  179. code: this.searchForm.code,
  180. userName: this.searchForm.userName,
  181. startTime: this.searchForm.startTime,
  182. endTime: this.searchForm.endTime,
  183. examineStatus: this.examine,
  184. };
  185. },
  186. },
  187. created() {
  188. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  189. this.getCustomerDataList();
  190. },
  191. methods: {
  192. //获取经销商列表
  193. async getCustomerDataList() {
  194. let res = await getCustomerList({
  195. pageNum: 1,
  196. pageSize: -1,
  197. });
  198. this.customerList = res.data.records;
  199. },
  200. //提审
  201. async bringFn(id) {
  202. await getFinanceOtherReceApply({ id });
  203. this.$message.success("提审成功");
  204. this.getDataList({
  205. pageNum: this.currentPage,
  206. pageSize: this.pageSize,
  207. examineStatus: this.examine,
  208. });
  209. },
  210. //弃审
  211. async unApprovalFn(id) {
  212. await getFinanceOtherReceAbandon({ id });
  213. this.$message.success("弃审成功");
  214. this.getDataList({
  215. pageNum: this.currentPage,
  216. pageSize: this.pageSize,
  217. examineStatus: this.examine,
  218. });
  219. },
  220. //radio切换'
  221. changeRadioGroupFn(v) {
  222. this.getDataList({
  223. pageSize: this.pageSize,
  224. pageNum: this.currentPage,
  225. examineStatus: v,
  226. });
  227. },
  228. // 更改每页数量
  229. handleSizeChange(val) {
  230. this.pageSize = val;
  231. this.currentPage = 1;
  232. this.getDataList({
  233. pageNum: 1,
  234. pageSize: this.pageSize,
  235. examineStatus: this.examine,
  236. });
  237. },
  238. // 更改当前页
  239. handleCurrentChange(val) {
  240. this.currentPage = val;
  241. this.getDataList({
  242. pageNum: val,
  243. pageSize: 10,
  244. examineStatus: this.examine,
  245. });
  246. },
  247. //清除
  248. async clearFn() {
  249. await this.$refs.searchForm.resetFields();
  250. this.examine = "";
  251. },
  252. //搜索
  253. searchFn() {
  254. this.getDataList({
  255. ...this.searchForm,
  256. // examineStatus: this.examine,
  257. pageSize: this.pageSize,
  258. pageNum: this.currentPage,
  259. });
  260. },
  261. //删除
  262. async deleFn() {
  263. let res = this.deleList.toString();
  264. console.log(res);
  265. await getFinanceOtherReceDelete({ ids: res });
  266. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  267. this.$message.success("删除成功");
  268. this.deleList = [];
  269. },
  270. selectionChangeFn(value) {
  271. // console.log(value);
  272. const res = value.map((v) => v.id);
  273. // console.log(res);
  274. this.deleList = res;
  275. },
  276. //新建后更新列表
  277. updateList() {
  278. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  279. },
  280. //获取来列表数据
  281. async getDataList(data) {
  282. let res = await getFinanceOtherReceList(data);
  283. // console.log(res);
  284. res.data.records.forEach((item) => {
  285. item.sums2 = ["totalAmount"];
  286. item.sums1 = ["totalAmount"];
  287. });
  288. this.dataList = res.data.records;
  289. this.listTotal = res.data.total;
  290. },
  291. //详情
  292. detailFn(id, type) {
  293. this.czType = type;
  294. this.approvalId = id;
  295. this.showPage = 4;
  296. },
  297. //审批
  298. approvalFn(id) {
  299. this.approvalId = id;
  300. this.showPage = 3;
  301. },
  302. //新建
  303. addFn() {
  304. this.showPage = 2;
  305. },
  306. },
  307. };
  308. </script>
  309. <style lang="scss" scoped>
  310. .selectStyle {
  311. width: 100%;
  312. }
  313. .dateStyle {
  314. width: 100%;
  315. }
  316. .delClass {
  317. margin-left: 10px;
  318. }
  319. </style>