index.vue 25 KB

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