日发运计划接口同步后台更新。数字键盘动作更新。主页、申请页列表功能按钮更新(撤回,编辑,删除)。完善页面细节
5个文件已修改
255 ■■■■■ 已修改文件
api/global.js 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.vue 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/jihua/jihua.vue 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/my-application/my-application.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/global.js
@@ -1,5 +1,8 @@
// import request from '@/config/request';
import { BaseUrl } from '@/utils/request.js'
import {
    BaseUrl
} from '@/utils/request.js'
// import { resolve } from 'node:path/win32';
// let BaseUrl = "/";
// const CURRENT_KEY = 'CURRENT_KEY';
@@ -98,6 +101,52 @@
    })
}
function logout() {
    uni.request({
            url: `${BaseUrl}/auth/token/logout`,
            method: 'DELETE',
            header: {
                'TENANT-ID': 5,
                Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                VERSION: 'zzl'
            }
        })
        .then(res => {
            console.log('缓存清理成功');
            uni.showToast({
                title: '到达登录页!'
            });
        })
        .catch(err => {
            uni.showToast({
                title: '缓存清理失败!'
            });
        });
}
// 删除撤回申请接口
function deleteWithDrawApplicationGlobal(id) {
    return new Promise((resolve, reject) => {
        uni.request({
            url: `${BaseUrl}/yunxiao/xswaybill/${id}`,
            method: 'DELETE',
            header: {
                'TENANT-ID': 5,
                Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                VERSION: 'zzl'
            },
            success: (res) => {
                resolve(res.data);
            },
            fail:(err) => {
                uni.showToast({
                    title: '删除出错',
                    icon: 'none'
                });
            }
        })
    })
}
@@ -109,5 +158,7 @@
export default {
    apiLogin,
    wxSmallLogin
    wxSmallLogin,
    logout,
    deleteWithDrawApplicationGlobal
}
pages/home/home.vue
@@ -50,10 +50,10 @@
                    <view class="bottom-container">
                        <!-- 按钮区域 -->
                        <view class="bottom-content__chulizhong bottom-content__item">
                            <view @click="withDrawClick(item.procInstId)" v-if="item.status == 1">
                            <!-- <view @click="withDrawClick(item.procInstId)" v-if="item.status == 1">
                                <image src="@/static/home/cehui.png" mode=""></image>
                                <view>撤回</view>
                            </view>
                            </view> -->
                            <view @click="checkTheScheduleClick(item.procInstId)" v-if="item.status == 1">
                                <image src="@/static/home/jindu.png" mode=""></image>
                                <view>查看进度</view>
@@ -66,18 +66,18 @@
                                <image src="@/static/home/history.png" mode=""></image>
                                <view>重新申请</view>
                            </view> -->
                            <view @click="editMyApplication(item)" v-if="item.status == 1 && item.processName == '发运通知单'">
                            <!-- <view @click="editMyApplication(item)" v-if="item.status == 1 && item.processName == '发运通知单'">
                                <image src="@/static/home/history.png" mode=""></image>
                                <view>编辑</view>
                            </view>
                            </view> -->
                            <view @click="approvalHistoryClick(item.procInstId)" v-if="item.status == 2 || item.status == 3">
                                <image src="@/static/home/history.png" mode=""></image>
                                <view>审批历史</view>
                            </view>
                            <view @click="deleteWithDrawApplication(item.tableId)" v-if="item.status == 3">
                            <!-- <view @click="deleteWithDrawApplication(item.tableId)" v-if="item.status == 3">
                                <image src="@/static/home/delete.png" mode=""></image>
                                <view>删除</view>
                            </view>
                            </view> -->
                        </view>
                        <!-- 已结束小组按钮 -->
                        <!-- <view class="bottom-content__chulizhong bottom-content__item" v-if="item.status == 2">
