index.vue 14 KB

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