kaihe-detail.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  1. <template>
  2. <div v-if="showDetail">
  3. <div style="display: flex; justify-content: space-between">
  4. <div style="display: flex; align-items: center">
  5. <el-breadcrumb separator="/">
  6. <el-breadcrumb-item
  7. ><span style="font-weight: 700">付费</span></el-breadcrumb-item
  8. >
  9. <el-breadcrumb-item
  10. ><span style="font-weight: 700"
  11. >付费详情页</span
  12. ></el-breadcrumb-item
  13. >
  14. </el-breadcrumb>
  15. <el-button
  16. style="margin-left: 10px"
  17. size="mini"
  18. icon="el-icon-arrow-left"
  19. @click="cancel"
  20. >返回列表
  21. </el-button>
  22. </div>
  23. <!-- <div v-if="showApproval == 0">
  24. 审核
  25. </div> -->
  26. </div>
  27. <br />
  28. <el-form ref="form" :model="form" label-width="80px">
  29. <el-row>
  30. <el-col :span="6">
  31. <el-form-item label="客户名称" prop="fCorpid">
  32. <el-select
  33. v-model="form.fCorpid"
  34. size="small"
  35. placeholder="请选择"
  36. clearable
  37. :disabled="
  38. form.fBillstatus >= 4 || readOnly == 0 || form.fId != null
  39. "
  40. style="width: 100%"
  41. filterable
  42. >
  43. <el-option
  44. v-for="item in corpList"
  45. :key="item.fId"
  46. :label="item.fName"
  47. :value="item.fId"
  48. />
  49. </el-select>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="6">
  53. <el-form-item label="开船日期">
  54. <el-date-picker
  55. v-model="form.date"
  56. type="daterange"
  57. size="small"
  58. placeholder="请选择日期"
  59. format="yyyy-MM-dd"
  60. value-format="yyyy-MM-dd"
  61. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  62. style="width: 100%"
  63. />
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="6">
  67. <el-form-item label="船名">
  68. <el-select
  69. v-model="form.fVslid"
  70. size="small"
  71. placeholder="请选择"
  72. clearable
  73. @change="fvslChange"
  74. @clear="fvslClear"
  75. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  76. style="width: 100%"
  77. >
  78. <el-option
  79. v-for="item in TVesselfs"
  80. :key="item.fId"
  81. :label="item.fName"
  82. :value="item.fId"
  83. />
  84. </el-select>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="6">
  88. <el-form-item label="航次">
  89. <el-select
  90. v-model="form.fVoyid"
  91. size="small"
  92. placeholder="请选择"
  93. clearable
  94. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  95. style="width: 100%"
  96. >
  97. <el-option
  98. v-for="item in TVoyagefs"
  99. :key="item.fId"
  100. :label="item.fNo"
  101. :value="item.fId"
  102. />
  103. </el-select>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="6">
  107. <el-form-item label="提单号">
  108. <el-input
  109. v-model="form.tMblno"
  110. size="small"
  111. placeholder="请输入"
  112. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  113. />
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="6">
  117. <el-form-item label="起运港">
  118. <el-select
  119. v-model="form.fLoadportid"
  120. size="small"
  121. placeholder="请选择"
  122. clearable
  123. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  124. style="width: 100%"
  125. >
  126. <el-option
  127. v-for="item in portNames"
  128. :key="item.fId"
  129. :label="item.fName"
  130. :value="item.fId"
  131. />
  132. </el-select>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="6">
  136. <el-form-item label="目的港">
  137. <el-select
  138. v-model="form.fDestportid"
  139. size="small"
  140. placeholder="请选择"
  141. clearable
  142. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  143. style="width: 100%"
  144. >
  145. <el-option
  146. v-for="item in portNames"
  147. :key="item.fId"
  148. :label="item.fName"
  149. :value="item.fId"
  150. />
  151. </el-select>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="6">
  155. <el-form-item label="对账单号">
  156. <el-input
  157. v-model="form.fStatementNo"
  158. size="small"
  159. placeholder="请输入"
  160. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  161. ></el-input>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="6">
  165. <el-form-item label="付款银行">
  166. <el-input
  167. v-model="form.bank"
  168. size="small"
  169. placeholder="请输入"
  170. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  171. ></el-input>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="6">
  175. <el-form-item label="付款账号">
  176. <el-input
  177. v-model="form.fBankNumber"
  178. size="small"
  179. placeholder="请输入"
  180. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  181. ></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="6">
  185. <el-form-item label="水单号">
  186. <el-input
  187. v-model="form.waterBillNo"
  188. size="small"
  189. placeholder="请输入"
  190. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  191. ></el-input>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="6">
  195. <el-form-item label="系统编号">
  196. <el-input
  197. v-model="form.srcBillNo"
  198. size="small"
  199. placeholder="请输入"
  200. disabled
  201. ></el-input>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="6">
  205. <el-form-item label="应收应付" prop="fDc">
  206. <el-select
  207. v-model="form.fDc"
  208. size="small"
  209. clearable
  210. disabled
  211. style="width: 100%"
  212. >
  213. <el-option label="应收" value="D" />
  214. <el-option label="应付" value="C" />
  215. </el-select>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="6">
  219. <el-form-item label="制单人">
  220. <el-input
  221. v-model="form.createBy"
  222. size="small"
  223. placeholder="请输入"
  224. disabled
  225. ></el-input>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="6">
  229. <el-form-item label="制单日期">
  230. <el-date-picker
  231. v-model="form.createTime"
  232. size="small"
  233. placeholder="请选择"
  234. format="yyyy-MM-dd"
  235. value-format="yyyy-MM-dd 00:00:00"
  236. disabled
  237. style="width: 100%"
  238. />
  239. </el-form-item>
  240. </el-col>
  241. </el-row>
  242. <el-row>
  243. <el-col :span="6">
  244. <el-form-item label="备注">
  245. <el-input
  246. type="textarea"
  247. v-model="form.fRemarks"
  248. size="small"
  249. placeholder="请输入"
  250. ></el-input>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. </el-form>
  255. <div class="head-but">
  256. <div>
  257. <el-button
  258. type="primary"
  259. size="mini"
  260. @click="submit"
  261. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  262. :loading="subLoading"
  263. >
  264. 确认付费
  265. </el-button>
  266. <el-button
  267. type="success"
  268. size="mini"
  269. @click="backrRconciliation"
  270. v-if="form.fBillstatus === '6'"
  271. :loading="subLoading"
  272. v-hasPermi="['finance:payment:revoke']"
  273. >撤销付费</el-button
  274. >
  275. <el-button
  276. type="danger"
  277. size="mini"
  278. v-if="form.fBillstatus == 4"
  279. :loading="subLoading"
  280. @click="backApproval('f_billstatus')"
  281. >撤销审批</el-button
  282. >
  283. <el-button
  284. v-if="readOnly == 3"
  285. size="mini"
  286. @click="goApproval('f_billstatus')"
  287. >审批</el-button
  288. >
  289. <el-button
  290. type="primary"
  291. size="mini"
  292. v-if="form.fBillstatus >= '3'"
  293. @click="addOrUpdateHandle('f_billstatus')"
  294. >查看审批流</el-button
  295. >
  296. <el-button
  297. type="success"
  298. size="mini"
  299. @click="save"
  300. :loading="subLoading"
  301. >
  302. 保存
  303. </el-button>
  304. <el-button
  305. type="warning"
  306. size="mini"
  307. :disabled="!form.fId"
  308. @click="handleExport"
  309. >
  310. 导出
  311. </el-button>
  312. <el-button
  313. type="cyan"
  314. icon="el-icon-search"
  315. size="mini"
  316. @click="Search"
  317. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  318. >
  319. 检索
  320. </el-button>
  321. </div>
  322. <div class="tabSetting">
  323. <div style="margin: 0 12px">
  324. <el-button
  325. icon="el-icon-setting"
  326. size="mini"
  327. circle
  328. @click="colSetting"
  329. ></el-button>
  330. </div>
  331. </div>
  332. </div>
  333. <el-table
  334. :data="tableData"
  335. style="width: 100%"
  336. show-summary
  337. :summary-method="getSummaries"
  338. >
  339. <el-table-column label="序号" type="index" width="50" />
  340. <el-table-column
  341. v-for="(item, index) in tableOption"
  342. :key="index"
  343. :label="item.name"
  344. :width="item.width"
  345. :prop="item.label"
  346. align="center"
  347. :fixed="item.fixed"
  348. sortable
  349. :show-overflow-tooltip="true"
  350. >
  351. <template slot-scope="scope">
  352. <span v-if="item.label == 'srcBillNo'">
  353. {{ scope.row.srcBillNo }}
  354. </span>
  355. <span v-if="item.label == 'fName'">
  356. {{ scope.row.fName }}
  357. </span>
  358. <span v-if="item.label == 'fFeeName'">
  359. {{ scope.row.fFeeName }}
  360. </span>
  361. <span v-if="item.label == 'goodName'">
  362. {{ scope.row.goodName }}
  363. </span>
  364. <span v-if="item.label == 'fFeeUnitName'">
  365. {{ scope.row.fFeeUnitName }}
  366. </span>
  367. <span v-if="item.label == 'fQty'">
  368. {{ scope.row.fQty }}
  369. </span>
  370. <span v-if="item.label == 'fUnitPrice'">
  371. {{ scope.row.fUnitPrice }}
  372. </span>
  373. <span v-if="item.label == 'fAmtdr'">
  374. {{ scope.row.fAmtdr }}
  375. </span>
  376. <span v-if="item.label == 'fAmt'">
  377. <el-input
  378. v-model="scope.row.fAmt"
  379. size="small"
  380. placeholder="请输入"
  381. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  382. @change="fAmtChange(scope.row)"
  383. ></el-input>
  384. </span>
  385. <span v-if="item.label == 'fvslName'">
  386. {{ scope.row.fvslName }}
  387. </span>
  388. <span v-if="item.label == 'fvoyName'">
  389. {{ scope.row.fvoyName }}
  390. </span>
  391. <span v-if="item.label == 'fCntrCount'">
  392. {{ scope.row.fCntrCount }}
  393. </span>
  394. <span v-if="item.label == 'cntrName'">
  395. {{ scope.row.cntrName }}
  396. </span>
  397. <span v-if="item.label == 'fLoadPortName'">
  398. {{ scope.row.fLoadPortName }}
  399. </span>
  400. <span v-if="item.label == 'fDestPortName'">
  401. {{ scope.row.fDestPortName }}
  402. </span>
  403. <span v-if="item.label == 'fBillStatusName'">
  404. {{ scope.row.fBillStatusName }}
  405. </span>
  406. <span v-if="item.label == 'createBy'">
  407. {{ scope.row.createBy }}
  408. </span>
  409. <span v-if="item.label == 'createTime'">
  410. {{ scope.row.createTime }}
  411. </span>
  412. <span v-if="item.label == 'fRemarks'">
  413. <el-input
  414. v-model="scope.row.fRemarks"
  415. size="small"
  416. placeholder="请输入"
  417. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  418. ></el-input>
  419. </span>
  420. </template>
  421. </el-table-column>
  422. <el-table-column
  423. label="操作"
  424. align="center"
  425. class-name="small-padding fixed-width"
  426. min-width="180"
  427. fixed="right"
  428. >
  429. <template slot-scope="scope">
  430. <el-button
  431. size="mini"
  432. type="text"
  433. icon="el-icon-delete"
  434. @click="rowDel(scope.row, scope.$index, tableData)"
  435. :disabled="form.fBillstatus >= 4 || readOnly == 0"
  436. >
  437. 删除
  438. </el-button>
  439. </template>
  440. </el-table-column>
  441. </el-table>
  442. <approval-comments
  443. v-if="addOrUpdateVisib"
  444. ref="ApprovalComments"
  445. @refreshDataList="returnData"
  446. />
  447. <add-or-update ref="addOrUpdate" @imporData="imporData" />
  448. <view-approval ref="viewApproval" />
  449. <column-setting
  450. ref="columnSetting"
  451. @reset="reset"
  452. @getRowdata="getRowdata"
  453. tableName="凯和付费详情页"
  454. />
  455. </div>
  456. </template>
  457. <script>
  458. import Cookies from "js-cookie";
  459. import { tableOption2 } from "./js/index";
  460. import {
  461. selectTVesself,
  462. selectTVoyagef,
  463. selectPortName,
  464. save,
  465. listCorps,
  466. confirm,
  467. RevocationApproval,
  468. getdetail,
  469. infoRemove,
  470. revoke,
  471. getExcelInfo,
  472. } from "@/api/finance/kaihe/payment";
  473. import ApprovalComments from "@/views/startApproval";
  474. import addOrUpdate from "./add-or-update.vue";
  475. import viewApproval from "@/views/viewApproval";
  476. import columnSetting from "@/components/ColumnSetting/index";
  477. import _ from "lodash";
  478. export default {
  479. data() {
  480. return {
  481. form: {
  482. fDc: "C",
  483. fSystemType: Cookies.get("sysType"),
  484. fVoyid: null,
  485. },
  486. options: [],
  487. tableData: [],
  488. tableOption: tableOption2,
  489. TVesselfs: [],
  490. TVoyagefs: [],
  491. portNames: [],
  492. corpList: [],
  493. wRtions: [],
  494. approve: false,
  495. addOrUpdateVisib: false,
  496. readOnly: null,
  497. subLoading: false,
  498. };
  499. },
  500. components: {
  501. ApprovalComments,
  502. addOrUpdate,
  503. viewApproval,
  504. columnSetting,
  505. },
  506. props: {
  507. showDetail: {
  508. type: Boolean,
  509. },
  510. },
  511. created() {},
  512. methods: {
  513. fvslChange(id) {
  514. selectTVoyagef({ fPid: id }).then((res) => {
  515. this.TVoyagefs = res.rows;
  516. });
  517. this.form.fVoyid = null;
  518. },
  519. fvslClear() {
  520. selectTVoyagef().then((res) => {
  521. this.TVoyagefs = res.rows;
  522. });
  523. this.form.fVoyid = null;
  524. },
  525. /** 导出按钮操作 */
  526. handleExport() {
  527. if (this.form.fCorpid == null) {
  528. return this.$message.error("客户名称不能为空");
  529. }
  530. let _this = this;
  531. this.$confirm("是否确认导出明细数据?", "警告", {
  532. confirmButtonText: "确定",
  533. cancelButtonText: "取消",
  534. type: "warning",
  535. })
  536. .then(function () {
  537. return getExcelInfo(_this.form.fId);
  538. })
  539. .then((response) => {
  540. this.download(response.msg);
  541. });
  542. },
  543. getRowdata(list) {
  544. this.tableOption = list;
  545. },
  546. reset() {
  547. this.tableOption = this.$options.data().tableOption;
  548. },
  549. colSetting() {
  550. this.$refs.columnSetting.init(this.tableOption);
  551. },
  552. init() {
  553. selectTVesself().then((res) => {
  554. this.TVesselfs = res.rows;
  555. });
  556. selectTVoyagef().then((res) => {
  557. this.TVoyagefs = res.rows;
  558. });
  559. selectPortName().then((res) => {
  560. this.portNames = res.rows;
  561. });
  562. this.getDicts("whether_reconciliation").then((response) => {
  563. if (response.data) {
  564. this.wRtions = response.data;
  565. }
  566. });
  567. listCorps().then((res) => {
  568. this.corpList = res;
  569. });
  570. setTimeout((e) => {
  571. this.$refs.columnSetting.getRow(this.tableOption);
  572. }, 100);
  573. },
  574. fAmtChange(row) {
  575. if (Number(row.fAmt) > Number(row.fAmtdr)) {
  576. row.fAmt = row.fAmtdr;
  577. this.$message.error("实收金额不能超过应收金额");
  578. }
  579. if (Number(row.fAmt) <= 0) {
  580. row.fAmt = row.fAmtdr;
  581. this.$message.error("请正确输入金额");
  582. }
  583. },
  584. rowDel(row, index, rows) {
  585. console.log();
  586. if (row.fId) {
  587. infoRemove(row.fId).then((res) => {
  588. if (res.code == 200) {
  589. rows.splice(index, 1);
  590. this.$message.success("删除成功");
  591. }
  592. });
  593. } else {
  594. rows.splice(index, 1);
  595. this.$message.success("删除成功");
  596. }
  597. },
  598. getSummaries(param) {
  599. const { columns, data } = param;
  600. const sums = [];
  601. if (data.length > 0) {
  602. columns.forEach((column, index) => {
  603. if (index == 0) {
  604. sums[index] = "合计";
  605. }
  606. if (column.label == "应付金额" || column.label == "实付金额") {
  607. const values = data.map((item) => Number(item[column.property]));
  608. if (!values.every((value) => isNaN(value))) {
  609. sums[index] = values.reduce((prev, curr) => {
  610. const value = Number(curr);
  611. if (!isNaN(value)) {
  612. return prev + curr;
  613. } else {
  614. return prev;
  615. }
  616. }, 0);
  617. // sums[index] += "元";
  618. } else {
  619. sums[index] = "0";
  620. // sums[index] = "0元";
  621. }
  622. }
  623. });
  624. }
  625. return sums;
  626. },
  627. info(row, status) {
  628. this.init();
  629. this.readOnly = status;
  630. const id = row.fId ? row.fId : row;
  631. getdetail(id).then((res) => {
  632. if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
  633. const date = [];
  634. date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
  635. res.data.tFee.date = date;
  636. }
  637. this.form = res.data.tFee;
  638. this.tableData = res.data.tFeeDo;
  639. });
  640. },
  641. copyData(id) {
  642. this.init();
  643. getdetail(id).then((res) => {
  644. if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
  645. const date = [];
  646. date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
  647. res.data.tFee.date = date;
  648. }
  649. delete res.data.tFee.fId;
  650. delete res.data.tFee.fBillstatus;
  651. delete res.data.tFee.fBillno;
  652. delete res.data.tFee.srcBillNo;
  653. delete res.data.tFee.createBy;
  654. delete res.data.tFee.createTime;
  655. delete res.data.tFee.updateBy;
  656. delete res.data.tFee.updateTime;
  657. delete res.data.tFee.fRemarks;
  658. this.form = res.data.tFee;
  659. });
  660. },
  661. returnData() {
  662. this.addOrUpdateVisib = false;
  663. this.homepaGe();
  664. },
  665. homepaGe() {
  666. let view = {
  667. fullPath: "/finance/contrast",
  668. hash: "",
  669. matched: Array(2),
  670. meta: Object,
  671. name: "Contrast",
  672. params: Object,
  673. path: "/finance/contrast",
  674. query: Object,
  675. title: "付费",
  676. };
  677. this.$router.push({ path: "/index" });
  678. this.$store
  679. .dispatch("tagsView/delView", view)
  680. .then(({ visitedViews }) => {
  681. if (this.isActive(view)) {
  682. this.toLastView(visitedViews, view);
  683. }
  684. });
  685. Global.$emit("removeCache", "closeSelectedTag", view);
  686. },
  687. // 审批按钮
  688. goApproval(status) {
  689. this.addOrUpdateVisib = true;
  690. this.$nextTick(() => {
  691. this.$refs.ApprovalComments.init(this.form.fId, status, 450);
  692. });
  693. },
  694. // 撤销审批
  695. backApproval(status) {
  696. let data = {
  697. id: this.form.fId,
  698. actId: 450,
  699. billId: this.form.fId,
  700. fidStatus: status,
  701. };
  702. this.subLoading = true;
  703. RevocationApproval(data).then((response) => {
  704. if (response.code === 200) {
  705. this.msgSuccess("撤销审批成功");
  706. const id = this.form.fId;
  707. getdetail(id)
  708. .then((res) => {
  709. if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
  710. const date = [];
  711. date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
  712. res.data.tFee.date = date;
  713. }
  714. this.form = res.data.tFee;
  715. this.tableData = res.data.tFeeDo;
  716. })
  717. .finally(() => {
  718. this.subLoading = false;
  719. });
  720. }
  721. });
  722. },
  723. returnData() {
  724. this.$emit("goBack", false);
  725. },
  726. // 查看审批流
  727. addOrUpdateHandle(status) {
  728. this.addOrUpdateVisible = true;
  729. this.addOrUpdateVisib = false;
  730. let id = null;
  731. if (this.form.fId) {
  732. id = this.form.fId;
  733. } else {
  734. id = this.form.id;
  735. }
  736. this.$nextTick(() => {
  737. this.$refs.viewApproval.init(id, 450, status);
  738. });
  739. },
  740. // 撤销付费
  741. backrRconciliation() {
  742. this.form.fBillstatus = "1";
  743. this.subLoading = true;
  744. let formDate = new window.FormData();
  745. formDate.append("tFee", JSON.stringify(this.form));
  746. formDate.append("tFeeDo", JSON.stringify(this.tableData));
  747. revoke(formDate)
  748. .then((response) => {
  749. this.msgSuccess("撤回成功");
  750. Object.assign(this.$data, this.$options.data());
  751. this.$emit("goBack", false);
  752. })
  753. .finally(() => {
  754. this.subLoading = false;
  755. });
  756. },
  757. Search() {
  758. const data = {
  759. fReconciliation: this.form.fReconciliation,
  760. fDc: this.form.fDc,
  761. fSystemType: 3,
  762. fCorpid: this.form.fCorpid,
  763. fVslid: this.form.fVslid,
  764. fVoyid: this.form.fVoyid,
  765. fDestportid: this.form.fDestportid,
  766. fLoadportid: this.form.fLoadportid,
  767. fStatementNo: this.form.fStatementNo,
  768. fMblno: this.form.tMblno,
  769. fFromDate: this.form.date ? this.form.date[0] : null,
  770. fToDate: this.form.date ? this.form.date[1] : null,
  771. };
  772. this.$refs.addOrUpdate.init(data, this.tableData);
  773. },
  774. imporData(rows) {
  775. this.tableData = this.tableData.concat(rows);
  776. },
  777. lumpSum() {
  778. let fAmtdr = 0;
  779. let fAmtcr = 0;
  780. this.tableData.map((e) => {
  781. fAmtdr = _.add(fAmtdr, Number(e.fAmtdr));
  782. fAmtcr = _.add(fAmtcr, Number(e.fAmt));
  783. });
  784. this.form.fAmtdr = fAmtdr;
  785. this.form.fAmtcr = fAmtcr;
  786. },
  787. submit() {
  788. if (this.form.fCorpid == null) {
  789. return this.$message.error("客户名称不能为空");
  790. }
  791. this.corpList.forEach((e) => {
  792. if (this.form.fCorpid == e.fId) {
  793. this.form.fCtrlcorpid = e.fName;
  794. }
  795. });
  796. if (this.tableData.length == 0) {
  797. return this.$message.error("明细表不能为空");
  798. }
  799. if (this.form.date) {
  800. this.form.fFromDate = this.form.date[0];
  801. this.form.fToDate = this.form.date[1];
  802. }
  803. this.lumpSum();
  804. if (this.form.fId == null) {
  805. return this.$message.error("数据未保存,不能进行确认付费");
  806. }
  807. this.subLoading = true;
  808. let formDate = new window.FormData();
  809. formDate.append("tFee", JSON.stringify(this.form));
  810. formDate.append("tFeeDo", JSON.stringify(this.tableData));
  811. formDate.append("billsType", JSON.stringify("KHDZ"));
  812. confirm(formDate)
  813. .then((res) => {
  814. if (res.code == 200) {
  815. this.$message.success("付费成功");
  816. Object.assign(this.$data, this.$options.data());
  817. this.$emit("goBack", false);
  818. }
  819. })
  820. .finally(() => {
  821. this.subLoading = false;
  822. });
  823. },
  824. save(type) {
  825. if (this.form.fCorpid == null) {
  826. return this.$message.error("客户名称不能为空");
  827. }
  828. this.corpList.forEach((e) => {
  829. if (this.form.fCorpid == e.fId) {
  830. this.form.fCtrlcorpid = e.fName;
  831. }
  832. });
  833. // if (this.tableData.length == 0) {
  834. // return this.$message.error("明细表不能为空");
  835. // }
  836. if (this.form.date) {
  837. this.form.fFromDate = this.form.date[0];
  838. this.form.fToDate = this.form.date[1];
  839. }
  840. this.lumpSum();
  841. this.subLoading = true;
  842. let formDate = new window.FormData();
  843. formDate.append("tFee", JSON.stringify(this.form));
  844. formDate.append("tFeeDo", JSON.stringify(this.tableData));
  845. formDate.append("billsType", JSON.stringify("KHDZ"));
  846. save(formDate)
  847. .then((res) => {
  848. if (res.code == 200) {
  849. if (!type) {
  850. if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
  851. const date = [];
  852. date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
  853. res.data.tFee.date = date;
  854. }
  855. }
  856. this.form = res.data.tFee;
  857. this.tableData = res.data.tFeeDo;
  858. this.$emit("refFresh");
  859. this.$message.success("保存成功");
  860. }
  861. })
  862. .finally(() => {
  863. this.subLoading = false;
  864. });
  865. },
  866. cancel() {
  867. if (this.readOnly != 0) {
  868. this.$confirm("返回列表,是否保存?", "提示", {
  869. confirmButtonText: "保存",
  870. cancelButtonText: "取消",
  871. type: "warning",
  872. })
  873. .then(() => {
  874. this.save("back");
  875. Object.assign(this.$data, this.$options.data());
  876. this.$emit("goBack", false);
  877. })
  878. .catch(() => {
  879. Object.assign(this.$data, this.$options.data());
  880. this.$emit("goDetail", false);
  881. });
  882. } else {
  883. Object.assign(this.$data, this.$options.data());
  884. this.$emit("goBack", false);
  885. }
  886. },
  887. },
  888. watch: {
  889. info: function (obj) {
  890. console.log(obj);
  891. },
  892. },
  893. };
  894. </script>
  895. <style lang="scss" scoped>
  896. .head-but {
  897. display: flex;
  898. justify-content: space-between;
  899. margin-bottom: 8px;
  900. }
  901. .tabSetting {
  902. display: flex;
  903. justify-content: flex-end;
  904. }
  905. </style>