salesDeliveryReportList.vue 39 KB

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