index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925
  1. <template>
  2. <div class="app-container">
  3. <div v-show="jiGang == false">
  4. <el-form
  5. :model="query"
  6. ref="queryForm"
  7. v-show="showSearch"
  8. :inline="true"
  9. label-width="88px"
  10. >
  11. <el-row>
  12. <el-form-item label="提单号" prop="fMblno">
  13. <el-input
  14. v-model="query.fMblno"
  15. placeholder="请输入提单号"
  16. clearable
  17. size="small"
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button
  22. type="cyan"
  23. icon="el-icon-search"
  24. size="mini"
  25. @click="getList"
  26. >搜索
  27. </el-button
  28. >
  29. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  30. >重置
  31. </el-button
  32. >
  33. </el-form-item>
  34. </el-row>
  35. </el-form>
  36. <el-row :gutter="10" class="mb8">
  37. <el-col :span="1.5">
  38. <el-button
  39. type="primary"
  40. icon="el-icon-plus"
  41. size="mini"
  42. @click="handleAdd()"
  43. v-hasPermi="['warehouseBusiness:containerPort:add']"
  44. >新增
  45. </el-button>
  46. </el-col>
  47. <el-col :span="1.5">
  48. <el-button
  49. type="success"
  50. icon="el-icon-edit"
  51. size="mini"
  52. :disabled="single"
  53. @click="handleUpdate"
  54. v-hasPermi="['agreement:agreementTask:edit']"
  55. >修改
  56. </el-button>
  57. </el-col>
  58. <!-- <el-col :span="1.5">-->
  59. <!-- <el-button-->
  60. <!-- type="danger"-->
  61. <!-- icon="el-icon-delete"-->
  62. <!-- size="mini"-->
  63. <!-- :disabled="multiple"-->
  64. <!-- @click="handleDelete"-->
  65. <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
  66. <!-- >删除-->
  67. <!-- </el-button>-->
  68. <!-- </el-col>-->
  69. <!-- <el-col :span="1.5">-->
  70. <!-- <el-button-->
  71. <!-- type="info"-->
  72. <!-- icon="el-icon-download"-->
  73. <!-- size="mini"-->
  74. <!-- :disabled="single"-->
  75. <!-- @click="handleUpdate(null, 2)"-->
  76. <!-- v-hasPermi="['agreement:agreementStorage:export']"-->
  77. <!-- >复制新增-->
  78. <!-- </el-button>-->
  79. <!-- </el-col>-->
  80. <right-toolbar
  81. :showSearch.sync="showSearch"
  82. @queryTable="getList"
  83. ></right-toolbar>
  84. </el-row>
  85. <el-table
  86. v-loading="loading"
  87. :data="agreementList"
  88. @selection-change="handleSelectionChange"
  89. >
  90. <el-table-column type="selection" width="55" align="center"/>
  91. <el-table-column type="index" label="行号" align="center" fixed width="60"/>
  92. <el-table-column
  93. label="日期"
  94. sortable
  95. align="center"
  96. prop="fBsdate"
  97. fixed
  98. show-overflow-tooltip
  99. />
  100. <el-table-column
  101. label="提单号"
  102. sortable
  103. align="center"
  104. prop="fMblno"
  105. fixed
  106. show-overflow-tooltip
  107. />
  108. <el-table-column
  109. label="制单人"
  110. sortable
  111. align="center"
  112. prop="createBy"
  113. fixed
  114. show-overflow-tooltip
  115. />
  116. <el-table-column
  117. label="状态"
  118. sortable
  119. align="center"
  120. prop="fBillstatus"
  121. fixed
  122. show-overflow-tooltip
  123. />
  124. <el-table-column
  125. label="操作"
  126. align="center"
  127. class-name="small-padding fixed-width"
  128. >
  129. <template slot-scope="scope">
  130. <el-button
  131. size="mini"
  132. type="text"
  133. icon="el-icon-view"
  134. @click="handleUpdate(scope.row)"
  135. >查看
  136. </el-button>
  137. <el-button
  138. size="mini"
  139. type="text"
  140. icon="el-icon-edit"
  141. @click="handleUpdate(scope.row)"
  142. v-if="scope.row.fBillstatus === '暂存'"
  143. v-hasPermi="['warehouseBusiness:containerPort:edit']"
  144. >修改
  145. </el-button>
  146. <el-button
  147. size="mini"
  148. type="text"
  149. icon="el-icon-delete"
  150. @click="handleDelete(scope.row)"
  151. v-if="scope.row.fBillstatus === '暂存'"
  152. v-hasPermi="['warehouseBusiness:containerPort:remove']"
  153. >删除
  154. </el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <div style="padding-top: 10px;float: right;padding-bottom: 20px">
  159. <el-pagination
  160. @size-change="handleSizeChange"
  161. @current-change="handleCurrentChange"
  162. :page-sizes="[10, 20, 30, 40]"
  163. background
  164. layout="sizes, prev, pager, next"
  165. :total="total">
  166. </el-pagination>
  167. </div>
  168. </div>
  169. <div v-show="jiGang == true">
  170. <div style="margin-bottom: 20px;">
  171. <el-button round icon="el-icon-arrow-left" @click="open" size="small">返回列表</el-button>
  172. <el-button type="primary" round size="small" @click="submitForm" icon="el-icon-edit">保 存</el-button>
  173. <el-button type="success" round size="small" @click="submit" icon="el-icon-check" :disabled="disabled">提 交</el-button>
  174. <el-button type="danger" round size="small" icon="el-icon-close" @click="cancellation"
  175. v-if="queryParams.fBillstatus >2">撤销提交
  176. </el-button>
  177. </div>
  178. <el-form
  179. :model="queryParams"
  180. ref="rules"
  181. :rules="rules"
  182. :inline="true"
  183. label-width="88px"
  184. >
  185. <el-row>
  186. <el-form-item label="日期" prop="fBsdate">
  187. <el-date-picker
  188. v-model="queryParams.fBsdate"
  189. type="date"
  190. value-format="yyyy-MM-dd"
  191. :disabled="disabled"
  192. clearable
  193. size="small"
  194. placeholder="选择日期"
  195. >
  196. </el-date-picker>
  197. </el-form-item>
  198. <el-form-item label="提单号" prop="fMblno">
  199. <el-input
  200. v-model="queryParams.fMblno"
  201. placeholder="请输入提单号"
  202. :disabled="disabled"
  203. clearable
  204. size="small"
  205. />
  206. </el-form-item>
  207. </el-row>
  208. </el-form>
  209. <h3><i class="el-icon-circle-plus"></i>收款信息</h3>
  210. <div
  211. class="dialogTableTitle flex a-center jlr"
  212. style="
  213. display: flex;
  214. justify-content: space-between;
  215. align-items: center;
  216. margin: 10px 0;
  217. "
  218. >
  219. <div>
  220. <el-button
  221. size="small"
  222. type="primary"
  223. @click.prevent="addCollection()"
  224. :disabled="disabled"
  225. >新行
  226. </el-button>
  227. <!-- <el-button :disabled="browseStatus" @click.prevent="deleteRow(warehouseDrList)"
  228. >删除
  229. </el-button> -->
  230. </div>
  231. </div>
  232. <el-table
  233. :data="warehouseDrList"
  234. ref="table"
  235. tooltip-effect="dark"
  236. border
  237. stripe
  238. show-summary
  239. :disabled="disabled"
  240. :summary-method="warehouseDrSummaries"
  241. >
  242. <el-table-column type="selection" width="55" align="center"/>
  243. <el-table-column label="序号" type="index" width="80">
  244. </el-table-column>
  245. <el-table-column
  246. prop="fCorpid"
  247. header-align="center"
  248. align="center"
  249. width="180px"
  250. label="客户名称"
  251. >
  252. <template slot-scope="scope">
  253. <el-select
  254. v-model="scope.row.fCorpid"
  255. filterable
  256. remote
  257. :remote-method="corpsRemoteMethod"
  258. placeholder="客户名称"
  259. :disabled="disabled"
  260. >
  261. <el-option
  262. v-for="(dict, index) in KHblnoOptions"
  263. :key="index.fId"
  264. :label="dict.fName"
  265. :value="dict.fId"
  266. ></el-option>
  267. </el-select>
  268. </template>
  269. </el-table-column>
  270. <el-table-column
  271. prop="fFeeunitid"
  272. header-align="center"
  273. align="center"
  274. width="180px"
  275. label="码头"
  276. >
  277. <template slot-scope="scope">
  278. <el-select
  279. style="width: 80%"
  280. v-model="scope.row.fFeeunitid"
  281. filterable
  282. :disabled="disabled"
  283. >
  284. <el-option
  285. v-for="(dict, index) in businessTypeOption"
  286. :key="index.dictValue"
  287. :label="dict.dictLabel"
  288. :value="dict.dictValue"
  289. ></el-option>
  290. </el-select>
  291. </template>
  292. </el-table-column>
  293. <el-table-column
  294. prop="fFeeid"
  295. header-align="center"
  296. align="center"
  297. width="180px"
  298. label="费用名称"
  299. >
  300. <template slot-scope="scope">
  301. <el-select
  302. style="width: 80%"
  303. v-model="scope.row.fFeeid"
  304. filterable
  305. :disabled="disabled"
  306. >
  307. <el-option
  308. v-for="(dict, index) in fFeeid_s"
  309. :key="index.fId"
  310. :label="dict.fName"
  311. :value="dict.fId"
  312. ></el-option>
  313. </el-select>
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. prop="fInventoryDays"
  318. header-align="center"
  319. align="center"
  320. width="180px"
  321. label="箱型"
  322. >
  323. <template slot-scope="scope">
  324. <el-select
  325. v-model="scope.row.fInventoryDays"
  326. placeholder="请选择箱型"
  327. clearable
  328. :disabled="disabled"
  329. >
  330. <el-option
  331. v-for="(dict, index) in jFeetunitOptions"
  332. :key="index.fId"
  333. :label="dict.fNo"
  334. :value="dict.fId"
  335. />
  336. </el-select>
  337. </template>
  338. </el-table-column>
  339. <el-table-column
  340. prop="fQty"
  341. header-align="center"
  342. align="center"
  343. width="130px"
  344. label="箱量"
  345. >
  346. <template slot-scope="scope">
  347. <el-input
  348. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  349. v-model="scope.row.fQty"
  350. placeholder="箱量"
  351. @input="calculation(scope.row)"
  352. show-word-limit
  353. :disabled="disabled"
  354. />
  355. </template>
  356. </el-table-column>
  357. <el-table-column
  358. prop="fUnitprice"
  359. header-align="center"
  360. align="center"
  361. width="130px"
  362. label="单价"
  363. >
  364. <template slot-scope="scope">
  365. <el-input
  366. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  367. v-model="scope.row.fUnitprice"
  368. placeholder="单价"
  369. show-word-limit
  370. @input="calculation(scope.row)"
  371. :disabled="disabled"
  372. />
  373. </template>
  374. </el-table-column>
  375. <el-table-column
  376. prop="fAmt"
  377. header-align="center"
  378. align="center"
  379. width="130px"
  380. label="金额"
  381. >
  382. <template slot-scope="scope">
  383. <el-input
  384. :disabled="disabled"
  385. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  386. v-model="scope.row.fAmt"
  387. placeholder="金额"
  388. show-word-limit
  389. />
  390. </template>
  391. </el-table-column>
  392. <el-table-column
  393. header-align="center"
  394. align="center"
  395. label="操作"
  396. >
  397. <template slot-scope="scope">
  398. <el-button
  399. @click.native.prevent="
  400. deleteRow(scope.$index, warehouseDrList)
  401. "
  402. size="small"
  403. :disabled="disabled"
  404. >移除
  405. </el-button
  406. >
  407. </template>
  408. </el-table-column>
  409. </el-table>
  410. <h3><i class="el-icon-remove"></i>付款信息</h3>
  411. <div
  412. class="dialogTableTitle flex a-center jlr"
  413. style="
  414. display: flex;
  415. justify-content: space-between;
  416. align-items: center;
  417. margin: 10px 0;
  418. "
  419. >
  420. <div>
  421. <el-button
  422. type="primary"
  423. @click.prevent="addpayment()"
  424. size="small"
  425. :disabled="disabled"
  426. >新行
  427. </el-button>
  428. </div>
  429. </div>
  430. <el-table
  431. :data="warehouseCrList"
  432. :disabled="disabled"
  433. ref="table"
  434. tooltip-effect="dark"
  435. border
  436. stripe
  437. show-summary
  438. :summary-method="warehouseDrSummaries"
  439. >
  440. <el-table-column type="selection" width="55" align="center"/>
  441. <el-table-column label="序号" type="index" width="80">
  442. </el-table-column>
  443. <el-table-column
  444. prop="fCorpid"
  445. header-align="center"
  446. align="center"
  447. width="180px"
  448. label="客户名称"
  449. >
  450. <template slot-scope="scope">
  451. <el-select
  452. v-model="scope.row.fCorpid"
  453. filterable
  454. :disabled="disabled"
  455. remote
  456. :remote-method="corpsRemote"
  457. placeholder="客户名称"
  458. >
  459. <el-option
  460. v-for="(dict, index) in blnoOptions"
  461. :key="index.fId"
  462. :label="dict.fName"
  463. :value="dict.fId"
  464. ></el-option>
  465. </el-select>
  466. </template>
  467. </el-table-column>
  468. <el-table-column
  469. prop="fFeeunitid"
  470. header-align="center"
  471. align="center"
  472. width="180px"
  473. label="码头"
  474. >
  475. <template slot-scope="scope">
  476. <el-select
  477. style="width: 80%"
  478. v-model="scope.row.fFeeunitid"
  479. filterable
  480. :disabled="disabled"
  481. >
  482. <el-option
  483. v-for="(dict, index) in businessTypeOption"
  484. :key="index.dictValue"
  485. :label="dict.dictLabel"
  486. :value="dict.dictValue"
  487. ></el-option>
  488. </el-select>
  489. </template>
  490. </el-table-column>
  491. <el-table-column
  492. prop="fFeeid"
  493. header-align="center"
  494. align="center"
  495. width="180px"
  496. label="费用名称"
  497. >
  498. <template slot-scope="scope">
  499. <el-select
  500. style="width: 80%"
  501. v-model="scope.row.fFeeid"
  502. filterable
  503. :disabled="disabled"
  504. >
  505. <el-option
  506. v-for="(dict, index) in fFeeid_s"
  507. :key="index.fId"
  508. :label="dict.fName"
  509. :value="dict.fId"
  510. ></el-option>
  511. </el-select>
  512. </template>
  513. </el-table-column>
  514. <el-table-column
  515. prop="fInventoryDays"
  516. header-align="center"
  517. align="center"
  518. width="180px"
  519. label="箱型"
  520. >
  521. <template slot-scope="scope">
  522. <el-select
  523. v-model="scope.row.fInventoryDays"
  524. placeholder="请选择箱型"
  525. :disabled="disabled"
  526. clearable
  527. >
  528. <el-option
  529. v-for="(dict, index) in jFeetunitOptions"
  530. :key="index.fId"
  531. :label="dict.fNo"
  532. :value="dict.fId"
  533. />
  534. </el-select>
  535. </template>
  536. </el-table-column>
  537. <el-table-column
  538. prop="fQty"
  539. header-align="center"
  540. align="center"
  541. width="130px"
  542. label="箱量"
  543. >
  544. <template slot-scope="scope">
  545. <el-input
  546. :disabled="disabled"
  547. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  548. v-model="scope.row.fQty"
  549. placeholder="箱量"
  550. @input="calculation(scope.row)"
  551. show-word-limit
  552. />
  553. </template>
  554. </el-table-column>
  555. <el-table-column
  556. prop="fUnitprice"
  557. header-align="center"
  558. align="center"
  559. width="130px"
  560. label="单价"
  561. >
  562. <template slot-scope="scope">
  563. <el-input
  564. :disabled="disabled"
  565. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  566. v-model="scope.row.fUnitprice"
  567. @input="calculation(scope.row)"
  568. placeholder="单价"
  569. show-word-limit
  570. />
  571. </template>
  572. </el-table-column>
  573. <el-table-column
  574. prop="fAmt"
  575. header-align="center"
  576. align="center"
  577. width="130px"
  578. label="金额"
  579. >
  580. <template slot-scope="scope">
  581. <el-input
  582. :disabled="disabled"
  583. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  584. v-model="scope.row.fAmt"
  585. placeholder="金额"
  586. show-word-limit
  587. />
  588. </template>
  589. </el-table-column>
  590. <el-table-column
  591. header-align="center"
  592. align="center"
  593. label="操作"
  594. >
  595. <template slot-scope="scope">
  596. <!-- <el-button size="small">审核费用</el-button> -->
  597. <el-button
  598. @click.native.prevent="
  599. deleteRow(scope.$index, warehouseCrList)
  600. "
  601. size="small"
  602. :disabled="disabled"
  603. >移除
  604. </el-button
  605. >
  606. </template>
  607. </el-table-column>
  608. </el-table>
  609. </div>
  610. </div>
  611. </template>
  612. <script>
  613. import {
  614. listCorps,
  615. preservation,
  616. submit,
  617. allInformation,
  618. single,
  619. singleDeletion,
  620. listCorps_s,
  621. revokeContainerPort
  622. } from '@/api/jiGang'
  623. import {listFees} from '@/api/basicdata/fees'
  624. export default {
  625. name: 'jiGang',
  626. data() {
  627. return {
  628. rules:{
  629. fBsdate:[{required: true, message: ' ', trigger: 'blur'}],
  630. fMblno:[{required: true, message: ' ', trigger: 'blur'}]
  631. },
  632. showSearch: true,
  633. jiGang: false,
  634. disabled: false,
  635. agreementList: [],
  636. warehouseCrList: [],
  637. fCNameOptions: [],
  638. fFeeid_s: [],
  639. fStltypeOptions: [],
  640. jFeetunitOptions: [],
  641. KHblnoOptions: [],
  642. browseStatus: false,
  643. fDNameOptions: [],
  644. warehouseDrList: [],
  645. businessTypeOption: [],
  646. loading: true,
  647. blnoOptions: [],
  648. single: true,
  649. total: 0,
  650. query: {
  651. pageNum: 1,
  652. pageSize: 10
  653. },
  654. selection: [],
  655. queryParams: {}
  656. }
  657. },
  658. created() {
  659. allInformation().then(res => {
  660. console.log(res)
  661. if (res.data.corpList) {
  662. this.KHblnoOptions = res.data.corpList
  663. }
  664. if (res.data.pierList) {
  665. this.businessTypeOption = res.data.pierList
  666. }
  667. if (res.data.cntrList) {
  668. this.jFeetunitOptions = res.data.cntrList
  669. }
  670. if (res.data.fees) {
  671. this.fFeeid_s = res.data.fees
  672. }
  673. })
  674. this.getList()
  675. },
  676. methods: {
  677. handleSizeChange(val) {
  678. console.log(`每页 ${val} 条`);
  679. this.query.pageSize = val
  680. this.getList()
  681. },
  682. handleCurrentChange(val) {
  683. console.log(`当前页: ${val}`);
  684. this.query.pageNum = val
  685. this.getList()
  686. },
  687. getList() {
  688. listCorps_s(this.query).then(res => {
  689. this.total = res.total
  690. console.log(res)
  691. this.loading = false
  692. this.agreementList = res.rows
  693. })
  694. },
  695. corpsRemoteMethod(name) {
  696. if (name == null || name === '') {
  697. return false
  698. }
  699. let queryParams = {pageNum: 1, fName: name, fTypeid: 1}
  700. listCorps(queryParams).then((response) => {
  701. console.log(response)
  702. this.fMblnoOptions = response.rows
  703. })
  704. },
  705. corpsRemote(name) {
  706. if (name == null || name === '') {
  707. return false
  708. }
  709. let queryParams = {pageNum: 1, fName: name, fTypeid: 2}
  710. listCorps(queryParams).then((response) => {
  711. console.log(response)
  712. this.blnoOptions = response.rows
  713. })
  714. },
  715. changeFeeId(row) {
  716. for (let li in this.fWbuOptions) {
  717. if (row.fFeeid === this.fWbuOptions[li].fId) {
  718. this.$set(row, 'fFeeunitid', this.fWbuOptions[li].fFeeunitid + '')
  719. this.changeFeeUnit(row)
  720. break
  721. }
  722. }
  723. },
  724. resetQuery() {
  725. this.query = {
  726. pageNum: 1,
  727. pageSize: 10
  728. }
  729. },
  730. open() {
  731. this.$confirm('是否确定返回列表?', '提示', {
  732. confirmButtonText: '确定',
  733. cancelButtonText: '取消',
  734. type: 'warning'
  735. }).then(() => {
  736. this.jiGang = false
  737. }).catch(() => {
  738. })
  739. },
  740. handleSelectionChange(selection) {
  741. console.log(selection)
  742. this.selection = selection
  743. if (selection.length === 1) {
  744. this.single = false
  745. } else {
  746. this.single = true
  747. }
  748. },
  749. handleUpdate(row) {
  750. let fId
  751. if (this.selection.length == 1) {
  752. fId = this.selection[0].fId
  753. } else {
  754. fId = row.fId
  755. }
  756. single(fId).then(res => {
  757. if (res.code === 200) {
  758. this.jiGang = true
  759. this.queryParams = res.data.warehouseBills
  760. this.warehouseDrList = res.data.feesDrList
  761. this.warehouseCrList = res.data.feesCrList
  762. for (let item in this.warehouseDrList){
  763. this.warehouseDrList[item].fFeeunitid = this.warehouseDrList[item].fFeeunitid + ''
  764. }
  765. for (let item in this.warehouseCrList){
  766. this.warehouseCrList[item].fFeeunitid = this.warehouseCrList[item].fFeeunitid + ''
  767. }
  768. if (this.queryParams.fBillstatus !== 2) {
  769. this.disabled = true
  770. } else {
  771. this.disabled = false
  772. }
  773. }
  774. })
  775. },
  776. handleDelete(row) {
  777. singleDeletion(row.fId).then(res => {
  778. console.log(res)
  779. if (res.code === 200){
  780. this.$message.success(res.msg);
  781. this.getList()
  782. }
  783. })
  784. },
  785. handleAdd() {
  786. this.jiGang = true
  787. this.disabled = false
  788. this.queryParams = {}
  789. this.warehouseDrList = []
  790. this.warehouseCrList = []
  791. },
  792. addpayment() {
  793. this.warehouseCrList.push({
  794. fCorpid: '',
  795. fFeeunitid: '',
  796. fInventoryDays: '',
  797. fQty: '',
  798. fUnitprice: '',
  799. fAmt: '',
  800. fFeeid: ''
  801. })
  802. this.fWbuOptions = []
  803. let queryParams = {pageNum: 1, fDc: 'C'}
  804. listFees(queryParams).then((response) => {
  805. this.fCNameOptions = response.rows
  806. })
  807. },
  808. deleteRow(index, rows) {
  809. rows.splice(index, 1)
  810. },
  811. submitForm() {
  812. this.$refs["rules"].validate((valid) => {
  813. if (valid) {
  814. let formDatae = new window.FormData()
  815. formDatae.append('warehouseBills', JSON.stringify(this.queryParams))
  816. formDatae.append('feesDr', JSON.stringify(this.warehouseDrList))
  817. formDatae.append('feesCr', JSON.stringify(this.warehouseCrList))
  818. preservation(formDatae).then(res => {
  819. console.log(res)
  820. if (res.code === 200) {
  821. this.$message.success('保存成功');
  822. this.getList()
  823. this.jiGang = false
  824. }
  825. })
  826. }
  827. });
  828. },
  829. submit() {
  830. this.$refs["rules"].validate((valid) => {
  831. if (valid) {
  832. let formDatae = new window.FormData()
  833. formDatae.append('warehouseBills', JSON.stringify(this.queryParams))
  834. formDatae.append('feesDr', JSON.stringify(this.warehouseDrList))
  835. formDatae.append('feesCr', JSON.stringify(this.warehouseCrList))
  836. submit(formDatae).then(res => {
  837. console.log(res)
  838. if (res.code === 200) {
  839. this.$message.success('提交成功');
  840. this.getList()
  841. this.jiGang = false
  842. }
  843. })
  844. }
  845. });
  846. },
  847. cancellation() {
  848. // let formDatae = new window.FormData()
  849. // formDatae.append('warehouseBills', JSON.stringify(this.queryParams))
  850. // formDatae.append('feesDr', JSON.stringify(this.warehouseDrList))
  851. // formDatae.append('feesCr', JSON.stringify(this.warehouseCrList))
  852. revokeContainerPort(this.queryParams.fId).then(res => {
  853. console.log(res)
  854. if (res.code === 200) {
  855. this.$message.success('撤销成功');
  856. this.getList()
  857. this.jiGang = false
  858. }
  859. })
  860. },
  861. calculation(row) {
  862. console.log(row)
  863. if (row.fQty && row.fUnitprice) {
  864. row.fAmt = Number(row.fQty) * Number(row.fUnitprice)
  865. }
  866. },
  867. addCollection() {
  868. this.warehouseDrList.push({
  869. fCorpid: '',
  870. fFeeunitid: '',
  871. fInventoryDays: '',
  872. fQty: '',
  873. fUnitprice: '',
  874. fAmt: '',
  875. fFeeid: ''
  876. })
  877. this.fWbuOptions = []
  878. let queryParams = {pageNum: 1, fDc: 'D'}
  879. listFees(queryParams).then((response) => {
  880. this.fDNameOptions = response.rows
  881. })
  882. },
  883. // 付款合计
  884. warehouseDrSummaries(param) {
  885. const {columns, data} = param
  886. const sums = []
  887. columns.forEach((column, index) => {
  888. if (index === 0) {
  889. sums[index] = '合计'
  890. return
  891. }
  892. const values = data.map((item) => Number(item[column.property]))
  893. if (
  894. column.property === 'fUnitprice' ||
  895. column.property === 'fAmount' ||
  896. column.property === 'fQty' ||
  897. column.property === 'fQty'
  898. ) {
  899. sums[index] = values.reduce((prev, curr) => {
  900. const value = Number(curr)
  901. if (!isNaN(value)) {
  902. return prev + curr
  903. } else {
  904. return prev
  905. }
  906. }, 0)
  907. sums[index] = sums[index].toFixed(2)
  908. }
  909. })
  910. return sums
  911. },
  912. }
  913. }
  914. </script>
  915. <style scoped>
  916. </style>