purchase_settlement_approval.vue 8.4 KB

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