freight_settlement_approval.vue 8.7 KB

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