salesClosingCashierList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  1. <!--销售平仓报表-->
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col style="padding-left: 15px" :span="16">
  6. <ws-button
  7. :type="searchType == 1 ? 'primary' : ''"
  8. @click="handlestatus(1)"
  9. >待审核</ws-button
  10. >
  11. <ws-button
  12. :type="searchType == 2 ? 'primary' : ''"
  13. @click="handlestatus(2)"
  14. >待结算</ws-button
  15. >
  16. <ws-button
  17. :type="searchType == 3 ? 'primary' : ''"
  18. @click="handlestatus(3)"
  19. >已结算</ws-button
  20. >
  21. <ws-button
  22. :type="searchType == '' ? 'primary' : ''"
  23. @click="handlestatus('')"
  24. >全部</ws-button
  25. >
  26. <ws-button
  27. type="primary"
  28. v-hasPermission="`report.saleCloseReport.view`"
  29. @click="handleAudit(1)"
  30. >驳回</ws-button
  31. >
  32. <ws-button
  33. type="primary"
  34. v-hasPermission="`report.saleCloseReport.view`"
  35. @click="handleAudit(0)"
  36. >通过</ws-button
  37. >
  38. <ws-button
  39. type="primary"
  40. v-hasPermission="`report.saleCloseReport.payment`"
  41. @click="payment()"
  42. >付款</ws-button
  43. >
  44. <ws-button
  45. type="primary"
  46. v-hasPermission="`report.saleCloseReport.recive`"
  47. @click="collection()"
  48. >收款</ws-button
  49. >
  50. </el-col>
  51. <el-col
  52. style="text-align: right; line-height: 60px; padding-right: 10px"
  53. :span="8"
  54. >
  55. <el-select
  56. v-model="contractNo"
  57. placeholder="请选择合同"
  58. clearable
  59. filterable
  60. :filter-method="dataFilter"
  61. @change="contractchange"
  62. maxlength="500"
  63. type="input"
  64. class="findValue"
  65. >
  66. <el-option
  67. v-if="item.reportStatus"
  68. v-for="item in options"
  69. :key="item.constKey"
  70. :label="item.contractNo + '(' + item.reportStatus + ')'"
  71. :value="item.contractNo"
  72. />
  73. <el-option
  74. v-if="!item.reportStatus"
  75. v-for="item in options"
  76. :key="item.constKey"
  77. :label="item.contractNo"
  78. :value="item.contractNo"
  79. />
  80. </el-select>
  81. </el-col>
  82. </el-row>
  83. <el-table
  84. class="wenzi"
  85. :data="saleList.records"
  86. style="width: 100%; margin-top: 20px"
  87. @selection-change="handleSelectionChange"
  88. ref="warehouseList"
  89. border
  90. @row-click="handleRowClick"
  91. :summary-method="getSummaries"
  92. show-summary
  93. >
  94. <el-table-column
  95. type="selection"
  96. :selectable="selectInit"
  97. width="55"
  98. ></el-table-column>
  99. <el-table-column type="index" label="序号" width="50"></el-table-column>
  100. <el-table-column
  101. class="table_td"
  102. prop="contractNo"
  103. width="120"
  104. label="合同编号"
  105. ></el-table-column>
  106. <el-table-column
  107. class="table_td"
  108. prop="closePositionDate"
  109. label="平仓日期"
  110. ></el-table-column>
  111. <el-table-column
  112. class="table_td"
  113. prop="closingQuantity"
  114. width="100"
  115. label="平仓数量(吨)"
  116. ></el-table-column>
  117. <el-table-column
  118. class="table_td"
  119. prop="transactionPrice"
  120. width="120"
  121. label="成交价格(元/吨)"
  122. ></el-table-column>
  123. <el-table-column
  124. class="table_td"
  125. prop="closeRate"
  126. width="120"
  127. label="平仓价格(元/吨)"
  128. ></el-table-column>
  129. <el-table-column
  130. class="table_td"
  131. prop="basisPrice"
  132. width="90"
  133. label="基差(元/吨)"
  134. ></el-table-column>
  135. <el-table-column
  136. class="table_td"
  137. prop="amountIngPayable"
  138. width="100"
  139. label="应付金额(元)"
  140. >
  141. <template scope="scope">
  142. <span v-if="scope.row.amountIngPayable != null">{{
  143. scope.row.amountIngPayable
  144. }}</span>
  145. <span v-else>-</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column
  149. class="table_td"
  150. prop="amountEdPayable"
  151. width="100"
  152. label="已付金额(元)"
  153. >
  154. <template scope="scope">
  155. <span
  156. @click="amountEdPayableimage(scope.row)"
  157. v-if="scope.row.amountEdPayable != null"
  158. >{{ scope.row.amountEdPayable }}</span
  159. >
  160. <span v-else>-</span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column
  164. class="table_td"
  165. prop="amountNotPayable"
  166. width="100"
  167. label="未付金额(元)"
  168. >
  169. <template scope="scope">
  170. <span v-if="scope.row.amountNotPayable != null">{{
  171. scope.row.amountNotPayable
  172. }}</span>
  173. <span v-else>-</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. class="table_td"
  178. prop="paymentDate"
  179. label="付款日期"
  180. ></el-table-column>
  181. <el-table-column
  182. class="table_td"
  183. prop="collectionIngPayable"
  184. width="100"
  185. label="应收金额(元)"
  186. >
  187. <template scope="scope">
  188. <span v-if="scope.row.collectionIngPayable != null">{{
  189. scope.row.collectionIngPayable
  190. }}</span>
  191. <span v-else>-</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. class="table_td"
  196. prop="collectionEdPayable"
  197. width="100"
  198. label="已收金额(元)"
  199. >
  200. <template scope="scope">
  201. <span
  202. @click="collectionScreenshotimage(scope.row)"
  203. v-if="scope.row.collectionEdPayable != null"
  204. >{{ scope.row.collectionEdPayable }}</span
  205. >
  206. <span v-else>-</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column
  210. class="table_td"
  211. prop="collectionNotPayable"
  212. width="100"
  213. label="未收金额(元)"
  214. >
  215. <template scope="scope">
  216. <span v-if="scope.row.collectionNotPayable != null">{{
  217. scope.row.collectionNotPayable
  218. }}</span>
  219. <span v-else>-</span>
  220. </template>
  221. </el-table-column>
  222. <el-table-column
  223. class="table_td"
  224. prop="collectionDate"
  225. label="收款日期"
  226. ></el-table-column>
  227. <el-table-column
  228. class="table_td"
  229. prop="customerName"
  230. width="60"
  231. label="客户"
  232. ></el-table-column>
  233. <el-table-column
  234. class="table_td"
  235. prop="warehouseName"
  236. width="60"
  237. label="库点"
  238. ></el-table-column>
  239. <el-table-column prop="status" label="状态">
  240. <template slot-scope="scope">
  241. <span v-if="scope.row.approveStatus != null">{{
  242. scope.row.approveStatus
  243. }}</span>
  244. <span v-else>{{ scope.row.status }}</span>
  245. </template>
  246. </el-table-column>
  247. </el-table>
  248. <!-- 页数 -->
  249. <el-pagination
  250. @size-change="handleSizeChange"
  251. @current-change="handleCurrentChange"
  252. :current-page="currentPage"
  253. :page-size="pageSize"
  254. layout="total, sizes, prev, pager, next, jumper"
  255. :total="deptBudgetTotal"
  256. ></el-pagination>
  257. <el-dialog
  258. width="25%"
  259. title="付款"
  260. :visible.sync="dialogFormVisible1"
  261. :append-to-body="true"
  262. >
  263. <el-form :model="form">
  264. <el-form-item label="未付金额(元)" :label-width="formLabelWidth">
  265. {{ paymentlist.amountNotPayable }}
  266. </el-form-item>
  267. <el-form-item label="本次付款金额(元)" :label-width="formLabelWidth">
  268. <el-input
  269. v-model="paymentlist.money"
  270. autocomplete="off"
  271. placeholder="请输入本次付款金额"
  272. class="deal"
  273. ></el-input>
  274. </el-form-item>
  275. <el-form-item
  276. label="付款日期"
  277. prop="submissionDate"
  278. :label-width="formLabelWidth"
  279. class="deal"
  280. >
  281. <ws-date-picker
  282. v-model="paymentlist.paymentDate"
  283. type="date"
  284. placeholder="请选择付款日期"
  285. value-format="yyyy-MM-dd"
  286. class="deal"
  287. />
  288. </el-form-item>
  289. <el-form-item label="上传付款截图" :label-width="formLabelWidth">
  290. <el-upload
  291. v-if="paymentlist.paymentScreenshot == ''"
  292. action="https://www.zthymaoyi.com/upload/admin"
  293. list-type="picture-card"
  294. :on-success="
  295. (res, file) => {
  296. handlepaymentScreenshot(res, file)
  297. }
  298. "
  299. :on-remove="handleRemove"
  300. class="photo2"
  301. >
  302. <i class="el-icon-plus"></i>
  303. </el-upload>
  304. <img
  305. v-if="paymentlist.paymentScreenshot != ''"
  306. style="width: 100px; height: 100px; border: 1px solid #ccc"
  307. :src="paymentlist.paymentScreenshot"
  308. alt=""
  309. />
  310. </el-form-item>
  311. </el-form>
  312. <div slot="footer" class="dialog-footer">
  313. <el-button @click="dialogFormVisible1 = false">取 消</el-button>
  314. <el-button type="primary" @click="paymoneyconfirm">提 交</el-button>
  315. </div>
  316. </el-dialog>
  317. <el-dialog
  318. width="25%"
  319. title="付款图片"
  320. :visible.sync="dialogFormVisible3"
  321. :append-to-body="true"
  322. >
  323. <div v-for="item in addressurl">
  324. <img style="width: 100px; height: 100px" :src="item" alt="" />
  325. </div>
  326. </el-dialog>
  327. <el-dialog
  328. width="25%"
  329. title="收款图片"
  330. :visible.sync="dialogFormVisible4"
  331. :append-to-body="true"
  332. >
  333. <div v-for="item in addressurl1">
  334. <img style="width: 100px; height: 100px" :src="item" alt="" />
  335. </div>
  336. </el-dialog>
  337. </div>
  338. <!-- </div> -->
  339. </template>
  340. <script>
  341. import {
  342. postsaleaudit,
  343. getsalelist,
  344. postsalepaymoney,
  345. postsalecollectmoney,
  346. getsaleclosingcontractno,
  347. } from '@/model/statisticalReport/index'
  348. import { posthandle } from '@/model/purchasingManagement/index'
  349. import { downloadFile } from '@/utils/batchDown'
  350. import Pagination from '@/components/Pagination'
  351. import WsUpload from '@/components/WsUpload'
  352. import { dayjs, fmoney, EventBus } from 'base-core-lib'
  353. export default {
  354. name: 'viewSpareMoney',
  355. components: {
  356. WsUpload,
  357. Pagination,
  358. },
  359. watch: {
  360. vesselId(val) {
  361. this.getList()
  362. },
  363. isShow(val) {
  364. this.showType = val
  365. },
  366. },
  367. data() {
  368. return {
  369. checked: true,
  370. dialogFormVisible1: false,
  371. dialogFormVisible2: false,
  372. dialogFormVisible3: false,
  373. dialogFormVisible4: false,
  374. dialogVisible: false,
  375. form: {
  376. transactionPrice: '',
  377. transactionsNumber: '',
  378. basis: '',
  379. submissionDate: '',
  380. },
  381. formLabelWidth: '140px',
  382. isShow: !this.autohide,
  383. //弹出框
  384. dialogViewSpareMoney: false,
  385. dialogApproveFormVisible: false,
  386. // 船舶类型
  387. monetaryKey: null,
  388. // 表格显示数据
  389. tableDate: [],
  390. // 是否显示
  391. showType: true,
  392. // 年
  393. year: '',
  394. value2: '',
  395. deptBudgetTotal: 0,
  396. currentPage: 1,
  397. pageSize: 10,
  398. searchType: '1',
  399. searchKeyWord: '',
  400. contractType: 2,
  401. contractNoList: [],
  402. enter: {
  403. closePositionList: [],
  404. },
  405. // 提交类型
  406. submitType: true,
  407. multipleSelection: [],
  408. size: 10,
  409. spanArr: [],
  410. contractNo: '全部合同',
  411. roleFlag: '1',
  412. inOutTaskNo: '',
  413. options:[],
  414. compId: sessionStorage.getItem('ws-pf_compId'),
  415. roleId: sessionStorage.getItem('ws-pf_roleId'),
  416. saleList: [],
  417. deptBudgetList: {},
  418. pcFlag: 1,
  419. historyList: [],
  420. addressurl: [],
  421. addressurl1: [],
  422. paymentlist: { paymentScreenshot: '' },
  423. collectionlist: { collectionScreenshot: '' },
  424. accessoryTFs: false,
  425. }
  426. },
  427. activated() {
  428. // this.loaddata()
  429. this.getList()
  430. this.showType = this.isShow
  431. },
  432. methods: {
  433. handleRowClick(row) {
  434. if (row.approveStatus == null) {
  435. this.$refs.warehouseList.toggleRowSelection(row)
  436. return true
  437. } else if (row.approveStatus != null) {
  438. if (row.taskId == null) {
  439. return false
  440. } else {
  441. this.$refs.warehouseList.toggleRowSelection(row)
  442. return true
  443. }
  444. }
  445. },
  446. selectInit(row) {
  447. //在这里一定要记得类型匹配的上。
  448. if (row.approveStatus == null) {
  449. return true
  450. } else if (row.approveStatus != null) {
  451. if (row.taskId == null) {
  452. return false
  453. } else {
  454. return true
  455. }
  456. }
  457. },
  458. audit(item, index, status, status2, reason) {
  459. if (index < this.multipleSelection.length) {
  460. posthandle({
  461. taskId: item.taskId,
  462. approved: status,
  463. auditMind: reason != undefined ? '已驳回' : '34',
  464. needReapply: status2 != undefined ? true : false,
  465. })
  466. .toPromise()
  467. .then((response) => {
  468. this.audit(this.multipleSelection[index + 1], index + 1, status)
  469. })
  470. .catch((req) => {
  471. this.$message.warning(req.message)
  472. })
  473. } else {
  474. if (status==true) {
  475. this.$message.success('通过成功')
  476. this.getList()
  477. } else if (status==false) {
  478. this.$message.success('驳回成功')
  479. this.getList()
  480. }
  481. }
  482. },
  483. dataFilter(val) {
  484. // console.log(val,"名")
  485. this.contractNo = val
  486. if (val) {
  487. //val存在
  488. this.options = this.contractNoList.filter(item => {
  489. if (
  490. !!~item.contractNo.indexOf(val) ||
  491. !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())
  492. ) {
  493. return true
  494. }
  495. })
  496. } else {
  497. //val为空时,还原数组
  498. this.options = this.contractNoList
  499. }
  500. },
  501. contractchange(e) {
  502. this.contractNo = e
  503. this.getList()
  504. },
  505. amountEdPayableimage(item) {
  506. this.dialogFormVisible3 = true
  507. this.addressurl = item.paymentScreenshot.split('$')
  508. },
  509. collectionScreenshotimage(item) {
  510. this.dialogFormVisible4 = true
  511. this.addressurl1 = item.collectionScreenshot.split('$')
  512. },
  513. handlestatus(status) {
  514. this.searchType = status
  515. this.getList()
  516. },
  517. collectionconfirm() {
  518. if (!this.collectionlist.money) {
  519. this.$message.warning('收款金额不能为空')
  520. return
  521. }
  522. if (
  523. this.collectionlist.money > this.collectionlist.collectionNotPayable
  524. ) {
  525. this.$message.warning('收款金额不能超过未收金额')
  526. return
  527. }
  528. if (this.collectionlist.money.indexOf('.') != -1) {
  529. if (this.collectionlist.money.split('.')[1].length > 2) {
  530. this.$message.warning('收款金额输入错误')
  531. return
  532. }
  533. }
  534. if (!this.collectionlist.collectionScreenshot) {
  535. this.$message.warning('请上传收款截图')
  536. return
  537. }
  538. this.$confirm(`确定提交收款信息?`, {
  539. cancelButtonText: '取消',
  540. confirmButtonText: '确定',
  541. type: 'warning',
  542. }).then(() => {
  543. postsalecollectmoney(this.collectionlist)
  544. .toPromise()
  545. .then((response) => {
  546. this.$message.success('提交成功')
  547. this.collectionlist = { collectionScreenshot: '' }
  548. this.dialogFormVisible2 = false
  549. this.getList()
  550. })
  551. .catch(() => {
  552. this.$message.warning('提交失败')
  553. })
  554. })
  555. },
  556. paymoneyconfirm() {
  557. if (!this.paymentlist.money) {
  558. this.$message.warning('付款金额不能为空')
  559. return
  560. }
  561. if (this.paymentlist.money > this.paymentlist.amountNotPayable) {
  562. this.$message.warning('付款金额不能超过未付金额')
  563. return
  564. }
  565. if (this.paymentlist.money.indexOf('.') != -1) {
  566. if (this.paymentlist.money.split('.')[1].length > 2) {
  567. this.$message.warning('付款金额输入错误')
  568. return
  569. }
  570. }
  571. if (!this.paymentlist.paymentScreenshot) {
  572. this.$message.warning('请上传付款截图')
  573. return
  574. }
  575. this.$confirm(`确定提交付款信息?`, {
  576. cancelButtonText: '取消',
  577. confirmButtonText: '确定',
  578. type: 'warning',
  579. }).then(() => {
  580. postsalepaymoney(this.paymentlist)
  581. .toPromise()
  582. .then((response) => {
  583. this.$message.success('提交成功')
  584. this.paymentlist = { paymentScreenshot: '' }
  585. this.dialogFormVisible1 = false
  586. this.getList()
  587. })
  588. .catch(() => {
  589. this.$message.warning('提交失败')
  590. })
  591. })
  592. },
  593. handlepaymentScreenshot(res, fire) {
  594. this.paymentlist.paymentScreenshot = res.url
  595. },
  596. handlecollectionScreenshot(res, fire) {
  597. this.collectionlist.collectionScreenshot = res.url
  598. },
  599. payment() {
  600. if (this.multipleSelection.length > 0) {
  601. var amountNotPayable = 0
  602. for (let i = 0; i < this.multipleSelection.length; i++) {
  603. amountNotPayable += this.multipleSelection[i].amountNotPayable
  604. if (this.multipleSelection[i].collectionIngPayable > 0) {
  605. this.$message.warning('请选择应付款的条目')
  606. return
  607. }
  608. if (
  609. this.multipleSelection[i].status != '已通过' &&
  610. this.multipleSelection[i].status != '部分付款'
  611. ) {
  612. this.$message.warning('只有已通过或部分付款的条目才可进行付款操作')
  613. return
  614. }
  615. }
  616. this.dialogFormVisible1 = true
  617. this.paymentlist.amountNotPayable = amountNotPayable
  618. this.paymentlist.salesClosingReportList = this.multipleSelection
  619. } else {
  620. this.$message.warning('请选择要审核的条目')
  621. }
  622. },
  623. collection() {
  624. if (this.multipleSelection.length > 0) {
  625. var collectionNotPayable = 0
  626. for (let i = 0; i < this.multipleSelection.length; i++) {
  627. collectionNotPayable += this.multipleSelection[i].collectionNotPayable
  628. if (this.multipleSelection[i].amountNotPayable > 0) {
  629. this.$message.warning('请选择应收款的条目')
  630. return
  631. }
  632. if (
  633. this.multipleSelection[i].status != '已通过' &&
  634. this.multipleSelection[i].status != '部分收款'
  635. ) {
  636. this.$message.warning('只有已通过或部分收款的条目才可进行收款操作')
  637. return
  638. }
  639. }
  640. this.dialogFormVisible2 = true
  641. this.collectionlist.collectionNotPayable = collectionNotPayable
  642. this.collectionlist.salesClosingReportList = this.multipleSelection
  643. } else {
  644. this.$message.warning('请选择要审核的条目')
  645. }
  646. },
  647. handleAudit(status, flag) {
  648. var that = this
  649. if (status == 0) {
  650. if (this.multipleSelection.length > 0) {
  651. this.$confirm(`是否确定通过?`, {
  652. cancelButtonText: '取消',
  653. confirmButtonText: '确定',
  654. type: 'warning',
  655. }).then(() => {
  656. that.audit(this.multipleSelection[0], 0, true)
  657. })
  658. } else {
  659. this.$message.warning('请选择要审核的条目')
  660. }
  661. } else if (status == 1) {
  662. if (this.multipleSelection.length > 0) {
  663. this.$confirm(`是否确定驳回?`, {
  664. cancelButtonText: '取消',
  665. confirmButtonText: '确定',
  666. type: 'warning',
  667. }).then(() => {
  668. that.audit(this.multipleSelection[0], 0, false, true, '已驳回')
  669. })
  670. } else {
  671. this.$message.warning('请选择要驳回的条目')
  672. }
  673. }
  674. },
  675. updated() {
  676. this.$nextTick(() => {
  677. this.$refs.warehouseList.doLayout()
  678. })
  679. },
  680. //合计
  681. getSummaries(param) {
  682. const { columns, data } = param
  683. const sums = []
  684. columns.forEach((column, index) => {
  685. if (index === 0) {
  686. sums[index] = '合计'
  687. } else if (
  688. index === 4 ||
  689. index === 10 ||
  690. index === 8 ||
  691. index === 9 ||
  692. index === 12 ||
  693. index === 13 ||
  694. index === 14
  695. ) {
  696. const values = data.map((item) => Number(item[column.property]))
  697. if (!values.every((value) => isNaN(value))) {
  698. sums[index] = values.reduce((prev, curr) => {
  699. const value = Number(curr)
  700. if (!isNaN(value)) {
  701. return prev + curr
  702. } else {
  703. return prev
  704. }
  705. }, 0)
  706. } else {
  707. sums[index] = '元'
  708. }
  709. } else {
  710. sums[index] = '--'
  711. }
  712. })
  713. return sums
  714. },
  715. //成交
  716. submit() {
  717. if (!this.warehouseList.transactionPrice) {
  718. this.$message({
  719. message: '成交价不能为空',
  720. type: 'warning',
  721. })
  722. return
  723. }
  724. this.$confirm(`确定提交成交信息`, {
  725. cancelButtonText: '取消',
  726. confirmButtonText: '确定',
  727. type: 'warning',
  728. }).then(() => {
  729. console.log(23456678790)
  730. chengList(this.warehouseList)
  731. .toPromise()
  732. .then((response) => {
  733. this.$message.success('添加成功')
  734. // this.$router.go(-1)
  735. })
  736. .catch(() => {
  737. console.log(1111111111)
  738. return false
  739. })
  740. })
  741. },
  742. getList() {
  743. // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
  744. // this.roleFlag=1
  745. // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
  746. // this.roleFlag=2
  747. // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
  748. // this.roleFlag=3
  749. // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
  750. // this.roleFlag=4
  751. // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
  752. // this.roleFlag=''
  753. // }
  754. getsalelist({
  755. compId: sessionStorage.getItem('ws-pf_compId'),
  756. currentPage: this.currentPage,
  757. pageSize: this.pageSize,
  758. searchType: this.searchType,
  759. contractNo: this.contractNo,
  760. // roleFlag:this.roleFlag
  761. })
  762. .toPromise()
  763. .then((response) => {
  764. this.deptBudgetTotal = response.total
  765. this.saleList = response
  766. })
  767. getsaleclosingcontractno({
  768. compId: sessionStorage.getItem('ws-pf_compId'),
  769. currentPage: this.currentPage,
  770. pageSize: this.pageSize,
  771. roleFlag: this.roleFlag,
  772. })
  773. .toPromise()
  774. .then((response) => {
  775. this.contractNoList = response
  776. this.contractNoList.unshift({contractNo:'全部合同'})
  777. this.options=this.contractNoList
  778. })
  779. },
  780. // loaddata(){
  781. // chengList({
  782. // compId: sessionStorage.getItem('ws-pf_compId'),
  783. // })
  784. // .toPromise()
  785. // .then(response => {
  786. // this.warehouseList = response
  787. // })
  788. // },
  789. handleSelectionChange(val) {
  790. this.multipleSelection = val
  791. },
  792. handleRemove(file) {
  793. console.log(file)
  794. },
  795. handlePictureCardPreview(file) {
  796. this.dialogImageUrl = file.url
  797. this.dialogVisible = true
  798. },
  799. handleDownload(file) {
  800. console.log(file)
  801. },
  802. // statusquery(state) {
  803. // this.searchType = state
  804. // this.getList()
  805. // },
  806. // delivery(item) {
  807. // this.$router.push({
  808. // path: 'warehouseManagementDelivery',
  809. // query: {
  810. // baseId: item.warehouseId,
  811. // positionId: item.binNumberId,
  812. // warehouseName: item.warehouseName,
  813. // binNumber: item.binNumber,
  814. // capacity: item.capacity
  815. // }
  816. // })
  817. // },
  818. //查看
  819. handleLook(row) {
  820. this.$router.push({
  821. path: 'warehouseManagementPutOutLook',
  822. query: {
  823. relevanceId: row.relevanceId,
  824. },
  825. })
  826. },
  827. //返回
  828. revert() {
  829. this.$router.push({ path: 'warehouseManagementList' })
  830. },
  831. handleClose() {
  832. this.accessoryTFs = false
  833. },
  834. handleSizeChange(val) {
  835. console.log(`每页 ${val} 条`)
  836. this.pageSize = val
  837. this.getList()
  838. },
  839. handleCurrentChange(val) {
  840. this.currentPage = val
  841. console.log(`当前页: ${val}`)
  842. this.getList()
  843. },
  844. editClick(row) {
  845. var status = ''
  846. if (row.status == '待审核' || row.status == '已完成') {
  847. status = '执行中'
  848. } else if (row.status == '执行中') {
  849. status = '已完成'
  850. }
  851. //cancelButtonClass: "btn-custom-cancel"
  852. this.$confirm(`是否将状态改为${status}`, {
  853. confirmButtonText: '确定',
  854. cancelButtonText: '取消',
  855. type: 'warning',
  856. })
  857. .then(() => {
  858. alsostate({ id: row.id })
  859. .toPromise()
  860. .then((response) => {
  861. this.$notify.success({
  862. title: '成功',
  863. message: '状态修改成功',
  864. })
  865. this.getList()
  866. })
  867. .catch((response) => {
  868. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  869. })
  870. })
  871. .catch(() => {
  872. return false
  873. })
  874. },
  875. selecttaskType(e) {
  876. for (var i = 0; i < this.taskTypeList.length; i++) {
  877. if (this.taskTypeList[i].value == e) {
  878. this.searchType = this.taskTypeList[i].type
  879. }
  880. }
  881. },
  882. // fujian(row) {
  883. // if (
  884. // row.receiveAttachmentPath === null ||
  885. // row.receiveAttachmentPath === ''
  886. // ) {
  887. // EventBus.$emit(
  888. // 'warning',
  889. // this.$t('system.noticeCircular.NoInformation')
  890. // )
  891. // } else {
  892. // this.accessoryTFs = true
  893. // }
  894. // this.appendixIdss = row.receiveAttachmentPath
  895. // },
  896. handleExamine(row) {
  897. this.$router.push({
  898. name: 'salesContractExamine',
  899. query: { id: row.id },
  900. })
  901. },
  902. // 关闭 dialog时 处理文件url 初始化upload组件
  903. handleCloe() {
  904. this.dialogViewSpareMoney = false
  905. },
  906. history(row) {
  907. billoperatehis({ id: row.id })
  908. .toPromise()
  909. .then((response) => {
  910. this.historyList = response
  911. })
  912. },
  913. //查找
  914. find() {
  915. this.currentPage = 1
  916. this.getList()
  917. },
  918. async exportlist() {
  919. const { data } = await export1(
  920. {
  921. compId: sessionStorage.getItem('ws-pf_compId'),
  922. contractType: this.contractType,
  923. currentPage: this.currentPage,
  924. pageSize: this.pageSize,
  925. searchType: this.searchType,
  926. searchKeyWord: this.searchKeyWord,
  927. startDate: this.startDate,
  928. endDate: this.endDate,
  929. },
  930. {},
  931. { responseType: 'blob' }
  932. ).toPromise()
  933. downloadFile({
  934. res: data,
  935. fileName: `${
  936. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  937. }_采购合同`,
  938. type: 'xls',
  939. })
  940. },
  941. total() {},
  942. },
  943. }
  944. </script>
  945. <style lang="scss" scoped>
  946. .connert {
  947. width: 90%;
  948. margin: 0 auto;
  949. }
  950. .vertical-text-left {
  951. width: 62px;
  952. text-align: right;
  953. }
  954. //分页
  955. .el-pagination {
  956. padding: 10px 15px;
  957. margin-bottom: 0;
  958. text-align: center;
  959. }
  960. /deep/.el-pager li.active {
  961. color: #5878e8;
  962. cursor: default;
  963. }
  964. /deep/.el-pager li:hover {
  965. color: #5878e8;
  966. cursor: default;
  967. }
  968. .el-button--default {
  969. color: #8890b1;
  970. border-color: #e8eaf1;
  971. }
  972. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  973. width: 30px;
  974. margin-left: 0;
  975. border-top-left-radius: 0px;
  976. border-bottom-left-radius: 0px;
  977. }
  978. /deep/.findValue .el-input__inner {
  979. border-top-right-radius: 0px;
  980. border-bottom-right-radius: 0px;
  981. width: 385px;
  982. }
  983. .completed.el-button--default {
  984. border-color: #5878e8;
  985. background-color: #f6f7fc;
  986. color: #5878e8;
  987. }
  988. .putstorage.el-button--default,
  989. .deliverystorage.el-button--default {
  990. border-color: #8890b1;
  991. background-color: #fff;
  992. color: #8890b1;
  993. }
  994. /deep/.el-table td,
  995. /deep/.el-table th.is-leaf {
  996. border-right: 1px solid #e9ecf7;
  997. text-align: center;
  998. }
  999. /deep/.el-table tr td:first-child,
  1000. /deep/.el-table tr th.is-leaf:first-child {
  1001. border-left: 1px solid #e9ecf7;
  1002. }
  1003. .record,
  1004. .adjustment {
  1005. display: inline-block;
  1006. color: #5878e8;
  1007. padding: 0 4px !important;
  1008. position: relative;
  1009. }
  1010. .record:after {
  1011. position: absolute;
  1012. content: '';
  1013. display: block;
  1014. top: 5px;
  1015. right: -2px;
  1016. width: 1px;
  1017. height: 12px;
  1018. background: #e9ecf7;
  1019. }
  1020. // .el-row{
  1021. // height: 150px;
  1022. // }
  1023. .base_header_layout .grid-content {
  1024. margin-top: 80px;
  1025. }
  1026. .el-input--small .el-input__inner {
  1027. margin-left: 20px;
  1028. }
  1029. .el-range-editor--small.el-input__inner {
  1030. height: 32px;
  1031. margin-left: -20%;
  1032. }
  1033. //执行样式
  1034. .executory,
  1035. .inExecution,
  1036. .done {
  1037. width: 6px;
  1038. height: 6px;
  1039. display: inline-block;
  1040. border-radius: 50%;
  1041. position: relative;
  1042. top: -1px;
  1043. font-size: 14px;
  1044. }
  1045. .executory {
  1046. background: #ff9f24;
  1047. }
  1048. .inExecution {
  1049. background: #5878e8;
  1050. }
  1051. .done {
  1052. background: #50cad4;
  1053. }
  1054. .record,
  1055. .adjustment {
  1056. display: inline-block;
  1057. color: #5878e8;
  1058. padding: 0 4px !important;
  1059. position: relative;
  1060. font-size: 14px;
  1061. }
  1062. .container {
  1063. overflow: scroll;
  1064. height: 93vh;
  1065. }
  1066. .button-container {
  1067. display: flex;
  1068. flex-wrap: nowrap;
  1069. justify-content: space-between;
  1070. align-items: center;
  1071. background-color: #fff;
  1072. width: 100%;
  1073. height: 50px;
  1074. padding: 0 10px;
  1075. & > div {
  1076. margin-left: 10px;
  1077. display: flex;
  1078. flex-wrap: nowrap;
  1079. flex-direction: row;
  1080. & > span {
  1081. line-height: 50px;
  1082. }
  1083. }
  1084. /deep/.auditFlow-box {
  1085. position: unset;
  1086. margin-left: 10px;
  1087. &/deep/.auditFlow-icon {
  1088. width: auto;
  1089. padding-right: 30px;
  1090. }
  1091. &/deep/.auditFlow-main {
  1092. position: absolute;
  1093. }
  1094. }
  1095. }
  1096. .bg-left {
  1097. padding-left: 30px;
  1098. }
  1099. .title {
  1100. position: relative;
  1101. }
  1102. .title::before {
  1103. content: '';
  1104. display: inline-block;
  1105. width: 5px;
  1106. height: 30px;
  1107. background: #5473e8;
  1108. position: absolute;
  1109. left: 0;
  1110. }
  1111. .el-button--primary {
  1112. background-color: #5878e8;
  1113. border-color: #5878e8;
  1114. // margin-left: 85%;
  1115. margin-top: 13px;
  1116. }
  1117. //导航条样式
  1118. .el-col-12 {
  1119. width: 50%;
  1120. height: 60px;
  1121. background: #f6f7fc;
  1122. border-radius: 4px 4px 1px 1px;
  1123. }
  1124. .el-input--small .el-input__inner {
  1125. height: 32px;
  1126. line-height: 32px;
  1127. width: 385px;
  1128. margin-top: 10px;
  1129. }
  1130. .bg-bottom {
  1131. margin-left: 85%;
  1132. }
  1133. .but {
  1134. margin-left: 30%;
  1135. /* margin-top: -32px; */
  1136. overflow: auto;
  1137. /* float: left; */
  1138. /* margin-left: 1px; */
  1139. margin-left: -10px;
  1140. }
  1141. .el-input--small {
  1142. font-size: 13px;
  1143. width: 390px;
  1144. margin-left: 74%;
  1145. }
  1146. /deep/.el-table .el-table__header .cell,
  1147. .el-table .el-table__body .cell {
  1148. text-align: center;
  1149. }
  1150. .el-scrollbar__wrap {
  1151. overflow-y: hidden;
  1152. }
  1153. /deep/.deal {
  1154. margin-left: 0%;
  1155. width: 64%;
  1156. }
  1157. .photo {
  1158. padding: 0% 34%;
  1159. }
  1160. .photo1 {
  1161. padding: 0 10%;
  1162. }
  1163. .photo2 {
  1164. padding: 0 17%;
  1165. }
  1166. /deep/.el-form-item--small .el-form-item__label,
  1167. .el-form-item--small .el-form-item__content {
  1168. text-align: center;
  1169. }
  1170. hr {
  1171. width: 91%;
  1172. }
  1173. /deep/.deaal {
  1174. width: 66%;
  1175. margin-left: 9%;
  1176. }
  1177. .el-date-editor.el-input,
  1178. .el-date-editor.el-input__inner,
  1179. .el-input-number--small {
  1180. width: 123% !important;
  1181. }
  1182. /deep/.el-table td,
  1183. .el-table th.is-leaf {
  1184. border-right: 1px solid #e9ecf7;
  1185. text-align: center;
  1186. height: 40px;
  1187. }
  1188. // .danjia{
  1189. // width: 9px;
  1190. // height: 9px;
  1191. // margin-left: 40px;
  1192. // }
  1193. .swiperUnit {
  1194. .swiper {
  1195. width: 100%;
  1196. height: 400rpx;
  1197. image {
  1198. width: 100%;
  1199. height: 100%;
  1200. border-radius: 10rpx;
  1201. }
  1202. }
  1203. .rowDot {
  1204. display: flex;
  1205. position: absolute;
  1206. bottom: 20rpx;
  1207. left: calc((100% - 144rpx) / 2);
  1208. .dots {
  1209. flex-direction: row;
  1210. justify-content: center;
  1211. align-items: center;
  1212. align-content: center;
  1213. .dot {
  1214. margin-right: 8rpx;
  1215. width: 40rpx;
  1216. height: 8rpx;
  1217. opacity: 1;
  1218. border-radius: 6rpx;
  1219. background: #fff5f9;
  1220. }
  1221. .dot.active {
  1222. background: #ff4e54;
  1223. }
  1224. }
  1225. }
  1226. }
  1227. </style>