tradeServices_audit.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <template>
  2. <view class="container">
  3. <u-form ref="uForm">
  4. <view class="form_item">
  5. <view class="title">申请信息</view>
  6. <!-- <u-divider ></u-divider> -->
  7. <u-form-item label-width='260' label="业务编号" :borderBottom="false">
  8. <u-input v-model="tradeList.billNo" input-align="right" placeholder="暂无" disabled />
  9. </u-form-item>
  10. <u-form-item label-width='260' label="名头" :borderBottom="false">
  11. <u-input v-model="tradeList.renown" input-align="right" placeholder="暂无" disabled />
  12. </u-form-item>
  13. <u-form-item label-width='260' label="仓库名称" :borderBottom="false">
  14. <u-input v-model="tradeList.warehouseName" input-align="right" placeholder="暂无" disabled />
  15. </u-form-item>
  16. <u-form-item label-width='260' label="仓位号" :borderBottom="false">
  17. <u-input v-model="tradeList.warehouseNo" input-align="right" placeholder="暂无" disabled />
  18. </u-form-item>
  19. <u-form-item label-width='260' label="仓库地址" :borderBottom="false">
  20. <u-input v-model="tradeList.warehouseAddress" input-align="right" placeholder="暂无" disabled />
  21. </u-form-item>
  22. <u-form-item label-width='260' label="货名" :borderBottom="false">
  23. <u-input v-model="tradeList.goodsName" input-align="right" placeholder="暂无" disabled />
  24. </u-form-item>
  25. <u-form-item label-width='260' label="品级" :borderBottom="false">
  26. <u-input v-model="tradeList.grade" input-align="right" placeholder="暂无" disabled />
  27. </u-form-item>
  28. <u-form-item label-width='260' label="现有储量(吨)" :borderBottom="false">
  29. <u-input v-model="tradeList.nowWeight" input-align="right" placeholder="暂无" disabled />
  30. </u-form-item>
  31. <u-form-item label-width='260' label="可用储量(吨)" :borderBottom="false">
  32. <u-input v-model="tradeList.useWeight" input-align="right" placeholder="暂无" disabled />
  33. </u-form-item>
  34. <u-form-item label-width='260' label="本单重量(吨)" :borderBottom="false">
  35. <u-input v-model="tradeList.weight" input-align="right" placeholder="暂无" disabled />
  36. </u-form-item>
  37. <u-form-item label-width='260' label="单价(元/吨)" :borderBottom="false">
  38. <u-input v-model="tradeList.unitPrice" input-align="right" placeholder="暂无" disabled />
  39. </u-form-item>
  40. <u-form-item label-width='260' label="总价值(元)" :borderBottom="false">
  41. <u-input v-model="tradeList.totalValue" input-align="right" placeholder="暂无" disabled />
  42. </u-form-item>
  43. <u-form-item label-width='260' label="申请比例(%)" :borderBottom="false">
  44. <u-input v-model="tradeList.applicationProportion" input-align="right" placeholder="暂无" disabled />
  45. </u-form-item>
  46. <u-form-item label-width='260' label="申请金额(元)" :borderBottom="false">
  47. <u-input v-model="tradeList.interest" input-align="right" placeholder="暂无" disabled />
  48. </u-form-item>
  49. </view>
  50. <view class="form_item">
  51. <view class="title">附件</view>
  52. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="0"
  53. :file-list="imgUrl" :size-type="['compressed']" @on-success="getImgUrl" :deletable="false"
  54. :showProgress="false" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  55. @on-progress="onProgress"></upload>
  56. </view>
  57. <view class="form_item">
  58. <view class="title">外审部门</view>
  59. <u-form-item label-width='260' label="银行" :borderBottom="false">
  60. <u-input v-model="tradeList.bank" input-align="right" placeholder="暂无" disabled />
  61. </u-form-item>
  62. <u-form-item label-width='260' label="第三方" :borderBottom="false">
  63. <u-input v-model="tradeList.three" input-align="right" placeholder="暂无" disabled />
  64. </u-form-item>
  65. </view>
  66. <view class="form_item" v-if="tradeList.approveStatus == '待银行审批'">
  67. <view class="title">发放信息</view>
  68. <u-form-item label-width='260' label="合同编号">
  69. <u-input v-model="tradeList.contractNo" input-align="right" placeholder="请输入合同编号" />
  70. </u-form-item>
  71. <u-form-item label-width='260' label="发放金额(元)">
  72. <u-input v-model="tradeList.paymentAmount" input-align="right" type="digit" @input="calculation()" placeholder="请输入发放金额" />
  73. </u-form-item>
  74. <view v-for="(item,index) in count">
  75. <view class="row">
  76. <view class="left ">
  77. <u-input v-model="item.modifyExpense" placeholder="输入费用名称,1-8个字" maxlength="8"/>
  78. </view>
  79. <view class="right">
  80. <u-input v-model="item.expenses" @input="calculation" input-align="right" placeholder="输入金额" type="digit" />
  81. </u-input><span class="yuan">元</span>
  82. <view class="del" @click="del(index)">—</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="flex count">
  87. <view class="add">
  88. <u-button @click="add" type="success" class="btnAdd" :disabled="addshow">添加费用</u-button>
  89. </view>
  90. <view class=" flex count_item">
  91. <span>合计应还:</span><span class="number">¥{{tradeList.amountDue}}</span>
  92. </view>
  93. </view>
  94. </view>
  95. </u-form>
  96. <view class="form_item flex">
  97. <view class="auditInfo flex" @click="auditInfo">
  98. <view class="title1">审核记录</view>
  99. <view class="img">
  100. <image src="../../../static/img/myimg/gengduo1@3x.png"
  101. style="width: 16rpx; height: 30rpx;top: 20rpx;margin-right: 0rpx;"></image>
  102. </view>
  103. </view>
  104. </view>
  105. <view style='padding:10px;' class='flex bottom-btn'>
  106. <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  107. <u-button @click='pass' type="success" class="btn2">通过</u-button>
  108. </view>
  109. <view v-if="show" class="shade">
  110. <view class="wrap">
  111. <view class="alert-top">
  112. <view class="titleAudit">
  113. {{title}}
  114. </view>
  115. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  116. </view>
  117. <view class="u-textarea-style">
  118. <view class="right-bottom">
  119. {{auditMind.length}}/1000个字
  120. </view>
  121. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  122. maxlength="1000" />
  123. </view>
  124. <view @click='close()' class="cancel">取消</view>
  125. <view @click='passSubmit()' class="confirm">确定</view>
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import upload from '@/components/upload.vue';
  132. export default {
  133. components: {
  134. upload
  135. },
  136. data() {
  137. return {
  138. id: "",
  139. action: this.$uploadUrl,
  140. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  141. btnLoading: false, //防止重复点击
  142. imgUrl: [],
  143. tradeList: {},
  144. isShowAlert: false,
  145. show: false,
  146. content: "",
  147. title: "",
  148. auditMind: "", //审核意见
  149. count: [],
  150. addshow: false
  151. }
  152. },
  153. onLoad(options) {
  154. this.id = options.id
  155. this.getList()
  156. },
  157. onshow() {
  158. },
  159. methods: {
  160. calculation() {
  161. let money = Number(this.tradeList.paymentAmount)
  162. for (let i = 0; i < this.count.length; i++) {
  163. money += Number(this.count[i].expenses)
  164. }
  165. this.tradeList.amountDue = money.toFixed(2)
  166. },
  167. del(num) {
  168. this.count.splice(num, 1)
  169. if (this.count.length == 4) {
  170. this.addshow = true
  171. } else {
  172. this.addshow = false
  173. }
  174. let money = Number(this.tradeList.paymentAmount)
  175. for (let i = 0; i < this.count.length; i++) {
  176. money += Number(this.count[i].expenses)
  177. }
  178. this.tradeList.amountDue = money.toFixed(2)
  179. },
  180. add() {
  181. this.count.push({
  182. modifyExpense: "",
  183. expenses: ""
  184. })
  185. if (this.count.length == 4) {
  186. this.addshow = true
  187. } else {
  188. this.addshow = false
  189. }
  190. },
  191. getList() {
  192. var that = this
  193. that.$api.doRequest('get', '/tradeWarehouseReceiptAppl/getTrageInfo', {
  194. id: that.id
  195. }).then(res => {
  196. that.tradeList = res.data.data
  197. // if (that.tradeList.approveStatus == "待银行审批") {
  198. // that.tradeList.amountDue = that.tradeList.interest
  199. // }
  200. //通过图片id找到地址
  201. that.$api.doRequest('get', '/appendix/query/getFileList', {
  202. appendixIds: that.tradeList.appendix
  203. }).then(res => {
  204. for (let i = 0; i < res.data.data.length; i++) {
  205. that.imgUrl.push({
  206. url: res.data.data[i].appendixPath
  207. })
  208. }
  209. }).catch(res => {
  210. if (res.errmsg) {
  211. uni.showToast({
  212. title: res.errmsg,
  213. icon: 'none',
  214. duration: 2000
  215. })
  216. }
  217. });
  218. })
  219. },
  220. reject() {
  221. this.show = true
  222. this.title = "驳回原因(驳回)"
  223. },
  224. pass() {
  225. if(this.tradeList.approveStatus == "待银行审批"){
  226. if (!this.tradeList.contractNo) {
  227. this.$api.msg('合同编号不能为空!')
  228. return
  229. }
  230. if (!this.tradeList.paymentAmount) {
  231. this.$api.msg('发放金额不能为空!')
  232. return
  233. }
  234. for(var index = 0 ; index < this.count.length;index++){
  235. if(!this.count[index].modifyExpense){
  236. this.$api.msg('请输入费用名称!')
  237. return
  238. }
  239. if(!this.count[index].expenses){
  240. this.$api.msg('请输入费用!')
  241. return
  242. }
  243. if(Number(this.count[index].expenses) < 1 || Number(this.count[index].expenses) > 100000000){
  244. this.$api.msg('费用输入有误!')
  245. return
  246. }
  247. if(this.count[index].expenses.toString().split(".")[1]){
  248. if(this.count[index].expenses.toString().split(".")[1].length > 2){
  249. this.$api.msg('费用请保留两位小数!')
  250. return
  251. }
  252. }
  253. if(index == 0){
  254. this.tradeList.modifyExpense1 = this.count[index].modifyExpense
  255. this.tradeList.applicationAmount = this.count[index].expenses
  256. this.tradeList.applicationAmountFlag = "显示中"
  257. }else if(index == 1){
  258. this.tradeList.modifyExpense2 = this.count[index].modifyExpense
  259. this.tradeList.supervisionFee = this.count[index].expenses
  260. this.tradeList.supervisionFeeFlag = "显示中"
  261. }else if(index == 2){
  262. this.tradeList.modifyExpense3 = this.count[index].modifyExpense
  263. this.tradeList.insurancePremium = this.count[index].expenses
  264. this.tradeList.insurancePremiumFlag = "显示中"
  265. }else if(index == 3){
  266. this.tradeList.modifyExpense4 = this.count[index].modifyExpense
  267. this.tradeList.otherFee = this.count[index].expenses
  268. this.tradeList.otherFeeFlag = "显示中"
  269. }
  270. }
  271. }
  272. this.show = true
  273. this.title = "审核意见(通过)"
  274. },
  275. close() {
  276. this.show = false
  277. },
  278. passSubmit() {
  279. if (this.title == "驳回原因(驳回)") {
  280. if (!this.auditMind) {
  281. this.$api.msg('驳回意见不能为空')
  282. return
  283. }
  284. uni.showLoading({
  285. title: "审核中"
  286. })
  287. this.$api.doRequest('post', '/newWorkflow/api/handle', {
  288. taskId: this.tradeList.taskId,
  289. approved: false,
  290. auditMind: this.auditMind,
  291. needReapply: true,
  292. }).then(res => {
  293. uni.hideLoading()
  294. if (res.data.code == 200) {
  295. uni.showToast({
  296. title: "驳回成功",
  297. icon: 'none',
  298. duration: 2000
  299. })
  300. uni.navigateBack()
  301. }
  302. }).catch(res => {
  303. uni.hideLoading()
  304. if (res.errmsg) {
  305. uni.showToast({
  306. title: res.errmsg,
  307. icon: 'none',
  308. duration: 2000
  309. })
  310. }
  311. });
  312. } else {
  313. uni.showLoading({
  314. title: "审核中"
  315. })//通过
  316. if(this.tradeList.approveStatus == "待银行审批"){
  317. this.tradeList.amountToRepaid = this.tradeList.amountDue//设置待还金额 = 应还金额
  318. this.$api.doRequest('post', '/tradeWarehouseReceiptAppl/api/editTradeWarehouseReceiptAppl', this.tradeList)
  319. .then(res => {
  320. if(res.data.code == 200){
  321. this.$api.doRequest('post', '/newWorkflow/api/handle', {
  322. taskId: this.tradeList.taskId,
  323. approved: true,
  324. auditMind: this.auditMind ? this.auditMind : "审核通过",
  325. needReapply: false,
  326. }).then(res => {
  327. uni.hideLoading()
  328. if (res.data.code == 200) {
  329. uni.showToast({
  330. title: "审核成功",
  331. icon: 'none',
  332. duration: 2000
  333. })
  334. uni.navigateBack()
  335. }
  336. }).catch(res => {
  337. uni.hideLoading()
  338. if (res.errmsg) {
  339. uni.showToast({
  340. title: res.errmsg,
  341. icon: 'none',
  342. duration: 2000
  343. })
  344. }
  345. });
  346. }
  347. })
  348. }else{
  349. this.$api.doRequest('post', '/newWorkflow/api/handle', {
  350. taskId: this.tradeList.taskId,
  351. approved: true,
  352. auditMind: this.auditMind ? this.auditMind : "审核通过",
  353. needReapply: false,
  354. }).then(res => {
  355. uni.hideLoading()
  356. if (res.data.code == 200) {
  357. uni.showToast({
  358. title: "审核成功",
  359. icon: 'none',
  360. duration: 2000
  361. })
  362. uni.navigateBack()
  363. }
  364. }).catch(res => {
  365. uni.hideLoading()
  366. if (res.errmsg) {
  367. uni.showToast({
  368. title: res.errmsg,
  369. icon: 'none',
  370. duration: 2000
  371. })
  372. }
  373. });
  374. }
  375. }
  376. },
  377. auditInfo() {
  378. uni.navigateTo({
  379. url: '/pages/task/audit_info?id=' + this.tradeList.id + "&workflowId=" + this.tradeList.workflowId
  380. })
  381. },
  382. filterFileType(index, lists) {
  383. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif' &&
  384. lists[index].fileType != 'jpeg') {
  385. lists.splice(index, 1);
  386. // 当前文件不支持
  387. uni.showModal({
  388. title: '暂不支持当前图片类型',
  389. showCancel: false
  390. });
  391. } else {
  392. this.isAdd = false;
  393. }
  394. },
  395. }
  396. }
  397. </script>
  398. <style scoped lang="scss">
  399. .container {
  400. padding: 6rpx 12rpx 250rpx 12rpx;
  401. }
  402. .title {
  403. font-size: 34rpx;
  404. font-weight: 600;
  405. margin-top: 20rpx;
  406. line-height: 90rpx;
  407. border-bottom: 2rpx solid #EEEEEE;
  408. }
  409. .form_item {
  410. background: #fff;
  411. margin: 10px;
  412. border-radius: 10px;
  413. padding: 10rpx 30rpx;
  414. // width: 100%;
  415. }
  416. .u-form-item {
  417. padding: 12rpx 0 !important;
  418. }
  419. .auditInfo {
  420. width: 100%;
  421. .title1 {
  422. width: 99%;
  423. font-size: 34rpx;
  424. font-weight: 600;
  425. // margin-top: 20rpx;
  426. line-height: 70rpx;
  427. }
  428. }
  429. .bottom-btn {
  430. width: 100%;
  431. position: fixed;
  432. bottom: 0;
  433. display: flex;
  434. z-index: 2;
  435. left: 0;
  436. background-color: #f8f8f8;
  437. flex-direction: column;
  438. .btn1,
  439. .btn2 {
  440. width: 100%;
  441. margin-bottom: 26rpx;
  442. border-radius: 90rpx;
  443. }
  444. .btn1 {
  445. background: white;
  446. color: #00C265;
  447. }
  448. }
  449. .shade {
  450. position: fixed;
  451. top: 0;
  452. left: 0;
  453. height: 100%;
  454. width: 100%;
  455. background: rgba(0, 0, 0, 0.4);
  456. z-index: 3;
  457. .wrap {
  458. position: absolute;
  459. left: 0;
  460. top: 0;
  461. right: 0;
  462. bottom: 0;
  463. margin: auto;
  464. background: #fff;
  465. width: calc(100% - 198rpx);
  466. height: 700rpx;
  467. border-radius: 20rpx;
  468. .alert-top {
  469. padding: 33rpx;
  470. display: flex;
  471. justify-content: center;
  472. align-items: center;
  473. position: relative;
  474. }
  475. .titleAudit {
  476. font-size: 32rpx;
  477. font-weight: 600;
  478. color: #333333;
  479. }
  480. .close {
  481. position: absolute;
  482. right: 33rpx;
  483. }
  484. }
  485. }
  486. .cancel,
  487. .confirm {
  488. position: absolute;
  489. display: inline-block;
  490. width: 50%;
  491. text-align: center;
  492. bottom: 0;
  493. padding: 10px;
  494. border-top: 1px solid #eee;
  495. font-size: 34rpx;
  496. }
  497. .cancel {
  498. left: 0;
  499. border-right: 1px solid #eee;
  500. color: #AFB3BF;
  501. }
  502. .confirm {
  503. right: 0;
  504. color: #22C572;
  505. }
  506. .u-textarea-style {
  507. margin: 20rpx;
  508. background: #F9F9FA;
  509. border-radius: 10px;
  510. border: 1px solid #EEEEEE;
  511. padding: 10rpx 20rpx;
  512. position: relative;
  513. .right-bottom {
  514. position: absolute;
  515. right: 20rpx;
  516. bottom: 20rpx;
  517. color: #AFB3BF;
  518. }
  519. }
  520. .row {
  521. display: flex;
  522. justify-content: space-between;
  523. border-bottom: 1px solid #eee;
  524. .right {
  525. display: flex;
  526. // .uni-input-input{
  527. // width: 30%;
  528. // font-size: 28rpx;
  529. // }
  530. .del {
  531. width: 46rpx;
  532. height: 46rpx;
  533. border-radius: 25rpx;
  534. background-color: #F1F4FB;
  535. text-align: center;
  536. line-height: 46rpx;
  537. font-weight: 600;
  538. margin-top: 8rpx;
  539. }
  540. .yuan {
  541. line-height: 70rpx;
  542. margin: 0 16rpx;
  543. }
  544. }
  545. }
  546. .count {
  547. width: 100%;
  548. margin: 20rpx 0;
  549. .add {
  550. width: 162rpx;
  551. height: 64rpx;
  552. background: #22C572;
  553. border-radius: 10rpx;
  554. color: #FFFFFF;
  555. line-height: 64rpx;
  556. text-align: center;
  557. font-size: 28rpx;
  558. }
  559. .count_item {
  560. width: 70%;
  561. justify-content: flex-end;
  562. font-size: 30rpx;
  563. line-height: 70rpx;
  564. .number {
  565. font-size: 32rpx;
  566. font-weight: 600;
  567. margin-left: 20rpx;
  568. }
  569. }
  570. }
  571. /deep/.u-list-item {
  572. margin: 20rpx 4rpx !important;
  573. }
  574. </style>