purchase_settlement_approval.vue 7.9 KB

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