index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. <template>
  2. <div class="user">
  3. <div class="content">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. highlight-current-row
  10. :selectConfig="selectConfig"
  11. :table-events="{
  12. select: select,
  13. }"
  14. :action-list="[]"
  15. @moreSearch="moreSearch"
  16. @get-list="getList">
  17. <template #amount="{ item }">
  18. <div style="width: 100%">
  19. <span>{{ item.currency }} {{ item.amount }}</span>
  20. </div>
  21. </template>
  22. </byTable>
  23. </div>
  24. <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
  25. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
  26. <template #fileSlot>
  27. <div style="width: 100%">
  28. <el-upload
  29. v-model:fileList="fileList"
  30. action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
  31. :data="uploadData"
  32. multiple
  33. :before-upload="uploadFile"
  34. :on-preview="onPreviewFile">
  35. <el-button type="primary">文件上传</el-button>
  36. </el-upload>
  37. </div>
  38. </template>
  39. </byForm>
  40. <template #footer>
  41. <el-button @click="dialogVisible = false" size="large">取 消</el-button>
  42. <el-button type="primary" @click="submitForm()" v-if="!formOption.disabled" size="large" :loading="submitLoading"> 确 定 </el-button>
  43. </template>
  44. </el-dialog>
  45. <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
  46. <byForm :formConfig="formSearchConfig" :formOption="formOptionTwo" v-model="sourceList.pagination">
  47. <template #departmentId>
  48. <div>
  49. <el-tree-select
  50. v-model="sourceList.pagination.departmentId"
  51. :data="deptTreeData"
  52. check-strictly
  53. :render-after-expand="false"
  54. node-key="deptId"
  55. style="width: 100%"
  56. :props="defaultProps"
  57. clearable />
  58. </div>
  59. </template>
  60. <template #time>
  61. <div style="width: 100%">
  62. <el-row :gutter="10">
  63. <el-col :span="11">
  64. <el-date-picker
  65. v-model="sourceList.pagination.beginCreateTime"
  66. type="datetime"
  67. placeholder="请选择"
  68. style="width: 100%"
  69. value-format="YYYY-MM-DD HH:mm:ss" />
  70. </el-col>
  71. <el-col :span="2" style="text-align: center">到</el-col>
  72. <el-col :span="11">
  73. <el-date-picker
  74. v-model="sourceList.pagination.endCreateTime"
  75. type="datetime"
  76. placeholder="请选择"
  77. style="width: 100%"
  78. value-format="YYYY-MM-DD HH:mm:ss" />
  79. </el-col>
  80. </el-row>
  81. </div>
  82. </template>
  83. <template #timeTwo>
  84. <div style="width: 100%">
  85. <el-row :gutter="10">
  86. <el-col :span="11">
  87. <el-date-picker
  88. v-model="sourceList.pagination.beginTime"
  89. type="datetime"
  90. placeholder="请选择"
  91. style="width: 100%"
  92. value-format="YYYY-MM-DD HH:mm:ss" />
  93. </el-col>
  94. <el-col :span="2" style="text-align: center">到</el-col>
  95. <el-col :span="11">
  96. <el-date-picker
  97. v-model="sourceList.pagination.endTime"
  98. type="datetime"
  99. placeholder="请选择"
  100. style="width: 100%"
  101. value-format="YYYY-MM-DD HH:mm:ss" />
  102. </el-col>
  103. </el-row>
  104. </div>
  105. </template>
  106. <template #money>
  107. <div style="width: 100%">
  108. <el-row :gutter="10">
  109. <el-col :span="11">
  110. <el-input-number
  111. onmousewheel="return false;"
  112. v-model="sourceList.pagination.startAmount"
  113. placeholder="请输入"
  114. style="width: 100%"
  115. :precision="2"
  116. :controls="false"
  117. :min="0" />
  118. </el-col>
  119. <el-col :span="2" style="text-align: center">到</el-col>
  120. <el-col :span="11">
  121. <el-input-number
  122. onmousewheel="return false;"
  123. v-model="sourceList.pagination.endAmount"
  124. placeholder="请输入"
  125. style="width: 100%"
  126. :precision="2"
  127. :controls="false"
  128. :min="0" />
  129. </el-col>
  130. </el-row>
  131. </div>
  132. </template>
  133. </byForm>
  134. <template #footer>
  135. <el-button @click="cancelSearch()" size="large">取 消</el-button>
  136. <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
  137. </template>
  138. </el-dialog>
  139. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
  140. <FundsPDF v-if="rowData.type != '20'" :rowData="rowData"></FundsPDF>
  141. <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
  142. <template #footer>
  143. <el-button @click="openPrint = false" size="large">取消</el-button>
  144. <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
  145. </template>
  146. </el-dialog>
  147. <el-dialog title="冲销" v-if="openCancelledOut" v-model="openCancelledOut" width="500">
  148. <byForm
  149. :formConfig="formCancelledOutConfig"
  150. :formOption="formOptionTwo"
  151. v-model="formCancelledOutData.data"
  152. :rules="rulesCancelledOut"
  153. ref="cancelledOut">
  154. <template #detail>
  155. <div style="width: 100%">
  156. <el-button type="primary" style="margin-left: -15px" @click="clickDetail" text>查看详情</el-button>
  157. </div>
  158. </template>
  159. </byForm>
  160. <template #footer>
  161. <el-button @click="openCancelledOut = false" size="large">取 消</el-button>
  162. <el-button type="danger" @click="submitCancelledOutForm()" size="large" :loading="submitCancelledOutLoading">冲 销</el-button>
  163. </template>
  164. </el-dialog>
  165. </div>
  166. </template>
  167. <script setup>
  168. import { ElMessage, ElMessageBox } from "element-plus";
  169. import byTable from "@/components/byTable/index";
  170. import byForm from "@/components/byForm/index";
  171. import { computed, ref } from "vue";
  172. import moment from "moment";
  173. import useUserStore from "@/store/modules/user";
  174. import FundsPDF from "@/components/PDF/fundsPDF.vue";
  175. import PaymentPDF from "@/components/PDF/paymentPDF.vue";
  176. const loading = ref(false);
  177. const submitLoading = ref(false);
  178. const sourceList = ref({
  179. data: [],
  180. pagination: {
  181. total: 0,
  182. pageNum: 1,
  183. pageSize: 10,
  184. keyword: "",
  185. corporationId: "",
  186. departmentId: "",
  187. createUser: "",
  188. beginCreateTime: "",
  189. endCreateTime: "",
  190. beginTime: "",
  191. endTime: "",
  192. currency: "",
  193. startAmount: undefined,
  194. endAmount: undefined,
  195. paymentStatus: "",
  196. paymentRemark: "",
  197. type: "",
  198. },
  199. });
  200. let dialogVisible = ref(false);
  201. let rules = ref({
  202. productClassifyId: [{ required: true, message: "请选择物料分类", trigger: "change" }],
  203. type: [{ required: true, message: "请选择物料类型", trigger: "change" }],
  204. });
  205. const accountCurrency = ref([]);
  206. const accountList = ref([]);
  207. const companyData = ref([]);
  208. const deptTreeData = ref([]);
  209. const userList = ref([]);
  210. const fundsType = ref([]);
  211. const fundsPaymentMethod = ref([]);
  212. const { proxy } = getCurrentInstance();
  213. const selectConfig = computed(() => {
  214. return [
  215. {
  216. label: "打款状态",
  217. prop: "paymentStatus",
  218. data: paymentType.value,
  219. },
  220. ];
  221. });
  222. const config = computed(() => {
  223. return [
  224. {
  225. attrs: {
  226. label: "归属公司",
  227. prop: "corporationName",
  228. width: 160,
  229. },
  230. },
  231. {
  232. attrs: {
  233. label: "归属部门",
  234. prop: "deptName",
  235. width: 160,
  236. },
  237. },
  238. {
  239. attrs: {
  240. label: "付款类型",
  241. prop: "type",
  242. width: 130,
  243. },
  244. render(type) {
  245. if (type != "20") {
  246. return "请款: " + proxy.dictValueLabel(type, fundsType.value);
  247. } else {
  248. return "采购付款 - 申请";
  249. }
  250. },
  251. },
  252. {
  253. attrs: {
  254. label: "申请人",
  255. prop: "userName",
  256. width: 140,
  257. },
  258. },
  259. {
  260. attrs: {
  261. label: "申请时间",
  262. prop: "applyForTime",
  263. width: 160,
  264. },
  265. },
  266. {
  267. attrs: {
  268. label: "用款时间",
  269. prop: "paymentTime",
  270. width: 160,
  271. },
  272. },
  273. {
  274. attrs: {
  275. label: "金额",
  276. slot: "amount",
  277. width: 120,
  278. align: "right",
  279. },
  280. },
  281. {
  282. attrs: {
  283. label: "款项说明",
  284. prop: "paymentRemark",
  285. "min-width": 200,
  286. },
  287. },
  288. {
  289. attrs: {
  290. label: "打款状态",
  291. prop: "status",
  292. width: 120,
  293. },
  294. render(status) {
  295. return proxy.dictValueLabel(status, paymentType.value);
  296. },
  297. },
  298. {
  299. attrs: {
  300. label: "操作",
  301. width: "180",
  302. align: "center",
  303. fixed: "right",
  304. },
  305. renderHTML(row) {
  306. return [
  307. row.status == "20"
  308. ? {
  309. attrs: {
  310. label: "打款",
  311. type: "primary",
  312. text: true,
  313. },
  314. el: "button",
  315. click() {
  316. formOption.disabled = false;
  317. getDtl(row);
  318. },
  319. }
  320. : {
  321. attrs: {
  322. label: "冲销",
  323. type: "danger",
  324. text: true,
  325. },
  326. el: "button",
  327. click(item) {
  328. ElMessageBox.confirm("冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?", "提示", {
  329. confirmButtonText: "继续",
  330. cancelButtonText: "取消",
  331. type: "warning",
  332. })
  333. .then(() => {
  334. rowData.value = item;
  335. formCancelledOutData.data = {
  336. accountPaymentId: item.id,
  337. remark: "",
  338. };
  339. openCancelledOut.value = true;
  340. })
  341. .catch(() => {});
  342. },
  343. },
  344. {
  345. attrs: {
  346. label: "打印",
  347. type: "primary",
  348. text: true,
  349. },
  350. el: "button",
  351. click() {
  352. clickPrint(row);
  353. },
  354. },
  355. {
  356. attrs: {
  357. label: "查看",
  358. type: "primary",
  359. text: true,
  360. },
  361. el: "button",
  362. click() {
  363. formOption.disabled = true;
  364. getDtl(row);
  365. },
  366. },
  367. ];
  368. },
  369. },
  370. ];
  371. });
  372. let formData = reactive({
  373. data: {
  374. fileList: [],
  375. },
  376. });
  377. const formOption = reactive({
  378. inline: true,
  379. labelWidth: 100,
  380. itemWidth: 100,
  381. rules: [],
  382. disabled: false,
  383. });
  384. const formOptionTwo = reactive({
  385. inline: true,
  386. labelWidth: 100,
  387. itemWidth: 100,
  388. rules: [],
  389. disabled: false,
  390. });
  391. const byform = ref(null);
  392. const treeListData = ref([]);
  393. const formConfig = computed(() => {
  394. return [
  395. {
  396. type: "title",
  397. label: "请款信息",
  398. },
  399. {
  400. type: "input",
  401. prop: "businessManagementName",
  402. label: "付款账户",
  403. disabled: true,
  404. },
  405. {
  406. type: "input",
  407. prop: "incomeAmount",
  408. label: "请款金额",
  409. disabled: true,
  410. },
  411. {
  412. type: "select",
  413. prop: "paymentMethod",
  414. label: "付款方式",
  415. disabled: true,
  416. data: fundsPaymentMethod.value,
  417. },
  418. {
  419. type: "input",
  420. prop: "name",
  421. label: "户名",
  422. disabled: true,
  423. },
  424. {
  425. type: "input",
  426. prop: "accountOpening",
  427. label: "银行账号",
  428. disabled: true,
  429. },
  430. {
  431. type: "input",
  432. prop: "openingBank",
  433. label: "开户银行",
  434. disabled: true,
  435. },
  436. {
  437. type: "input",
  438. prop: "interbankNumber",
  439. label: "联行号 / SWIFT Code",
  440. disabled: true,
  441. },
  442. {
  443. type: "input",
  444. prop: "paymentRemark",
  445. label: "摘要",
  446. disabled: true,
  447. itemType: "textarea",
  448. },
  449. {
  450. type: "title",
  451. title: "付款信息",
  452. },
  453. {
  454. type: "select",
  455. prop: "accountManagementId",
  456. label: "付款账户",
  457. required: true,
  458. data: accountList.value,
  459. },
  460. {
  461. type: "selectInput",
  462. label: "付款金额",
  463. itemWidth: 60,
  464. prop: "amount",
  465. data: accountCurrency.value,
  466. placeholder: "请输入",
  467. selectPlaceholder: "币种",
  468. selectProp: "currency",
  469. disabled: true,
  470. },
  471. {
  472. type: "date",
  473. itemType: "datetime",
  474. prop: "expensesTime",
  475. label: "打款时间",
  476. format: "YYYY-MM-DD HH:mm:ss",
  477. },
  478. {
  479. type: "input",
  480. prop: "remark",
  481. label: "摘要",
  482. itemType: "textarea",
  483. },
  484. {
  485. type: "slot",
  486. label: "上传附件",
  487. prop: "fileList",
  488. slotName: "fileSlot",
  489. },
  490. ];
  491. });
  492. const fileList = ref([]);
  493. const uploadData = ref({});
  494. const uploadFile = async (file) => {
  495. const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
  496. uploadData.value = res.uploadBody;
  497. file.id = res.id;
  498. file.fileName = res.fileName;
  499. file.fileUrl = res.fileUrl;
  500. return true;
  501. };
  502. const onPreviewFile = (file) => {
  503. window.open(file.raw.fileUrl, "_blank");
  504. };
  505. const recursive = (data) => {
  506. data.map((item) => {
  507. item.label = item.deptName;
  508. item.id = item.corporationId;
  509. if (item.children) {
  510. recursive(item.children);
  511. } else {
  512. item.children = [];
  513. }
  514. });
  515. };
  516. const getDict = () => {
  517. proxy.getDict(["account_currency", "founds_type", "funds_payment_method"]).then((res) => {
  518. accountCurrency.value = res.account_currency.map((item) => {
  519. return {
  520. label: item.dictValue,
  521. value: item.dictKey,
  522. };
  523. });
  524. fundsType.value = res.founds_type.map((item) => {
  525. return {
  526. label: item.dictValue,
  527. value: item.dictKey,
  528. };
  529. });
  530. fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
  531. return {
  532. label: item.dictValue,
  533. value: item.dictKey,
  534. };
  535. });
  536. });
  537. proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
  538. if (res.rows && res.rows.length > 0) {
  539. accountList.value = res.rows.map((item) => {
  540. return {
  541. label: item.alias + " (" + item.name + ")",
  542. value: item.id,
  543. };
  544. });
  545. }
  546. });
  547. proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
  548. if (res.rows && res.rows.length > 0) {
  549. companyData.value = res.rows.map((item) => {
  550. return {
  551. label: item.name,
  552. value: item.id,
  553. };
  554. });
  555. }
  556. });
  557. proxy
  558. .get("/tenantDept/list", {
  559. pageNum: 1,
  560. pageSize: 9999,
  561. tenantId: useUserStore().user.tenantId,
  562. })
  563. .then((message) => {
  564. recursive(message.data);
  565. deptTreeData.value = [];
  566. let data = proxy.handleTree(message.data, "deptId");
  567. if (data && data.length > 0) {
  568. for (let i = 0; i < data.length; i++) {
  569. if (data[i].children && data[i].children.length > 0) {
  570. deptTreeData.value = deptTreeData.value.concat(data[i].children);
  571. }
  572. }
  573. }
  574. });
  575. proxy
  576. .get("/tenantUser/list", {
  577. pageNum: 1,
  578. pageSize: 10000,
  579. tenantId: useUserStore().user.tenantId,
  580. })
  581. .then((res) => {
  582. if (res.rows && res.rows.length > 0) {
  583. userList.value = res.rows.map((item) => {
  584. return {
  585. deptId: item.deptId,
  586. label: item.nickName,
  587. value: item.userId,
  588. };
  589. });
  590. }
  591. });
  592. };
  593. getDict();
  594. const getList = async (req) => {
  595. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  596. loading.value = true;
  597. proxy.post("/accountPayment/page", sourceList.value.pagination).then((message) => {
  598. sourceList.value.data = message.rows;
  599. sourceList.value.pagination.total = message.total;
  600. setTimeout(() => {
  601. loading.value = false;
  602. }, 200);
  603. });
  604. };
  605. const paymentType = ref([
  606. {
  607. label: "已打款",
  608. value: 10,
  609. },
  610. {
  611. label: "未打款",
  612. value: 20,
  613. },
  614. ]);
  615. const selection = ref({
  616. data: [],
  617. });
  618. const select = (_selection, row) => {
  619. selection.value.data = _selection;
  620. };
  621. const submitForm = () => {
  622. byform.value.handleSubmit(() => {
  623. if (fileList.value && fileList.value.length > 0) {
  624. formData.data.fileList = fileList.value.map((item) => {
  625. return {
  626. id: item.raw.id,
  627. fileName: item.raw.fileName,
  628. fileUrl: item.raw.fileUrl,
  629. };
  630. });
  631. } else {
  632. formData.data.fileList = [];
  633. }
  634. submitLoading.value = true;
  635. proxy.post("/accountPayment/add", formData.data).then(
  636. () => {
  637. ElMessage({
  638. message: "打款成功",
  639. type: "success",
  640. });
  641. dialogVisible.value = false;
  642. submitLoading.value = false;
  643. getList();
  644. },
  645. () => {
  646. submitLoading.value = false;
  647. }
  648. );
  649. });
  650. };
  651. const getTreeList = () => {
  652. proxy
  653. .post("/productClassify/tree", {
  654. parentId: "",
  655. name: "",
  656. definition: "2",
  657. })
  658. .then((message) => {
  659. treeListData.value = message;
  660. formConfig.value[0].data = message;
  661. });
  662. };
  663. const getDtl = (row) => {
  664. proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
  665. formData.data = res;
  666. formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
  667. proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((fileObj) => {
  668. formData.data.fileList = fileObj[row.id] || [];
  669. if (formData.data.fileList && formData.data.fileList.length > 0) {
  670. fileList.value = formData.data.fileList.map((item) => {
  671. return {
  672. raw: item,
  673. name: item.fileName,
  674. url: item.fileUrl,
  675. };
  676. });
  677. } else {
  678. fileList.value = [];
  679. }
  680. });
  681. dialogVisible.value = true;
  682. });
  683. };
  684. getTreeList();
  685. getList();
  686. const openSearch = ref(false);
  687. const formSearchConfig = computed(() => {
  688. return [
  689. {
  690. type: "select",
  691. prop: "corporationId",
  692. label: "归属公司",
  693. data: companyData.value,
  694. clearable: true,
  695. },
  696. {
  697. type: "slot",
  698. slotName: "departmentId",
  699. label: "归属部门",
  700. },
  701. {
  702. type: "select",
  703. prop: "createUser",
  704. label: "请款人",
  705. data: userList.value,
  706. clearable: true,
  707. },
  708. {
  709. type: "select",
  710. prop: "type",
  711. label: "付款类型",
  712. data: fundsType.value,
  713. clearable: true,
  714. },
  715. {
  716. type: "slot",
  717. slotName: "time",
  718. label: "请款时间",
  719. },
  720. {
  721. type: "slot",
  722. slotName: "timeTwo",
  723. label: "用款时间",
  724. },
  725. {
  726. type: "select",
  727. prop: "currency",
  728. label: "币种",
  729. data: accountCurrency.value,
  730. clearable: true,
  731. },
  732. {
  733. type: "slot",
  734. slotName: "money",
  735. label: "交易金额",
  736. },
  737. {
  738. type: "select",
  739. prop: "paymentStatus",
  740. label: "打款状态",
  741. data: paymentType.value,
  742. clearable: true,
  743. },
  744. {
  745. type: "input",
  746. itemType: "textarea",
  747. prop: "paymentRemark",
  748. label: "款项说明",
  749. },
  750. ];
  751. });
  752. let copySearch = ref({});
  753. const moreSearch = () => {
  754. copySearch.value = proxy.deepClone(sourceList.value.pagination);
  755. openSearch.value = true;
  756. };
  757. const cancelSearch = () => {
  758. sourceList.value.pagination = copySearch.value;
  759. openSearch.value = false;
  760. };
  761. const submitSearch = () => {
  762. if (
  763. sourceList.value.pagination.startAmount &&
  764. sourceList.value.pagination.endAmount &&
  765. Number(sourceList.value.pagination.startAmount) > Number(sourceList.value.pagination.endAmount)
  766. ) {
  767. return ElMessage("交易金额输入错误");
  768. }
  769. if (
  770. sourceList.value.pagination.beginCreateTime &&
  771. sourceList.value.pagination.endCreateTime &&
  772. sourceList.value.pagination.beginCreateTime > sourceList.value.pagination.endCreateTime
  773. ) {
  774. return ElMessage("开始时间不能大于结束时间");
  775. }
  776. if (
  777. sourceList.value.pagination.beginTime &&
  778. sourceList.value.pagination.endTime &&
  779. sourceList.value.pagination.beginTime > sourceList.value.pagination.endTime
  780. ) {
  781. return ElMessage("开始时间不能大于结束时间");
  782. }
  783. openSearch.value = false;
  784. sourceList.value.pagination.keyword = "";
  785. sourceList.value.pagination.pageNum = 1;
  786. getList();
  787. };
  788. const openPrint = ref(false);
  789. const rowData = ref({});
  790. const clickPrint = (row) => {
  791. rowData.value = {
  792. id: row.businessId,
  793. type: row.type,
  794. };
  795. openPrint.value = true;
  796. };
  797. const clickDownload = () => {
  798. if (rowData.value.type != "20") {
  799. proxy.getPdf("请款PDF文件");
  800. } else {
  801. proxy.getPdf("采购付款PDF文件");
  802. }
  803. };
  804. let formCancelledOutData = reactive({
  805. data: {},
  806. });
  807. const cancelledOut = ref(null);
  808. const formCancelledOutConfig = computed(() => {
  809. return [
  810. {
  811. type: "slot",
  812. label: "打款明细",
  813. slotName: "detail",
  814. },
  815. {
  816. type: "input",
  817. itemType: "textarea",
  818. prop: "remark",
  819. label: "冲销原因",
  820. },
  821. ];
  822. });
  823. let rulesCancelledOut = ref({
  824. remark: [{ required: true, message: "请输入冲销原因", trigger: "blur" }],
  825. });
  826. const openCancelledOut = ref(false);
  827. const submitCancelledOutLoading = ref(false);
  828. const submitCancelledOutForm = () => {
  829. cancelledOut.value.handleSubmit(() => {
  830. submitCancelledOutLoading.value = true;
  831. proxy.post("/writeOffRecords/add", formCancelledOutData.data).then(
  832. () => {
  833. ElMessage({
  834. message: "冲销完成",
  835. type: "success",
  836. });
  837. openCancelledOut.value = false;
  838. submitCancelledOutLoading.value = false;
  839. getList();
  840. },
  841. () => {
  842. submitCancelledOutLoading.value = false;
  843. }
  844. );
  845. });
  846. };
  847. const clickDetail = () => {
  848. formOption.disabled = true;
  849. getDtl(rowData.value);
  850. };
  851. </script>
  852. <style lang="scss" scoped>
  853. .user {
  854. padding: 20px;
  855. }
  856. ::v-deep(.el-input-number .el-input__inner) {
  857. text-align: left;
  858. }
  859. </style>