collectionManagement.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <!--收款管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="12">
  5. <template slot="left">
  6. <ws-button
  7. :type="searchType == 3 ? 'primary' : ''"
  8. @click="handlestatus(3)"
  9. >待收款</ws-button>
  10. <ws-button
  11. :type="searchType == 4 ? 'primary' : ''"
  12. @click="handlestatus(4)"
  13. >已收款</ws-button>
  14. <ws-button
  15. :type="searchType == '' ? 'primary' : ''"
  16. @click="handlestatus('')"
  17. >全部</ws-button>
  18. <ws-button type="primary" @click="adopt" v-hasPermission=" `outbound.collectionOut.view`">备注</ws-button>
  19. <ws-button type="primary" @click="collect" v-hasPermission=" `outbound.collectionOut.new`">收款</ws-button>
  20. </template>
  21. <template slot="right">
  22. <el-col
  23. style="text-align: right; line-height: 60px; padding-right: 10px"
  24. :span="8"
  25. >
  26. <div class="el-input el-input--small el-input--suffix">
  27. <el-select
  28. v-model="contractNo"
  29. placeholder="请选择合同"
  30. clearable
  31. filterable
  32. @change="contractchange"
  33. maxlength="500"
  34. type="input"
  35. class="findValue"
  36. >
  37. <el-option
  38. v-if="item.listStatus"
  39. v-for="item in options"
  40. :key="item.constKey"
  41. :label="item.contractNo + '(' + item.listStatus + ')'"
  42. :value="item.contractNo"
  43. />
  44. <el-option
  45. v-if="!item.listStatus"
  46. v-for="item in options"
  47. :key="item.constKey"
  48. :label="item.contractNo"
  49. :value="item.contractNo"
  50. />
  51. </el-select>
  52. </div>
  53. </el-col>
  54. </template>
  55. </BaseHeaderLayout>
  56. <el-table
  57. :data="collectList"
  58. style="width: 100%; margin-top: 20px"
  59. ref="collectList"
  60. border
  61. height="780"
  62. @selection-change="handleSelectionChange"
  63. >
  64. <el-table-column
  65. :selectable="selectInit"
  66. type="selection"
  67. width="55"
  68. ></el-table-column>
  69. <el-table-column type="index" label="序号" width="50">
  70. <template scope="scope">
  71. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  72. <span v-else>{{ scope.$index + 1 }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column
  76. class="table_td"
  77. prop="carNo"
  78. label="车牌号"
  79. ></el-table-column>
  80. <el-table-column
  81. class="table_td"
  82. prop="goodsName"
  83. label="货名"
  84. ></el-table-column>
  85. <el-table-column
  86. class="table_td"
  87. prop="grossWeight"
  88. label="毛重(公斤)"
  89. ></el-table-column>
  90. <el-table-column
  91. class="table_td"
  92. prop="tare"
  93. label="皮重(公斤)"
  94. ></el-table-column>
  95. <el-table-column
  96. class="table_td"
  97. prop="netWeight"
  98. label="净重(公斤)"
  99. ></el-table-column>
  100. <el-table-column
  101. class="table_td"
  102. prop="contractPrice"
  103. label="合同单价(元/公斤)"
  104. width="150"
  105. ></el-table-column>
  106. <el-table-column
  107. width='150'
  108. class="table_td"
  109. prop="calculationCollectable"
  110. label="计算应收(元)"
  111. ></el-table-column>
  112. <el-table-column
  113. class="table_td"
  114. width='200'
  115. prop="actualCollectionment"
  116. label="实际应收(元)"
  117. >
  118. <template slot-scope="scope">
  119. <div class="inputChenge">
  120. <!-- readonly -->
  121. <el-input
  122. v-model="scope.row.actualCollectionment"
  123. v-if="scope.row.identification == 'true'"
  124. ></el-input>
  125. <div v-if="scope.row.identification == 'false'" class="inputs">
  126. {{ scope.row.actualCollectionment }}
  127. </div>
  128. </div>
  129. <img
  130. width="17"
  131. height="18"
  132. style="vertical-align: text-top; position: relative; top: -1px"
  133. src="../../../public/img/edit.png"
  134. @click="whether(scope.row)"
  135. v-if="scope.row.identification == 'false'"
  136. alt=""
  137. />
  138. <i
  139. class="el-icon-check"
  140. style="line-height: 29px; margin-left: 10px"
  141. v-if="scope.row.identification == 'true'"
  142. @click="varietyClick(scope.row)"
  143. ></i>
  144. <!-- <div>—</div> -->
  145. </template></el-table-column>
  146. <el-table-column
  147. class="table_td"
  148. prop="amountEdCollectionable"
  149. label="已收款(元)"
  150. >
  151. <template slot-scope="scope">
  152. <div @click="cellClick(scope.row)">{{scope.row.amountEdCollectionable}}</div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. class="table_td"
  157. prop="collectionDate"
  158. width="90"
  159. label="收款时间"
  160. ></el-table-column>
  161. <el-table-column
  162. class="table_td"
  163. prop="status"
  164. label="状态"
  165. ></el-table-column>
  166. <el-table-column
  167. class="table_td"
  168. prop="collectionEdPayable"
  169. label="操作"
  170. width="200"
  171. ><template scope="scope">
  172. <el-button @click="collectment(2,scope.row)" v-hasPermission="`outbound.collectionOut.weight`">查看</el-button>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. <el-dialog :visible.sync="isShowImgList" title="收款截图">
  177. <div v-for="(item,index) in imgList" :key="index" class="imgList-style">
  178. <img :src="item" alt="" class="img">
  179. </div>
  180. </el-dialog>
  181. <!-- 收款 -->
  182. <el-dialog
  183. width="25%"
  184. title="收款"
  185. :visible.sync="collectForm"
  186. :append-to-body="true"
  187. >
  188. <el-form :model="form">
  189. <el-form-item label="未收金额(元)" :label-width="formLabelWidth">
  190. <el-input
  191. v-model="allmoney1"
  192. autocomplete="off"
  193. class="deal"
  194. ></el-input>
  195. </el-form-item>
  196. <el-form-item label="本次收款金额(元)" :label-width="formLabelWidth">
  197. <el-input
  198. v-model="collectmoney"
  199. autocomplete="off"
  200. placeholder="请输入本次收款金额"
  201. class="deal"
  202. ></el-input>
  203. </el-form-item>
  204. <el-form-item
  205. label="收款日期"
  206. prop="collectionDate"
  207. :label-width="formLabelWidth"
  208. class="deal"
  209. >
  210. <ws-date-picker
  211. v-model="collectionDate"
  212. type="date"
  213. placeholder="请选择收款日期"
  214. value-format="yyyy-MM-dd"
  215. class="deal"
  216. />
  217. </el-form-item>
  218. <el-form-item label="上传收款截图" :label-width="formLabelWidth">
  219. <el-upload
  220. action="https://www.zthymaoyi.com/upload/admin"
  221. list-type="picture-card"
  222. :on-success="handlePictureCardPreview1"
  223. :on-remove="handleRemove"
  224. class="photo2"
  225. >
  226. <i class="el-icon-plus"></i>
  227. </el-upload>
  228. <el-dialog :visible.sync="dialogVisible">
  229. <img width="100%" :src="collectionScreenshot" alt="" />
  230. </el-dialog>
  231. </el-form-item>
  232. </el-form>
  233. <div slot="footer" class="dialog-footer">
  234. <el-button @click="collectForm = false">取 消</el-button>
  235. <el-button type="primary" @click="collectSubmit">提 交</el-button>
  236. </div>
  237. </el-dialog>
  238. <!--备注-->
  239. <el-dialog
  240. width="25%"
  241. title="备注"
  242. :visible.sync="collectForm1"
  243. :append-to-body="true"
  244. >
  245. <el-form :model="form">
  246. <div class="beizhu">
  247. <el-input
  248. v-model="remarks"
  249. autocomplete="off"
  250. placeholder="备注信息,不超过1000字"
  251. class="deal"
  252. ></el-input>
  253. </div>
  254. </el-form>
  255. <div slot="footer" class="dialog-footer">
  256. <el-button @click="collectForm1 = false">取 消</el-button>
  257. <el-button type="primary" @click="adoptRemarks()">保存</el-button>
  258. </div>
  259. </el-dialog>
  260. <!-- <houseSelfCollectPrint v-show="false"></houseSelfCollectPrint> -->
  261. <div style="text-align: center">
  262. <el-pagination
  263. @size-change="handleSizeChange"
  264. @current-change="handleCurrentChange"
  265. :current-page="currentPage"
  266. :page-size="deptCircularPage.pageSize"
  267. layout="total, sizes, prev, pager, next, jumper"
  268. :total="deptBudgetTotal"
  269. >
  270. </el-pagination>
  271. </div>
  272. </div>
  273. </template>
  274. <script>
  275. import {
  276. getcollection,
  277. editcollect,
  278. remarksAdd,
  279. moneyCollection,
  280. contractList
  281. } from '@/model/outboundManagement/index'
  282. export default {
  283. watch: {},
  284. data() {
  285. return {
  286. imgList:[],
  287. isShowImgList:false,
  288. //分页
  289. currentPage: 1,
  290. pageSize: 10,
  291. allmoney1:0,
  292. deptCircularPage: {},
  293. deptBudgetTotal: 0,
  294. warehouseList: [
  295. {
  296. collectionEdPayable: '快收款',
  297. },
  298. ],
  299. options:[],
  300. contractNoList:[],
  301. contractNo: '全部合同',
  302. dialogVisible: false,
  303. form: {},
  304. compId: sessionStorage.getItem('ws-pf_compId'),
  305. collectForm: false,
  306. collectForm1: false,
  307. managementType : 3,
  308. remarks:'',
  309. money: 0,
  310. // id:'',
  311. collectmoney: 0,
  312. paymentManagementList:[],
  313. collectionManagement:{
  314. paymentManagementList:[],
  315. remarks:'',
  316. },
  317. collectList:[],
  318. collectionDate: '',
  319. collectionScreenshot: '',
  320. amountEdCollectionable:'',
  321. actualCollectionment:'',
  322. // collectDate: '',
  323. calculationCollectable:'',
  324. searchType: '',
  325. searchTypeText: '',
  326. formLabelWidth: '120px',
  327. searchKeyWord: '',
  328. value1: '', //收款日期
  329. modification: [],
  330. }
  331. },
  332. activated() {
  333. this.getList()
  334. },
  335. methods: {
  336. cellClick(row){
  337. this.imgList = row.collectionScreenshot.split('$')
  338. this.isShowImgList = true
  339. // console.log(val)
  340. // console.log(val2)
  341. // console.log(val3)
  342. // console.log(event)
  343. console.log(row)
  344. },
  345. contractchange(e) {
  346. this.contractNo = e
  347. this.getList()
  348. },
  349. //修改实际应收
  350. varietyClick(row) {
  351. if (
  352. row.actualCollectionment < 0 ||
  353. row.actualCollectionment > 1000000 ||
  354. (String(row.actualCollectionment).indexOf('.') != -1 &&
  355. String(row.actualCollectionment).length -
  356. (String(row.actualCollectionment).indexOf('.') + 1) >
  357. 2)
  358. ) {
  359. this.$message({
  360. message: '实际应收输入错误',
  361. type: 'warning',
  362. })
  363. return
  364. }
  365. if (!row.actualCollectionment) {
  366. this.$message({
  367. message: '实际应收不能为空',
  368. type: 'warning',
  369. })
  370. return
  371. }
  372. if (row.actualCollectionment < row.amountEdCollectionable) {
  373. this.$message({
  374. message: '实际应收不能小于已收款',
  375. type: 'warning',
  376. })
  377. return
  378. }
  379. this.$confirm(`确定要修改实际应收?`, {
  380. confirmButtonText: '确定',
  381. cancelButtonText: '取消',
  382. type: 'warning',
  383. })
  384. .then(() => {
  385. editcollect({
  386. actualCollectionment: row.actualCollectionment,
  387. amountNotCollectable:row.actualCollectionment-row.amountEdCollectionable,
  388. id: row.id,
  389. })
  390. .toPromise()
  391. .then((response) => {
  392. this.$notify.success({
  393. title: '成功',
  394. message: '修改成功',
  395. })
  396. this.getList()
  397. })
  398. .catch((response) => {})
  399. })
  400. .catch(() => {
  401. return false
  402. })
  403. },
  404. whether(row) {
  405. row.identification = 'true'
  406. },
  407. handlestatus(status) {
  408. this.searchType = status
  409. this.getList()
  410. },
  411. // ,relationId :row.relationId
  412. collectment(index,row) {
  413. this.$router.push({ path: 'collectionment',
  414. query: {
  415. type: index,
  416. id: row.id ,
  417. relationId :row.relationId,
  418. compId: sessionStorage.getItem('ws-pf_compId')} })
  419. // this.$router.push({ path: 'settlement', query: { type: index,id: row.id,waterMin:data1.waterMin} })
  420. },
  421. collect() {
  422. this.allmoney1=0
  423. if (this.modification.length == 0) {
  424. this.$message.warning('请选择一条要收款的条目')
  425. } else {
  426. for (var i = 0; i < this.modification.length; i++) {
  427. this.allmoney1 += this.modification[i].actualCollectionment - this.modification[i].amountEdCollectionable
  428. }
  429. this.collectForm = true
  430. }
  431. },
  432. collectSubmit() {
  433. if (!this.collectionScreenshot) {
  434. this.$message({
  435. message: '请上传收款截图',
  436. type: 'warning',
  437. })
  438. return
  439. }
  440. this.$confirm(`确定提交收款信息?`, {
  441. cancelButtonText: '取消',
  442. confirmButtonText: '确定',
  443. type: 'warning',
  444. }).then(() => {
  445. moneyCollection({
  446. paymentManagementList: this.modification,
  447. money: this.collectmoney,
  448. collectionDate: this.collectionDate,
  449. collectionScreenshot: this.collectionScreenshot,
  450. })
  451. .toPromise()
  452. .then((response) => {
  453. this.$message.success('收款成功')
  454. this.collectmoney=''
  455. this.collectionDate=''
  456. this.collectionScreenshot=''
  457. this.collectForm = false
  458. this.getList()
  459. })
  460. })
  461. },
  462. //添加备注信息
  463. adopt() {
  464. this.remarks = this.remarks
  465. this.paymentManagementList = this.collectList[0].paymentManagementList
  466. if (this.modification.length == 0) {
  467. this.$message.warning('请选择要备注的条目')
  468. } else {
  469. this.collectForm1 = true
  470. }
  471. },
  472. adoptRemarks() {
  473. this.collectionManagement.remarks = this.remarks
  474. this.$confirm(`确定要保存备注信息?`, {
  475. confirmButtonText: '确定',
  476. cancelButtonText: '取消',
  477. type: 'warning',
  478. })
  479. .then(() => {
  480. remarksAdd({
  481. paymentManagementList : this.modification,
  482. remarks: this.remarks
  483. })
  484. .toPromise()
  485. .then(() => {
  486. this.collectForm1 = false
  487. this.$message.success('添加备注信息成功')
  488. this.paymentManagementList = {}
  489. this.getList()
  490. })
  491. .catch(() => {
  492. return false
  493. })
  494. })
  495. },
  496. handlePictureCardPreview1(file) {
  497. this.collectionScreenshot = file.url
  498. },
  499. dataFilter(val) {
  500. // console.log(val,"名")
  501. this.contractNo = val
  502. if (val) {
  503. //val存在
  504. this.options = this.contractNoList.filter(item => {
  505. if (
  506. !!~item.contractNo.indexOf(val) ||
  507. !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())
  508. ) {
  509. return true
  510. }
  511. })
  512. } else {
  513. //val为空时,还原数组
  514. this.options = this.contractNoList
  515. }
  516. },
  517. selectInit(row) {
  518. //在这里一定要记得类型匹配的上。
  519. if (row.approveStatus == null) {
  520. return true
  521. } else if (row.approveStatus != null) {
  522. if (row.taskId == null) {
  523. return false
  524. } else {
  525. return true
  526. }
  527. }
  528. },
  529. getList(){
  530. getcollection({
  531. managementType : this.managementType,
  532. currentPage:this.currentPage,
  533. pageSize:this.pageSize,
  534. searchKeyWord:this.searchKeyWord,
  535. searchType:this.searchType,
  536. warehouseName:this.warehouseName,
  537. contractNo: this.contractNo,
  538. }).toPromise().then((response) => {
  539. for (var i = 0; i < response.records.length; i++) {
  540. response.records[i].identification = 'false'
  541. response.records[i].contractPrice = response.records[i].contractPrice*1000
  542. }
  543. this.collectList = response.records
  544. this.deptBudgetTotal = response.total
  545. })
  546. contractList({
  547. compId: sessionStorage.getItem('ws-pf_compId'),
  548. currentPage: this.currentPage,
  549. pageSize: this.pageSize,
  550. })
  551. .toPromise()
  552. .then((response) => {
  553. this.contractNoList = response
  554. this.contractNoList.unshift({contractNo:'全部合同'})
  555. this.options=this.contractNoList
  556. console.log( this.options[0].listStatus)
  557. })
  558. },
  559. handleRemove(file) {
  560. console.log(file)
  561. },
  562. handleSelectionChange(val) {
  563. this.modification = val
  564. },
  565. selecttaskType() {},
  566. handleSizeChange(val) {
  567. console.log(`每页 ${val} 条`)
  568. this.pageSize = val
  569. this.getList()
  570. },
  571. handleCurrentChange(val) {
  572. this.currentPage = val
  573. console.log(`当前页: ${val}`)
  574. this.getList()
  575. },
  576. },
  577. }
  578. </script>
  579. <style lang="scss" scoped>
  580. .ws-info-table {
  581. border: none;
  582. }
  583. .ws-info-table .el-form-item {
  584. width: 50%;
  585. border: none;
  586. }
  587. /deep/.ws-info-table .el-form-item .el-form-item__label {
  588. width: 30%;
  589. text-align: center;
  590. background: #ffffff;
  591. color: #8890b1;
  592. }
  593. /deep/.ws-info-table .el-form-item .el-form-item__content {
  594. border: none;
  595. }
  596. .title {
  597. font-size: 16px;
  598. font-weight: 600;
  599. }
  600. .formItem {
  601. width: 70% !important;
  602. }
  603. /deep/.el-table .el-table__header .cell,
  604. .el-table .el-table__body .cell {
  605. text-align: center;
  606. }
  607. /deep/.el-table--enable-row-transition .el-table__body td {
  608. text-align: center;
  609. }
  610. /deep/.beizhu .el-input--small .el-input__inner {
  611. height: 220px;
  612. line-height: 28px;
  613. }
  614. .inputChenge {
  615. width: 40%;
  616. display: inline-flex;
  617. }
  618. .deal {
  619. width: 66%;
  620. }
  621. .inputs {
  622. margin: 0 auto;
  623. }
  624. .el-col-8 {
  625. width: 33.33333%;
  626. }
  627. /deep/.findValue .el-input__inner {
  628. border-top-right-radius: 0px;
  629. border-bottom-right-radius: 0px;
  630. width: 385px;
  631. }
  632. /deep/.el-select .el-input .el-input--small .el-input--suffix {
  633. display: block;
  634. font-size: 13px;
  635. margin-left: -67px;
  636. }
  637. .imgList-style{
  638. width: 50%;
  639. display: inline-block;
  640. .img{
  641. width: 100%;
  642. height: 300px;
  643. }
  644. }
  645. </style>