tradeServices_audit.vue 16 KB

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