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