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