stockDetaiList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <template>
  2. <view class="pagesCons">
  3. <view class="tab-body flex_column ">
  4. <view class="flex_column">
  5. <view>
  6. <u-tabs-swiper ref="uTabs" bar-width='100' :active-color="$config('primaryColors')" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  7. swiperWidth="750"></u-tabs-swiper>
  8. </view>
  9. <view class="stock-con">
  10. <view class="stock-tit">
  11. <view class="u-line"></view>库存查询
  12. </view>
  13. <view class="flex align_center align_center" style="margin-top: 10px;">
  14. <u-image width="60px" height="60px"/>
  15. <view style="padding-left: 10px;height: 80px;" class="flex_column align_center">
  16. <view>产品编码:<text>{{'0123456'}}</text></view>
  17. <view>原厂编码:<text>{{'0123456'}}</text></view>
  18. <view>
  19. <text>可用数量:122</text>
  20. <text>库存成本:1230000</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  27. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;" v-for="(tabs, index) in tabList" :key="index">
  28. <scroll-view scroll-y style="width: 100%;overflow: scroll;" @scrolltolower="onreachBottom">
  29. <view
  30. class="check-order-list"
  31. v-for="item in 7"
  32. >
  33. <view class="check-row" @click="viewRow(item)">
  34. <view class="flex justify_between">
  35. <text>2021-12-31 12:12:12</text>
  36. <text>销售退货</text>
  37. </view>
  38. <view class="flex justify_between">
  39. <text>2021-12-31 12:12:12</text>
  40. <text>销售退货</text>
  41. </view>
  42. </view>
  43. </view>
  44. <u-empty text="暂无套餐" :src="`/static/${$config('themePath')}/def_no_meal@3x.png`" icon-size="240" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  45. <view style="padding: 20upx;">
  46. <u-loadmore :load-text="$config('loadText')" v-if="total>pageSize || status=='loading'" :status="status" />
  47. </view>
  48. </scroll-view>
  49. </swiper-item>
  50. </swiper>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. // import { listCustomerBundle } from '@/api/customerBundle'
  56. // import vSelect from '@/components/select/v-select.vue'
  57. // import { searchCustomerList } from '@/api/car.js'
  58. export default {
  59. // components: {
  60. // vSelect
  61. // },
  62. data() {
  63. return {
  64. showSearch: false,
  65. showCustomeList: false,
  66. customList: [],
  67. tips: {
  68. text: '请选择客户信息',
  69. color: '#666',
  70. fontSize: 34
  71. },
  72. status: 'loadmore',
  73. background: {
  74. // 渐变色
  75. backgroundImage: this.$config('topBarBackground')
  76. },
  77. tabList: [
  78. {
  79. dispName: '出库详情',
  80. code:''
  81. },
  82. {
  83. dispName: '出入库明细',
  84. code:'1'
  85. },
  86. ],
  87. current: 0,
  88. swiperCurrent: 0,
  89. orderStatus: '', // 订单状态
  90. currentId: '',
  91. payTypeList: [],
  92. pageNo: 1,
  93. pageSize: 10,
  94. list: [],
  95. total: 0,
  96. // 查询条件
  97. beginDate: null,
  98. endDate: null,
  99. queryWord: '',
  100. bundleName: '',
  101. number: '',
  102. payTypes: '',
  103. sellChannel: '',
  104. refundStatus: '',
  105. carNumber: '',
  106. createChannels: [],
  107. createChanneList: [] // 创建渠道列表
  108. }
  109. },
  110. onLoad() {
  111. let _this = this
  112. this.getpayType()
  113. this.pageInit()
  114. //创建渠道列表
  115. this.createChanneList = this.$store.state.vuex_createChannelList
  116. uni.$on('refreshBundle',function(data){
  117. console.log(data.msg,'refreshOrder')
  118. _this.pageInit()
  119. })
  120. uni.setNavigationBarColor({
  121. backgroundColor: this.$config('topBarBackground'),
  122. frontColor: this.$config('topBarTitleColors')
  123. })
  124. },
  125. onBackPress() {
  126. if(this.showSearch){
  127. this.showSearch = false
  128. return true
  129. }
  130. },
  131. onNavigationBarButtonTap(e){
  132. if(e.index == 0){
  133. this.openSearch()
  134. }
  135. },
  136. methods:{
  137. message(title){
  138. uni.showToast({
  139. icon:'none',
  140. title: title
  141. })
  142. },
  143. // 获取所有收费方式
  144. getpayType () {
  145. this.payTypeList = this.$store.state.vuex_paymentTypeList
  146. },
  147. filterpayType (val,dataList) {
  148. var _value = ''
  149. for (let i = 0; i < dataList.length; i++) {
  150. if (val == dataList[i].code) {
  151. _value = dataList[i].dispName
  152. break
  153. }
  154. }
  155. return _value
  156. },
  157. getpayTypeText(v) {
  158. this.payTypes = v
  159. },
  160. // 选择创建渠道
  161. selCreatChannel(items,index){
  162. let hasIndex = this.createChannels.findIndex(item=> item == items.code)
  163. if(hasIndex>=0){
  164. this.createChannels.splice(hasIndex,1)
  165. this.createChanneList[index].checked = false
  166. }else{
  167. this.createChannels.push(items.code)
  168. this.createChanneList[index].checked = true
  169. }
  170. this.createChanneList.splice()
  171. },
  172. pageInit(showSearch){
  173. if(showSearch){
  174. if(this.endDate&&!this.beginDate){
  175. this.message('请选择开始日期')
  176. return false
  177. }
  178. if(this.beginDate&&!this.endDate){
  179. this.message('请选择结束日期')
  180. return false
  181. }
  182. }
  183. this.total = 0
  184. this.pageNo = 1
  185. this.getRow()
  186. this.showSearch = showSearch
  187. },
  188. // tabs通知swiper切换
  189. tabsChange(index) {
  190. this.swiperCurrent = index;
  191. },
  192. swiperChange(event){
  193. console.log(event.detail)
  194. this.list = []
  195. this.status = "loading"
  196. },
  197. // swiper-item左右移动,通知tabs的滑块跟随移动
  198. transition(e) {
  199. console.log(e,'eeeeeeeee')
  200. let dx = e.detail.dx;
  201. this.$refs.uTabs.setDx(dx);
  202. },
  203. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  204. // swiper滑动结束,分别设置tabs和swiper的状态
  205. animationfinish(e) {
  206. console.log('---------')
  207. let current = e.detail.current;
  208. if(current != this.current){
  209. this.$refs.uTabs.setFinishCurrent(current);
  210. this.swiperCurrent = current;
  211. this.current = current;
  212. this.refundStatus = this.tabList.length ? this.tabList[this.current].code : ''
  213. this.resetForm(false)
  214. }
  215. },
  216. // scroll-view到底部加载更多
  217. onreachBottom() {
  218. console.log(this.list.length, this.total)
  219. if(this.list.length < this.total){
  220. this.pageNo += 1
  221. this.getRow()
  222. }else{
  223. this.status = "nomore"
  224. }
  225. },
  226. checkNums (states, i){
  227. if(states){
  228. let arr = states.split(',')
  229. return arr[i]
  230. }
  231. return 0
  232. },
  233. // 查询列表
  234. getRow (pageNo) {
  235. let _this = this
  236. if (pageNo) {
  237. this.pageNo = pageNo
  238. }
  239. let sdata = {
  240. pageNo: this.pageNo,
  241. pageSize: this.pageSize,
  242. queryWord: this.queryWord,
  243. beginDate: this.beginDate||'',
  244. endDate: this.endDate||'',
  245. createChannels: this.createChannels
  246. }
  247. if (this.number) {
  248. sdata.number = this.number
  249. }
  250. if (this.bundleName) {
  251. sdata.bundleName = this.bundleName
  252. }
  253. if (this.payTypes) {
  254. let arr = []
  255. arr.push(this.payTypes)
  256. sdata.payTypes = arr
  257. }
  258. if (this.sellChannel) {
  259. sdata.sellChannelCode = this.sellChannel
  260. }
  261. if (this.refundStatus) {
  262. sdata.refundStatus = this.refundStatus
  263. }
  264. _this.status = "loading"
  265. listCustomerBundle(sdata).then(res => {
  266. if (res.code == 200 || res.status == 204 || res.status == 200) {
  267. if(_this.pageNo>1){
  268. _this.list = _this.list.concat(res.data.list || [])
  269. }else{
  270. _this.list = res.data.list || []
  271. }
  272. _this.total = res.data.count || 0
  273. } else {
  274. _this.list = []
  275. _this.total = 0
  276. }
  277. _this.status = "loadmore"
  278. })
  279. },
  280. // 查询条件
  281. openSearch(){
  282. let _this = this
  283. this.showSearch = true
  284. if (this.payTypes) {
  285. setTimeout(function(){
  286. _this.$refs.payType.setVal(_this.payTypes)
  287. },300)
  288. }
  289. if(this.createChanneList.length==0){
  290. //创建渠道列表
  291. this.createChanneList = this.$store.state.vuex_createChannelList
  292. this.createChanneList.map(item=>{item.checked = false})
  293. }
  294. },
  295. bindBeginDateChange(e){
  296. this.beginDate = e.target.value
  297. },
  298. bindEndDateChange(e){
  299. this.endDate = e.target.value
  300. },
  301. // 重置
  302. resetForm(flag){
  303. this.queryWord = ''
  304. this.beginDate = ''
  305. this.endDate = ''
  306. this.bundleName = ''
  307. this.number = ''
  308. this.payTypes = ''
  309. this.sellChannel = ''
  310. this.carNumber = ''
  311. this.createChannels= []
  312. //创建渠道列表
  313. if(flag){
  314. this.createChanneList = this.$store.state.vuex_createChannelList
  315. this.createChanneList.map(item=>{item.checked = false})
  316. this.$refs.payType.resetVal()
  317. }
  318. this.pageInit(flag)
  319. },
  320. // 详细页
  321. viewRow(item){
  322. uni.navigateTo({
  323. url: "/pages/workOrder/sellOrder/customBundleDetail?id="+item.id
  324. })
  325. },
  326. // 付款
  327. payRow (params) {
  328. let _this = this
  329. let id = params.row.id
  330. this.currentId = id
  331. this.$Modal.confirm({
  332. title: '确认付款操作吗',
  333. onOk: () => {
  334. // 打开购买套餐页面
  335. _this.openPackagePay = true
  336. },
  337. onCancel: () => {
  338. }
  339. })
  340. },
  341. collectMoney (data){
  342. // 进入收款页面
  343. uni.redirectTo({
  344. url: '/pages/workOrder/sellOrder/bundlePay?id='+data.id
  345. })
  346. },
  347. // 车牌号查询客户信息
  348. queryCustomByCar (event) {
  349. console.log(event.detail.value, '==搜索关键词')
  350. let queryWord = event.detail.value
  351. if (queryWord.length > 0){
  352. let params = {vehicleNumber: ''}
  353. if (queryWord.length == 5 || queryWord.length == 6){
  354. params.vehicle5Number = queryWord.toUpperCase()
  355. this.queryCustomInfo(params)
  356. } else if (queryWord.length == 7 || queryWord.length == 8){
  357. params.vehicleNumber = queryWord.toUpperCase()
  358. this.queryCustomInfo(params)
  359. }
  360. }else{
  361. this.queryWord = ''
  362. }
  363. },
  364. // 获取客户车辆信息
  365. queryCustomInfo (params) {
  366. let _this = this
  367. searchCustomerList(params).then(res => {
  368. if (res.status - 0 === 200) {
  369. _this.customList = res.data || []
  370. if(_this.customList.length){
  371. _this.customList.map(item=>{
  372. item.text = item.customer.mobile + '-' + item.vehicle.number
  373. })
  374. if(_this.customList.length > 1){
  375. this.showCustomeList = true
  376. uni.hideKeyboard()
  377. }else{
  378. this.selectCustomCar(0)
  379. }
  380. }else{
  381. uni.showToast({
  382. icon:'none',
  383. title:'此车牌不存在'
  384. })
  385. this.carNumber = ''
  386. }
  387. }
  388. })
  389. },
  390. // 选择下拉选项
  391. selectCustomCar (index){
  392. let row = this.customList[index]
  393. if (row){
  394. this.queryWord = row.customer.mobile
  395. this.carNumber = row.vehicle.number
  396. }
  397. },
  398. // 取消选择已存在的客户信息
  399. closeSelCust(){
  400. this.customList = []
  401. this.queryWord = ''
  402. this.carNumber = ''
  403. },
  404. }
  405. }
  406. </script>
  407. <style lang="scss">
  408. page{
  409. height: 100%;
  410. }
  411. .pagesCons{
  412. width: 100%;
  413. height: 100%;
  414. background-color: #fff;
  415. display: flex;
  416. flex-direction: column;
  417. .tab-body{
  418. height: 100%;
  419. display: flex;
  420. flex-direction: column;
  421. .stock-con{
  422. background-color: #ffffff;
  423. border-radius: 20upx;
  424. box-shadow: 3upx 2upx 6upx #eee;
  425. padding: 20upx;
  426. // position: fixed;
  427. // top:40px;
  428. .stock-tit{
  429. .u-line{
  430. display: inline-block;
  431. width: 6upx;
  432. height: 40upx;
  433. background-color: red;
  434. vertical-align: bottom;
  435. margin: 0 20upx 0 10upx;
  436. }
  437. }
  438. }
  439. .check-list{
  440. flex-grow: 1;
  441. // height: calc(100vh - 44px);
  442. }
  443. .check-order-list{
  444. background: #ffffff;
  445. padding: 10upx 20upx;
  446. margin-top: 25upx;
  447. border-radius: 30upx;
  448. box-shadow: 1px 1px 3px #EEEEEE;
  449. .check-row{
  450. >view{
  451. padding: 5px;
  452. }
  453. // display: flex;
  454. // align-items: center;
  455. // padding: 20upx 10upx;
  456. // font-size: 28upx;
  457. // &:first-child{
  458. // color: #222222;
  459. // font-size: 34upx;
  460. // padding-bottom: 0;
  461. // }
  462. // &:last-child{
  463. // color: #666E75;
  464. // }
  465. // > view{
  466. // &:first-child{
  467. // flex-grow: 1;
  468. // }
  469. // }
  470. // .state{
  471. // font-size: 30upx;
  472. // width: 30%;
  473. // text-align: right;
  474. // }
  475. // .customeInfo{
  476. // color: #999;
  477. // .uname{
  478. // margin-right: 20upx;
  479. // }
  480. // }
  481. // .action{
  482. // margin: 0 6rpx;
  483. // padding: 0 20rpx;
  484. // color: #fff;
  485. // border-radius: 100rpx;
  486. // &:after{
  487. // border: 0;
  488. // }
  489. // }
  490. // .pay{
  491. // background-color: #ffaa00;
  492. // }
  493. }
  494. }
  495. }
  496. }
  497. .slot-wrap {
  498. display: flex;
  499. align-items: center;
  500. /* 如果您想让slot内容占满整个导航栏的宽度 */
  501. flex: 1;
  502. /* 如果您想让slot内容与导航栏左右有空隙 */
  503. padding: 0 30rpx 0 0;
  504. color: #fff;
  505. font-size: 28upx;
  506. .left-icon{
  507. flex-grow: 1;
  508. font-size: 32upx;
  509. }
  510. .right-icon{
  511. padding-left:50upx;
  512. }
  513. .uni-icons{
  514. margin-right: 10upx;
  515. }
  516. }
  517. .search-popup{
  518. .search-title{
  519. text-align: center;
  520. padding: 20upx;
  521. color: #333;
  522. border-bottom: 1px solid #eee;
  523. }
  524. uni-picker{
  525. width: 100%;
  526. }
  527. .uni-list{
  528. padding:10upx 30upx;
  529. margin: 0;
  530. border-bottom: 1px solid #EEEEEE;
  531. .uni-list-cell{
  532. border: 0;
  533. .uni-list-cell-db{
  534. flex: 1;
  535. width: 100%;
  536. }
  537. .p30{
  538. padding-right: 30upx;
  539. }
  540. .uni-input{
  541. height: 2.5em;
  542. line-height: 2.5em;
  543. font-size: 28upx;
  544. display: flex;
  545. align-items: center;
  546. text-align: right;
  547. > view{
  548. &:first-child{
  549. flex-grow: 1;
  550. }
  551. &:last-child{
  552. color: #999;
  553. }
  554. .form-input-placeholder{
  555. color: #999;
  556. }
  557. }
  558. }
  559. .item-icon{
  560. margin-left: 10upx;
  561. }
  562. .checkbox-items{
  563. display: flex;
  564. flex-wrap: wrap;
  565. justify-content: space-between;
  566. .checkbox{
  567. width: 24%;
  568. background: #F8F8F8;
  569. text-align: center;
  570. margin: 20upx 0;
  571. padding: 10upx 0;
  572. border-radius: 50upx;
  573. font-size: 24upx;
  574. border:1upx solid #eee;
  575. }
  576. .checked{
  577. background: rgba(4, 133, 246, 0.15);
  578. border-color: rgba(4, 133, 246, 0.5);
  579. color: rgba(4, 133, 246, 1);
  580. }
  581. }
  582. }
  583. }
  584. .uni-list-btns{
  585. display: flex;
  586. padding: 20upx;
  587. uni-button{
  588. font-size: 28upx;
  589. margin: 25upx 20upx 0;
  590. flex:1;
  591. border-radius: 100upx;
  592. &:after{
  593. border: 0;
  594. }
  595. }
  596. }
  597. }
  598. </style>