purchase_settlement_approval.vue 8.1 KB

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