@@ -125,9 +125,9 @@
                        <!-- 待办按钮 -->
                        <view class="bottom-content__item">
                            <view @click="theFormDataClick(item.tableId)">
                <image src="@/static/home/jindu.png" mode=""></image>
                <view>申请详情</view>
              </view>
                                <image src="@/static/home/jindu.png" mode=""></image>
                                <view>申请详情</view>
                            </view>
                            <view @click="adopClick(item)">
                                <image src="@/static/home/tongguo.png" mode=""></image>
                                <view>通过</view>
@@ -175,7 +175,7 @@
                        </view>
                        <view class="center-content__three center-margin">
                            <view class="">
                                <text>审批意见:{{ item.comment=='undefined'?'未填写':item.comment || '未填写' }}</text>
                                <text>审批意见:{{ item.comment == 'undefined' ? '未填写' : item.comment || '未填写' }}</text>
                            </view>
                            <view class="">
                                <text>
@@ -218,7 +218,7 @@
        <!-- 日计划 -->
        <combined-title title="日发运计划" detailsPath="/pages/jihua/jihua" v-if="rijihuaMenu"></combined-title>
        <view class="card-group bottomChild" >
        <view class="card-group bottomChild">
            <combination-card class="card" :showTop="false" v-for="(item, index) in fyData.slice(0, 2)" :key="item.id" v-if="rijihuaMenu">
                <template v-slot:top></template>
                <template v-slot:center>
