freight_settlement_approval.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view class="container">
  3. <view class="topInfo">
  4. <view class="topInfo-item">
  5. <view class="flex info">
  6. <view class="logo">
  7. <image src="../../../static/img/reject.png" mode="" v-if="list[0].approveStatus == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="list[0].approveStatus == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="list[0].approveStatus == '待决策人审核'|| list[0].approveStatus == '待财务审核'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{list[0].approveStatus}}</view>
  15. </view>
  16. <view class="infoData">{{list[0].updateDate}}</view>
  17. </view>
  18. </view>
  19. <view class="content">
  20. <view class="top">
  21. <view>合同编号</view>
  22. <view>{{list[0].contractNo}}</view>
  23. </view>
  24. <view class="car-container">
  25. <view v-for="(item,index) in list" style="border-bottom: 2rpx solid #EEEEEE;margin-top: 30rpx;">
  26. <view class="car-num title">{{item.carNo}} ({{item.tranCarNo}})</view>
  27. <view class="car-type-item">
  28. <view class="left">装</view>
  29. <view class="textInfo">{{item.loadingWeight}}吨</view>
  30. </view>
  31. <view class="car-type-item">
  32. <view class="center">卸</view>
  33. <view class="textInfo">{{item.unloadingWeight}}吨</view>
  34. </view>
  35. <view class="car-type-item">
  36. <view class="right">结</view>
  37. <view class="textInfo">{{item.settlementWeight}}吨</view>
  38. </view>
  39. <view class="car-type-item">
  40. <view class="left">运</view>
  41. <view class="textInfo">{{item.transportPrice}}元/吨</view>
  42. </view>
  43. <view class="car-type-item">
  44. <view class="center">扣</view>
  45. <view class="textInfo">{{item.deductionAmount}}元</view>
  46. </view>
  47. <view class="car-type-item">
  48. <view class="right">付</view>
  49. <view class="textInfo">{{item.amountIngPayable}}元</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <u-popup v-model="show1" mode="center">
  55. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  56. <view class="rejectText">审核意见(驳回)</view>
  57. <u-input v-model="rejectInfo" type="textarea" :border="border" class="rejectInfoCss"
  58. placeholder="请输入审核意见" />
  59. <view class="flex">
  60. <u-button @click="show1 = false" type="error" hover-class='none'>取消</u-button>
  61. <u-button @click="rejectSubmit()" type="success">确定</u-button>
  62. </view>
  63. </view>
  64. </u-popup>
  65. <u-popup v-model="show2" mode="center">
  66. <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
  67. <view class="rejectText">审核意见(通过)</view>
  68. <u-input v-model="rejectInfo1" type="textarea" :border="border" :height="height" :auto-height="autoHeight" class="rejectInfoCss"
  69. placeholder="请输入审核意见" />
  70. <view class="flex">
  71. <u-button @click="show2 = false" type="error" hover-class='none'>取消</u-button>
  72. <u-button @click="passSubmit()" type="success">确定</u-button>
  73. </view>
  74. </view>
  75. </u-popup>
  76. <u-toast ref="uToast" />
  77. <view style='padding:10px;' class='flex bottom-btn'>
  78. <u-button @click="show1 = true" type="error" class="btn1" hover-class='none'>驳回</u-button>
  79. <u-button @click="show2 = true" type="success" class="btn2">通过</u-button>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. currentPage: 1,
  88. pageSize: 10,
  89. list: [
  90. {
  91. approveStatus:"",
  92. }
  93. ],
  94. rejectInfo:"",
  95. rejectInfo1:"",
  96. show1:false,
  97. show2:false,
  98. height:200,
  99. autoHeight: true,
  100. border: false,
  101. }
  102. },
  103. onLoad() {
  104. this.getList()
  105. },
  106. methods: {
  107. getList() {
  108. this.$api.doRequest('get', '/tranSettlementReport/selectTranSettlementReport', {
  109. compId: "2710b21efc1e4393930c5dc800010dc4",
  110. currentPage: this.currentPage,
  111. pageSize: this.pageSize,
  112. contractNo: "全部合同"
  113. }).then(res => {
  114. if (res.data.code == 200) {
  115. this.list = res.data.data.records
  116. }
  117. })
  118. },
  119. // 驳回
  120. rejectSubmit() {
  121. var that = this
  122. if (this.list.length == 0) {
  123. this.$api.msg('没有要审核的条目!')
  124. } else {
  125. if (!this.rejectInfo) {
  126. this.$api.msg('驳回原因不能为空!')
  127. }else{
  128. this.show1 = false
  129. uni.showModal({
  130. content: "是否确定驳回?",
  131. showCancel: true,
  132. confirmText: '确定',
  133. success: function(res) {
  134. if (res.confirm) {
  135. that.audit(that.list[0], 0, false, true, '已驳回')
  136. }
  137. }
  138. })
  139. }
  140. }
  141. },
  142. //通过
  143. passSubmit() {
  144. var that = this
  145. if (this.list.length == 0) {
  146. this.$api.msg('没有要审核的条目!')
  147. } else {
  148. if (!this.rejectInfo1) {
  149. this.$api.msg('审核意见不能为空!')
  150. }else{
  151. this.show2 = false
  152. uni.showModal({
  153. content: "是否确定通过?",
  154. showCancel: true,
  155. confirmText: '确定',
  156. success: function(res) {
  157. if (res.confirm) {
  158. that.audit(that.list[0], 0, true, 2)
  159. }
  160. }
  161. })
  162. }
  163. }
  164. },
  165. //审核方法
  166. audit(item, index, status, status2, reason) {
  167. if (index < this.list.length) {
  168. this.$api.doRequest('post', '/workflow/api/handle', {
  169. taskId: item.taskId,
  170. approved: status,
  171. auditMind: reason != undefined ? this.rejectInfo : this.rejectInfo1,
  172. needReapply: status2 != undefined ? true : false,
  173. }).then(res => {
  174. this.audit(this.list[index + 1], index + 1, status)
  175. })
  176. } else {
  177. if (status == true) {
  178. this.$api.msg('通过成功')
  179. setTimeout(function() {
  180. uni.navigateBack()
  181. }, 1000);
  182. } else if (status == false) {
  183. this.$api.msg('驳回成功')
  184. setTimeout(function() {
  185. uni.navigateBack()
  186. }, 1000);
  187. }
  188. }
  189. },
  190. }
  191. }
  192. </script>
  193. <style scoped lang="scss">
  194. .container {
  195. margin: 10rpx;
  196. padding: 20rpx 20rpx 230rpx 20rpx;
  197. }
  198. .content {
  199. .top {
  200. display: flex;
  201. justify-content: space-between;
  202. border-radius: 20rpx;
  203. background: white;
  204. padding: 30rpx 20rpx;
  205. font-size: 36rpx;
  206. margin-top: 30rpx;
  207. }
  208. .title {
  209. font-size: 28rpx;
  210. font-weight: 600;
  211. color: #333333;
  212. text-align: left;
  213. margin-bottom: 30rpx;
  214. }
  215. .car-container{
  216. padding: 10rpx 20rpx;
  217. border-radius: 20rpx;
  218. background: white;
  219. margin:30rpx 0 ;
  220. // border-bottom: 2rpx solid #EEEEEE;
  221. }
  222. .car-type-item {
  223. display: inline-flex;
  224. // justify-content: center;
  225. width: 33.33%;
  226. margin-bottom: 40rpx ;
  227. }
  228. .title{
  229. font-size: 36rpx;
  230. }
  231. }
  232. .bottom-btn {
  233. width: 100%;
  234. position: fixed;
  235. bottom:0;
  236. display: flex;
  237. z-index: 2;
  238. left: 0;
  239. background-color: #f8f8f8;
  240. flex-direction: column;
  241. .btn1,.btn2{
  242. width: 100%;
  243. margin-bottom: 26rpx;
  244. border-radius: 90rpx;
  245. }
  246. .btn1{
  247. background: white;
  248. color: #00C265;
  249. }
  250. }
  251. .submit {
  252. width: 40%;
  253. background: #22C572;
  254. border-radius: 10rpx;
  255. }
  256. .left{
  257. background: #FEECE6;
  258. color: #FE6430;
  259. }
  260. .center{
  261. background: #EBEEFA;
  262. color: #5C76DF;
  263. }
  264. .right{
  265. background: #E9F8F0 ;
  266. color: #22C572 ;
  267. }
  268. .left,.center,.right{
  269. width: 50rpx;
  270. height: 50rpx;
  271. text-align: center;
  272. line-height: 50rpx;
  273. border-radius: 10rpx;
  274. }
  275. .textInfo{
  276. margin: 6rpx 0 0 10rpx;
  277. }
  278. .topInfo {
  279. height: 210rpx;
  280. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  281. padding: 30rpx;
  282. .topInfo-item {
  283. height: 158rpx;
  284. background-color: #FFFFFF;
  285. border-radius: 20rpx;
  286. padding: 40rpx;
  287. .logo {
  288. width: 40rpx;
  289. height: 40rpx;
  290. margin-top: 8rpx;
  291. }
  292. .infoText {
  293. font-size: 36rpx;
  294. font-weight: 600;
  295. margin-left: 20rpx;
  296. }
  297. .infoData {
  298. color: #878C9C;
  299. font-size: 26rpx;
  300. margin-top: 10rpx;
  301. }
  302. }
  303. }
  304. .rejectInfoCss {
  305. border: 1px solid #ccc;
  306. border-radius: 10rpx;
  307. background-color: #F9F9FA;
  308. // height: 100px;
  309. overflow-y: auto;
  310. margin: 30rpx;
  311. }
  312. .rejectText {
  313. text-align: center;
  314. }
  315. /deep/.u-input__textarea{
  316. height: 300rpx!important;
  317. }
  318. </style>