tradeServices_audit.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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}}/100个字
  120. </view>
  121. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  122. maxlength="100" />
  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. this.$api.doRequest('post', '/workflow/api/handle', {
  285. taskId: this.tradeList.taskId,
  286. approved: false,
  287. auditMind: this.auditMind,
  288. needReapply: true,
  289. }).then(res => {
  290. if (res.data.code == 200) {
  291. uni.showToast({
  292. title: "驳回成功",
  293. icon: 'none',
  294. duration: 2000
  295. })
  296. uni.navigateBack()
  297. }
  298. }).catch(res => {
  299. if (res.errmsg) {
  300. uni.showToast({
  301. title: res.errmsg,
  302. icon: 'none',
  303. duration: 2000
  304. })
  305. }
  306. });
  307. } else {//通过
  308. if(this.tradeList.approveStatus == "待银行审批"){
  309. this.tradeList.amountToRepaid = this.tradeList.amountDue//设置待还金额 = 应还金额
  310. this.$api.doRequest('post', '/tradeWarehouseReceiptAppl/api/editTradeWarehouseReceiptAppl', this.tradeList)
  311. .then(res => {
  312. if(res.data.code == 200){
  313. this.$api.doRequest('post', '/workflow/api/handle', {
  314. taskId: this.tradeList.taskId,
  315. approved: true,
  316. auditMind: this.auditMind ? this.auditMind : "审核通过",
  317. needReapply: false,
  318. }).then(res => {
  319. if (res.data.code == 200) {
  320. uni.showToast({
  321. title: "审核成功",
  322. icon: 'none',
  323. duration: 2000
  324. })
  325. uni.navigateBack()
  326. }
  327. }).catch(res => {
  328. if (res.errmsg) {
  329. uni.showToast({
  330. title: res.errmsg,
  331. icon: 'none',
  332. duration: 2000
  333. })
  334. }
  335. });
  336. }
  337. })
  338. }else{
  339. this.$api.doRequest('post', '/workflow/api/handle', {
  340. taskId: this.tradeList.taskId,
  341. approved: true,
  342. auditMind: this.auditMind ? this.auditMind : "审核通过",
  343. needReapply: false,
  344. }).then(res => {
  345. if (res.data.code == 200) {
  346. uni.showToast({
  347. title: "审核成功",
  348. icon: 'none',
  349. duration: 2000
  350. })
  351. uni.navigateBack()
  352. }
  353. }).catch(res => {
  354. if (res.errmsg) {
  355. uni.showToast({
  356. title: res.errmsg,
  357. icon: 'none',
  358. duration: 2000
  359. })
  360. }
  361. });
  362. }
  363. }
  364. },
  365. auditInfo() {
  366. uni.navigateTo({
  367. url: '/pages/task/audit_info?id=' + this.tradeList.id + "&workflowId=" + this.tradeList.workflowId
  368. })
  369. },
  370. filterFileType(index, lists) {
  371. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif' &&
  372. lists[index].fileType != 'jpeg') {
  373. lists.splice(index, 1);
  374. // 当前文件不支持
  375. uni.showModal({
  376. title: '暂不支持当前图片类型',
  377. showCancel: false
  378. });
  379. } else {
  380. this.isAdd = false;
  381. }
  382. },
  383. }
  384. }
  385. </script>
  386. <style scoped lang="scss">
  387. .container {
  388. padding: 6rpx 12rpx 250rpx 12rpx;
  389. }
  390. .title {
  391. font-size: 34rpx;
  392. font-weight: 600;
  393. margin-top: 20rpx;
  394. line-height: 90rpx;
  395. border-bottom: 2rpx solid #EEEEEE;
  396. }
  397. .form_item {
  398. background: #fff;
  399. margin: 10px;
  400. border-radius: 10px;
  401. padding: 10rpx 30rpx;
  402. // width: 100%;
  403. }
  404. .u-form-item {
  405. padding: 12rpx 0 !important;
  406. }
  407. .auditInfo {
  408. width: 100%;
  409. .title1 {
  410. width: 99%;
  411. font-size: 34rpx;
  412. font-weight: 600;
  413. // margin-top: 20rpx;
  414. line-height: 70rpx;
  415. }
  416. }
  417. .bottom-btn {
  418. width: 100%;
  419. position: fixed;
  420. bottom: 0;
  421. display: flex;
  422. z-index: 2;
  423. left: 0;
  424. background-color: #f8f8f8;
  425. flex-direction: column;
  426. .btn1,
  427. .btn2 {
  428. width: 100%;
  429. margin-bottom: 26rpx;
  430. border-radius: 90rpx;
  431. }
  432. .btn1 {
  433. background: white;
  434. color: #00C265;
  435. }
  436. }
  437. .shade {
  438. position: fixed;
  439. top: 0;
  440. left: 0;
  441. height: 100%;
  442. width: 100%;
  443. background: rgba(0, 0, 0, 0.4);
  444. z-index: 3;
  445. .wrap {
  446. position: absolute;
  447. left: 0;
  448. top: 0;
  449. right: 0;
  450. bottom: 0;
  451. margin: auto;
  452. background: #fff;
  453. width: calc(100% - 198rpx);
  454. height: 700rpx;
  455. border-radius: 20rpx;
  456. .alert-top {
  457. padding: 33rpx;
  458. display: flex;
  459. justify-content: center;
  460. align-items: center;
  461. position: relative;
  462. }
  463. .titleAudit {
  464. font-size: 32rpx;
  465. font-weight: 600;
  466. color: #333333;
  467. }
  468. .close {
  469. position: absolute;
  470. right: 33rpx;
  471. }
  472. }
  473. }
  474. .cancel,
  475. .confirm {
  476. position: absolute;
  477. display: inline-block;
  478. width: 50%;
  479. text-align: center;
  480. bottom: 0;
  481. padding: 10px;
  482. border-top: 1px solid #eee;
  483. font-size: 34rpx;
  484. }
  485. .cancel {
  486. left: 0;
  487. border-right: 1px solid #eee;
  488. color: #AFB3BF;
  489. }
  490. .confirm {
  491. right: 0;
  492. color: #22C572;
  493. }
  494. .u-textarea-style {
  495. margin: 20rpx;
  496. background: #F9F9FA;
  497. border-radius: 10px;
  498. border: 1px solid #EEEEEE;
  499. padding: 10rpx 20rpx;
  500. position: relative;
  501. .right-bottom {
  502. position: absolute;
  503. right: 20rpx;
  504. bottom: 20rpx;
  505. color: #AFB3BF;
  506. }
  507. }
  508. .row {
  509. display: flex;
  510. justify-content: space-between;
  511. border-bottom: 1px solid #eee;
  512. .right {
  513. display: flex;
  514. // .uni-input-input{
  515. // width: 30%;
  516. // font-size: 28rpx;
  517. // }
  518. .del {
  519. width: 46rpx;
  520. height: 46rpx;
  521. border-radius: 25rpx;
  522. background-color: #F1F4FB;
  523. text-align: center;
  524. line-height: 46rpx;
  525. font-weight: 600;
  526. margin-top: 8rpx;
  527. }
  528. .yuan {
  529. line-height: 70rpx;
  530. margin: 0 16rpx;
  531. }
  532. }
  533. }
  534. .count {
  535. width: 100%;
  536. margin: 20rpx 0;
  537. .add {
  538. width: 162rpx;
  539. height: 64rpx;
  540. background: #22C572;
  541. border-radius: 10rpx;
  542. color: #FFFFFF;
  543. line-height: 64rpx;
  544. text-align: center;
  545. font-size: 28rpx;
  546. }
  547. .count_item {
  548. width: 70%;
  549. justify-content: flex-end;
  550. font-size: 30rpx;
  551. line-height: 70rpx;
  552. .number {
  553. font-size: 32rpx;
  554. font-weight: 600;
  555. margin-left: 20rpx;
  556. }
  557. }
  558. }
  559. /deep/.u-list-item {
  560. margin: 20rpx 4rpx !important;
  561. }
  562. </style>