exportProcess.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <view>
  3. <u-navbar title="出库申请" class="head">
  4. <view class="tabs" slot="bottom">
  5. <u-tabs bar-width="80" inactive-color="#777777" active-color="#101010" :list="list" :is-scroll="false"
  6. :current="current" @change="change"></u-tabs>
  7. <view class="screen" @click="changeShow()" v-if="false">
  8. 筛选<u-icon size="24" name="arrow-down" color="#777777"></u-icon>
  9. </view>
  10. <view class="options" v-if="this.show==true" @click="changeShow()">
  11. 选项3
  12. </view>
  13. </view>
  14. </u-navbar>
  15. <view class="listProcess">
  16. <view style="display: flex;" v-show="current==0"
  17. v-for="(item, index) in list[0].list" :key="index" >
  18. <u-checkbox
  19. v-model="item.checked"
  20. :name="item.id"
  21. >
  22. </u-checkbox>
  23. <view class="item" @click="ckInfo(item.id,current)" >
  24. <view class="title">
  25. {{item.projectName}}
  26. </view>
  27. <view class="group">
  28. <view class="name">
  29. 所属项目部:
  30. </view>
  31. <view class="value">
  32. {{item.departmentName}}
  33. </view>
  34. </view>
  35. <view class="group">
  36. <view class="name">
  37. 申请人:
  38. </view>
  39. <view class="value">
  40. {{item.createByName}}
  41. </view>
  42. </view>
  43. <view class="group">
  44. <view class="name">
  45. 申请时间:
  46. </view>
  47. <view class="value" >
  48. {{item.createTime}}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view v-show="current==1" v-for="(item,i) in list[1].list" @click="ckInfo(item.id,current)" :key="i">
  54. <view class="item" >
  55. <view class="title">
  56. <span v-if="current==1"
  57. style="margin-right: 6px;"
  58. :style="{color:recordStatusColor(item.status)}">[{{item.statusN}}]</span>
  59. {{item.projectName}}
  60. </view>
  61. <view class="group">
  62. <view class="name">
  63. 所属项目部:
  64. </view>
  65. <view class="value">
  66. {{item.departmentName}}
  67. </view>
  68. </view>
  69. <view class="group">
  70. <view class="name">
  71. 申请人:
  72. </view>
  73. <view class="value">
  74. {{item.createByName}}
  75. </view>
  76. </view>
  77. <view class="group">
  78. <view class="name">
  79. 申请时间:
  80. </view>
  81. <view class="value" >
  82. {{item.createTime}}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <u-divider v-if="list[current].recordsTotal==list[current].list.length"
  88. :isnone="list[current].recordsTotal==0" nonetext="没有找到相关内容"
  89. border-color="#CFD2D5">已经到底了</u-divider>
  90. </view>
  91. <view class="bottom" v-show="current==0">
  92. <u-checkbox v-model="checked" @change="checkedAll" >
  93. 全选
  94. </u-checkbox>
  95. <span style="float: right;">
  96. <u-button size="medium" @click="submit(2)"
  97. type="revoke" style="border-radius:10px 0 0 10px" >拒绝</u-button>
  98. <u-button @click="submit(1)"
  99. size="medium" type="primary" style="border-radius:0 10px 10px 0" >同意</u-button>
  100. </span>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import * as API from '@/apis/pagejs/approve.js'
  106. import {
  107. recordStatus,
  108. recordStatusColor
  109. } from '@/apis/status.js'
  110. export default {
  111. data() {
  112. return {
  113. list: [{
  114. name: '审批中',
  115. pageIndex: 1,
  116. pageSize: 50,
  117. recordsTotal: 1,
  118. status:"0",
  119. list:[]
  120. }, {
  121. name: '已审批',
  122. pageIndex: 1,
  123. pageSize: 20,
  124. recordsTotal: 1,
  125. status:"1",
  126. list:[]
  127. }],
  128. current: 0,
  129. show:false,
  130. checked:false,
  131. }
  132. },
  133. onReachBottom() {
  134. console.log("onReachBottom")
  135. var obj=this.list[this.current]
  136. if (obj.list.length < obj.recordsTotal) {
  137. this.myLoadmore();
  138. }
  139. },
  140. onReady(){
  141. this.getList()
  142. },
  143. methods: {
  144. recordStatus,
  145. recordStatusColor,
  146. checkedAll(e) {
  147. this.list[0].list.map(val => {
  148. val.checked = e.value;
  149. })
  150. },
  151. getList(val){
  152. uni.showLoading({
  153. title: "加载中",
  154. mask: true,
  155. })
  156. var list=this.list[this.current].list
  157. var obj=this.list[this.current]
  158. var listForm={...obj}
  159. delete listForm.list
  160. API.outApproveList(listForm).then((res) => {
  161. if(listForm.pageIndex==1){
  162. list = res.data.data;
  163. }else{
  164. list = [
  165. ...list,
  166. ...res.data.data
  167. ];
  168. }
  169. this.list[this.current].list=list
  170. this.list[this.current].recordsTotal = res.data.recordsTotal;
  171. if(this.current==0){
  172. this.carhelp.set("badgeList_outApproveList",res.data.recordsTotal)
  173. }
  174. if(val!='init'){
  175. uni.hideLoading();
  176. }
  177. }).catch(error => {
  178. uni.showToast({
  179. title: error,
  180. icon: "none"
  181. })
  182. })
  183. },
  184. myLoadmore(){
  185. this.list[this.current].pageIndex += 1;
  186. this.getList();
  187. },
  188. init(){
  189. this.current=0
  190. this.list[0].pageIndex=1
  191. this.list[1].pageIndex=1
  192. this.list[0].list=[]
  193. this.list[1].list=[]
  194. this.getList('init')
  195. },
  196. ckInfo(id,status){
  197. var url="./deliveryDetails?id="+id;
  198. if(status!=0){
  199. url="./deliveryInfo?id="+id;
  200. }
  201. uni.navigateTo({
  202. url:url,
  203. events: {
  204. refreshData: () => {
  205. this.init()
  206. }
  207. }
  208. })
  209. },
  210. change(index) {
  211. this.current = index;
  212. var list=this.list[this.current].list
  213. if(list.length==0){
  214. this.getList();
  215. }
  216. },
  217. submit(status){
  218. var list=this.list[0].list.filter(val => {
  219. return val.checked
  220. }).map(var2=>{
  221. return var2.id
  222. })
  223. if(list.length){
  224. } else{
  225. uni.showToast({
  226. title:"请勾选记录"
  227. })
  228. return;
  229. }
  230. var ids=list.join()
  231. var message=""
  232. var _this=this;
  233. if(status==2){
  234. message="拒绝"
  235. }else{
  236. message="同意"
  237. //this.showpopup=true;
  238. }
  239. uni.showModal({
  240. title:"提示",
  241. content:"是否"+message+"出库审批",
  242. success(res) {
  243. if(res.confirm){
  244. _this.saveRecordApprove(status,ids);
  245. }else{
  246. }
  247. }
  248. })
  249. },saveRecordApprove(status,ids){
  250. uni.showLoading({
  251. title: "加载中",
  252. mask: true,
  253. })
  254. API.saveRecordApprove({
  255. recordIds:ids,
  256. status:status,
  257. //signUrl:this.signUrl
  258. }).then((res) => {
  259. //this.showpopup=false;
  260. // uni.showToast({
  261. // title:"操作成功"
  262. // })
  263. uni.showModal({
  264. title:"提示",
  265. content:"操作成功",
  266. showCancel:false,
  267. success(resc) {
  268. if(resc.confirm){
  269. }else{
  270. }
  271. }
  272. })
  273. this.current=0
  274. this.list[0].pageIndex=1
  275. this.list[1].pageIndex=1
  276. this.list[0].list=[]
  277. this.list[1].list=[]
  278. this.getList()
  279. }).catch(error => {
  280. uni.showToast({
  281. title: error,
  282. icon: "none"
  283. })
  284. })
  285. },
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. page{
  291. padding-bottom: 100rpx;
  292. }
  293. .head {
  294. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  295. /deep/.u-navbar {
  296. //background: 0!important;
  297. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  298. height: 210rpx;
  299. //padding: 0 32rpx;
  300. }
  301. /deep/.u-border-bottom:after {
  302. height: 0;
  303. }
  304. .tabs {
  305. padding: 0 32rpx
  306. }
  307. }
  308. .tabs{
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. /deep/.u-tabs{
  313. background: 0 !important;
  314. width: 250rpx;
  315. }
  316. /deep/.u-tab-bar{
  317. background-color: #2A8EFB !important;
  318. }
  319. .screen{
  320. color: #415058;
  321. position: relative;
  322. font-family: Microsoft Yahei;
  323. /deep/.uicon-arrow-down{
  324. margin-left: 4rpx;
  325. }
  326. }
  327. .options{
  328. width: 120rpx;
  329. height: 60rpx;
  330. line-height: 60rpx;
  331. text-align: center;
  332. background-color: #fff;
  333. color: rgba(65, 80, 88, 1);
  334. font-family: Microsoft Yahei;
  335. position: absolute;
  336. top: 160rpx;
  337. right: 24rpx;
  338. box-shadow:5px 5px 10px gray;
  339. }
  340. }
  341. .listProcess{
  342. padding: 0 32rpx;
  343. margin-top: 60px;
  344. margin-bottom: 10px;
  345. .item{
  346. width: 640rpx;
  347. border-radius: 8px;
  348. background-color: rgba(255, 255, 255, 1);
  349. padding: 18rpx 32rpx ;
  350. margin-bottom: 24rpx;
  351. .title{
  352. color: rgba(51, 51, 51, 1);
  353. font-size: 36rpx;
  354. margin-bottom: 8rpx;
  355. }
  356. .group{
  357. display: flex;
  358. color: rgba(119, 119, 119, 1);
  359. font-size: 24rpx;
  360. // font-weight: bold;
  361. }
  362. }
  363. }
  364. .bottom{
  365. position: fixed;
  366. bottom: 0;
  367. left: 0;
  368. right: 0;
  369. background-color: #fff;
  370. padding: 16rpx 32rpx;
  371. }
  372. </style>