index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div class="page-container list-container">
  3. <el-row :gutter="24" style="width: 100%">
  4. <el-col :span="12">
  5. <div class="dashboard-total-item">
  6. <div class="dashboard-total-item-label">
  7. <span>
  8. <span>预存款余额</span>
  9. </span>
  10. </div>
  11. <div class="number-label">¥ {{ totalRemain ? totalRemain : 0 }}</div>
  12. </div>
  13. </el-col>
  14. <el-col :span="12">
  15. <div class="dashboard-total-item">
  16. <div class="dashboard-total-item-label">
  17. <span>
  18. <span>赠送余额</span>
  19. </span>
  20. </div>
  21. <div class="number-label">
  22. ¥ {{ donateRemain ? donateRemain : 0 }}
  23. </div>
  24. </div>
  25. </el-col>
  26. </el-row>
  27. <!-- 功能按钮区 -->
  28. <div class="list-btns-container">
  29. <el-button type="success" size="small" icon="Refresh" @click="getList"
  30. >刷新</el-button
  31. >
  32. <el-dropdown>
  33. <el-button type="primary" size="small">
  34. 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
  35. </el-button>
  36. <template #dropdown>
  37. <el-dropdown-menu>
  38. <el-dropdown-item
  39. icon="Download"
  40. @click="handleExport"
  41. v-hasPermi="['business:deduct:export']"
  42. >
  43. 导出</el-dropdown-item
  44. >
  45. <!-- <el-dropdown-item type="warning" size="small" icon="Download" @click="handleArea"
  46. v-hasPermi="['business:workOrder:export']"> area</el-dropdown-item> -->
  47. </el-dropdown-menu>
  48. </template>
  49. </el-dropdown>
  50. <!-- <el-button type="warning" size="small" icon="Download" @click="handleExport"
  51. v-hasPermi="['business:workOrder:export']">导出</el-button> -->
  52. <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
  53. </div>
  54. <!-- 搜索区 -->
  55. <!-- <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
  56. label-width="68px">
  57. <el-form-item>
  58. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  59. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  60. </el-form-item>
  61. </el-form> -->
  62. <!-- 列表区 -->
  63. <el-table
  64. v-loading="loading"
  65. :data="orderList"
  66. size="small"
  67. border
  68. height="100%"
  69. @selection-change="handleSelectionChange"
  70. >
  71. <el-table-column type="selection" width="55" align="center" />
  72. <el-table-column
  73. label="委托单号"
  74. align="center"
  75. prop="formNo"
  76. min-width="140"
  77. />
  78. <el-table-column
  79. label="扣款单位"
  80. align="center"
  81. prop="contactCompany"
  82. min-width="150"
  83. />
  84. <el-table-column label="扣款信息" align="center">
  85. <template #default="scope">
  86. {{ scope.row.year }}年{{ scope.row.month }}月扣款
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. label="扣款时间"
  91. align="center"
  92. prop="deductDate"
  93. min-width="120"
  94. />
  95. <el-table-column
  96. label="扣款金额"
  97. header-align="center"
  98. align="right"
  99. prop="amount"
  100. min-width="80"
  101. />
  102. <el-table-column
  103. label="扣款明细"
  104. align="center"
  105. prop="amount"
  106. min-width="80"
  107. >
  108. <template #default="scope">
  109. <!-- <el-button link size="small" type="primary" @click="handleDetail(scope.row)">查看明细</el-button> -->
  110. <el-button
  111. link
  112. size="small"
  113. type="primary"
  114. v-hasPermi="['business:deduct:info']"
  115. @click="handleStatementAccount(scope.row)"
  116. >跳转对账单</el-button
  117. >
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <statementAccountForm ref="statementAccountFormRef" :get-list="getList" />
  122. <!-- 分页 -->
  123. <pagination
  124. v-show="total > 0"
  125. :total="total"
  126. v-model:page="queryParams.pageNum"
  127. v-model:limit="queryParams.pageSize"
  128. @pagination="getList"
  129. />
  130. </div>
  131. </template>
  132. <script setup name="Company">
  133. // import contractForm from "./form";
  134. import {
  135. listDeduct,
  136. delDeduct,
  137. exportDeduct,
  138. } from "@/api/business/entrust/deduct";
  139. import statementAccountForm from "./form.vue";
  140. import { getRemain } from "@/api/business/entrust/deposit";
  141. // import companyForm from "./form"
  142. const { proxy } = getCurrentInstance();
  143. /** 字典数组区 */
  144. /** 查询 对象 */
  145. const orderList = ref([]);
  146. const loading = ref(true);
  147. const ids = ref([]);
  148. const single = ref(true);
  149. const multiple = ref(true);
  150. const total = ref(0);
  151. const prev = ref([]);
  152. const statementAccountFormRef = ref(null);
  153. const totalRemain = ref(0);
  154. const donateRemain = ref(0);
  155. const { contract_verify_status } = proxy.useDict("contract_verify_status");
  156. const { contract_status } = proxy.useDict("contract_status");
  157. /** 查询对象 */
  158. const queryParams = ref({
  159. pageNum: 1,
  160. pageSize: 10,
  161. orderByColumn: "create_time",
  162. companyName: "",
  163. noContract: 0,
  164. });
  165. const editStatus = {
  166. startMonth: false,
  167. };
  168. /*********************** 方法区 ****************************/
  169. /** 查询company列表 */
  170. function getList() {
  171. loading.value = true;
  172. Promise.all([listDeduct(queryParams.value), getRemain()]).then((res) => {
  173. orderList.value = res[0].rows.map((l) => ({ ...l }));
  174. prev.value = proxy.deepClone(res[0].rows);
  175. total.value = res[0].total;
  176. totalRemain.value = res[1].data.totalRemain;
  177. donateRemain.value = res[1].data.donateRemain;
  178. loading.value = false;
  179. });
  180. }
  181. /** 搜索按钮操作 */
  182. function handleQuery() {
  183. queryParams.value.pageNum = 1;
  184. getList();
  185. }
  186. /** 重置按钮操作 */
  187. function resetQuery() {
  188. proxy.resetForm("queryRef");
  189. handleQuery();
  190. }
  191. // 多选框选中数据
  192. function handleSelectionChange(selection) {
  193. ids.value = selection.map((item) => item.id);
  194. single.value = selection.length != 1;
  195. multiple.value = !selection.length;
  196. }
  197. /** 删除按钮操作 */
  198. function handleDelete(row) {
  199. const _ids = row.id || ids.value;
  200. proxy.$modal
  201. .confirm("是否确认删除选中的数据项?")
  202. .then(function () {
  203. return delDeduct(_ids);
  204. })
  205. .then(() => {
  206. getList();
  207. proxy.$modal.msgSuccess("删除成功!");
  208. })
  209. .catch(() => {});
  210. }
  211. /** 导出按钮操作 */
  212. function handleExport() {
  213. // proxy.download(
  214. // "business/archive/order/export",
  215. // {
  216. // ...queryParams.value,
  217. // },
  218. // `合同导出_${new Date().getTime()}.xlsx`
  219. // );
  220. exportDeduct(queryParams.value);
  221. }
  222. function startDateChangeHandler(row, startDate) {
  223. if (startDate) {
  224. // console.log(startDate)
  225. row.endMonth = proxy
  226. .moment(startDate)
  227. .add(row.monthNum - 1, "M")
  228. .format("YYYY-MM-DD");
  229. } else row.endMonth = null;
  230. console.log(row);
  231. }
  232. function saveHandler(row, field) {
  233. const index = prev.value.findIndex((l) => l.id === row.id);
  234. if (prev.value[index][field] === row[field]) {
  235. row.editStatus[field] = !row.editStatus[field];
  236. } else {
  237. proxy.$modal
  238. .confirm("确定修改起始月么?")
  239. .then((_) => {
  240. updateDeduct(row).then((res) => {
  241. getList();
  242. });
  243. })
  244. .catch((_) => {});
  245. }
  246. }
  247. function handleDetail(row) {}
  248. function handleStatementAccount(row) {
  249. statementAccountFormRef.value.open(row.id);
  250. }
  251. getList();
  252. </script>
  253. <style>
  254. .dashboard-total-item {
  255. display: flex;
  256. align-items: center;
  257. padding: 0 24px;
  258. height: 80px;
  259. background-color: #fff;
  260. font-size: 16px;
  261. justify-content: space-between;
  262. }
  263. </style>