purchase_settlement_approval.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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].status == '已驳回'"
  8. style="height: 40rpx;"></image><!-- 驳回 -->
  9. <image src="../../../static/img/tongguo.png" mode="" v-if="list[0].status == '已通过'"
  10. style="height: 40rpx;"></image><!-- 通过 -->
  11. <image src="../../../static/img/daishenhe.png" mode="" v-if="list[0].status == '审核中'||list[0].status == '未审核'"
  12. style="height: 40rpx;"></image><!-- 待审核 -->
  13. </view>
  14. <view class="infoText">{{list[0].status}}</view>
  15. </view>
  16. <view class="infoData">{{list[0].warehousingDate}}</view>
  17. </view>
  18. </view>
  19. <view class="content">
  20. <view class="top content-item">
  21. <view>{{contractNo}}</view>
  22. <view>元/吨</view>
  23. </view>
  24. <view class="content-item">
  25. <view class="car-container" v-for="(item,index) in list">
  26. <view class="car-num title">{{item.carNo}}</view>
  27. <view class="row">
  28. <view class="left car-type-item">净重</view>
  29. <view class="right weightInfoCss">{{item.netWeight}} 吨</view>
  30. </view>
  31. <view class="row">
  32. <view class="left car-type-item">结重</view>
  33. <view class="right weightInfoCss">{{item.settlementWeight}} 吨</view>
  34. </view>
  35. <view class="row">
  36. <view class="left car-type-item">扣款</view>
  37. <view class="right weightInfoCss">¥{{item.deductionAmountchange?item.deductionAmountchange:"0"}}/吨</view>
  38. </view>
  39. <view class="row ">
  40. <view class="left money">应付</view>
  41. <view class="right moneyInfo">¥{{item.amountIngPayable}}元</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <u-toast ref="uToast" />
  47. <!-- <view class="bottom-btn">
  48. <u-button type="primary" class="submit" hover-class="none" @click="rejectSubmit()">驳回</u-button>
  49. <u-button type="primary" class="submit" hover-class="none" @click="passSubmit()">通过</u-button>
  50. </view> -->
  51. <view style='padding:10px;' class='flex bottom-btn'>
  52. <u-button @click='rejectSubmit' type="error" class="btn1" hover-class='none'>驳回</u-button>
  53. <u-button @click='passSubmit' type="success" class="btn2">通过</u-button>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. id: "",
  62. currentPage: 1,
  63. pageSize: 10,
  64. list: [],
  65. contractNo: "",
  66. }
  67. },
  68. onLoad(options) {
  69. this.id = options.id
  70. this.getList()
  71. },
  72. methods: {
  73. getList(id) {
  74. this.$api.doRequest('get', '/stockPurchaseReceiptReport/getInfo', {
  75. id: this.id
  76. }).then(res => {
  77. this.contractNo = res.data.data.contractNo
  78. if (res.data.code == 200) {
  79. this.$api.doRequest('get', '/stockPurchaseReceiptReport/selectPurchaseOrder', {
  80. compId: "2710b21efc1e4393930c5dc800010dc4",
  81. currentPage: this.currentPage,
  82. pageSize: this.pageSize,
  83. contractNo: this.contractNo,
  84. }).then(res => {
  85. if (res.data.code == 200) {
  86. this.list = res.data.data.records
  87. }
  88. })
  89. }
  90. })
  91. },
  92. //驳回
  93. rejectSubmit() {
  94. var that = this
  95. if (this.list.length == 0) {
  96. that.$api.msg('没有要审核的条目!')
  97. } else {
  98. // uni.showModal({
  99. // content: "是否确定驳回?",
  100. // success(res) {
  101. // if(res)
  102. // this.audit(this.list[0], 0, false, true, '已驳回')
  103. // }
  104. // })
  105. uni.showModal({
  106. content: "是否确定驳回?",
  107. showCancel: true,
  108. confirmText: '确定',
  109. success: function(res) {
  110. if (res.confirm) {
  111. that.audit(that.list[0], 0, false, true, '已驳回')
  112. }
  113. }
  114. })
  115. }
  116. },
  117. //通过
  118. passSubmit() {
  119. var that = this
  120. if (this.list.length == 0) {
  121. that.$api.msg('没有要审核的条目!')
  122. } else {
  123. // uni.showModal({
  124. // content: "是否确定通过?",
  125. // success(res) {
  126. // if(res)
  127. // this.audit(this.list[0], 0, true, 2)
  128. // }
  129. // })
  130. uni.showModal({
  131. content: "是否确定通过?",
  132. showCancel: true,
  133. confirmText: '确定',
  134. success: function(res) {
  135. if (res.confirm) {
  136. that.audit(that.list[0], 0, true, 2)
  137. }
  138. }
  139. })
  140. }
  141. },
  142. //审核方法
  143. audit(item, index, status, status2, reason) {
  144. if (index < this.list.length) {
  145. this.$api.doRequest('post', '/workflow/api/handle', {
  146. taskId: item.taskId,
  147. approved: status,
  148. auditMind: reason != undefined ? '已驳回' : '34',
  149. needReapply: status2 != undefined ? true : false,
  150. }).then(res => {
  151. this.audit(this.list[index + 1], index + 1, status)
  152. })
  153. } else {
  154. if (status == true) {
  155. that.$api.msg('通过成功')
  156. this.getList()
  157. } else if (status == false) {
  158. that.$api.msg('驳回成功')
  159. this.getList()
  160. }
  161. }
  162. },
  163. }
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .container {
  168. padding: 20rpx 20rpx 250rpx 20rpx;
  169. }
  170. .content {
  171. margin-top: 30rpx;
  172. .top {
  173. display: flex;
  174. justify-content: space-between;
  175. }
  176. .content-item {
  177. border-radius: 20rpx;
  178. background: white;
  179. padding: 40rpx 20rpx;
  180. margin-bottom: 30rpx;
  181. }
  182. .title {
  183. font-size: 32rpx;
  184. font-weight: 600;
  185. color: #333333;
  186. text-align: left;
  187. margin: 20rpx 0;
  188. }
  189. .car-container{
  190. border-bottom: 2rpx solid #EEEEEE;
  191. }
  192. .car-type-item {
  193. font-size: 28rpx;
  194. margin: 20rpx 0;
  195. color: #878C9C;
  196. }
  197. .weightInfoCss {
  198. font-size: 28rpx;
  199. color: #333333;
  200. font-weight: 500;
  201. }
  202. .row {
  203. display: flex;
  204. justify-content: space-between;
  205. // .right,
  206. // input {
  207. // font-size: 28rpx;
  208. // // color: #333333;
  209. // }
  210. }
  211. .money {
  212. font-size: 32rpx;
  213. font-weight: 500;
  214. margin-bottom: 30rpx ;
  215. }
  216. .moneyInfo {
  217. color: #22C572;
  218. font-size: 32rpx;
  219. }
  220. }
  221. .bottom-btn {
  222. width: 100%;
  223. position: fixed;
  224. bottom:0;
  225. display: flex;
  226. z-index: 2;
  227. left: 0;
  228. background-color: #f8f8f8;
  229. flex-direction: column;
  230. .btn1,.btn2{
  231. width: 100%;
  232. margin-bottom: 26rpx;
  233. border-radius: 90rpx;
  234. }
  235. .btn1{
  236. background: white;
  237. color: #00C265;
  238. }
  239. }
  240. .topInfo {
  241. height: 210rpx;
  242. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  243. padding: 30rpx;
  244. .topInfo-item {
  245. height: 150rpx;
  246. background-color: #FFFFFF;
  247. border-radius: 20rpx;
  248. padding: 40rpx;
  249. .logo {
  250. width: 40rpx;
  251. height: 40rpx;
  252. margin-top: 8rpx;
  253. }
  254. .infoText {
  255. font-size: 36rpx;
  256. font-weight: 600;
  257. margin-left: 20rpx;
  258. }
  259. .infoData {
  260. color: #878C9C;
  261. font-size: 26rpx;
  262. margin-top: 10rpx;
  263. }
  264. }
  265. }
  266. </style>