index.vue 26 KB

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