incomeMoney.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. <template>
  2. <div>
  3. <div
  4. class="dialogTableTitle flex a-center jlr"
  5. style="
  6. display: flex;
  7. justify-content: space-between;
  8. align-items: center;
  9. margin: 10px 0;
  10. "
  11. >
  12. <div>
  13. <el-button
  14. size="small"
  15. type="primary"
  16. :disabled="browseStatus"
  17. @click.prevent="addCollection()"
  18. >新行
  19. </el-button>
  20. <el-button
  21. type="primary"
  22. size="small"
  23. :disabled="browseStatus"
  24. @click="saveForm"
  25. >保 存
  26. </el-button
  27. >
  28. <el-button
  29. size="small"
  30. @click.prevent="handleSelect()"
  31. type="danger"
  32. >作业费协议
  33. </el-button>
  34. <el-button
  35. v-if="feeDisplay"
  36. size="small"
  37. :disabled="browseStatus"
  38. type="warning"
  39. >计算仓储费
  40. </el-button>
  41. <el-button
  42. type="primary"
  43. size="small"
  44. v-if="browseStatus"
  45. @click="feeChange"
  46. >费用变更</el-button>
  47. </div>
  48. </div>
  49. <el-table
  50. :data="warehouseDrList"
  51. ref="table"
  52. tooltip-effect="dark"
  53. border
  54. stripe
  55. show-summary
  56. @selection-change="Collectionoptions"
  57. :summary-method="warehouseDrSummaries"
  58. >
  59. <el-table-column type="selection" width="55" align="center"/>
  60. <el-table-column label="序号" type="index" width="80"></el-table-column>
  61. <el-table-column
  62. prop="fCorpid"
  63. header-align="center"
  64. align="center"
  65. width="300px"
  66. label="客户名称"
  67. >
  68. <template slot-scope="scope">
  69. <el-select
  70. v-model="scope.row.fCorpid"
  71. filterable
  72. clearable
  73. placeholder="客户名称"
  74. :disabled="browseStatus || scope.row.fBillstatus == 6"
  75. >
  76. <el-option
  77. v-for="(item, index) in fMblnoOptions"
  78. :key="index.fId"
  79. :label="item.fName"
  80. :value="item.fId"
  81. ></el-option>
  82. </el-select>
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. prop="fFeeid"
  87. header-align="center"
  88. align="center"
  89. width="240px"
  90. label="费用名称"
  91. >
  92. <template slot-scope="scope">
  93. <el-select
  94. v-model="scope.row.fFeeid"
  95. clearable
  96. filterable
  97. placeholder="费用名称"
  98. :disabled="browseStatus || scope.row.fBillstatus == 6"
  99. >
  100. <el-option
  101. v-for="(item, index) in fDNameOptions"
  102. :key="index.fId"
  103. :label="item.fName"
  104. :value="item.fId"
  105. ></el-option>
  106. </el-select>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. prop="fBusinessType"
  111. header-align="center"
  112. align="center"
  113. width="180px"
  114. label="作业类型"
  115. >
  116. <template slot-scope="scope">
  117. <el-select
  118. style="width: 80%"
  119. v-model="scope.row.fBusinessType"
  120. filterable
  121. disabled
  122. >
  123. <el-option
  124. v-for="(item, index) in businessTypeOption"
  125. :key="index.dictValue"
  126. :label="item.dictLabel"
  127. :value="item.dictValue"
  128. ></el-option>
  129. </el-select>
  130. </template>
  131. </el-table-column>
  132. <el-table-column
  133. prop="fFeeUnitid"
  134. header-align="center"
  135. align="center"
  136. width="180px"
  137. label="计价单位"
  138. >
  139. <template slot-scope="scope">
  140. <el-select
  141. v-model="scope.row.fFeeUnitid"
  142. placeholder="请选择计价单位"
  143. clearable
  144. :disabled="browseStatus || scope.row.fBillstatus == 6"
  145. @change="changeFeeUnit(scope.row)"
  146. >
  147. <el-option
  148. v-for="(item, index) in fFeetUnitOptions"
  149. :key="index.dictValue"
  150. :label="item.dictLabel"
  151. :value="item.dictValue"
  152. />
  153. </el-select>
  154. </template>
  155. </el-table-column>
  156. <el-table-column
  157. prop="fQty"
  158. header-align="center"
  159. align="center"
  160. width="130px"
  161. label="数量"
  162. >
  163. <template slot-scope="scope">
  164. <el-input
  165. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  166. v-model="scope.row.fQty"
  167. placeholder="数量"
  168. :disabled="browseStatus || scope.row.fBillstatus == 6"
  169. @change="changeContractAmt(scope.row)"
  170. show-word-limit
  171. />
  172. </template>
  173. </el-table-column>
  174. <el-table-column
  175. prop="fUnitprice"
  176. header-align="center"
  177. align="center"
  178. width="130px"
  179. label="单价"
  180. >
  181. <template slot-scope="scope">
  182. <el-input
  183. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  184. v-model="scope.row.fUnitprice"
  185. placeholder="单价"
  186. :disabled="browseStatus || scope.row.fSrcTypeId !== 0 || scope.row.fBillstatus == 6"
  187. @change="changeContractAmt(scope.row)"
  188. show-word-limit
  189. />
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. prop="fAmount"
  194. header-align="center"
  195. align="center"
  196. width="130px"
  197. label="金额"
  198. >
  199. <template slot-scope="scope">
  200. <el-input
  201. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  202. v-model="scope.row.fAmount"
  203. :disabled="browseStatus || scope.row.fSrcTypeId !== 0 || scope.row.fBillstatus == 6"
  204. placeholder="金额"
  205. show-word-limit
  206. />
  207. </template>
  208. </el-table-column>
  209. <el-table-column
  210. prop="fStltypeid"
  211. header-align="center"
  212. align="center"
  213. width="130px"
  214. label="结算方式"
  215. >
  216. <template slot-scope="scope">
  217. <el-select
  218. v-model="scope.row.fStltypeid"
  219. placeholder="请选择结算表票结、月结"
  220. :disabled="browseStatus || scope.row.fBillstatus == 6"
  221. >
  222. <el-option
  223. v-for="(item, index) in fStltypeOptions"
  224. :key="index.dictValue"
  225. :label="item.dictLabel"
  226. :value="item.dictValue"
  227. ></el-option>
  228. </el-select>
  229. </template>
  230. </el-table-column>
  231. <el-table-column
  232. prop="fCurrency"
  233. header-align="center"
  234. align="center"
  235. width="130px"
  236. label="币别"
  237. >
  238. <template slot-scope="scope">
  239. <el-input
  240. v-model="scope.row.fCurrency"
  241. :disabled="browseStatus || scope.row.fBillstatus == 6"
  242. placeholder="币别"
  243. show-word-limit
  244. />
  245. </template>
  246. </el-table-column>
  247. <el-table-column
  248. prop="fExrate"
  249. header-align="center"
  250. align="center"
  251. width="130px"
  252. label="汇率"
  253. >
  254. <template slot-scope="scope">
  255. <el-input
  256. v-model="scope.row.fExrate"
  257. :disabled="browseStatus || scope.row.fBillstatus == 6"
  258. placeholder="汇率"
  259. show-word-limit
  260. />
  261. </template>
  262. </el-table-column>
  263. <el-table-column
  264. prop="fTaxrate"
  265. header-align="center"
  266. align="center"
  267. width="130px"
  268. label="税率"
  269. >
  270. <template slot-scope="scope">
  271. <el-input
  272. v-model="scope.row.fTaxrate"
  273. :disabled="browseStatus || scope.row.fBillstatus == 6"
  274. placeholder="税率"
  275. show-word-limit
  276. />
  277. </template>
  278. </el-table-column>
  279. <el-table-column
  280. prop="fMblno"
  281. header-align="center"
  282. align="center"
  283. width="130px"
  284. label="提单号"
  285. >
  286. <template slot-scope="scope">
  287. <el-input
  288. v-model="scope.row.fMblno"
  289. :disabled="browseStatus || scope.row.fBillstatus == 6"
  290. placeholder="提单号"
  291. show-word-limit
  292. />
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. prop="fProductName"
  297. header-align="center"
  298. align="center"
  299. width="140px"
  300. label="品名"
  301. >
  302. <template slot-scope="scope">
  303. <el-input
  304. v-model="scope.row.fProductName"
  305. :disabled="browseStatus || scope.row.fBillstatus == 6"
  306. placeholder="品名"
  307. show-word-limit
  308. />
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. prop="fMarks"
  313. header-align="center"
  314. align="center"
  315. width="130px"
  316. label="品牌"
  317. >
  318. <template slot-scope="scope">
  319. <el-input
  320. v-model="scope.row.fMarks"
  321. :disabled="browseStatus || scope.row.fBillstatus == 6"
  322. placeholder="品牌"
  323. show-word-limit
  324. />
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. prop="fSrcTypeId"
  329. header-align="center"
  330. align="center"
  331. width="130px"
  332. label="来源"
  333. >
  334. <template slot-scope="scope">
  335. <span v-if="scope.row.fSrcTypeId === 0">录入</span>
  336. <span v-if="scope.row.fSrcTypeId == 1">协议</span>
  337. <span v-if="scope.row.fSrcTypeId == 10">变更</span>
  338. </template>
  339. </el-table-column>
  340. <span v-if="feeDisplay">
  341. <el-table-column
  342. prop="fBilltype"
  343. header-align="center"
  344. align="center"
  345. width="140px"
  346. label="业务来源"
  347. >
  348. <template slot-scope="scope">
  349. <span v-if="scope.row.fBilltype === 'SJRK'">入库</span>
  350. <span v-if="scope.row.fBilltype === 'SJCK'">出库</span>
  351. <span v-if="scope.row.fBilltype === 'KCZZ'">库存总账</span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column
  355. prop="fMblno"
  356. header-align="center"
  357. align="center"
  358. width="140px"
  359. label="业务单号"
  360. >
  361. </el-table-column>
  362. <el-table-column
  363. prop="fProductName"
  364. header-align="center"
  365. align="center"
  366. width="140px"
  367. label="货物名称"
  368. >
  369. </el-table-column>
  370. <el-table-column
  371. prop="fMarks"
  372. header-align="center"
  373. align="center"
  374. width="140px"
  375. label="唛头"
  376. />
  377. <el-table-column
  378. prop="fBsdate"
  379. header-align="center"
  380. align="center"
  381. width="140px"
  382. label="业务日期"
  383. >
  384. <template slot-scope="scope">
  385. <el-date-picker
  386. v-model="scope.row.fBsdate"
  387. size="large"
  388. type="date"
  389. disabled
  390. value-format="timestamp"
  391. placeholder="业务日期"
  392. >
  393. </el-date-picker>
  394. </template>
  395. </el-table-column>
  396. <el-table-column
  397. prop="fBillingway"
  398. header-align="center"
  399. align="center"
  400. width="180px"
  401. label="计费单位"
  402. >
  403. <template slot-scope="scope">
  404. <el-select
  405. v-model="scope.row.fBillingway"
  406. placeholder="请选择计费单位"
  407. disabled
  408. clearable
  409. >
  410. <el-option
  411. v-for="dict in fFeetunitOptions"
  412. :key="dict.dictValue"
  413. :label="dict.dictLabel"
  414. :value="dict.dictValue"
  415. />
  416. </el-select>
  417. </template>
  418. </el-table-column>
  419. <el-table-column
  420. prop="fBillingQty"
  421. header-align="center"
  422. align="center"
  423. width="140px"
  424. label="计费数量"
  425. >
  426. </el-table-column>
  427. <el-table-column
  428. prop="fChargedate"
  429. header-align="center"
  430. align="center"
  431. width="140px"
  432. label="计费起始日期"
  433. >
  434. <template slot-scope="scope">
  435. <el-date-picker
  436. v-model="scope.row.fChargedate"
  437. size="large"
  438. type="date"
  439. disabled
  440. value-format="timestamp"
  441. placeholder="计费起始日期"
  442. >
  443. </el-date-picker>
  444. </template>
  445. </el-table-column>
  446. <el-table-column
  447. prop="fBillingDeadline"
  448. header-align="center"
  449. align="center"
  450. width="140px"
  451. label="计费截止日期"
  452. >
  453. <template slot-scope="scope">
  454. <el-date-picker
  455. v-model="scope.row.fBillingDeadline"
  456. size="large"
  457. type="date"
  458. disabled
  459. value-format="timestamp"
  460. placeholder="计费截止日期"
  461. >
  462. </el-date-picker>
  463. </template>
  464. </el-table-column>
  465. <el-table-column
  466. prop="fBillingDays"
  467. header-align="center"
  468. align="center"
  469. width="140px"
  470. label="计费天数"
  471. >
  472. </el-table-column>
  473. <el-table-column
  474. prop="fInventoryDays"
  475. header-align="center"
  476. align="center"
  477. width="140px"
  478. label="库存天数"
  479. >
  480. </el-table-column>
  481. <el-table-column
  482. prop="fAmt"
  483. header-align="center"
  484. align="center"
  485. width="140px"
  486. label="计费金额"
  487. >
  488. </el-table-column>
  489. </span>
  490. <el-table-column
  491. prop="remarks"
  492. header-align="center"
  493. align="center"
  494. width="150px"
  495. label="备注"
  496. >
  497. <template slot-scope="scope">
  498. <el-input
  499. v-model="scope.row.Remarks"
  500. :disabled="browseStatus || scope.row.fBillstatus == 6"
  501. placeholder="备注"
  502. show-word-limit
  503. />
  504. </template>
  505. </el-table-column>
  506. <el-table-column
  507. header-align="center"
  508. align="center"
  509. label="操作"
  510. width="200px"
  511. fixed="right"
  512. >
  513. <template slot-scope="scope">
  514. <el-button
  515. @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"
  516. size="small"
  517. :disabled="browseStatus || scope.row.fBillstatus == 6"
  518. >移除
  519. </el-button>
  520. <el-button
  521. size="small"
  522. @click="listCheck(scope.row)"
  523. v-if="scope.row.fBillstatus < 6"
  524. >请核</el-button>
  525. <el-button
  526. size="small"
  527. @click="revokeListCheck(scope.row)"
  528. v-if="scope.row.fBillstatus == 6"
  529. >撤销请核</el-button>
  530. </template>
  531. </el-table-column>
  532. </el-table>
  533. <!-- 选择作业费协议数据 -->
  534. <el-dialog
  535. v-dialogDrag
  536. title="作业费协议"
  537. :close-on-click-modal="false"
  538. :modal="false"
  539. style="box-shadow: 0 1px 3px rgba(0, 0, 0, 0) !important"
  540. :visible.sync="warehousingagreements"
  541. width="70%"
  542. >
  543. <template slot="作业费协议">
  544. <div class="avue-crud__dialog__header">
  545. <span class="el-dialog__title">
  546. <span
  547. style="
  548. display: inline-block;
  549. width: 3px;
  550. height: 20px;
  551. margin-right: 5px;
  552. float: left;
  553. margin-top: 2px;
  554. "
  555. ></span>
  556. </span>
  557. </div>
  558. </template>
  559. <el-menu
  560. :default-active="activeIndex"
  561. v-if="Navigation === true"
  562. class="el-menu-demo"
  563. mode="horizontal"
  564. @select="handleSelect"
  565. >
  566. <el-menu-item index="1">车队作业费</el-menu-item>
  567. <el-menu-item index="2">劳务作业费</el-menu-item>
  568. </el-menu>
  569. <el-table
  570. :data="tasklegList"
  571. ref="table"
  572. tooltip-effect="dark"
  573. width="100%"
  574. border
  575. stripe
  576. @selection-change="whgenlegSelectionChange"
  577. >
  578. <el-table-column type="selection" width="55"></el-table-column>
  579. <el-table-column label="行号" type="index" width="80">
  580. </el-table-column>
  581. <el-table-column
  582. prop="fCorpname"
  583. header-align="center"
  584. align="center"
  585. label="客户名称"
  586. />
  587. <el-table-column
  588. prop="fName"
  589. header-align="center"
  590. align="center"
  591. label="费用名称"
  592. />
  593. <el-table-column
  594. prop="fFeeUnitid"
  595. header-align="center"
  596. align="center"
  597. width="180px"
  598. label="计价单位"
  599. >
  600. <template slot-scope="scope">
  601. <el-select
  602. v-model="scope.row.fFeeUnitid"
  603. placeholder="请选择计价单位"
  604. @change="changeFeeUnit(scope.row)"
  605. disabled
  606. clearable
  607. >
  608. <el-option
  609. v-for="(dict, index) in fFeetUnitOptions"
  610. :key="index.dictValue"
  611. :label="dict.dictLabel"
  612. :value="dict.dictValue"
  613. />
  614. </el-select>
  615. </template>
  616. </el-table-column>
  617. <el-table-column
  618. prop="fPrice"
  619. header-align="center"
  620. align="center"
  621. label="单价"
  622. width="100px"
  623. />
  624. <el-table-column
  625. prop="remark"
  626. header-align="center"
  627. align="center"
  628. label="备注"
  629. />
  630. </el-table>
  631. <pagination
  632. v-show="whgenlegTotal > 0"
  633. :total="whgenlegTotal"
  634. :page.sync="pageNum"
  635. :limit.sync="pageSize"
  636. @pagination="getWhgenlegList"
  637. />
  638. <div slot="footer" class="dialog-footer">
  639. <el-button type="primary" @click="zhgenlegData" :disabled="browseStatus">导 入</el-button>
  640. <el-button
  641. @click="
  642. warehousingagreements = false;
  643. Navigation = false;
  644. "
  645. >取 消
  646. </el-button
  647. >
  648. </div>
  649. </el-dialog>
  650. </div>
  651. </template>
  652. <script>
  653. import {operationAgreement} from "@/api/agreement/agreement";
  654. import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseInStock";
  655. export default {
  656. props: {
  657. feeDisplay:false,
  658. browseStatus: {
  659. type: Boolean,
  660. default: false,
  661. },
  662. warehouseDrList: {
  663. type: Array,
  664. default: [],
  665. },
  666. businessTypeOption: {
  667. type: Array,
  668. default: [],
  669. },
  670. fMblnoOptions: {
  671. type: Array,
  672. default: [],
  673. },
  674. fDNameOptions: {
  675. type: Array,
  676. default: [],
  677. },
  678. fFeetUnitOptions: {
  679. type: Array,
  680. default: [],
  681. },
  682. fStltypeOptions: {
  683. type: Array,
  684. default: [],
  685. },
  686. fGrossweight: {
  687. type: Number,
  688. default: null,
  689. },
  690. fQty: {
  691. type: Number,
  692. default: null,
  693. },
  694. fNetweight: {
  695. type: Number,
  696. default: null,
  697. },
  698. fCntqty: {
  699. type: Number,
  700. default: null,
  701. },
  702. form: {
  703. type: Object,
  704. default: null,
  705. },
  706. },
  707. data() {
  708. return {
  709. Collectionoptionss: [],
  710. warehousingagreements: false,
  711. whgenlegTotal: 0,
  712. Navigation: false,
  713. tasklegList: [],
  714. dialogWhgenlegList: [],
  715. pageNum: 1,
  716. pageSize: 10,
  717. };
  718. },
  719. methods: {
  720. feeChange() {
  721. this.$emit("feeChangeD", 'D');
  722. },
  723. saveForm() {
  724. this.$emit("chiSave");
  725. },
  726. addCollection() {
  727. this.$emit("chiAdd");
  728. },
  729. // 付款合计
  730. warehouseDrSummaries(param) {
  731. const {columns, data} = param;
  732. const sums = [];
  733. columns.forEach((column, index) => {
  734. if (index === 0) {
  735. sums[index] = "合计";
  736. return;
  737. }
  738. const values = data.map((item) => Number(item[column.property]));
  739. // column.property === "fUnitprice" ||
  740. if (
  741. column.property === "fAmount"
  742. // column.property === "fAmount" ||
  743. // column.property === "fQty"
  744. ) {
  745. sums[index] = values.reduce((prev, curr) => {
  746. const value = Number(curr);
  747. if (!isNaN(value)) {
  748. return prev + curr;
  749. } else {
  750. return prev;
  751. }
  752. }, 0);
  753. sums[index] = sums[index].toFixed(2);
  754. }
  755. });
  756. return sums;
  757. },
  758. // 收款选
  759. Collectionoptions(selection) {
  760. this.Collectionoptionss = selection;
  761. for (let item in this.fWbuOptions) {
  762. for (let li in this.Collectionoptionss) {
  763. if (
  764. this.fWbuOptions[item].fId === this.Collectionoptionss[li].fFeeid
  765. ) {
  766. this.$set(
  767. this.Collectionoptionss[li],
  768. "fFeeids",
  769. this.fWbuOptions[item].fName
  770. );
  771. }
  772. }
  773. }
  774. },
  775. deleteRow(index, rows) {
  776. rows.splice(index, 1);
  777. },
  778. // 变更计价单位
  779. changeFeeUnit(row) {
  780. if (!row.fFeeUnitid) {
  781. return false;
  782. }
  783. if (row.fFeeUnitid === "2") {
  784. this.$set(row, "fQty", (this.fGrossweight / 1000).toFixed(2));
  785. } else if (row.fFeeUnitid === "1") {
  786. this.$set(row, "fQty", this.fQty.toFixed(2));
  787. } else if (row.fFeeUnitid === "3") {
  788. this.$set(row, "fQty", (this.fNetweight / 1000).toFixed(2));
  789. } else if (row.fFeeUnitid === "7") {
  790. this.$set(row, "fQty", this.fCntqty);
  791. } else {
  792. this.$set(row, "fQty", 0);
  793. }
  794. if (row.fUnitprice) {
  795. this.$set(
  796. row,
  797. "fAmount",
  798. parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2)
  799. );
  800. }
  801. },
  802. // 数量计算
  803. changeContractAmt(row) {
  804. let fQty = 0;
  805. let fUnitprice = 0;
  806. if (row.fUnitprice) {
  807. fUnitprice = row.fUnitprice;
  808. }
  809. if (row.fQty) {
  810. fQty = row.fQty;
  811. }
  812. this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
  813. },
  814. handleSelect() {
  815. if (!this.form.fCorpid) {
  816. this.$message({
  817. message: "请维护客户",
  818. type: "warning",
  819. });
  820. } else if (this.form.fProductName == undefined) {
  821. this.$message({
  822. message: "请维护入库明细品名",
  823. type: "warning",
  824. });
  825. } else {
  826. this.pageNum = 1;
  827. this.pageSize = 10;
  828. this.dialogWhgenlegList = [];
  829. this.whgenlegTotal = 0;
  830. this.warehousingagreements = true;
  831. this.getWhgenlegList();
  832. }
  833. },
  834. // 查询作业费信息
  835. getWhgenlegList() {
  836. let data = {};
  837. this.Navigation = false;
  838. data = {
  839. pageNum: this.pageNum,
  840. pageSize: this.pageSize,
  841. fCorpid: this.form.fCorpid,
  842. };
  843. operationAgreement(data).then((response) => {
  844. response.rows.map((e) => {
  845. if (e.fFeeUnitid) {
  846. e.fFeeUnitid = e.fFeeUnitid.toString();
  847. }
  848. });
  849. this.tasklegList = response.rows;
  850. this.whgenlegTotal = response.total;
  851. });
  852. },
  853. // 库存总账多选框
  854. whgenlegSelectionChange(selection) {
  855. this.dialogWhgenlegList = selection;
  856. },
  857. //导入收付款信息明细
  858. zhgenlegData() {
  859. if (this.dialogWhgenlegList.length === 0) {
  860. this.$message({
  861. message: "请选择需要导入的数据",
  862. type: "warning",
  863. });
  864. } else {
  865. this.dialogWhgenlegList.map((e) => {
  866. let qty = 1;
  867. if (e.fFeeUnitid == 1) {
  868. qty = this.fQty;
  869. } else if (e.fFeeUnitid == 2) {
  870. qty = (this.fGrossweight / 1000).toFixed(2);
  871. } else if (e.fFeeUnitid == 3) {
  872. qty = (this.fNetweight / 1000).toFixed(2);
  873. } else if (e.fFeeUnitid == 7) {
  874. qty = this.fCntqty;
  875. }
  876. let fAmount = 0;
  877. fAmount = e.fPrice * qty;
  878. this.warehouseDrList.push({
  879. fQty: qty,
  880. fCorpid: e.fCorpid,
  881. fFeeid: e.feeFId,
  882. fFeeUnitid: e.fFeeUnitid,
  883. fUnitprice: e.fPrice,
  884. fCurrency: "RMB",
  885. fExrate: 1,
  886. fAmount: fAmount,
  887. fTaxrate: this.fTaxrate,
  888. fMblno: this.form.fMblno,
  889. fProductName: this.form.fProductName,
  890. fMarks: this.form.fMarks,
  891. fBusinessType: this.form.fBusinessType,
  892. fSrcTypeId: 1,
  893. });
  894. });
  895. this.warehousingagreements = false;
  896. }
  897. },
  898. // 费用明细请核
  899. listCheck(row) {
  900. feesCheck(row.fId).then(res => {
  901. this.$message.success('请核成功')
  902. res.data.fFeeUnitid = res.data.fFeeunitid.toString();
  903. if (res.data.fDc == 'D') {
  904. let index = this.warehouseDrList.findIndex(item => item.fId == res.data.fId)
  905. this.warehouseDrList.splice(index, 1, res.data)
  906. } else {
  907. let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
  908. this.warehouseCrList.splice(index, 1, res.data)
  909. }
  910. })
  911. },
  912. // 费用明细撤销请核
  913. revokeListCheck(row) {
  914. revokefeeCheck(row.fId).then(res => {
  915. res.data.fFeeUnitid = res.data.fFeeunitid.toString();
  916. this.$message.success('操作成功')
  917. if (res.data.fDc == 'D') {
  918. let index = this.warehouseDrList.findIndex(item => item.fId == res.data.fId)
  919. this.warehouseDrList.splice(index, 1, res.data)
  920. } else {
  921. let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
  922. this.warehouseCrList.splice(index, 1, res.data)
  923. }
  924. })
  925. },
  926. },
  927. watch: {
  928. browseStatus(val) {
  929. this.browseStatus = val;
  930. },
  931. warehouseDrList(val) {
  932. this.warehouseDrList = val;
  933. },
  934. },
  935. };
  936. </script>
  937. <style scoped lang="scss">
  938. </style>