index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <view style="background-color: #f2f2f6;padding-bottom: 0.01rpx;" :class="mask ? 'tl-show': ''">
  3. <view style="background-color: #fff;position: fixed;top: var(--window-top);width: 100%;z-index: 8;">
  4. <u-tabs :list="tabsList" keyName="dictValue" itemStyle="height:88rpx;" lineColor="#FD4B09"
  5. @click="tabsClick" :current="current">
  6. <view slot="right" style="padding:0 4px;" @tap="popupShow=true">
  7. <u-icon name="list" size="21" bold></u-icon>
  8. </view>
  9. </u-tabs>
  10. <view style="background-color: #fff;padding: 10rpx 20rpx;">
  11. <u-search placeholder="请输入业务编号" v-model="form.billNo" @custom="custom" @search="custom"></u-search>
  12. </view>
  13. <view class="tabClass">
  14. <u-tag plain :text="form.processType" closable :show="form.processType!=null"
  15. @close="tabClose(1)"></u-tag>
  16. <u-tag plain :text="form.billDate" closable :show="form.billDate!=null" @close="tabClose(2)"></u-tag>
  17. <u-tag plain :text="form.applyDate" closable :show="form.applyDate!=null" @close="tabClose(3)"></u-tag>
  18. </view>
  19. </view>
  20. <view class="content" :style="{'margin-top': (98+viewHeght)+'px'}">
  21. <view class="contentBox" v-for="(item,index) in dataList" :key="index">
  22. <view style="width: 100%;margin: 0 auto;">
  23. <u-cell-group :border="false">
  24. <u-cell :border="false" center :title="item.billNo" arrow-direction="down">
  25. <view slot="icon" style="width: 10rpx;height: 35rpx;background-color: #fd4b09;"></view>
  26. <view slot="value" style="padding: 5rpx 30rpx;border:1rpx solid #FD4B09;
  27. border-radius: 100rpx;color: #FD4B09;">
  28. {{item.auditStatus | textFilter(tabsList)}}
  29. </view>
  30. </u-cell>
  31. </u-cell-group>
  32. <view class="textBox">
  33. <view style="font-size: 32rpx;"> {{item.checkType | textFilter(typeList)}}</view>
  34. <view>{{item.billTime}}</view>
  35. </view>
  36. <!-- blade-system/dict-biz/dictionary?code=outbound_work_order_status -->
  37. <view class="textBox">
  38. <view>业务对象</view>
  39. <view>{{item.corpsName}}</view>
  40. </view>
  41. <view class="textBox">
  42. <view>数量</view>
  43. <view>{{item.orderQuantity}}</view>
  44. </view>
  45. <view class="textBox">
  46. <view>金额</view>
  47. <view>{{item.amount}}</view>
  48. </view>
  49. <view class="textBox">
  50. <view>申请人/日期</view>
  51. <view>{{item.sendName}}/{{item.sendTime}}</view>
  52. </view>
  53. <view class="textBox">
  54. <view>订单备注</view>
  55. <view class="textBox-text">{{item.orderRemark}}</view>
  56. </view>
  57. <view style="display: flex;" v-if="item.auditStatus=='S'">
  58. <u-button style="margin:0 5px 0 10px;" type="success" size="small" text="审核驳回"
  59. @click="approveSubmit(item,2)"></u-button>
  60. <u-button style="margin:0 5px 0 5px;" type="primary" size="small" text="审核通过"
  61. @click="approveSubmit(item,1)"></u-button>
  62. <u-button style="margin:0 10px 0 5px;" type="warning" size="small" text="审核进度"
  63. @click="inSchedule(item)"></u-button>
  64. </view>
  65. <view v-else style="margin: 0 10px;">
  66. <u-button type="warning" size="small" text="审核进度" @click="inSchedule(item)"></u-button>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <u-popup :show="popupShow" :round="10" @close="popupClose" closeable>
  72. <view style="padding: 10px;">
  73. <view style="display: flex;justify-content: center;font-size: 36rpx;">
  74. <text>筛选</text>
  75. </view>
  76. <u--form style="margin-bottom: 20px;" labelPosition="left" :model="form" ref="uForm">
  77. <u-form-item label="业务类型" borderBottom :labelWidth='66'>
  78. <u-input readonly v-model="form.processType" placeholder="请选择业务类型" border="none"
  79. @click.native='typeShow=true'></u-input>
  80. <u-icon slot="right" name="arrow-right" @click="typeShow=true"></u-icon>
  81. </u-form-item>
  82. <u-form-item label="业务日期" borderBottom :labelWidth='66'>
  83. <u-input readonly v-model="form.billDate" placeholder="请选择业务日期" border="none"
  84. @click.native='dateShow=true'></u-input>
  85. <u-icon slot="right" name="arrow-right" @click="dateShow=true"></u-icon>
  86. </u-form-item>
  87. <u-form-item label="申请日期" :labelWidth='66'>
  88. <u-input readonly v-model="form.applyDate" placeholder="请选择申请日期" border="none"
  89. @click.native='dateShow2=true'></u-input>
  90. <u-icon slot="right" name="arrow-right" @click="dateShow2=true"></u-icon>
  91. </u-form-item>
  92. </u--form>
  93. <view style="display: flex;">
  94. <u-button style="margin-right: 4px;" text="重置" @click='reset'></u-button>
  95. <u-button type="primary" text="检索" @click='submit'></u-button>
  96. </view>
  97. </view>
  98. </u-popup>
  99. <u-popup :show="scheduleShow" mode="center" :round="6" @close="scheduleClose" closeable>
  100. <view style="width:500rpx;margin: 100rpx 40rpx 40rpx 40rpx;">
  101. <u-steps :current="scheduleCurrent" dot direction="column">
  102. <u-steps-item v-for='(item,index) in scheduleList' :key='index' :title="item.title"
  103. :desc="item.time">
  104. </u-steps-item>
  105. </u-steps>
  106. </view>
  107. </u-popup>
  108. <u-picker :show="typeShow" :columns="columns" @close='typeShow=false' @cancel='typeShow=false'
  109. @confirm='typeConfirm' maxRange='无限制' closeOnClickOverlay></u-picker>
  110. <u-calendar :show="dateShow" mode="range" :minDate='minDate' monthNum='24' allowSameDay @confirm="dateConfirm"
  111. @close='dateShow=false'></u-calendar>
  112. <u-calendar :show="dateShow2" mode="range" :minDate='minDate' monthNum='24' allowSameDay @confirm="dateConfirm2"
  113. @close='dateShow2=false'></u-calendar>
  114. <!-- <u-empty v-if="total == 0" style="position: absolute;top: 45%;left: 50%;transform:translate(-50%,-50%)"
  115. mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
  116. <u-datetime-picker :show="timeOpen" v-model="datetime" mode="date" @cancel="timeOpen = false,mask = false"
  117. @confirm="confirmTiem"></u-datetime-picker>
  118. <uni-calendar ref="calendar" :insert="false" :range="true" @confirm="confirmCalendar" />
  119. <u-picker :show="show" :columns="columns" :keyName="keyName"
  120. @cancel="show = false,mask = false,sortOpen = false" @confirm="confirm"></u-picker>
  121. <u-loadmore v-if="total !== 0 && dataList.length != 0" :status="status" /> -->
  122. <u-back-top :scroll-top="scrollTop" icon="arrow-up" :customStyle="{backgroundColor:'#FD4B09'}"
  123. :iconStyle="{color:'#fff'}"></u-back-top>
  124. </view>
  125. </template>
  126. <script>
  127. import {
  128. getList,
  129. listAll,
  130. approvePass,
  131. findAuditProcessList
  132. } from '@/api/views/approve/index.js'
  133. export default {
  134. data() {
  135. return {
  136. viewHeght: 0,
  137. scheduleCurrent: 0,
  138. scheduleList: [],
  139. scheduleShow: false,
  140. minDate: null,
  141. maxDate: null,
  142. dateShow: false,
  143. dateShow2: false,
  144. typeShow: false,
  145. popupShow: false,
  146. timeOpen: false,
  147. datetime: Number(new Date()),
  148. // 列表的参数
  149. dataList: [],
  150. screen: [],
  151. columns: [
  152. ['采购审核', '退货审批', '退款审批']
  153. ],
  154. show: false,
  155. sortOpen: false,
  156. mask: false,
  157. total: 0,
  158. keyName: 'cname',
  159. status: 'loadmore',
  160. // 请求的参数
  161. form: {
  162. current: 1,
  163. size: 10,
  164. auditStatus: 'S',
  165. billNo: null,
  166. processType: null,
  167. billDate: null,
  168. applyDate: null,
  169. applybegintime: null,
  170. applyendtime: null,
  171. billTimeStart: null,
  172. billTimeEnd: null,
  173. },
  174. formTwo: {},
  175. // tabs切换数据
  176. tabsList: [{
  177. dictKey: 'S',
  178. dictValue: '待审核'
  179. }, {
  180. dictKey: 'A',
  181. dictValue: '已通过'
  182. }, {
  183. dictKey: 'B',
  184. dictValue: '已驳回'
  185. },
  186. {
  187. dictKey: null,
  188. dictValue: '全部'
  189. }
  190. ],
  191. typeList: [{
  192. dictKey: 'XSTD',
  193. dictValue: '销售退单请核'
  194. },
  195. {
  196. dictKey: 'YPJ-XSTH',
  197. dictValue: '销售退款退货'
  198. }, {
  199. dictKey: 'PJTK',
  200. dictValue: '销售退货'
  201. }, {
  202. dictKey: 'PJCG',
  203. dictValue: '采购'
  204. }, {
  205. dictKey: 'PJCGTK',
  206. dictValue: '采购退货'
  207. }, {
  208. dictKey: 'RZCG',
  209. dictValue: '采购融资审核'
  210. }
  211. ],
  212. // tabs当前选择的
  213. current: 0,
  214. scrollTop: 0
  215. }
  216. },
  217. filters: {
  218. textFilter(val, list) {
  219. let name;
  220. list.forEach(e => {
  221. if (e.dictKey == val) {
  222. name = e.dictValue
  223. }
  224. })
  225. return name;
  226. }
  227. },
  228. onLoad() {
  229. this.form = uni.getStorageSync('approveForm') ? uni.getStorageSync('approveForm') : this.form
  230. this.form.auditStatus = "S"
  231. const now = new Date();
  232. this.minDate = now.setFullYear(now.getFullYear() - 1);
  233. this.dataList = []
  234. this.getList()
  235. },
  236. onReachBottom() {
  237. this.status = 'loading'
  238. if (this.dataList.length < this.total) {
  239. this.form.current++
  240. this.getList()
  241. } else {
  242. this.status = 'nomore'
  243. }
  244. },
  245. onPageScroll(e) {
  246. this.scrollTop = e.scrollTop;
  247. },
  248. methods: {
  249. tabClose(type) {
  250. if (type == 1) {
  251. this.form.processType = null
  252. }
  253. if (type == 2) {
  254. this.form.billDate = null
  255. this.form.billTimeStart = null
  256. this.form.billTimeEnd = null
  257. }
  258. if (type == 3) {
  259. this.form.applyDate = null
  260. this.form.applybegintime = null
  261. this.form.applyendtime = null
  262. }
  263. uni.setStorageSync('approveForm', this.form);
  264. this.form.current = 1
  265. this.dataList = []
  266. this.getList()
  267. },
  268. custom() {
  269. this.form.current = 1
  270. this.dataList = []
  271. this.getList()
  272. },
  273. getList() {
  274. uni.showLoading({
  275. title: '加载中',
  276. mask: true
  277. });
  278. getList(this.form).then(res => {
  279. if (res.data.length == 0) {
  280. this.dataList = []
  281. this.total = 0
  282. } else {
  283. this.total = res.data.total || 0
  284. this.dataList = this.dataList.concat(res.data.records)
  285. }
  286. uni.hideLoading();
  287. if (this.total < 10) {
  288. this.status = 'nomore'
  289. }
  290. this.getViewHeight()
  291. })
  292. },
  293. // tabs切换
  294. tabsClick(item) {
  295. this.current = item.index
  296. this.form.auditStatus = item.dictKey
  297. this.form.current = 1
  298. this.dataList = []
  299. this.getList()
  300. },
  301. popupClose() {
  302. this.popupShow = false
  303. },
  304. typeConfirm(e) {
  305. this.form.processType = e.value[0]
  306. this.typeShow = false
  307. },
  308. dateConfirm(e) {
  309. this.form.billDate = e[0] + '~' + e[e.length - 1]
  310. this.dateShow = false
  311. },
  312. dateConfirm2(e) {
  313. this.form.applyDate = e[0] + '~' + e[e.length - 1]
  314. this.dateShow2 = false
  315. },
  316. getViewHeight() {
  317. uni.createSelectorQuery().select('.tabClass').boundingClientRect(data => {
  318. this.viewHeght = data.height
  319. }).exec();
  320. },
  321. submit() {
  322. if (this.form.billDate) {
  323. let arr = []
  324. arr = this.form.billDate.split("~")
  325. this.form.billTimeStart = arr[0]
  326. this.form.billTimeEnd = arr[1]
  327. }
  328. if (this.form.applyDate) {
  329. let arr = []
  330. arr = this.form.applyDate.split("~")
  331. this.form.applybegintime = arr[0] + " " + "00:00:00"
  332. this.form.applyendtime = arr[1] + " " + "23:59:59"
  333. }
  334. uni.setStorageSync('approveForm', this.form);
  335. this.popupShow = false
  336. this.form.current = 1
  337. this.dataList = []
  338. this.getList()
  339. },
  340. reset() {
  341. this.form.processType = null
  342. this.form.billDate = null
  343. this.form.billTimeStart = null
  344. this.form.billTimeEnd = null
  345. this.form.applyDate = null
  346. this.form.applybegintime = null
  347. this.form.applyendtime = null
  348. uni.setStorageSync('approveForm', this.form);
  349. },
  350. approveSubmit(row, type) {
  351. console.log(row, type, uni.getStorageSync('username'), )
  352. let obj = {}
  353. obj = {
  354. ...row,
  355. operate: type,
  356. auditName: uni.getStorageSync('username'),
  357. auditOpTime: this.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss')
  358. }
  359. approvePass(obj).then(res => {
  360. uni.showToast({
  361. icon: "none",
  362. title: '操作成功',
  363. mask: true
  364. });
  365. this.form.current = 1
  366. this.dataList = []
  367. this.getList()
  368. })
  369. },
  370. inSchedule(row) {
  371. this.scheduleShow = true
  372. this.scheduleList = []
  373. let obj = {}
  374. obj = {
  375. id: row.srcBillId,
  376. batchNo: row.batchNo,
  377. }
  378. findAuditProcessList(obj).then(res => {
  379. res.data.forEach(e => {
  380. this.scheduleList.push({
  381. title: '提交',
  382. time: '申请人:' + (e.sendName ? e.sendName : '') + '\n' +
  383. '提交日期:' + (e.sendTime ? e.sendTime : '') + '\n' +
  384. '备注:' + (e.sendMsg ? e.sendMsg : '')
  385. })
  386. if (e.auditStatus == 'S') {
  387. this.scheduleCurrent = 0
  388. this.scheduleList.push({
  389. title: '待审核',
  390. time: '审批人:' + (e.auditName ? e.auditName : '') + '\n' +
  391. '审批日期:' + (e.auditOpTime ? e.auditOpTime : '') + '\n' +
  392. '审批意见:' + (e.auditMsg ? e.auditMsg : '')
  393. })
  394. }
  395. if (e.auditStatus == 'A') {
  396. this.scheduleCurrent = 1
  397. this.scheduleList.push({
  398. title: '已通过',
  399. time: '审批人:' + (e.auditName ? e.auditName : '') + '\n' +
  400. '审批日期:' + (e.auditOpTime ? e.auditOpTime : '') + '\n' +
  401. '审批意见:' + (e.auditMsg ? e.auditMsg : '')
  402. })
  403. }
  404. if (e.auditStatus == 'B') {
  405. this.scheduleCurrent = 1
  406. this.scheduleList.push({
  407. title: '已驳回',
  408. time: '审批人:' + (e.auditName ? e.auditName : '') + '\n' +
  409. '审批日期:' + (e.auditOpTime ? e.auditOpTime : '') + '\n' +
  410. '审批意见:' + (e.auditMsg ? e.auditMsg : '')
  411. })
  412. }
  413. })
  414. })
  415. },
  416. scheduleClose() {
  417. this.scheduleShow = false
  418. }
  419. }
  420. }
  421. </script>
  422. <style scoped>
  423. .contentBox {
  424. width: 96%;
  425. margin: 20rpx auto;
  426. background-color: #FFFFFF;
  427. border-radius: 20rpx;
  428. /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
  429. padding-top: 15rpx;
  430. padding-bottom: 10rpx;
  431. }
  432. .textBox {
  433. padding: 0 15px;
  434. display: flex;
  435. justify-content: space-between;
  436. font-size: 28rpx;
  437. margin-bottom: 10rpx;
  438. align-items: flex-end;
  439. }
  440. .textBox-text {
  441. width: 400rpx;
  442. overflow: hidden;
  443. white-space: nowrap;
  444. text-overflow: ellipsis;
  445. }
  446. .dropdown {
  447. position: absolute;
  448. z-index: 9;
  449. background: rgba(0, 0, 0, .3);
  450. width: 100%;
  451. left: 0;
  452. top: calc(var(--status-bar-height) + 90px);
  453. bottom: 0;
  454. }
  455. .tl-show {
  456. overflow: hidden;
  457. position: fixed;
  458. height: 100%;
  459. width: 100%;
  460. }
  461. .tabClass {
  462. display: flex;
  463. flex-direction: row;
  464. flex-wrap: wrap;
  465. padding: 0 20rpx 10rpx;
  466. }
  467. </style>