purchase_settlement_approval.vue 5.3 KB

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