@@ -333,9 +333,19 @@
import combinedTitle from '@/components/common/combined-title/combined-title.vue';
import combinationCard from '@/components/common/combination-card/combination-card.vue';
import { setAccessToken, redirectLogin } from '@/utils/status.js';
import { logout } from '@/api/global.js';
export default {
    name: 'home',
    onLaunch() {
        let that = this;
        uni.addInterceptor('redirectTo', {
            //监听关闭本页面跳转
            success(e) {
                that.watchRouter();
            }
        });
    },
    computed: {
        rijihuaMenu() {
            return this.$store.state.rijihuaMenu;
@@ -456,24 +466,7 @@
    onUnload(event) {
        //多层级跳转之后,监听左上角返回事件,直接退回到index
        console.log('监听左上角', event);
        uni
            .request({
                url: `${BaseUrl}/auth/token/logout`,
                method: 'DELETE',
                header: {
                    'TENANT-ID': 5,
                    Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                    VERSION: 'zzl'
                }
            })
            .then(res => {
                console.log('缓存清理成功');
            })
            .catch(err => {
                uni.showToast({
                    title: '缓存清理失败!'
                });
            });
        this.logout();
    },
    onShow() {
        // 菜单注释(app待用)
@@ -488,6 +481,9 @@
        // popupMenu
    },
    methods: {
        watchRouter() {
            console.log('路由跳转');
        },
        init() {
            this.getUserInfo(); // 用户信息
            this.getProcessDataList(); // 申请列表
@@ -606,19 +602,19 @@
            this.withDrawData.procInstId = procInstId;
        },
        withDrawConfirm() {
                this.$reqPost('cancel', this.withDrawData).then(res => {
                    this.withDrawShow = false;
                    if (res.code == 0) {
                        uni.showToast({
                            title: res.data,
                            duration: 2000
                        });
                    }
                    // 刷新列表
                    this.getProcessDataList();
                    this.todoList();
                    this.doneList();
                });
            this.$reqPost('cancel', this.withDrawData).then(res => {
                this.withDrawShow = false;
                if (res.code == 0) {
                    uni.showToast({
                        title: res.data,
                        duration: 2000
                    });
                }
                // 刷新列表
                this.getProcessDataList();
                this.todoList();
                this.doneList();
            });
        },
        withDrawCancel() {
            this.withDrawShow = false;
@@ -645,7 +641,7 @@
                    this.$u.toast('通过失败!!');
                }
                this.todoList(); // 我的待办
                this.doneList();
                this.doneList();
            });
        },
        adoptModalCancel() {
@@ -668,7 +664,7 @@
                    this.$u.toast('操作失败!!!');
                }
                this.todoList(); // 我的待办
                this.doneList();
                this.doneList();
            });
        },
        rejectModalCancel() {
@@ -709,32 +705,16 @@
            });
        },
        // 删除撤回申请
        deleteWithDrawApplication(id){
            uni
                .request({
                    url: `${BaseUrl}/yunxiao/xswaybill/${id}`,
                    method: 'DELETE',
                    header: {
                        'TENANT-ID': 5,
                        Authorization: 'Bearer ' + uni.getStorageSync('access_token'),
                        VERSION: 'zzl'
        deleteWithDrawApplication(id) {
            this.deleteWithDrawApplicationGlobal(id)
                .then(res => {
                    if (res.code == 0) {
                        // 刷新列表
                        this.getProcessDataList();
                    }
                })
                .then(res => {
                    uni.showToast({
                        title:'删除成功',
                        icon:'none'
                    })
                    // 刷新列表
                    this.getProcessDataList();
                })
                .catch(err => {
                    uni.showToast({
                        title:'删除出错',
                        icon:'none'
                    })
                    console.log('删除撤回申请异常');
                });
        },
        // 重新申请
@@ -827,7 +807,6 @@
                url: `/pages/approval-history/approval-history?index=${v}`
            });
        },
        redirectLogin() {
            redirectLogin();
        },
@@ -906,7 +885,7 @@
            }
        }
    }
    .bottomChild{
    .bottomChild {
        margin-bottom: vww(20);
    }
pages/jihua/jihua.vue
@@ -162,6 +162,7 @@
    onPageScroll(e) {
        // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
        this.scrollTop = e.scrollTop;
        // console.log('屏幕滚动监听事件',this.scrollTop);
    },
    // 点击导航栏菜单后
    onNavigationBarButtonTap(e) {
@@ -194,17 +195,17 @@
            },
            deep: true,
            immediate: true
        },
        scrollTop: {
            handler: function(newV, oldV) {
                if (newV != oldV) {
                    this.keyBoardClose();
                    // this.keyBoardShow = false;
                }
            }
        },
        deep: true,
        immediate: true
        }
        // scrollTop: {
        //     handler: function(newV, oldV) {
        //             if (newV != oldV) {
        //                 this.keyBoardClose();
        //                 // this.keyBoardShow = false;
        //             }
        //     },
        //     deep: true,
        //     immediate: true
        // }
    },
    methods: {
        init() {
@@ -265,12 +266,16 @@
        //提交
        dataFormSubmit() {
            this.overlayShow = true;
            uni.showLoading({
                title:'加载中...'
            })
            this.fyData.forEach(e => {
                if(!e.shippingDate && e.numPlan){
                    e.shippingDate = this.info.shippingDate
                }
            });
            this.$reqPost('addObj', this.fyData).then(res => {
                uni.hideLoading();
                if(res.code == 0){
                    setTimeout(()=>{
                        uni.showToast({
@@ -322,13 +327,15 @@
        // 修改弹出框
        editPopupClose(){
            console.log('修改弹出框Close');
            // this.editPopupShow = false;
            this.editPopupShow = false;
            this.keyBoardShow = false;
        },
        editPopupOpen(){
            console.log('修改弹出框Open');
        },
        // 切换全部和已设置
        groupChange(n) {
            this.initVariable();
            this.isTomJihua = n;
            if (n == '已设置的计划') {
                this.xscarshippingdayplan();
@@ -338,6 +345,7 @@
        },
        //切换今日和明日
        tabClick(item) {
            this.initVariable();
            if (item.index == 1) {
                this.info.shippingDate = this.tomorrowDate();
                if (this.isTomJihua == '已设置的计划') {
@@ -354,6 +362,16 @@
                }
            }
        },
        // 初始化变量
        initVariable(){
            this.keyBoardShow = false;
            this.keyBoardValue = null;
            this.fayunPlanFocusId = null;
            uni.pageScrollTo({
                scrollTop: 0,
                duration: 300
            });
        },
        inputChange(val) {
            console.log('全部计划', val);
        },
@@ -363,10 +381,6 @@
        },   
        // input获取焦点
        faYunPlanCarsFocus(item) {
            // 获取该焦点在页面的位置
            // let boxBottom = document.getElementById('#u-dropdown');
            // console.log('元素',boxBottom);
            // let bottom = this.$refs.planViewRef.offsetHeight
            this.keyBoardShow = true;
            this.fayunPlanFocusId = item.orderId;
            this.keyBoardValue = item.numPlan + '';
@@ -375,6 +389,17 @@
            } else{
                this.isCursor = true;
            }
            // 根据列表下标,使屏幕滚动到相应可视位置
            for(let i = 0;i<this.fyData.length;i++){
                if(this.fyData[i].orderId == item.orderId){
                    uni.pageScrollTo({
                        scrollTop: i*144,
                        duration: 300
                    });
                }
            }
        },
        // 键盘
        valChange(val) {
@@ -393,7 +418,7 @@
                        item.numPlan = val;
                        this.keyBoardValue = item.numPlan;
                    }
                }
                }
            });
        },
        backspace() {
@@ -538,7 +563,7 @@
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: vww(44) vww(10) vww(70) vww(10);
    padding: vww(44) vww(10) vww(270) vww(10);
    box-sizing: border-box;
    .main-inside {
        width: 100%;
pages/my-application/my-application.vue
@@ -86,10 +86,10 @@
        <view class="bottom-container">
          <!-- 按钮区域 -->
          <view class="bottom-content__chulizhong bottom-content__item">
            <view @click="withDrawClick(item.procInstId)" v-if="item.status == 1">
            <!-- <view @click="withDrawClick(item.procInstId)" v-if="item.status == 1">
              <image src="@/static/home/cehui.png" mode=""></image>
              <view>撤回</view>
            </view>
            </view> -->
            <view @click="checkTheScheduleClick(item.procInstId)" v-if="item.status == 1">
              <image src="@/static/home/jindu.png" mode=""></image>
              <view>查看进度</view>
@@ -102,18 +102,18 @@
              <image src="@/static/home/history.png" mode=""></image>
              <view>重新申请</view>
            </view> -->
            <view @click="editMyApplication(item)" v-if="item.status == 1 && item.processName == '发运通知单'">
            <!-- <view @click="editMyApplication(item)" v-if="item.status == 1 && item.processName == '发运通知单'">
              <image src="@/static/home/history.png" mode=""></image>
              <view>编辑</view>
            </view>
            </view> -->
            <view @click="approvalHistoryClick(item.procInstId)" v-if="item.status == 2 || item.status == 3">
              <image src="@/static/home/history.png" mode=""></image>
              <view>审批历史</view>
            </view>
                        <view @click="deleteWithDrawApplication(item.tableId)" v-if="item.status == 3">
                        <!-- <view @click="deleteWithDrawApplication(item.tableId)" v-if="item.status == 3">
                            <image src="@/static/home/delete.png" mode=""></image>
                            <view>删除</view>
                        </view>
                        </view> -->
          </view>
        </view>
      </template>
@@ -562,6 +562,14 @@
        url: `/pages/approval-history/approval-history?index=${v}`
      });
    },
        // 删除已撤回申请
        deleteWithDrawApplication(id){
            this.deleteWithDrawApplicationGlobal(id).then(res=>{
                console.log('shenqing,回显',res);
            }).catch(err=>{
                console.log('shenqing,删除错误');
            })
        },
    // 新增申请
    newApplicationClick() {
      uni.navigateTo({
utils/request.js
@@ -18,7 +18,7 @@
const responseFailedDependency = () => {
    uni.showToast({
        title: '登录状态过期,即将返回登录!',
        icon: 'error',
        icon: 'none',
        position: 'top',
        duration: 2000
    });