acquisition_information_approval.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="wrap">
  3. <view class='content1'>
  4. <view class='row'>
  5. <view class="left">鲅鱼圈库</view>
  6. <!-- <view class="right">鲅鱼圈库</view> -->
  7. </view>
  8. <view class='row '>
  9. <textarea placeholder="请输入仓库信息" class="textarea" maxlength="2000" v-model="textareaValue"></textarea>
  10. <view class="textarea-bottom">{{textareaValue?textareaValue.length:'0'}}/2000字</view>
  11. </view>
  12. <view class='row content-item'>
  13. <!-- <u-checkbox activeColor="#19be6b" v-model="value" @change="checkBoxChange">显示在易粮易运收购信息中</u-checkbox> -->
  14. 显示在易粮易运收购信息中
  15. <view class="right">
  16. <u-switch v-model="checked" active-color="#22C572" inactive-color="#eee" size='40' @change="checkBoxChange" disabled="disabled"></u-switch>
  17. </view>
  18. </view>
  19. </view>
  20. <view v-if='show' class="shade">
  21. <view class="wrap">
  22. <view class="alert-top">
  23. <view class="title">
  24. {{title}}
  25. </view>
  26. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  27. </view>
  28. <view class="u-textarea-style">
  29. <view class="right-bottom">
  30. {{auditMind.length}}/100个字
  31. </view>
  32. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  33. maxlength="100" />
  34. </view>
  35. <view @click='close()' class="cancel">取消</view>
  36. <view @click='passSubmit()' class="confirm">确定</view>
  37. </view>
  38. </view>
  39. <u-toast ref="uToast" />
  40. <view style='padding:10px;' class='flex bottom-btn'>
  41. <!-- getRoles("acquisitionQuality.initial") -->
  42. <u-button v-if='isSHowBtn' @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
  43. <u-button v-if='isSHowBtn' @click='pass' type="success" class="btn2">通过</u-button>
  44. </view>
  45. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  46. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='登录提示'
  47. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. mapState
  53. } from 'vuex';
  54. export default {
  55. components: {
  56. },
  57. data() {
  58. return {
  59. isSHowBtn: true,
  60. isShowAlert: false,
  61. content: '当前登入信息验证失败,是否重新登录?',
  62. textareaValue: '',
  63. value: '',
  64. show:false,
  65. title:"",
  66. auditMind:"", //审核意见
  67. checked: false,
  68. }
  69. },
  70. onLoad() {
  71. },
  72. computed: {
  73. ...mapState(['hasLogin', 'userInfo']),
  74. },
  75. onShow() {
  76. this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
  77. console.log("checkSession", res)
  78. if (res.data.data == "INVALID") {
  79. this.isShowAlert = true;
  80. // uni.showModal({
  81. // title: '登录提示',
  82. // content: '当前登入信息验证失败,是否重新登录?',
  83. // showCancel: true,
  84. // confirmText: '登录',
  85. // success: (e) => {
  86. // if (e.confirm) {
  87. // uni.navigateTo({
  88. // url: '/pages/public/login'
  89. // })
  90. // }
  91. // },
  92. // fail: () => {},
  93. // complete: () => {}
  94. // })
  95. }
  96. })
  97. console.log("hasLogin", this.hasLogin)
  98. },
  99. methods: {
  100. pass(){
  101. this.title = "审核意见(通过)"
  102. this.show = true
  103. },
  104. reject(){
  105. this.title = "驳回原因(驳回)"
  106. this.show = true
  107. },
  108. close(){
  109. this.show = false
  110. },
  111. passSubmit(item){
  112. if(this.title == "审核意见(通过)"){
  113. this.$api.doRequest('post', '/workflow/api/handle', {
  114. taskId: item.taskId,
  115. approved: true,
  116. auditMind: this.auditMind ? this.auditMind : "34",
  117. needReapply:true
  118. }).then(res => {
  119. if (res.data.code == 200) {
  120. this.$api.msg('通过成功')
  121. }
  122. })
  123. }else if(this.title == "驳回原因(驳回)"){
  124. if(!this.auditMind){
  125. this.$api.msg('驳回原因不能为空!')
  126. return
  127. }
  128. this.$api.doRequest('post', '/workflow/api/handle', {
  129. taskId: item.taskId,
  130. approved: false,
  131. auditMind: this.auditMind ? this.auditMind : "34",
  132. needReapply:true
  133. }).then(res => {
  134. if (res.data.code == 200) {
  135. this.$api.msg('驳回成功')
  136. }
  137. })
  138. }
  139. },
  140. /**
  141. * 统一跳转接口,拦截未登录路由
  142. * navigator标签现在默认没有转场动画,所以用view
  143. */
  144. navTo(url) {
  145. if (!this.hasLogin) {
  146. url = '/pages/public/login';
  147. }
  148. uni.navigateTo({
  149. url
  150. })
  151. },
  152. alertBtn() {
  153. uni.navigateTo({
  154. url: '/pages/public/login'
  155. })
  156. },
  157. cancelClick() {
  158. this.isShowAlert = false
  159. },
  160. checkBoxChange(e) {
  161. console.log(e)
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang='scss' scoped>
  167. page {
  168. background: #F5F6FA;
  169. }
  170. .wrap {
  171. background: #fff;
  172. margin: 10px;
  173. border-radius: 10px;
  174. padding: 40rpx 30rpx;
  175. }
  176. .content-item{
  177. margin-top: 50rpx;
  178. font-size: 28rpx;
  179. }
  180. .row {
  181. display: flex;
  182. justify-content: space-between;
  183. position: relative;
  184. /* border-bottom: 1px solid #EEEEEE; */
  185. .right,
  186. input {
  187. font-size: 28rpx;
  188. // color: #333333;
  189. }
  190. .left{
  191. font-size: 34rpx;
  192. color: #333333;
  193. font-weight: 600;
  194. }
  195. }
  196. .textarea {
  197. background: #F9F9FA;
  198. font-size: 26rpx;
  199. text-align: left;
  200. width: 100%;
  201. height: 60px;
  202. padding: 32rpx;
  203. border-radius: 10rpx;
  204. margin-top: 40rpx;
  205. height: 50vh;
  206. padding-bottom: 20rpx;
  207. color: #AFB3BF ;
  208. }
  209. .textarea-bottom {
  210. position: absolute;
  211. bottom: 20rpx;
  212. right: 20rpx;
  213. color: #606266;
  214. }
  215. .bottom-btn {
  216. width: 100%;
  217. position: fixed;
  218. bottom: 0;
  219. display: flex;
  220. z-index: 2;
  221. left: 0;
  222. background-color: #f8f8f8;
  223. flex-direction: column;
  224. .btn1,
  225. .btn2 {
  226. width: 100%;
  227. margin-bottom: 26rpx;
  228. border-radius: 90rpx;
  229. }
  230. .btn1 {
  231. background: white;
  232. color: #00C265;
  233. }
  234. }
  235. .shade {
  236. position: fixed;
  237. top: 0;
  238. left: 0;
  239. height: 100%;
  240. width: 100%;
  241. background: rgba(0, 0, 0, 0.4);
  242. z-index: 3;
  243. .wrap {
  244. position: absolute;
  245. left: 0;
  246. top: 0;
  247. right: 0;
  248. bottom: 0;
  249. margin: auto;
  250. background: #fff;
  251. width: calc(100% - 198rpx);
  252. height: 700rpx;
  253. border-radius: 20rpx;
  254. padding: 20rpx;
  255. .alert-top {
  256. padding: 33rpx;
  257. display: flex;
  258. justify-content: center;
  259. align-items: center;
  260. position: relative;
  261. }
  262. .title {
  263. font-size: 32rpx;
  264. font-weight: 600;
  265. color: #333333;
  266. }
  267. .close {
  268. position: absolute;
  269. right: 33rpx;
  270. }
  271. }
  272. }
  273. .cancel,
  274. .confirm {
  275. position: absolute;
  276. display: inline-block;
  277. width: 50%;
  278. text-align: center;
  279. bottom: 0;
  280. padding: 10px;
  281. border-top: 1px solid #eee;
  282. font-size: 34rpx;
  283. }
  284. .cancel {
  285. left: 0;
  286. border-right: 1px solid #eee;
  287. color: #AFB3BF;
  288. }
  289. .confirm {
  290. right: 0;
  291. color: #22C572;
  292. }
  293. .u-textarea-style {
  294. margin: 20rpx;
  295. background: #F9F9FA;
  296. border-radius: 10px;
  297. border: 1px solid #EEEEEE;
  298. padding: 10rpx 20rpx;
  299. position: relative;
  300. .right-bottom {
  301. position: absolute;
  302. right: 20rpx;
  303. bottom: 20rpx;
  304. color: #AFB3BF;
  305. }
  306. }
  307. /deep/.u-input__textarea {
  308. height: 300rpx !important;
  309. }
  310. </style>