payMoney.vue 27 KB

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