index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <div class="page-container list-container">
  3. <!-- 功能按钮区 -->
  4. <div class="list-btns-container">
  5. <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
  6. v-hasPermi="['business:payment:add']">新增</el-button>
  7. <el-dropdown trigger="click">
  8. <el-button type="primary" size="small">
  9. 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
  10. </el-button>
  11. <template #dropdown>
  12. <el-dropdown-menu>
  13. <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:payment:export']">
  14. 导出</el-dropdown-item>
  15. </el-dropdown-menu>
  16. </template>
  17. </el-dropdown>
  18. </div>
  19. <!-- 搜索区 -->
  20. <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
  21. label-width="68px">
  22. <el-form-item label="客户名称:" prop="companyName">
  23. <el-input v-model="queryParams.companyName" style="width: 150px" placeholder="请输入客户名称" clearable
  24. @keyup.enter="handleQuery" />
  25. </el-form-item>
  26. <el-form-item label="合同编号:" prop="contractNo">
  27. <el-input v-model="queryParams.contractNo" style="width: 150px" placeholder="请输入合同编号" clearable
  28. @keyup.enter="handleQuery" />
  29. </el-form-item>
  30. <el-form-item prop="applierTime" label="审核时间:">
  31. <el-date-picker v-model="queryParams.dateFilter" type="daterange" clearable format="YYYY - MM - DD "
  32. value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期" end-placeholder="业务日期"
  33. style="width: 100%;"></el-date-picker>
  34. </el-form-item>
  35. <el-form-item>
  36. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  37. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  38. </el-form-item>
  39. </el-form>
  40. <!-- 列表区 -->
  41. <el-table v-loading="loading" :data="orderList" size="small" border height="100%"
  42. @selection-change="handleSelectionChange">
  43. <el-table-column type="selection" width="55" align="center" />
  44. <!-- <el-table-column type="index" label="序号" width="50" align="center" /> -->
  45. <el-table-column v-if="getShowStatus(2)" label="客户名称" prop="companyName" min-width="250" align="center" />
  46. <el-table-column v-if="getShowStatus(16)" label="服务公司" prop="serviceCompanyName" width="200" align="center" />
  47. <el-table-column v-if="getShowStatus(3)" label="合同号" prop="formNo" min-width="200" align="center" />
  48. <el-table-column v-if="getShowStatus(4)" label="申请日期" prop="formDate" min-width="90" align="center">
  49. <template #default="scope">
  50. {{
  51. scope.row.formDate
  52. ? moment(scope.row.formDate).format("YYYY-MM-DD")
  53. : ""
  54. }}
  55. </template>
  56. </el-table-column>
  57. <!-- <el-table-column label="服务公司" prop="subsidiary" width="150" align="center" /> -->
  58. <el-table-column v-if="getShowStatus(5)" label="支出事由" prop="paymentCause" min-width="90" align="center" />
  59. <el-table-column v-if="getShowStatus(6)" label="支出科目" prop="paymentSubject" min-width="90" align="center"
  60. show-overflow-tooltip />
  61. <el-table-column v-if="getShowStatus(7)" label="支出金额" prop="sumAmount" width="80" header-align="center"
  62. align="right">
  63. <template #default="scope">
  64. <span>{{ rowNum(scope.row.sumAmount) }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="审核日期" prop="verifyDate" width="150" align="center" />
  68. <el-table-column v-if="getShowStatus(8)" label="审核状态" prop="status" min-width="120" align="center">
  69. <template #header>
  70. <div>审核状态</div>
  71. </template>
  72. <template #default="scope">
  73. <span v-if="scope.row.verifyStatus === 0" style="color: #cd853f">未审核</span>
  74. <span v-else-if="scope.row.verifyStatus === 1" style="color: #32cd32">财务审核通过</span>
  75. <span v-else-if="scope.row.verifyStatus === 2" style="color: #dc143c">财务审核不通过</span>
  76. <span v-else-if="scope.row.verifyStatus === 3" style="color: #32cd32">出纳审核通过</span>
  77. <span v-else-if="scope.row.verifyStatus === 4" style="color: #dc143c">出纳审核不通过</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column v-if="getShowStatus(9)" label="支付状态" min-width="100" prop="arriveStatus" align="center">
  81. <template #default="scope">
  82. <span v-if="scope.row.paymentStatus === 0" style="color: #dc143c">未支付</span>
  83. <span v-else-if="scope.row.paymentStatus === 1" style="color: #32cd32">已支付</span>
  84. <span v-else-if="scope.row.paymentStatus === 2" style="color: #cd853f">部分支付</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column v-if="getShowStatus(10)" label="收款账户名" prop="acceptAccount" min-width="100" align="center" />
  88. <el-table-column v-if="getShowStatus(11)" label="收款账号" prop="acceptAccountNo" width="90" align="center" />
  89. <el-table-column v-if="getShowStatus(13)" label="申请人" prop="applierName" min-width="130" align="center" />
  90. <el-table-column v-if="getShowStatus(14)" label="备注" prop="remark" align="center" />
  91. <el-table-column label="操作" fixed="right" width="60" align="center">
  92. <template #default="scope">
  93. <el-button link type="primary" size="small" @click="handleFormPageOpen(scope.row.id)">查看</el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <payment-form ref="paymentRef" :get-list="getList" />
  98. <!-- 分页 -->
  99. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  100. v-model:limit="queryParams.pageSize" @pagination="getList" />
  101. </div>
  102. </template>
  103. <script setup name="Payment">
  104. import paymentForm from "./form";
  105. import { listPayment, exportPayment } from "@/api/business/financial/payment";
  106. const { proxy } = getCurrentInstance();
  107. /** 字典数组区 */
  108. /** 查询 对象 */
  109. const orderList = ref([]);
  110. const loading = ref(true);
  111. const ids = ref([]);
  112. const single = ref(true);
  113. const multiple = ref(true);
  114. const total = ref(0);
  115. const showRows = ref([2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13]);
  116. const rows = ref([
  117. {
  118. key: 2,
  119. label: "客户名称",
  120. },
  121. {
  122. key: 3,
  123. label: "合同编号",
  124. },
  125. {
  126. key: 4,
  127. label: "收款日期",
  128. },
  129. {
  130. key: 5,
  131. label: "收款时间",
  132. },
  133. {
  134. key: 9,
  135. label: "申请人",
  136. },
  137. {
  138. key: 11,
  139. label: "审核状态",
  140. },
  141. {
  142. key: 12,
  143. label: "支付状态",
  144. },
  145. {
  146. key: 14,
  147. label: "确认到账时间",
  148. },
  149. {
  150. key: 13,
  151. label: "备注",
  152. },
  153. ]);
  154. const { contract_verify_status } = proxy.useDict("contract_verify_status");
  155. const { contract_status } = proxy.useDict("contract_status");
  156. /** 查询对象 */
  157. const queryParams = ref({
  158. pageNum: 1,
  159. orderByColumn: "create_time",
  160. pageSize: 20,
  161. });
  162. /*********************** 方法区 ****************************/
  163. onActivated(() => {
  164. // 你的逻辑
  165. getList();
  166. });
  167. /** 查询company列表 */
  168. function getList() {
  169. loading.value = true;
  170. listPayment(queryParams.value).then((response) => {
  171. orderList.value = response.rows;
  172. total.value = response.total;
  173. loading.value = false;
  174. });
  175. }
  176. /** 搜索按钮操作 */
  177. function handleQuery() {
  178. queryParams.value.pageNum = 1;
  179. getList();
  180. }
  181. /** 重置按钮操作 */
  182. function resetQuery() {
  183. // proxy.resetForm("queryRef");
  184. queryParams.value = {
  185. pageNum: 1,
  186. pageSize: 20,
  187. nonpayment: true,
  188. };
  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 handleView(id) {
  199. proxy.$refs.paymentRef.open(id);
  200. }
  201. // 数字格式化
  202. function rowNum(num) {
  203. if (!num) {
  204. return;
  205. }
  206. num = num.toLocaleString(); // 3,000
  207. if (num.indexOf(".") == -1) {
  208. num = num + ".00"; //3,000.00
  209. } else if (num.charAt(num.indexOf(".") == num.length - 2)) {
  210. num = num + "0";
  211. }
  212. return num;
  213. }
  214. /** 删除按钮操作 */
  215. function handleDelete(row) {
  216. const _ids = row.id || ids.value;
  217. proxy.$modal
  218. .confirm("是否确认删除选中的数据项?")
  219. .then(function () {
  220. return delOrder(_ids);
  221. })
  222. .then(() => {
  223. getList();
  224. proxy.$modal.msgSuccess("删除成功!");
  225. })
  226. .catch(() => { });
  227. }
  228. function handleAlter(row) {
  229. const id = row.id || ids.value;
  230. proxy.$refs.paymentRef.openSimple(id, "alterOrder");
  231. }
  232. function handleDissolution() {
  233. const row = orderList.value.find((item) => item.id === ids.value[0]);
  234. proxy.$modal
  235. .confirm("是否确认解除合同?")
  236. .then(function () {
  237. return dissolutionOrder(row);
  238. })
  239. .then(() => {
  240. getList();
  241. proxy.$modal.msgSuccess("删除成功!");
  242. })
  243. .catch(() => { });
  244. }
  245. /** 导出按钮操作 */
  246. function handleExport() {
  247. exportPayment(queryParams.value);
  248. }
  249. function handleImport() { }
  250. function getShowStatus(key) {
  251. const index = showRows.value.findIndex((l) => l === key);
  252. return index >= 0;
  253. }
  254. function handleAdd() {
  255. proxy.$refs.paymentRef.open();
  256. }
  257. function handleFormPageOpen(id) {
  258. proxy.$refs.paymentRef.open(id);
  259. }
  260. getList();
  261. </script>