| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view>
- <cu-custom bgColor="bg-luohu" :isBack="true">
- <block slot="backText">返回</block>
- <block slot="content">委托暂存</block>
- </cu-custom>
- <block v-if="list.length > 0">
- <view class="list" v-for="(item,index) in list" :key="index">
- <uni-section :title="item.wei_tuo_dan_hao_" type="line" padding>
- <view class="content">
- <text>暂存类型:{{item.bao_cun_biao_ti_}}</text>
- <text></text>
- </view>
- <view class="content">
- <text>暂存时间:{{item.bian_zhi_shi_jian}}</text>
- <text></text>
- </view>
- <view class="btn">
- <view>
- <u-button type="primary" size="mini" @click="goClick(item.id_)"
- class="u-m-r-20 btn-back-color">继续编制
- </u-button>
- <u-button type="error" size="mini" @click="repulse(item.id_)">
- 删除暂存
- </u-button>
- </view>
- </view>
- </uni-section>
- </view>
- </block>
- <block v-else></block>
- </view>
- </template>
- <script>
- import {
- ACCESS_TOKEN,
- USER_NAME,
- USER_INFO
- } from "@/common/util/constants" // 拉取登录token,userName,userInfo
- export default {
- data() {
- return {
- current: 0,
- list: [],
- ReachBottomShow: true
- }
- },
- // 下拉刷新
- onPullDownRefresh() {
- this.getInit()
- },
- // 上拉加载
- onReachBottom() {
- let _self = this
- uni.showNavigationBarLoading()
- if (this.ReachBottomShow) {
- this.getData()
- }
- },
- onShow() {
- this.getInit()
- },
- methods: {
- getInit() {
- this.current = 0
- this.list = []
- this.getData()
- },
- //获取暂存列表
- getData() {
- uni.showLoading({
- mask: true,
- title: 'loading'
- });
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- var page = 0
- if (this.current == 0) {
- page = 0
- } else {
- page = this.current * 10
- }
- let sql =
- `select id_,bian_zhi_shi_jian,wei_tuo_dan_hao_,bao_cun_biao_ti_ from t_mjsjdzcb where dui_ying_shu_ju_b = 't_lhwtsqb' and bian_zhi_ren_ = '${useId}' and create_time_ > DATE_SUB(NOW(),INTERVAL 3 MONTH) order by create_time_ desc LIMIT ${page},10`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const data = res.data.variables.data
- this.list.push(...data)
- uni.stopPullDownRefresh();
- if (data.length > 10) {
- this.ReachBottomShow = false
- }
- if (data.length != 0) {
- this.current++
- }
- uni.hideLoading()
- }
- })
- },
- //删除接口
- repulse(id) {
- let that = this
- uni.showModal({
- title: '提示',
- content: '是否删除该条暂存数据,删除后,将无法恢复?',
- success: function(res) {
- if (res.confirm) {
- let params = {}
- params['tableName'] = 't_mjsjdzcb'
- params['paramWhere'] = "{id_:'" + id + "'}"
- let requestData = that.$sig(params)
- that.$http.post("/ibps/business/v3/sys/universal/batchDelete", requestData).then(
- res => {
- if (res.data.state == 200) {
- uni.showToast({
- title: '删除成功',
- icon: 'none',
- duration: 2000
- })
- that.getInit()
- }
- })
- } else if (res.cancel) {
- }
- }
- })
- },
- //跳转到委托单添加页面
- goClick(id) {
- uni.navigateTo({ // 跳转页面
- url: '/pages/jiance/order?saveId=' + id
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .list {
- padding: 0 20rpx;
- .content {
- line-height: 45rpx;
- }
- .btn {
- display: flex;
- justify-content: flex-end;
- }
- }
- </style>
|