collectionManagement.vue 17 KB

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