purchase_settlement_approval.vue 9.4 KB

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