salesDeliveryReportList.vue 39 KB

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