purchase_settlement_approval.vue 9.1 KB

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