shippingList.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425
  1. //火运结算报表
  2. <template>
  3. <div class="container">
  4. <el-scrollbar style="height: 100%">
  5. <el-row>
  6. <el-col style="padding-left: 15px" :span="16">
  7. <ws-button
  8. :type="searchType == 1 ? 'primary' : ''"
  9. @click="handlestatus(1)"
  10. >待审核</ws-button
  11. >
  12. <ws-button
  13. :type="searchType == 2 ? 'primary' : ''"
  14. @click="handlestatus(2)"
  15. >待结算</ws-button
  16. >
  17. <ws-button
  18. :type="searchType == 3 ? 'primary' : ''"
  19. @click="handlestatus(3)"
  20. >已结算</ws-button
  21. >
  22. <ws-button
  23. :type="searchType == '' ? 'primary' : ''"
  24. @click="handlestatus('')"
  25. >全部</ws-button
  26. >
  27. <ws-button
  28. type="primary"
  29. v-hasPermission="`report.transportationReport.view`"
  30. @click="handlepass()"
  31. >通过</ws-button
  32. >
  33. <ws-button
  34. type="primary"
  35. v-hasPermission="`report.transportationReport.view`"
  36. @click="handlereject()"
  37. >驳回</ws-button
  38. >
  39. <ws-button
  40. type="primary"
  41. v-hasPermission="`report.transportationReport.payment`"
  42. @click="handlepayment"
  43. >付款</ws-button
  44. >
  45. <ws-button
  46. type="primary"
  47. v-hasPermission="`report.transportationReport.draw`"
  48. @click="handleninvoice"
  49. >开发票</ws-button
  50. >
  51. </el-col>
  52. <el-col
  53. style="text-align: right; line-height: 60px; padding-right: 10px"
  54. :span="8"
  55. >
  56. <el-select
  57. v-model="contractNo"
  58. placeholder="请选择合同"
  59. clearable
  60. filterable
  61. :filter-method="dataFilter"
  62. @change="contractchange"
  63. maxlength="500"
  64. type="input"
  65. class="findValue"
  66. >
  67. <el-option
  68. v-if="item.reportStatus"
  69. v-for="item in options"
  70. :key="item.constKey"
  71. :label="item.contractNo + '(' + item.reportStatus + ')'"
  72. :value="item.contractNo"
  73. />
  74. <el-option
  75. v-if="!item.reportStatus"
  76. v-for="item in options"
  77. :key="item.constKey"
  78. :label="item.contractNo"
  79. :value="item.contractNo"
  80. />
  81. </el-select>
  82. </el-col>
  83. </el-row>
  84. <el-table
  85. class="wenzi"
  86. :data="warehouseList.records"
  87. style="width: 100%; margin-top: 20px"
  88. ref="warehouseList"
  89. border
  90. :summary-method="getSummaries"
  91. show-summary
  92. @row-click="handleRowClick"
  93. @selection-change="handleSelectionChange"
  94. >
  95. <el-table-column
  96. :selectable="selectInit"
  97. type="selection"
  98. width="55"
  99. ></el-table-column>
  100. <el-table-column type="index" label="序号" width="50"></el-table-column>
  101. <el-table-column
  102. class="table_td"
  103. prop="contractNo"
  104. label="合同编号"
  105. ></el-table-column>
  106. <el-table-column
  107. class="table_td"
  108. prop="taskNo"
  109. label="运输任务"
  110. ></el-table-column>
  111. <el-table-column
  112. class="table_td"
  113. prop="processNo"
  114. label="运输阶段"
  115. ></el-table-column>
  116. <el-table-column
  117. class="table_td"
  118. prop="n"
  119. label="类型"
  120. ></el-table-column>
  121. <el-table-column
  122. class="boxNo"
  123. prop="phone"
  124. label="箱号/仓位号"
  125. ></el-table-column>
  126. <el-table-column
  127. class="table_td"
  128. prop="carNo"
  129. label="装车净重(吨)"
  130. ></el-table-column
  131. >
  132. <el-table-column
  133. class="table_td"
  134. prop="loadingWeight"
  135. label="卸车净重(吨)"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. class="table_td"
  140. prop="loadingWeight"
  141. label="损耗(吨)"
  142. >
  143. </el-table-column>
  144. </el-table>
  145. <!-- 页数 -->
  146. <el-pagination
  147. @size-change="handleSizeChange"
  148. @current-change="handleCurrentChange"
  149. :current-page="currentPage"
  150. :page-size="pageSize"
  151. layout="total, sizes, prev, pager, next, jumper"
  152. :total="deptBudgetTotal"
  153. ></el-pagination>
  154. </el-scrollbar>
  155. <!-- 付款 -->
  156. <el-dialog
  157. width="25%"
  158. title="付款"
  159. :visible.sync="dialogFormVisible1"
  160. :append-to-body="true"
  161. >
  162. <el-form :model="form">
  163. <el-form-item label="未付金额(元)" :label-width="formLabelWidth">
  164. <template>
  165. <span>{{ amountNotPayable }}</span>
  166. </template>
  167. </el-form-item>
  168. <el-form-item label="本次付款金额" :label-width="formLabelWidth">
  169. <el-input
  170. v-model="money"
  171. autocomplete="off"
  172. placeholder="请输入本次付款金额"
  173. class="deal"
  174. ></el-input>
  175. </el-form-item>
  176. <el-form-item
  177. label="付款日期"
  178. prop="paymentDate"
  179. :label-width="formLabelWidth"
  180. class="deal"
  181. >
  182. <ws-date-picker
  183. v-model="paymentDate"
  184. type="date"
  185. placeholder="请选择付款日期"
  186. value-format="yyyy-MM-dd"
  187. class="deal"
  188. />
  189. </el-form-item>
  190. <el-form-item label="上传付款截图" :label-width="formLabelWidth">
  191. <el-upload
  192. action="https://www.zthymaoyi.com/upload/admin"
  193. list-type="picture-card"
  194. :on-success="handlePictureCardPreview"
  195. :on-remove="handleRemove"
  196. class="photo2"
  197. >
  198. <i class="el-icon-plus"></i>
  199. </el-upload>
  200. </el-form-item>
  201. </el-form>
  202. <div slot="footer" class="dialog-footer">
  203. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  204. <el-button type="primary" @click="submitMoney()">提 交</el-button>
  205. </div>
  206. </el-dialog>
  207. <!-- 批量开发票 -->
  208. <el-dialog
  209. width="30%"
  210. title="批量开发票"
  211. :visible.sync="dialogFormVisible2"
  212. :append-to-body="true"
  213. >
  214. <el-form :model="form">
  215. <el-form-item label="发票金额(元)" :label-width="formLabelWidth">
  216. <span> {{ amountEdPayable }}</span>
  217. </el-form-item>
  218. </el-form>
  219. <div slot="footer" class="dialog-footer">
  220. <el-button @click="dialogFormVisible2 = false">取 消</el-button>
  221. <el-button type="primary" @click="submitBatchInvoice()"
  222. >提 交</el-button
  223. >
  224. </div>
  225. </el-dialog>
  226. <!-- 开发票 -->
  227. <el-dialog
  228. width="30%"
  229. title="开发票"
  230. :visible.sync="dialogFormVisible3"
  231. :append-to-body="true"
  232. >
  233. <el-form :model="form">
  234. <el-form-item label="可开发票金额(元)" :label-width="formLabelWidth1">
  235. {{ amountEdPayable }}
  236. </el-form-item>
  237. <el-form-item label="实际发票金额(元)" :label-width="formLabelWidth1">
  238. <el-input
  239. v-model="alreadyInvoice"
  240. autocomplete="off"
  241. class="deal"
  242. ></el-input>
  243. </el-form-item>
  244. </el-form>
  245. <div slot="footer" class="dialog-footer">
  246. <el-button @click="dialogFormVisible3 = false">取 消</el-button>
  247. <el-button type="primary" @click="submitInvoice()">提 交</el-button>
  248. </div>
  249. </el-dialog>
  250. <!--账户-->
  251. <el-dialog
  252. width="30%"
  253. title="账户信息"
  254. :visible.sync="dialogFormVisible8"
  255. :append-to-body="true"
  256. >
  257. <h3 style="margin-left: 30px">{{ driverPayeeList.payeeName }}的账户</h3>
  258. <div v-for="(item, index) in driverPayeeList" :key="index">
  259. <h4 style="margin-left: 30px">账户-{{index+1}}</h4>
  260. <div class="anniu">
  261. <el-radio-group @change="bankCard(item,id)" v-model="item.radio">
  262. <el-radio label="1">本次收款账户</el-radio>
  263. </el-radio-group>
  264. </div>
  265. <el-form class="customer" :model="form">
  266. <el-form-item label="账户类型" :label-width="formLabelWidth">
  267. {{ item.accountType }}
  268. </el-form-item>
  269. <el-form-item label="银行卡号" :label-width="formLabelWidth">
  270. {{ item.bankCard }}
  271. </el-form-item>
  272. <el-form-item label="开户行" :label-width="formLabelWidth">
  273. {{ item.bankDeposit }}
  274. </el-form-item>
  275. <el-form-item label="开户支行" :label-width="formLabelWidth">
  276. {{ item.bankDepositBranch }}
  277. </el-form-item>
  278. <el-form-item
  279. label="收款人姓名"
  280. :label-width="formLabelWidth"
  281. v-if="item.accountTypeFlag == 1"
  282. >
  283. {{ item.payeeName }}
  284. </el-form-item>
  285. <el-form-item
  286. label="收款人身份证号"
  287. :label-width="formLabelWidth"
  288. v-if="item.accountTypeFlag == 1"
  289. >
  290. {{ item.payeeNumberCard }}
  291. </el-form-item>
  292. <el-form-item
  293. v-if="item.accountTypeFlag == 2"
  294. label="企业名称"
  295. :label-width="formLabelWidth"
  296. >
  297. {{ item.compName }}
  298. </el-form-item>
  299. </el-form>
  300. </div>
  301. <div slot="footer" class="dialog-footer">
  302. <el-button @click="dialogFormVisible8 = false">取 消</el-button>
  303. </div>
  304. </el-dialog>
  305. <!--磅单 -->
  306. <WinseaContentModal
  307. v-model="accessoryTFs"
  308. title="磅单信息"
  309. @on-cancel="handleClose"
  310. >
  311. <p>查看装车磅单</p>
  312. <img width="100" height="100" :src="loadingImg1" alt="" />
  313. </WinseaContentModal>
  314. <WinseaContentModal
  315. v-model="accesscard"
  316. title="磅单信息"
  317. @on-cancel="handleClose1"
  318. >
  319. <p>查看卸车磅单</p>
  320. <img width="100" height="100" :src="unloadingImg1" alt="" />
  321. </WinseaContentModal>
  322. <!--付款截图 -->
  323. <WinseaContentModal
  324. v-model="paymentImg"
  325. title="付款截图信息"
  326. @on-cancel="handleClose2"
  327. >
  328. <p>查看付款截图</p>
  329. <div v-for="item in paymentScreenshot1">
  330. <img style="width: 100px; height: 100px" :src="item" alt="" />
  331. </div>
  332. </WinseaContentModal>
  333. </div>
  334. <!-- </div> -->
  335. </template>
  336. <script>
  337. import {
  338. autoList,
  339. editauto,
  340. autocontract,
  341. autopaymoney,
  342. openinvoicelist,
  343. // postaudit,
  344. // getselectctcontractno,
  345. } from '@/model/statisticalReport/index'
  346. import { posthandle } from '@/model/purchasingManagement/index'
  347. import { downloadFile } from '@/utils/batchDown'
  348. import Pagination from '@/components/Pagination'
  349. import WsUpload from '@/components/WsUpload'
  350. import { EventBus } from 'base-core-lib'
  351. export default {
  352. name: 'viewSpareMoney',
  353. components: {
  354. WsUpload,
  355. Pagination,
  356. },
  357. watch: {
  358. vesselId(val) {
  359. this.getList()
  360. },
  361. isShow(val) {
  362. this.showType = val
  363. },
  364. },
  365. data() {
  366. return {
  367. checked: true,
  368. alreadyInvoice: '',
  369. needReapply: true,
  370. dialogFormVisible1: false,
  371. dialogFormVisible2: false,
  372. dialogFormVisible3: false,
  373. dialogFormVisible4: false,
  374. dialogFormVisible5: false,
  375. dialogFormVisible6: false,
  376. dialogFormVisible7: false,
  377. dialogFormVisible8: false,
  378. dialogFormVisible11: false,
  379. dialogVisible: false,
  380. form: {
  381. transactionPrice: '',
  382. transactionsNumber: '',
  383. basis: '',
  384. },
  385. currect: true,
  386. formLabelWidth: '120px',
  387. formLabelWidth1: '140px',
  388. barWidth: 0,
  389. barHeight: 0,
  390. retioX: 1,
  391. ratioY: 1,
  392. isTaped: false,
  393. isHover: false,
  394. settlementWeightchange: false,
  395. deductionAmountchange: false,
  396. isShow: !this.autohide,
  397. //弹出框
  398. dialogViewSpareMoney: false,
  399. contractNoList: [],
  400. // 是否显示
  401. showType: true,
  402. // 年
  403. year: '',
  404. options: [],
  405. id:'',
  406. pickerOptions: {},
  407. value2: '',
  408. deptBudgetTotal: 0,
  409. currentPage: 1,
  410. pageSize: 10,
  411. searchType: '1',
  412. manualFlag: '',
  413. searchTypeText: '未完成',
  414. searchKeyWord: '',
  415. driverPayeeList: {
  416. radio: '1',
  417. },
  418. contractType: 2,
  419. accessoryTFs: false,
  420. accesscard: false,
  421. paymentImg: false,
  422. enter: {
  423. closePositionList: [],
  424. },
  425. // 提交类型
  426. submitType: true,
  427. size: 10,
  428. spanArr: [],
  429. contractNo: '全部合同',
  430. inOutTaskNo: '',
  431. compId: sessionStorage.getItem('ws-pf_compId'),
  432. roleId: sessionStorage.getItem('ws-pf_roleId'),
  433. deptCircularPage: {},
  434. warehouseList: [],
  435. orderList: {},
  436. deptBudgetList: {},
  437. id: '',
  438. pcFlag: 1,
  439. carryoverlist: {},
  440. modification: [],
  441. loadingImg1: [],
  442. unloadingImg1: [],
  443. paymentScreenshot1: [],
  444. amendlist: {},
  445. roleFlag: 1,
  446. alreadyInvoice1: 0,
  447. money: '',
  448. paymentDate: '',
  449. tranSettlementReportList: [],
  450. autoSettlementReport: {
  451. tranSettlementReportList: [],
  452. money: '',
  453. amountNotPayable: 0,
  454. amountEdPayable: 0,
  455. paymentDate: '',
  456. paymentScreenshot: '',
  457. id: '',
  458. },
  459. amountNotPayable: 0,
  460. amountEdPayable: 0,
  461. paymentScreenshotUrls: [],
  462. carryovercontractnolist: [],
  463. historyList: [],
  464. pickerBeginDateBefore: {
  465. disabledDate: (time) => {
  466. return time.getTime() > Date.now()
  467. },
  468. },
  469. }
  470. },
  471. activated() {
  472. this.getList()
  473. this.showType = this.isShow
  474. },
  475. methods: {
  476. cur(status) {
  477. if (status == 0) {
  478. this.currect = true
  479. } else {
  480. var that = this
  481. this.currect = false
  482. getselectctcontractno({
  483. customerName: this.modification[0].customerName,
  484. contractNo: this.modification[0].contractNo,
  485. })
  486. .toPromise()
  487. .then((response) => {
  488. that.carryovercontractnolist = response
  489. for (var i = 0; i < that.carryovercontractnolist.length; i++) {
  490. if (that.carryovercontractnolist[i].amountNotPayable > 0) {
  491. that.carryovercontractnolist[i].closeaccountstatus = '待结算'
  492. } else {
  493. that.carryovercontractnolist[i].closeaccountstatus = '已结算'
  494. }
  495. }
  496. })
  497. .catch((response) => {
  498. console.log(response)
  499. EventBus.$emit('error', response.message)
  500. })
  501. }
  502. },
  503. handleRowClick(row) {
  504. if (row.approveStatus == null) {
  505. this.$refs.warehouseList.toggleRowSelection(row)
  506. return true
  507. } else if (row.approveStatus != null) {
  508. if (row.taskId == null) {
  509. return false
  510. } else {
  511. this.$refs.warehouseList.toggleRowSelection(row)
  512. return true
  513. }
  514. }
  515. },
  516. selectInit(row) {
  517. //在这里一定要记得类型匹配的上。
  518. if (row.approveStatus == null) {
  519. return true
  520. } else if (row.approveStatus != null) {
  521. if (row.taskId == null) {
  522. return false
  523. } else {
  524. return true
  525. }
  526. }
  527. },
  528. handleClose() {
  529. this.accessoryTFs = false
  530. },
  531. handleClose1() {
  532. this.accesscard = false
  533. },
  534. handleClose2() {
  535. this.paymentImg = false
  536. },
  537. //账户
  538. look(item) {
  539. this.dialogFormVisible8 = true
  540. if (item.driverPayeeInfoList) {
  541. this.driverPayeeList= item.driverPayeeInfoList
  542. this.driverPayeeList.payeeName=item.driverPayeeInfoList[0].payeeName
  543. for (var i = 0; i < item.driverPayeeInfoList.length; i++){
  544. if(item.driverPayeeInfoList[i].bankCard==item.cardNo){
  545. this.driverPayeeList[i].radio='1'
  546. }
  547. else{
  548. this.driverPayeeList[i].radio='2'
  549. }
  550. console.log(this.driverPayeeList[i].radio)
  551. }
  552. this.id=item.id
  553. }
  554. },
  555. //付款
  556. handlepayment() {
  557. this.amountNotPayable = 0
  558. this.money = this.money
  559. this.tranSettlementReportList = this.warehouseList.records[0].tranSettlementReportList
  560. this.amountEdPayable = this.warehouseList.records[0].amountEdPayable
  561. this.paymentDate = this.paymentDate
  562. if (this.modification.length == 0) {
  563. this.$message.warning('请选择一条要付款的条目')
  564. } else {
  565. for (var i = 0; i < this.modification.length; i++) {
  566. if (
  567. this.modification[i].status != '已通过' &&
  568. this.modification[i].status != '部分付款'
  569. ) {
  570. this.$message.warning('只有已通过或部分付款的条目才可进行付款操作')
  571. return
  572. }
  573. this.amountNotPayable += this.modification[i].amountNotPayable
  574. }
  575. this.dialogFormVisible1 = true
  576. }
  577. },
  578. submitMoney() {
  579. this.autoSettlementReport.money = this.money
  580. this.autoSettlementReport.paymentDate = this.paymentDate
  581. if (this.modification.length == 0) {
  582. this.$message.warning('请选择一条要付款的条目')
  583. } else {
  584. if (
  585. this.money < 0 ||
  586. (String(this.money).indexOf('.') != -1 &&
  587. String(this.money).length - (String(this.money).indexOf('.') + 1) >
  588. 2)
  589. ) {
  590. this.$message({
  591. message: '付款金额输入错误',
  592. type: 'warning',
  593. })
  594. return
  595. }
  596. if (this.money) {
  597. if (isNaN(this.money)) {
  598. this.$message({
  599. message: '付款金额非数字!',
  600. type: 'warning',
  601. })
  602. return
  603. }
  604. }
  605. if (!this.money) {
  606. this.$message({
  607. message: '付款金额不能为空!',
  608. type: 'warning',
  609. })
  610. return
  611. }
  612. if (this.money > this.modification[0].amountNotPayable) {
  613. this.$message({
  614. message: '付款金额不能大于未付金额!',
  615. type: 'warning',
  616. })
  617. return
  618. }
  619. this.$confirm(`确定提交付款信息?`, {
  620. cancelButtonText: '取消',
  621. confirmButtonText: '确定',
  622. type: 'warning',
  623. }).then(() => {
  624. autopaymoney({
  625. tranSettlementReportList: this.modification,
  626. // amountEdPayable: this.modification[0].amountEdPayable,
  627. // amountNotPayable: this.modification[0].amountNotPayable,
  628. money: this.money,
  629. paymentDate: this.paymentDate,
  630. paymentScreenshot: this.paymentScreenshot,
  631. })
  632. .toPromise()
  633. .then((response) => {
  634. this.$notify.success({
  635. title: '成功',
  636. message: '付款成功',
  637. })
  638. this.tranSettlementReportList = {}
  639. this.money = ''
  640. this.paymentDate = ''
  641. this.dialogFormVisible1 = false
  642. this.getList()
  643. })
  644. .catch((response) => {
  645. console.log(response)
  646. EventBus.$emit('error', response.message)
  647. })
  648. })
  649. }
  650. },
  651. //开发票
  652. editClickInvoice(row) {
  653. this.id = row.id
  654. this.alreadyInvoice1 = row.alreadyInvoice
  655. this.amountEdPayable = row.amountEdPayable
  656. this.amountNotPayable = row.amountNotPayable
  657. this.dialogFormVisible3 = 'true'
  658. },
  659. submitInvoice() {
  660. if (this.amountEdPayable < 0) {
  661. this.$message.warning('请选择一条已付款的条目')
  662. } else {
  663. if (
  664. this.alreadyInvoice < 0 ||
  665. this.alreadyInvoice > this.amountEdPayable - this.alreadyInvoice1 ||
  666. (String(this.alreadyInvoice).indexOf('.') != -1 &&
  667. String(this.alreadyInvoice).length -
  668. (String(this.alreadyInvoice).indexOf('.') + 1) >
  669. 2)
  670. ) {
  671. this.$message({
  672. message: '金额输入错误',
  673. type: 'warning',
  674. })
  675. return
  676. }
  677. if (this.alreadyInvoice) {
  678. if (isNaN(this.alreadyInvoice)) {
  679. this.$message({
  680. message: '金额非数字!',
  681. type: 'warning',
  682. })
  683. return
  684. }
  685. }
  686. if (!this.alreadyInvoice) {
  687. this.$message({
  688. message: '金额不能为空!',
  689. type: 'warning',
  690. })
  691. return
  692. }
  693. this.$confirm(`确定提交发票信息?`, {
  694. cancelButtonText: '取消',
  695. confirmButtonText: '确定',
  696. type: 'warning',
  697. }).then(() => {
  698. editauto({
  699. id: this.id,
  700. flag: 2,
  701. alreadyInvoice: this.alreadyInvoice,
  702. amountEdPayable: this.amountEdPayable,
  703. amountNotPayable: this.amountNotPayable,
  704. })
  705. .toPromise()
  706. .then((response) => {
  707. this.$notify.success({
  708. title: '成功',
  709. message: '提交成功',
  710. })
  711. this.dialogFormVisible3 = false
  712. this.getList()
  713. })
  714. .catch((response) => {
  715. console.log(response)
  716. EventBus.$emit('error', response.message)
  717. })
  718. })
  719. }
  720. },
  721. //批量开发票
  722. handleninvoice() {
  723. this.amountEdPayable = 0
  724. this.tranSettlementReportList = this.warehouseList.records[0].tranSettlementReportList
  725. for (var i = 0; i < this.modification.length; i++) {
  726. this.amountEdPayable += this.modification[i].amountEdPayable
  727. }
  728. this.dialogFormVisible2 = true
  729. },
  730. submitBatchInvoice() {
  731. if (this.modification.length == 0) {
  732. this.$message.warning('请选择一条要开发票的条目')
  733. } else if (this.modification[0].amountEdPayable < 0) {
  734. this.$message.warning('请选择一条已付款的条目')
  735. } else {
  736. this.$confirm(`确定提交发票信息?`, {
  737. cancelButtonText: '取消',
  738. confirmButtonText: '确定',
  739. type: 'warning',
  740. }).then(() => {
  741. openinvoicelist({
  742. tranSettlementReportList: this.modification,
  743. })
  744. .toPromise()
  745. .then((response) => {
  746. this.$notify.success({
  747. title: '成功',
  748. message: '提交成功',
  749. })
  750. this.dialogFormVisible2 = false
  751. this.getList()
  752. })
  753. .catch((response) => {
  754. console.log(response)
  755. EventBus.$emit('error', response.message)
  756. })
  757. })
  758. }
  759. },
  760. //修改结算重量
  761. changesettlementWeight(item) {
  762. if (!this.settlementWeight) {
  763. this.$message({
  764. message: '结算重量不能为空!',
  765. type: 'warning',
  766. })
  767. return
  768. }
  769. if (
  770. (this.settlementWeight &&
  771. String(this.settlementWeight).indexOf('.') != -1 &&
  772. String(this.settlementWeight).length -
  773. (String(this.settlementWeight).indexOf('.') + 1) >
  774. 2) ||
  775. (this.settlementWeight && this.settlementWeight > 100) ||
  776. (this.settlementWeight && this.settlementWeight < 1)
  777. ) {
  778. this.$message({
  779. message: '结算重量输入错误',
  780. type: 'warning',
  781. })
  782. return
  783. }
  784. editauto({
  785. settlementWeight: Math.abs(this.settlementWeight),
  786. id: item.id,
  787. flag: 0,
  788. })
  789. .toPromise()
  790. .then((response) => {
  791. this.$message.success('修改结算重量成功')
  792. this.getList()
  793. })
  794. .catch((req) => {
  795. this.$message.warning('修改结算重量失败')
  796. })
  797. },
  798. //设置本次账户
  799. bankCard(item,id) {
  800. editauto({
  801. cardNo: item.bankCard,
  802. id: id,
  803. flag: 3,
  804. })
  805. .toPromise()
  806. .then((response) => {
  807. this.$message.success('成功')
  808. this.dialogFormVisible8 = false
  809. this.getList()
  810. })
  811. .catch((req) => {
  812. this.$message.warning('失败')
  813. })
  814. },
  815. editsettlementWeight(item) {
  816. this.settlementWeight = item.settlementWeight
  817. item.settlementWeightchange = true
  818. },
  819. //修改扣款
  820. changedeductionAmount(item) {
  821. if (!this.deductionAmount) {
  822. this.$message({
  823. message: '扣款金额不能为空!',
  824. type: 'warning',
  825. })
  826. return
  827. }
  828. if (
  829. (this.deductionAmount &&
  830. String(this.deductionAmount).indexOf('.') != -1 &&
  831. String(this.deductionAmount).length -
  832. (String(this.deductionAmount).indexOf('.') + 1) >
  833. 2) ||
  834. (this.deductionAmount && this.deductionAmount > 100000) ||
  835. (this.deductionAmount && this.deductionAmount < 1)
  836. ) {
  837. this.$message({
  838. message: '扣款金额输入错误',
  839. type: 'warning',
  840. })
  841. return
  842. }
  843. editauto({
  844. deductionAmount: Math.abs(this.deductionAmount),
  845. id: item.id,
  846. flag: 1,
  847. })
  848. .toPromise()
  849. .then((response) => {
  850. this.$message.success('修改扣款成功')
  851. this.getList()
  852. })
  853. .catch((req) => {
  854. this.$message.warning('修改扣款失败')
  855. })
  856. },
  857. editdeductionAmount(item) {
  858. this.deductionAmount = item.deductionAmount
  859. item.deductionAmountchange = true
  860. },
  861. //装车磅单
  862. lookloadingImg(row) {
  863. if (row.loadingImg == null || row.loadingImg == '') {
  864. EventBus.$emit(
  865. this.$message.warning('暂无磅单信息')
  866. )
  867. } else {
  868. this.accessoryTFs = true
  869. }
  870. this.loadingImg1 = row.loadingImg
  871. },
  872. //卸车磅单
  873. lookunloadingImg(row) {
  874. if (row.unloadingImg === null || row.unloadingImg === '') {
  875. EventBus.$emit(
  876. this.$message.warning('暂无磅单信息')
  877. )
  878. } else {
  879. this.accesscard = true
  880. }
  881. this.unloadingImg1 = row.unloadingImg
  882. },
  883. //付款截图
  884. lookpaymentScreenshot(row) {
  885. if (row.paymentScreenshot == null || row.paymentScreenshot == '') {
  886. EventBus.$emit(
  887. this.$message.warning('暂无付款截图信息')
  888. )
  889. } else {
  890. this.paymentImg = true
  891. }
  892. this.paymentScreenshot1 = row.paymentScreenshot.split('$')
  893. },
  894. //审核
  895. audit(item, index, status, status2, reason) {
  896. if (index < this.modification.length) {
  897. posthandle({
  898. taskId: item.taskId,
  899. approved: status,
  900. auditMind: reason != undefined ? '已驳回' : '34',
  901. needReapply: status2 != undefined ? true : false,
  902. })
  903. .toPromise()
  904. .then((response) => {
  905. this.audit(this.modification[index + 1], index + 1, status)
  906. })
  907. .catch((req) => {
  908. this.$message.warning(req.message)
  909. })
  910. } else {
  911. if (status==true) {
  912. this.$message.success('通过成功')
  913. this.getList()
  914. } else if (status==false) {
  915. this.$message.success('驳回成功')
  916. this.getList()
  917. }
  918. }
  919. },
  920. handlereject(status) {
  921. var that = this
  922. if (this.modification.length == 0) {
  923. this.$message.warning('请选择要驳回的条目')
  924. } else {
  925. this.$confirm(`是否确定驳回?`, {
  926. cancelButtonText: '取消',
  927. confirmButtonText: '确定',
  928. type: 'warning',
  929. }).then(() => {
  930. that.audit(this.modification[0], 0, false, true, '已驳回')
  931. })
  932. }
  933. },
  934. dataFilter(val) {
  935. // console.log(val,"名")
  936. this.contractNo = val
  937. if (val) {
  938. //val存在
  939. this.options = this.contractNoList.filter((item) => {
  940. if (
  941. !!~item.contractNo.indexOf(val) ||
  942. !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())
  943. ) {
  944. return true
  945. }
  946. })
  947. } else {
  948. //val为空时,还原数组
  949. this.options = this.contractNoList
  950. }
  951. },
  952. handlepass() {
  953. var that = this
  954. if (this.modification.length == 0) {
  955. this.$message.warning('请选择要通过的条目')
  956. } else {
  957. this.$confirm(`是否确定通过?`, {
  958. cancelButtonText: '取消',
  959. confirmButtonText: '确定',
  960. type: 'warning',
  961. }).then(() => {
  962. that.audit(this.modification[0], 0, true, 2)
  963. })
  964. }
  965. },
  966. handleSelectionChange(val) {
  967. this.modification = val
  968. },
  969. handlestatus(status) {
  970. this.searchType = status
  971. this.getList()
  972. },
  973. contractchange(e) {
  974. this.contractNo = e
  975. this.getList()
  976. },
  977. updated() {
  978. this.$nextTick(() => {
  979. this.$refs.warehouseList.doLayout()
  980. })
  981. },
  982. //合计
  983. getSummaries(param) {
  984. const { columns, data } = param
  985. const sums = []
  986. columns.forEach((column, index) => {
  987. if (index === 0) {
  988. sums[index] = '合计'
  989. } else if (
  990. index === 13 ||
  991. index === 14 ||
  992. index === 15 ||
  993. index === 16
  994. ) {
  995. const values = data.map((item) => Number(item[column.property]))
  996. if (!values.every((value) => isNaN(value))) {
  997. sums[index] = values.reduce((prev, curr) => {
  998. const value = Number(curr)
  999. if (!isNaN(value)) {
  1000. return prev + curr
  1001. } else {
  1002. return prev
  1003. }
  1004. }, 0)
  1005. } else {
  1006. sums[index] = '元'
  1007. }
  1008. } else {
  1009. sums[index] = '--'
  1010. }
  1011. })
  1012. return sums
  1013. },
  1014. //列表
  1015. getList() {
  1016. autoList({
  1017. compId: sessionStorage.getItem('ws-pf_compId'),
  1018. tranTypeKey: 2,
  1019. currentPage: this.currentPage,
  1020. pageSize: this.pageSize,
  1021. searchType: this.searchType,
  1022. contractNo: this.contractNo,
  1023. manualFlag: this.manualFlag,
  1024. })
  1025. .toPromise()
  1026. .then((response) => {
  1027. for (var i = 0; i < response.records.length; i++) {
  1028. response.records[i].settlementWeightchange = false
  1029. response.records[i].deductionAmountchange = false
  1030. response.records[i].amountNotPayable=response.records[i].amountIngPayable-response.records[i].amountEdPayable
  1031. // response.records[i].settlementPrice =
  1032. // response.records[i].unitPrice -
  1033. // Math.abs(response.records[i].basisPrice) -
  1034. // Math.abs(response.records[i].unloadingCharge) -
  1035. // Math.abs(response.records[i].invoiceFee) -
  1036. // Math.abs(response.records[i].deductionAmount)
  1037. }
  1038. this.deptBudgetTotal = response.total
  1039. this.warehouseList = response
  1040. })
  1041. autocontract({
  1042. compId: sessionStorage.getItem('ws-pf_compId'),
  1043. currentPage: this.currentPage,
  1044. pageSize: this.pageSize,
  1045. // roleFlag: this.roleFlag,
  1046. })
  1047. .toPromise()
  1048. .then((response) => {
  1049. this.contractNoList = response
  1050. this.contractNoList.unshift({ contractNo: '全部合同' })
  1051. this.options = this.contractNoList
  1052. })
  1053. },
  1054. handleRemove(file) {
  1055. console.log(file)
  1056. },
  1057. handlePictureCardPreview(file) {
  1058. this.paymentScreenshot = file.url
  1059. this.dialogVisible = true
  1060. },
  1061. handleDownload(file) {
  1062. console.log(file)
  1063. },
  1064. getSpanArr(data) {
  1065. let that = this
  1066. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  1067. that.spanArr = []
  1068. that.pos = 0
  1069. // //遍历数据
  1070. data.forEach((item, index) => {
  1071. //判断是否是第一项
  1072. if (index === 0) {
  1073. this.spanArr.push(1)
  1074. this.pos = 0
  1075. } else {
  1076. //不是第一项时,就根据标识去存储
  1077. if (data[index].warehouseNumViewList.length > 1) {
  1078. 查找到符合条件的数据时每次要把之前存储的数据 + 1
  1079. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  1080. this.spanArr.push(0)
  1081. } else {
  1082. // 没有符合的数据时,要记住当前的index
  1083. this.spanArr.push(1)
  1084. this.pos = index
  1085. }
  1086. }
  1087. })
  1088. },
  1089. dateFormat(fmt, date) {
  1090. let ret
  1091. const opt = {
  1092. 'Y+': date.getFullYear().toString(), // 年
  1093. 'm+': (date.getMonth() + 1).toString(), // 月
  1094. 'd+': date.getDate().toString(), // 日
  1095. 'H+': date.getHours().toString(), // 时
  1096. // "M+": date.getMinutes().toString(), // 分
  1097. // "S+": date.getSeconds().toString() // 秒
  1098. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  1099. }
  1100. for (let k in opt) {
  1101. ret = new RegExp('(' + k + ')').exec(fmt)
  1102. if (ret) {
  1103. fmt = fmt.replace(
  1104. ret[1],
  1105. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  1106. )
  1107. }
  1108. }
  1109. return fmt
  1110. },
  1111. handleSizeChange(val) {
  1112. console.log(`每页 ${val} 条`)
  1113. this.pageSize = val
  1114. this.getList()
  1115. },
  1116. handleCurrentChange(val) {
  1117. this.currentPage = val
  1118. console.log(`当前页: ${val}`)
  1119. this.getList()
  1120. },
  1121. // 关闭 dialog时 处理文件url 初始化upload组件
  1122. handleCloe() {
  1123. this.dialogViewSpareMoney = false
  1124. },
  1125. history(row) {
  1126. billoperatehis({ id: row.id })
  1127. .toPromise()
  1128. .then((response) => {
  1129. this.historyList = response
  1130. })
  1131. },
  1132. async exportlist() {
  1133. const { data } = await export1(
  1134. {
  1135. compId: sessionStorage.getItem('ws-pf_compId'),
  1136. contractType: this.contractType,
  1137. currentPage: this.currentPage,
  1138. pageSize: this.pageSize,
  1139. searchType: this.searchType,
  1140. searchKeyWord: this.searchKeyWord,
  1141. startDate: this.startDate,
  1142. endDate: this.endDate,
  1143. },
  1144. {},
  1145. { responseType: 'blob' }
  1146. ).toPromise()
  1147. downloadFile({
  1148. res: data,
  1149. fileName: `${
  1150. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1151. }_采购合同`,
  1152. type: 'xls',
  1153. })
  1154. },
  1155. total() {},
  1156. },
  1157. }
  1158. </script>
  1159. <style lang="scss" scoped>
  1160. .connert {
  1161. width: 90%;
  1162. margin: 0 auto;
  1163. }
  1164. .vertical-text-left {
  1165. width: 62px;
  1166. text-align: right;
  1167. }
  1168. //分页
  1169. .el-pagination {
  1170. padding: 10px 15px;
  1171. margin-bottom: 0;
  1172. text-align: center;
  1173. }
  1174. /deep/.el-pager li.active {
  1175. color: #5878e8;
  1176. cursor: default;
  1177. }
  1178. /deep/.el-pager li:hover {
  1179. color: #5878e8;
  1180. cursor: default;
  1181. }
  1182. .el-button--default {
  1183. color: #8890b1;
  1184. border-color: #e8eaf1;
  1185. }
  1186. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  1187. width: 30px;
  1188. margin-left: 0;
  1189. border-top-left-radius: 0px;
  1190. border-bottom-left-radius: 0px;
  1191. }
  1192. /deep/.findValue .el-input__inner {
  1193. border-top-right-radius: 0px;
  1194. border-bottom-right-radius: 0px;
  1195. width: 385px;
  1196. }
  1197. .completed.el-button--default {
  1198. border-color: #5878e8;
  1199. background-color: #f6f7fc;
  1200. color: #5878e8;
  1201. }
  1202. .putstorage.el-button--default,
  1203. .deliverystorage.el-button--default {
  1204. border-color: #8890b1;
  1205. background-color: #fff;
  1206. color: #8890b1;
  1207. }
  1208. /deep/.el-table td,
  1209. /deep/.el-table th.is-leaf {
  1210. border-right: 1px solid #e9ecf7;
  1211. text-align: center;
  1212. }
  1213. /deep/.el-table tr td:first-child,
  1214. /deep/.el-table tr th.is-leaf:first-child {
  1215. border-left: 1px solid #e9ecf7;
  1216. }
  1217. .record,
  1218. .adjustment {
  1219. display: inline-block;
  1220. color: #5878e8;
  1221. padding: 0 4px !important;
  1222. position: relative;
  1223. }
  1224. .record:after {
  1225. position: absolute;
  1226. content: '';
  1227. display: block;
  1228. top: 5px;
  1229. right: -2px;
  1230. width: 1px;
  1231. height: 12px;
  1232. background: #e9ecf7;
  1233. }
  1234. .anniu {
  1235. margin-left: 40%;
  1236. margin-top: -7%;
  1237. margin-bottom: 6%;
  1238. }
  1239. // .el-row{
  1240. // height: 150px;
  1241. // }
  1242. .base_header_layout .grid-content {
  1243. margin-top: 80px;
  1244. }
  1245. .el-input--small .el-input__inner {
  1246. margin-left: 20px;
  1247. }
  1248. .el-range-editor--small.el-input__inner {
  1249. height: 32px;
  1250. margin-left: -20%;
  1251. }
  1252. //执行样式
  1253. .executory,
  1254. .inExecution,
  1255. .done {
  1256. width: 6px;
  1257. height: 6px;
  1258. display: inline-block;
  1259. border-radius: 50%;
  1260. position: relative;
  1261. top: -1px;
  1262. font-size: 14px;
  1263. }
  1264. .executory {
  1265. background: #ff9f24;
  1266. }
  1267. .inExecution {
  1268. background: #5878e8;
  1269. }
  1270. .done {
  1271. background: #50cad4;
  1272. }
  1273. .record,
  1274. .adjustment {
  1275. display: inline-block;
  1276. color: #5878e8;
  1277. padding: 0 4px !important;
  1278. position: relative;
  1279. font-size: 14px;
  1280. }
  1281. .container {
  1282. overflow: scroll;
  1283. height: 93vh;
  1284. }
  1285. .button-container {
  1286. display: flex;
  1287. flex-wrap: nowrap;
  1288. justify-content: space-between;
  1289. align-items: center;
  1290. background-color: #fff;
  1291. width: 100%;
  1292. height: 50px;
  1293. padding: 0 10px;
  1294. & > div {
  1295. margin-left: 10px;
  1296. display: flex;
  1297. flex-wrap: nowrap;
  1298. flex-direction: row;
  1299. & > span {
  1300. line-height: 50px;
  1301. }
  1302. }
  1303. /deep/.auditFlow-box {
  1304. position: unset;
  1305. margin-left: 10px;
  1306. &/deep/.auditFlow-icon {
  1307. width: auto;
  1308. padding-right: 30px;
  1309. }
  1310. &/deep/.auditFlow-main {
  1311. position: absolute;
  1312. }
  1313. }
  1314. }
  1315. .bg-left {
  1316. padding-left: 30px;
  1317. }
  1318. .title {
  1319. position: relative;
  1320. }
  1321. .title::before {
  1322. content: '';
  1323. display: inline-block;
  1324. width: 5px;
  1325. height: 30px;
  1326. background: #5473e8;
  1327. position: absolute;
  1328. left: 0;
  1329. }
  1330. .el-button--primary {
  1331. background-color: #5878e8;
  1332. border-color: #5878e8;
  1333. // margin-left: 85%;
  1334. margin-top: 13px;
  1335. }
  1336. //导航条样式
  1337. .el-col-12 {
  1338. width: 50%;
  1339. height: 60px;
  1340. background: #f6f7fc;
  1341. border-radius: 4px 4px 1px 1px;
  1342. }
  1343. .el-input--small .el-input__inner {
  1344. height: 32px;
  1345. line-height: 32px;
  1346. width: 385px;
  1347. margin-top: 10px;
  1348. }
  1349. .bg-bottom {
  1350. margin-left: 85%;
  1351. }
  1352. .but {
  1353. margin-left: 30%;
  1354. /* margin-top: -32px; */
  1355. overflow: auto;
  1356. /* float: left; */
  1357. /* margin-left: 1px; */
  1358. margin-left: -10px;
  1359. }
  1360. .look .el-form-item {
  1361. border-bottom: 1px solid #ccc;
  1362. }
  1363. .el-input--small {
  1364. font-size: 13px;
  1365. width: 390px;
  1366. margin-left: 74%;
  1367. }
  1368. /deep/.el-table .el-table__header .cell,
  1369. .el-table .el-table__body .cell {
  1370. text-align: center;
  1371. }
  1372. .el-scrollbar__wrap {
  1373. overflow-y: hidden;
  1374. }
  1375. /deep/.deal {
  1376. margin-left: 0%;
  1377. width: 64%;
  1378. }
  1379. .photo {
  1380. padding: 0% 34%;
  1381. }
  1382. .photo1 {
  1383. padding: 0 10%;
  1384. }
  1385. .photo2 {
  1386. padding: 0 12%;
  1387. }
  1388. /deep/.el-form-item--small .el-form-item__label,
  1389. .el-form-item--small .el-form-item__content {
  1390. text-align: center;
  1391. }
  1392. hr {
  1393. width: 91%;
  1394. }
  1395. /deep/.deaal {
  1396. width: 66%;
  1397. margin-left: 9%;
  1398. }
  1399. .el-date-editor.el-input,
  1400. .el-date-editor.el-input__inner,
  1401. .el-input-number--small {
  1402. width: 123% !important;
  1403. }
  1404. /deep/.el-table td,
  1405. .el-table th.is-leaf {
  1406. border-right: 1px solid #e9ecf7;
  1407. text-align: center;
  1408. height: 40px;
  1409. }
  1410. </style>