purchase_settlement_approval.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. {
  66. status:"",
  67. }
  68. ],
  69. contractNo: "",
  70. }
  71. },
  72. onLoad(options) {
  73. this.id = options.id
  74. this.getList()
  75. },
  76. methods: {
  77. getList(id) {
  78. this.$api.doRequest('get', '/stockPurchaseReceiptReport/getInfo', {
  79. id: this.id
  80. }).then(res => {
  81. this.contractNo = res.data.data.contractNo
  82. if (res.data.code == 200) {
  83. this.$api.doRequest('get', '/stockPurchaseReceiptReport/selectPurchaseOrder', {
  84. compId: "2710b21efc1e4393930c5dc800010dc4",
  85. currentPage: this.currentPage,
  86. pageSize: this.pageSize,
  87. contractNo: this.contractNo,
  88. }).then(res => {
  89. if (res.data.code == 200) {
  90. this.list = res.data.data.records
  91. }
  92. })
  93. }
  94. })
  95. },
  96. //驳回
  97. rejectSubmit() {
  98. var that = this
  99. if (this.list.length == 0) {
  100. that.$api.msg('没有要审核的条目!')
  101. } else {
  102. // uni.showModal({
  103. // content: "是否确定驳回?",
  104. // success(res) {
  105. // if(res)
  106. // this.audit(this.list[0], 0, false, true, '已驳回')
  107. // }
  108. // })
  109. uni.showModal({
  110. content: "是否确定驳回?",
  111. showCancel: true,
  112. confirmText: '确定',
  113. success: function(res) {
  114. if (res.confirm) {
  115. that.audit(that.list[0], 0, false, true, '已驳回')
  116. }
  117. }
  118. })
  119. }
  120. },
  121. //通过
  122. passSubmit() {
  123. var that = this
  124. if (this.list.length == 0) {
  125. that.$api.msg('没有要审核的条目!')
  126. } else {
  127. // uni.showModal({
  128. // content: "是否确定通过?",
  129. // success(res) {
  130. // if(res)
  131. // this.audit(this.list[0], 0, true, 2)
  132. // }
  133. // })
  134. uni.showModal({
  135. content: "是否确定通过?",
  136. showCancel: true,
  137. confirmText: '确定',
  138. success: function(res) {
  139. if (res.confirm) {
  140. that.audit(that.list[0], 0, true, 2)
  141. }
  142. }
  143. })
  144. }
  145. },
  146. //审核方法
  147. audit(item, index, status, status2, reason) {
  148. if (index < this.list.length) {
  149. this.$api.doRequest('post', '/workflow/api/handle', {
  150. taskId: item.taskId,
  151. approved: status,
  152. auditMind: reason != undefined ? '已驳回' : '34',
  153. needReapply: status2 != undefined ? true : false,
  154. }).then(res => {
  155. this.audit(this.list[index + 1], index + 1, status)
  156. })
  157. } else {
  158. if (status == true) {
  159. that.$api.msg('通过成功')
  160. this.getList()
  161. } else if (status == false) {
  162. that.$api.msg('驳回成功')
  163. this.getList()
  164. }
  165. }
  166. },
  167. }
  168. }
  169. </script>
  170. <style scoped lang="scss">
  171. .container {
  172. padding: 20rpx 20rpx 250rpx 20rpx;
  173. }
  174. .content {
  175. margin-top: 30rpx;
  176. .top {
  177. display: flex;
  178. justify-content: space-between;
  179. }
  180. .content-item {
  181. border-radius: 20rpx;
  182. background: white;
  183. padding: 40rpx 20rpx;
  184. margin-bottom: 30rpx;
  185. }
  186. .title {
  187. font-size: 32rpx;
  188. font-weight: 600;
  189. color: #333333;
  190. text-align: left;
  191. margin: 20rpx 0;
  192. }
  193. .car-container{
  194. border-bottom: 2rpx solid #EEEEEE;
  195. }
  196. .car-type-item {
  197. font-size: 28rpx;
  198. margin: 20rpx 0;
  199. color: #878C9C;
  200. }
  201. .weightInfoCss {
  202. font-size: 28rpx;
  203. color: #333333;
  204. font-weight: 500;
  205. }
  206. .row {
  207. display: flex;
  208. justify-content: space-between;
  209. // .right,
  210. // input {
  211. // font-size: 28rpx;
  212. // // color: #333333;
  213. // }
  214. }
  215. .money {
  216. font-size: 32rpx;
  217. font-weight: 500;
  218. margin-bottom: 30rpx ;
  219. }
  220. .moneyInfo {
  221. color: #22C572;
  222. font-size: 32rpx;
  223. }
  224. }
  225. .bottom-btn {
  226. width: 100%;
  227. position: fixed;
  228. bottom:0;
  229. display: flex;
  230. z-index: 2;
  231. left: 0;
  232. background-color: #f8f8f8;
  233. flex-direction: column;
  234. .btn1,.btn2{
  235. width: 100%;
  236. margin-bottom: 26rpx;
  237. border-radius: 90rpx;
  238. }
  239. .btn1{
  240. background: white;
  241. color: #00C265;
  242. }
  243. }
  244. .topInfo {
  245. height: 210rpx;
  246. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  247. padding: 30rpx;
  248. .topInfo-item {
  249. height: 150rpx;
  250. background-color: #FFFFFF;
  251. border-radius: 20rpx;
  252. padding: 40rpx;
  253. .logo {
  254. width: 40rpx;
  255. height: 40rpx;
  256. margin-top: 8rpx;
  257. }
  258. .infoText {
  259. font-size: 36rpx;
  260. font-weight: 600;
  261. margin-left: 20rpx;
  262. }
  263. .infoData {
  264. color: #878C9C;
  265. font-size: 26rpx;
  266. margin-top: 10rpx;
  267. }
  268. }
  269. }
  270. </style>