purchase_settlement_approval.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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. uni.showLoading({
  198. title: "审核中"
  199. })
  200. if (index < this.list.length) {
  201. this.$api.doRequest('post', '/workflow/api/handle', {
  202. taskId: item.taskId,
  203. approved: status,
  204. auditMind: reason != undefined ? this.rejectInfo : this.rejectInfo1,
  205. needReapply: status2 != undefined ? true : false,
  206. }).then(res => {
  207. this.audit(this.list[index + 1], index + 1, status)
  208. })
  209. } else {
  210. if (status == true) {
  211. that.$api.msg('通过成功')
  212. } else if (status == false) {
  213. that.$api.msg('驳回成功')
  214. }
  215. setTimeout(function() {
  216. if (that.everyCheck) {
  217. helper.setAudit(that.list)
  218. } else {
  219. uni.navigateBack()
  220. }
  221. uni.hideLoading()
  222. }, 1000);
  223. }
  224. },
  225. }
  226. }
  227. </script>
  228. <style scoped lang="scss">
  229. .container {
  230. padding: 20rpx 20rpx 250rpx 20rpx;
  231. }
  232. .content {
  233. margin-top: 30rpx;
  234. .top {
  235. display: flex;
  236. justify-content: space-between;
  237. margin-top: 10rpx;
  238. margin-bottom: 30rpx;
  239. }
  240. .top1 {
  241. display: flex;
  242. justify-content: space-between;
  243. margin-bottom: 20rpx;
  244. font-size: 32rpx;
  245. }
  246. .content-item {
  247. border-radius: 20rpx;
  248. background: white;
  249. padding: 40rpx 20rpx;
  250. margin-bottom: 30rpx;
  251. }
  252. .title {
  253. font-size: 32rpx;
  254. font-weight: 600;
  255. color: #333333;
  256. text-align: left;
  257. margin: 20rpx 0;
  258. }
  259. .car-container {
  260. border-bottom: 2rpx solid #EEEEEE;
  261. }
  262. .car-type-item {
  263. font-size: 28rpx;
  264. margin: 20rpx 0;
  265. color: #878C9C;
  266. }
  267. .weightInfoCss {
  268. font-size: 28rpx;
  269. color: #333333;
  270. font-weight: 500;
  271. }
  272. .row {
  273. display: flex;
  274. justify-content: space-between;
  275. // .right,
  276. // input {
  277. // font-size: 28rpx;
  278. // // color: #333333;
  279. // }
  280. }
  281. .money {
  282. font-size: 32rpx;
  283. font-weight: 500;
  284. margin-bottom: 30rpx;
  285. }
  286. .moneyInfo {
  287. color: #22C572;
  288. font-size: 32rpx;
  289. }
  290. }
  291. .bottom-btn {
  292. width: 100%;
  293. position: fixed;
  294. bottom: 0;
  295. display: flex;
  296. z-index: 2;
  297. left: 0;
  298. background-color: #f8f8f8;
  299. flex-direction: column;
  300. .btn1,
  301. .btn2 {
  302. width: 100%;
  303. margin-bottom: 26rpx;
  304. border-radius: 90rpx;
  305. }
  306. .btn1 {
  307. background: white;
  308. color: #00C265;
  309. }
  310. }
  311. .topInfo {
  312. height: 210rpx;
  313. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  314. padding: 30rpx;
  315. .topInfo-item {
  316. height: 150rpx;
  317. background-color: #FFFFFF;
  318. border-radius: 20rpx;
  319. padding: 40rpx;
  320. .logo {
  321. width: 40rpx;
  322. height: 40rpx;
  323. margin-top: 8rpx;
  324. }
  325. .infoText {
  326. font-size: 36rpx;
  327. font-weight: 600;
  328. margin-left: 20rpx;
  329. }
  330. .infoData {
  331. color: #878C9C;
  332. font-size: 26rpx;
  333. margin-top: 10rpx;
  334. }
  335. }
  336. }
  337. .shade {
  338. position: fixed;
  339. top: 0;
  340. left: 0;
  341. height: 100%;
  342. width: 100%;
  343. background: rgba(0, 0, 0, 0.4);
  344. z-index: 3;
  345. .wrap {
  346. position: absolute;
  347. left: 0;
  348. top: 0;
  349. right: 0;
  350. bottom: 0;
  351. margin: auto;
  352. background: #fff;
  353. width: calc(100% - 198rpx);
  354. height: 700rpx;
  355. border-radius: 20rpx;
  356. .alert-top {
  357. padding: 33rpx;
  358. display: flex;
  359. justify-content: center;
  360. align-items: center;
  361. position: relative;
  362. }
  363. .title {
  364. font-size: 32rpx;
  365. font-weight: 600;
  366. color: #333333;
  367. }
  368. .close {
  369. position: absolute;
  370. right: 33rpx;
  371. }
  372. }
  373. }
  374. .cancel,
  375. .confirm {
  376. position: absolute;
  377. display: inline-block;
  378. width: 50%;
  379. text-align: center;
  380. bottom: 0;
  381. padding: 10px;
  382. border-top: 1px solid #eee;
  383. font-size: 34rpx;
  384. }
  385. .cancel {
  386. left: 0;
  387. border-right: 1px solid #eee;
  388. color: #AFB3BF;
  389. }
  390. .confirm {
  391. right: 0;
  392. color: #22C572;
  393. }
  394. .u-textarea-style {
  395. margin: 20rpx;
  396. background: #F9F9FA;
  397. border-radius: 10px;
  398. border: 1px solid #EEEEEE;
  399. padding: 10rpx 20rpx;
  400. position: relative;
  401. .right-bottom {
  402. position: absolute;
  403. right: 20rpx;
  404. bottom: 20rpx;
  405. color: #AFB3BF;
  406. }
  407. }
  408. /deep/.u-input__textarea {
  409. height: 300rpx !important;
  410. }
  411. </style>