purchase_settlement_approval.vue 9.1 KB

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