Mr.Shi
2023-09-04 09a4dffa44acc386ab66b4e01af473068586e4fb
小程序
已添加3个文件
已修改9个文件
1774 ■■■■■ 文件已修改
minipro_standard/common/config.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/login/login.vue 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/workbench/workbench.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/components/user.vue 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/processPlan/processPlan.vue 404 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue 1071 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/store/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/api/index.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/request/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/request/requestInterceptors.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/request/responseInterceptors.js 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/common/config.js
@@ -1,7 +1,8 @@
module.exports = {
    // baseUrl: 'http://106.14.20.42/test_hfznzz/',
    // baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
    baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
    baseUrl: 'http://192.168.0.15:10021/',
    // baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
    phoneRegular: /^1[3456789]\d{9}$/,
    mailboxRegular: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
    positiveInteger: /^[0-9]*[1-9][0-9]*$/,
minipro_standard/pages.json
@@ -202,6 +202,20 @@
                        "navigationBarTitleText": "库存量查询",
                        "enablePullDownRefresh": false
                    }
                },
                {
                    "path": "pages/reportingForWork/reportingForWork",
                    "style": {
                        "navigationBarTitleText": "一键报工",
                        "enablePullDownRefresh": false
                    }
                },
                {
                    "path": "pages/processPlan/processPlan",
                    "style": {
                        "navigationBarTitleText": "选择工序计划",
                        "enablePullDownRefresh": false
                    }
                }
            ]
        },
minipro_standard/pages/login/login.vue
@@ -7,50 +7,77 @@
        </view>
        <view class="bg_w rd8 ptb30 pl40 bbox com-input flex input-height">
            <image src="@/static/login_ic_code@2x.png" mode="" class="img40 mr25"></image>
            <u--input placeholder="企业代码" border="none" v-model="loginForm.companyId"></u--input>
            <u--input placeholder="企业代码" border="none" v-model="from.companyId"></u--input>
        </view>
        <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height">
            <image src="@/static/login_ic_phone@2x.png" mode="" class="img40 mr25"></image>
            <u--input placeholder="手机号" border="none" v-model="loginForm.username"></u--input>
            <u--input placeholder="手机号" border="none" v-model="from.username"></u--input>
        </view>
        <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height">
            <image src="@/static/login_ic_password@2x.png" mode="" class="img40 mr25"></image>
            <u--input placeholder="密码" border="none" v-model="loginForm.password"></u--input>
            <u--input placeholder="密码" border="none" v-model="from.password"></u--input>
        </view>
        <view class="login-btn mt80" @click="loginAction">立即登录</view>
    </view>
</template>
<script>
    import { wxAccountLogin, getUserInfo } from '@/util/api/index.js'
    import { wxLogin, wxAccountLogin, getUserInfo, wxProgramLogin } from '@/util/api/index.js';
    export default {
        data() {
            return {
                loginForm: {
                from: {
                    openid: '',
                    unionid: '',
                    companyId: '',
                    username: '',
                    password: ''
                }
            };
        },
        onLoad() {
            var that = this
            uni.login({
                provider: 'weixin',
                success: function (loginRes) {
                    wxProgramLogin({ code: loginRes.code })
                        .then(async (res) => {
                            if (res.code === 200) {
                                // å…ç™»å½•,直接跳首页
                                if (res.data.loginStatus == 0) {
                                    that.$store.commit('SETSESSION', res.data.session)
                                    let info = await getUserInfo()
                                    if (info.code === 200) {
                                        await that.$store.commit('setEntrance', 'WX')
                                        await that.$store.commit('setUserInfo', info.data)
                                        await that.$store.dispatch('getMenuList', 2)
                                        uni.switchTab({
                                            url: '/pages/workbench/workbench'
                                        });
                                    }
                                } else {
                                    that.from.openid = res.data.openid
                                    that.from.unionid = res.data.unionid
                                }
                            }
                        })
                }
            });
        },
        methods: {
            async loginAction() {
                if (!this.loginForm.companyId) return uni.showToast({ title: '企业代码不能为空', icon:"error", duration: 2000 });
                if (!this.loginForm.username) return uni.showToast({ title: '手机号不能为空', icon:"error", duration: 2000 });
                if (!this.loginForm.password) return uni.showToast({ title: '密码不能为空', icon:"error", duration: 2000 });
                let res = await wxAccountLogin({
                    companyId: this.loginForm.companyId,
                    username: this.loginForm.username,
                    password: this.loginForm.password
                })
                if (!this.from.companyId) return uni.showToast({ title: '企业代码不能为空', icon:"error", duration: 2000 });
                if (!this.from.username) return uni.showToast({ title: '手机号不能为空', icon:"error", duration: 2000 });
                if (!this.from.password) return uni.showToast({ title: '密码不能为空', icon:"error", duration: 2000 });
                let res = await wxAccountLogin(this.from)
                if (res.code === 200) {
                    let user = await getUserInfo({})
                    if (user.code === 200) {
                        await this.$store.commit('SETUSERINFO', user.data)
                        await this.$store.dispatch('getMenuList', 2)
                        uni.reLaunch({
                        uni.switchTab({
                            url: '/pages/workbench/workbench'
                        })
                        });
                    }
                }
            }
minipro_standard/pages/workbench/workbench.vue
@@ -1,12 +1,12 @@
<template>
    <view class="index">
        <view class="menu">
            <view class="menu_list" v-for="(row, i) in 3" :key="i">
            <!-- <view class="menu_list" v-for="(row, i) in Menu" :key="i">
                <view class="menu_list_head">
                    <span>常用功能</span>
                    <span>{{row.label}}</span>
                </view>
                <div class="menu_list_list">
                    <view class="menu_list_item" v-for="item in list" :key="item.id" @click="jump(item)">
                    <view class="menu_list_item" v-for="item in row.children" :key="item.id" @click="jump(item)">
                        <image :src="item.icon" mode="widthFix" />
                        <span>{{item.label}}</span>
                    </view>
@@ -14,7 +14,7 @@
                    <view class="menu_list_zw"></view>
                    <view class="menu_list_zw"></view>
                </div>
            </view>
            </view> -->
        </view>
        <myTabbar :index="1" />
    </view>
@@ -22,11 +22,18 @@
<script>
    import myTabbar from "@/components/myTabber.vue"
    import { mapState } from 'vuex'
    
    export default {
        components: {
            myTabbar
        },
        computed: mapState([
            'Menu'
        ]),
        onReady() {
            console.log(this.Menu)
        },
        data() {
            return {
                list: [
minipro_standard/pages_adjust/components/user.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,127 @@
<template>
    <u-popup :show="show" mode="bottom" :closeable="true" :round="10" @open="open" @close="close">
        <view class="title">
            <text>选择生产人员</text>
        </view>
        <view class="content">
            <view class="content_search">
                <u-search :showAction="false" placeholder="搜索姓名" v-model="keyword"></u-search>
            </view>
            <div class="content_total">共{{total}}条数据</div>
            <scroll-view class="content_list" scroll-y>
                <div class="content_list_item" v-for="(item, index) in indexList" :key="index" @click="getVal(item)">
                    <div class="content_list_item_name">
                        <span>{{item.name}}</span>
                    </div>
                </div>
            </scroll-view>
        </view>
    </u-popup>
</template>
<script>
    export default {
        props: {
            show: Boolean
        },
        data() {
            return {
                keyword: '',
                total: 0,
                indexList: []
            };
        },
        methods: {
            getVal(item) {
                this.$emit('value', item)
            },
            open() {
                this.indexList = []
                this.loadmore()
            },
            scrolltolower() {
                this.loadmore()
            },
            loadmore() {
                for (let i = 0; i < 20; i++) {
                    this.indexList.push({
                        id: i,
                        name: `李伟|生产部|${i}`
                    })
                }
            },
            close() {
                this.$emit('close')
            }
        }
    }
</script>
<style lang="scss" scoped>
    .title {
        width: 100%;
        height: 85rpx;
        line-height: 85rpx;
        text-align: center;
        text {
            font-size: 30rpx;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #222222;
        }
    }
    .content {
        width: 100%;
        .content_search {
            width: 100%;
            padding: 0 30rpx 30rpx 30rpx;
            background: white;
            position: sticky;
            top: 85rpx;
            z-index: 9;
            box-sizing: border-box;
        }
        .content_total {
            padding: 24rpx 30rpx;
            background: #F7F7F7;
            font-size: 24rpx;
            font-weight: 400;
            color: #666666;
        }
        .content_list {
            width: 100%;
            height: 800rpx;
            display: flex;
            flex-direction: column;
            .content_list_item {
                padding: 30rpx;
                display: flex;
                border-bottom: 1rpx solid #ececec;
                .serious {
                    color: $nav-stateColor4 !important;
                }
                .success {
                    color: $nav-stateColor2 !important;
                }
                .warning {
                    color: $nav-stateColor5 !important;
                }
                .content_list_item_status {
                    font-size: 28rpx;
                    margin-right: 10rpx;
                }
                .content_list_item_name {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    span {
                        font-size: 30rpx;
                        font-family: PingFangSC-Regular, PingFang SC;
                        font-weight: 400;
                        color: #222222;
                    }
                }
            }
        }
    }
</style>
minipro_standard/pages_adjust/pages/processPlan/processPlan.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,404 @@
<template>
    <view class="content">
        <view class="content_search">
            <Search @searchInput="searchInput" @submit="submit" placeholder="搜索物料名称/编码/工序名称" />
        </view>
        <view class="content_list">
            <scroll-view @scrolltolower="getLists" scroll-y :style="{height: height}">
                <view class="content_list_item" v-for="(item, i) in listData" :key="i" @click="clickItem(item)">
                    <view class="content_list_item_title">
                        <text>{{item.materialName}}|{{item.produceName}}</text>
                        <view class="content_list_item_title_tips" v-if="item.urgent">优先{{ item.urgent }}</view>
                    </view>
                    <view class="content_list_item_nr">
                        <view class="content_list_item_nr_box">
                            <view class="label">物料编码:</view>
                            <view class="cr">{{item.materialName}}丨{{item.materialCode}}</view>
                        </view>
                        <view class="content_list_item_nr_box">
                            <view class="label">计划数量:</view>
                            <view class="cr">{{item.num}}{{item.umodel.name}}</view>
                        </view>
                        <view class="content_list_item_nr_box">
                            <view class="label">计划日期:</view>
                            <view class="cr">{{item.workPlanStartDate}} ~ {{item.workPlanEndDate}}</view>
                        </view>
                        <view class="content_list_item_nr_box">
                            <view class="label">计划员:</view>
                            <view class="cr">{{item.planUserName}}</view>
                        </view>
                        <view class="content_list_item_nr_box">
                            <view class="label">生产批次:</view>
                            <view class="cr">{{item.batch}}</view>
                        </view>
                        <view class="content_list_item_nr_box" v-if="item.salesOrder">
                            <view class="label">销售订单:</view>
                            <view class="cr">{{ item.salesOrder }}</view>
                        </view>
                    </view>
                </view>
            </scroll-view>
        </view>
    </view>
</template>
<script>
    import Search from '@/components/Search.vue'
    export default {
        components: {
            Search
        },
        data() {
            return {
                pageData: {
                    capacity: 10,
                    page: 0,
                    total: 0,
                    name: ''
                },
                loading: false,
                finished: false,
                refreshing: false,
                height: '',
                listData: []
            };
        },
        onReady() {
            var that = this
            this.$nextTick(() => {
                uni.createSelectorQuery().in(this).select('.content_search').boundingClientRect((rect) => {
                    that.height = `calc(100vh - ${rect.height}px)`
                }).exec()
            })
        },
        methods: {
            clickItem(obj) {
                uni.navigateBack({ delta: 1 });
            },
            // èŽ·å–å¤´éƒ¨ç»„ä»¶é«˜åº¦
            getHeight(height) {
                this.height = height
            },
            // æœç´¢
            searchInput(val) {
                this.listData.mixParam = val
                this.listData.page = 0
                this.finished = false
                this.lists = []
                this.getLists()
            },
            // ç‚¹å‡»æ ‡ç­¾æœç´¢
            clickTag(ids) {
                this.listData.cateIds = ids
                this.listData.page = 0
                this.finished = false
                this.lists = []
                // this.getLists()
            },
            // èŽ·å–åˆ—è¡¨ç»Ÿè®¡
            pageCounts() {
                pageCount({
                    factoryId: this.listData.departIds,
                    procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
                    startDate: this.listData.startDate,
                    endDate: this.listData.endDate,
                    statusList: this.listData.cateIds
                }).then(res => {
                    if (res.code === 200 && res.data) {
                        this.tagList[0].num = res.data.allNum.toString()
                        this.tagList[1].num = res.data.startNum.toString()
                        this.tagList[2].num = res.data.ingNum.toString()
                        this.tagList[3].num = res.data.endNum.toString()
                    }
                })
            },
            // èŽ·å–å·¥åŽ‚æ•°æ®
            getOrganizations() {
                getOrganization({
                    type: 1
                }).then(res => {
                    if (res.code === 200 && res.data && res.data.length !== 0) {
                        res.data.forEach((item, i) => {
                            item.isActive = i === 0;
                        })
                        if (res.data.length > 0) {
                            this.factoryList = res.data
                            this.listData.departIds = this.factoryList[0].id
                            this.listData.procedureIds = ''
                            this.finished = false
                            this.getWorkingProcedures(this.factoryList[0].id)
                            this.getLists()
                            this.pageCounts()
                        }
                    }
                })
            },
            // èŽ·å–å·¥åºæ•°æ®
            getWorkingProcedures(orgId) {
                this.data = []
                getWorkingProcedure({
                        orgId
                    })
                    .then(res => {
                        if (res.code === 200 && res.data && res.data.length !== 0) {
                            res.data.forEach((item, i) => {
                                item.isActive = false;
                            })
                            this.data = res.data
                        }
                    })
            },
            // æœç´¢å¼¹æ¡†æäº¤
            submit() {
                let pmodelOrgId = []
                this.data.forEach((item) => {
                    if (item.isActive) {
                        pmodelOrgId.push(item.id)
                    }
                })
                this.listData.procedureIds = pmodelOrgId
                this.listData.page = 0
                this.finished = false
                this.lists = []
                // this.getLists()
                // this.pageCounts()
            },
            // èŽ·å–è®¡åˆ’åˆ—è¡¨æ•°æ®
            getLists() {
                console.log('getLists')
                if (!this.finished) {
                    this.pageData.page = this.pageData.page + 1
                    this.loading = true
                    getList({
                        capacity: this.pageData.capacity,
                        page: this.pageData.page,
                        model: {
                            mixParam: this.pageData.name,
                            statusList: [1, 4],
                            paused: 0
                        },
                        sorts: [
                            { direction: 'DESC', property: 'CREATE_TIME' }
                        ]
                    }).then(res => {
                        if (this.refreshing) {
                            this.listData = []
                            this.refreshing = false;
                        }
                        this.loading = false
                        if (res.code === 200 && res.data.records && res.data.records.length !== 0) {
                            this.pageData.total = res.data.total
                            this.listData.push(...res.data.records)
                        } else {
                            this.finished = true
                        }
                    }).catch(err => {
                        this.loading = false
                        this.finished = true
                        if (this.refreshing) {
                            this.listData = []
                            this.refreshing = false;
                        }
                    })
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
    .content {
        .content_search {
            width: 100%;
            padding: 30rpx;
            background: white;
            position: sticky;
            top: 0;
            z-index: 999;
            box-sizing: border-box;
            .Search_item {
                margin-bottom: 40rpx;
                .Search_item_label {
                    font-size: 30rpx;
                    font-weight: 500;
                    color: #222222;
                }
                .Search_item_content {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-top: 30rpx;
                    .tag {
                        display: flex;
                        flex-wrap: wrap;
                        align-items: center;
                        .tag_active {
                            background: $nav-color !important;
                            color: #ffffff !important;
                        }
                        .tag_item {
                            padding: 22rpx 26rpx;
                            box-sizing: border-box;
                            background: #F2F2F2;
                            border-radius: 8rpx;
                            font-size: 26rpx;
                            font-weight: 400;
                            color: #333333;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            margin-right: 22rpx;
                            margin-bottom: 22rpx;
                        }
                    }
                    text {
                        font-size: 26rpx;
                        font-weight: 400;
                        color: #333333;
                        margin: 0 30rpx;
                    }
                    .Search_item_content_a {
                        padding: 20rpx 0;
                        flex: 1;
                        background: #F7F7F7;
                        border-radius: 8rpx;
                        border: 1rpx solid #EEEEEE;
                        font-size: 26rpx;
                        font-weight: 400;
                        color: #B2B2B2;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                    }
                }
            }
            .content_search_x {
                height: 24rpx;
            }
        }
        .content_list {
            width: 100%;
            display: flex;
            flex-direction: column;
            .content_list_item {
                width: 100%;
                box-sizing: border-box;
                padding: 30rpx;
                background: #ffffff;
                margin-bottom: 20rpx;
                &:last-child {
                    margin-bottom: 0 !important;
                }
                .content_list_item_title {
                    display: flex;
                    align-items: center;
                    .content_list_item_title_tips {
                        padding: 4rpx 8rpx;
                        box-sizing: border-box;
                        background: #DE5243;
                        border-radius: 8rpx;
                        font-size: 22rpx;
                        font-family: PingFangSC-Regular, PingFang SC;
                        font-weight: 400;
                        color: #FFFFFF;
                        margin-left: 16rpx;
                    }
                    .warning {
                        color: $nav-stateColor1 !important;
                    }
                    .green {
                        color: $nav-stateColor6 !important;
                    }
                    text {
                        font-size: 32rpx;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                    }
                }
                .content_list_item_nr {
                    padding: 24rpx 30rpx;
                    background: #F7F7F7;
                    border-radius: 16rpx;
                    margin-top: 30rpx;
                    display: flex;
                    justify-content: space-between;
                    flex-wrap: wrap;
                    .content_list_item_nr_boxs {
                        width: 45%;
                        display: flex;
                        margin-top: 24rpx;
                        &:nth-child(1) {
                            margin-top: 0;
                        }
                        &:nth-child(2) {
                            margin-top: 0;
                        }
                        .warning {
                            color: $nav-stateColor4 !important;
                        }
                        .label {
                            flex-shrink: 0;
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #666666;
                        }
                        .cr {
                            flex: 1;
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #222222;
                            overflow: hidden;
                            white-space: nowrap;
                            text-overflow: ellipsis;
                            -o-text-overflow:ellipsis;
                        }
                    }
                    .content_list_item_nr_box {
                        width: 100%;
                        display: flex;
                        margin-top: 24rpx;
                        &:nth-child(1) {
                            margin-top: 0;
                        }
                        .label {
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #666666;
                            flex-shrink: 0;
                        }
                        .cr {
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #222222;
                        }
                    }
                }
            }
        }
        .content_total {
            width: 100%;
            height: 80rpx;
            padding: 24rpx 30rpx;
            background: #F7F7F7;
            font-size: 24rpx;
            font-weight: 400;
            box-sizing: border-box;
            color: #666666;
            position: sticky;
            z-index: 99;
        }
    }
</style>
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1071 @@
<template>
    <view class="bg">
        <view class="bg_plan" @click="selectPlan">
            <view class="bg_plan_label" v-if="!from.processPlan">
                <text><b>*</b>工序生产计划</text>
            </view>
            <view class="bg_plan_nr" v-else>
                <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} | {{ from.processPlan.produceName }}</text>
                <text>{{ from.processPlan.batch }}{{ from.processPlan.salesOrder ? ` / ${from.processPlan.salesOrder}` : '' }}</text>
                <text>计划时间:{{ from.processPlan.workPlanStartDate }} ~ {{ from.processPlan.workPlanEndDate }}</text>
                <text>计划进度:{{from.processPlan.num}}/{{from.processPlan.workorderDistributNum}}{{ from.processPlan.unitName }}</text>
            </view>
            <view class="bg_plan_label_val">
                <text v-if="!from.processPlan">请选择</text>
                <image src="@/static/ic_ar@2x.png" alt="" />
            </view>
        </view>
        <view class="bg_list">
            <view class="bg_list_item">
                <view class="bg_list_item_top">
                    <view class="bg_list_item_top_left">
                        <view class="bg_list_item_top_left_x"></view>
                        <text>生产信息</text>
                    </view>
                </view>
                <view class="bg_list_item_h">
                    <view class="bg_list_item_num" @click="openDev">
                        <view class="bg_list_item_num_item">
                            <text>生产设备</text>
                            <view class="bg_list_item_num_item_sr">
                                <text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text>
                                <image src="@/static/ic_ar@2x.png" alt="" />
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num" @click="userShow = true">
                        <view class="bg_list_item_num_item">
                            <text>生产人员</text>
                            <view class="bg_list_item_num_item_sr">
                                <text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '请选择'}}</text>
                                <image src="@/static/ic_ar@2x.png" alt="" />
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="bg_list_item">
                <view class="bg_list_item_top">
                    <view class="bg_list_item_top_left">
                        <view class="bg_list_item_top_left_x"></view>
                        <text>生产投料</text>
                    </view>
                    <view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0">
                        <image src="@/static/gongdan_ic_shoudong@2x.png" alt="" />
                        <text>新增投料</text>
                    </view>
                </view>
                <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
                    <van-swipe-cell v-for="(item, index) in wuList" :key="index">
                        <view class="bg_list_item_h">
                            <view class="bg_list_item_num">
                                <view class="bg_list_item_num_item">
                                    <view class="bg_list_item_num_item_wl">
                                        <text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text>
                                        <view class="bg_list_item_num_item_wl_lx">
                                            <text class="green" v-if="item.qualityType == 0">合格&nbsp;/&nbsp;</text>
                                            <text class="yellow" v-if="item.qualityType == 1">不良&nbsp;/&nbsp;</text>
                                            <text class="red" v-if="item.qualityType == 2">报废&nbsp;/&nbsp;</text>
                                            <text>{{ item.locationName }}&nbsp;/&nbsp;</text>
                                            <text>{{ item.batch }}</text>
                                        </view>
                                    </view>
                                    <view class="bg_list_item_num_item_sr">
                                        <u--input
                                            placeholder="请输入"
                                            border="surround"
                                            type="number"
                                            :customStyle="{width: '180rpx'}"
                                            v-model="item.num"
                                            @input="inputwl(index)"
                                          ></u--input>
                                        <!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> -->
                                        <text>{{ item.unitName }}</text>
                                    </view>
                                </view>
                            </view>
                        </view>
                        <template #right>
                            <van-button style="height: 100%;" @click="deleItem(index)" square text="删除" type="danger" />
                        </template>
                    </van-swipe-cell>
                </template>
                <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
                    <view class="kong">
                        <text>暂无数据</text>
                    </view>
                </template>
                <view class="kong" v-if="hasBom == 1 && bomType == 1">
                    <text>当前工序无需投料</text>
                </view>
            </view>
            <view class="bg_list_item bottomval">
                <view class="bg_list_item_top">
                    <view class="bg_list_item_top_left">
                        <view class="bg_list_item_top_left_x"></view>
                        <text>产出明细</text>
                    </view>
                </view>
                <view class="bg_list_item_h">
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text><b>*</b>良品数</text>
                            <view class="bg_list_item_num_item_sr">
                                <u--input
                                    placeholder="请输入"
                                    border="surround"
                                    type="number"
                                    :customStyle="{width: '180rpx'}"
                                    v-model="from.qualified"
                                    @input="changeNum(1)"
                                  ></u--input>
                                <!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" /> -->
                                <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text>不良数</text>
                            <view class="bg_list_item_num_item_sr">
                                <u--input
                                    placeholder="请输入"
                                    border="surround"
                                    type="number"
                                    :customStyle="{width: '180rpx'}"
                                    v-model="from.undesirable"
                                    @input="changeNum(2)"
                                  ></u--input>
                                <!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="请输入" /> -->
                                <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num" v-if="from.undesirable > 0">
                        <view class="bg_list_item_num_item" @click="openBL">
                            <text><b>*</b>不良项</text>
                            <view class="bg_list_item_num_item_sr">
                                <text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '设置'}}</text>
                                <image src="@/static/ic_ar@2x.png" alt="" />
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="bg_plan" @click="TimeShow = true">
                <view class="bg_plan_label">
                    <text>报工时长</text>
                </view>
                <view class="bg_plan_label_val">
                    <text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '请选择'}}</text>
                    <image src="@/static/ic_ar@2x.png" alt="" />
                </view>
            </view>
            <view class="bg_list_item" v-if="arrType && arrType.length > 0">
                <view class="bg_list_item_top">
                    <view class="bg_list_item_top_left">
                        <view class="bg_list_item_top_left_x"></view>
                        <text>工资绩效</text>
                    </view>
                </view>
                <view class="bg_list_item_h">
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text>计件方式</text>
                            <view class="bg_list_item_num_item_list">
                                <view :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'" v-for="(item, index) in arrType" :key="index" @click="clickPerformanceType(index)">{{ item.name }}</view>
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text>工资单价</text>
                            <view class="bg_list_item_num_item_sr">
                                <text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}元/{{arrType[from.index].type == 0 ? 'ä»¶' : '时'}}</text>
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text>预计工资</text>
                            <view class="bg_list_item_num_item_sr">
                                <text class="color1">{{expectedSalary}}元</text>
                            </view>
                        </view>
                    </view>
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text>达标率</text>
                            <view class="bg_list_item_num_item_sr">
                                <text class="color1">{{complianceRate}}%</text>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!--  æŠ¥å·¥æŒ‰é’®  -->
        <view class="bh_zw"></view>
        <view class="bg_footer">
            <view class="bg_footer_submit1" @click="continueSubmit">继续报工</view>
            <view class="bg_footer_submit" @click="submit">提交</view>
        </view>
        <!-- ç”Ÿäº§äººå‘˜ -->
        <user :show="userShow" @close="userShow = false" @value="onConfirm1" />
        <!-- ç”Ÿäº§è®¾å¤‡ -->
        <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm" @cancel="onCancel"></u-picker>
        <!-- æ—¶é—´ -->
        <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker>
        <!-- ç‰©æ–™ -->
        <selectMaterial ref="selectMaterial" @selectAction="getValue" />
        <!-- ä¸è‰¯é¡¹ -->
        <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000">
            <view class="rp p40 contanir">
                <view class="c2 b tc">不良项</view>
                <view class="content bl_list">
                    <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)">
                        <div class="bl_list_item_left">
                            <u-checkbox-group>
                                <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox>
                            </u-checkbox-group>
                        </div>
                        <div class="bl_list_item_right">
                            <input type="number" @click.stop v-model="item.num" placeholder="0" />
                        </div>
                    </div>
                </view>
                <view class="flex ap tc bottom-view">
                    <view class="fx1 ml20 ptb20 sbtn_green" @click="onConfirm3">确定</view>
                </view>
            </view>
        </u-popup>
    </view>
</template>
<script>
    import user from '../../components/user.vue'
    import selectMaterial from '@/components/selectMaterial.vue'
    export default {
        components: {
            user,
            selectMaterial
        },
        data() {
            return {
                from: {
                    processPlan: null,
                    deviceId: '',
                    deviceName: '',
                    // userId: store.state.userInfo.id,
                    userId: '',
                    // userName: store.state.userInfo.companyUser.name,
                    userName: '',
                    qualified: '',  // è‰¯å“æ•°
                    undesirable: '', // ä¸è‰¯æ•°
                    duration: '',
                    durationName: '0小时0分钟',
                    time: '',
                    defective: [],
                    defectiveName: '',
                    type: '',    // ç»©æ•ˆç±»åž‹
                    index: 0
                },
                columns: [],
                arrType: [],
                bomType: '',
                hasBom : '',
                deviceShow: false,
                userShow: false,
                wuList: [],
                deviceList: [],
                cateList: [
                    {
                        active: false,
                        num: '',
                        name: '有瑕疵'
                    }
                ],
                total: 0,    // å¯æŠ•数量
                ids: '',
                plansId: '',
                deviceId: '',
                TimeShow: '',
                show1: '',
                show: false
            };
        },
        computed: {
            // é¢„计工资
            expectedSalary() {
                if (this.arrType.length === 0) return 0;
                if (this.arrType[from.index].type == 0) {
                    if (!this.from.qualified) return 0
                    if (this.arrType[from.index].unqualified == 1) {   // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                        let total = Number(this.from.qualified) + Number(this.from.undesirable)
                        return (total * (this.arrType[from.index].salary / 10 / 10)).toFixed(2)
                    } else {
                        return (Number(this.from.qualified) * (this.arrType[from.index].salary / 10 / 10)).toFixed(2)
                    }
                } else {
                    if (!this.from.duration) return 0;
                    let h = (this.from.duration / 60 / 60).toFixed(2)
                    return (Number(h) * (this.arrType[from.index].salary / 10 / 10)).toFixed(2)
                }
            },
            // è¾¾æ ‡çއ
            complianceRate() {
                if (this.arrType.length === 0) return 0;
                if (!this.from.qualified && !this.from.undesirable) return 0;
                if (!this.from.duration) return 0;
                if (!this.arrType[from.index].num) return 0;
                if (this.arrType[from.index].unqualified == 1) {   // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(this.from.qualified) + Number(this.from.undesirable)) / (this.from.duration / 3600)).toFixed(2)
                    let b = (this.arrType[from.index].num / (this.arrType[from.index].times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                } else {
                    let a = (this.from.qualified / (this.from.duration / 3600)).toFixed(2)
                    let b = (this.arrType[from.index].num / (this.arrType[from.index].times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                }
            }
        },
        onLoad() {
            let arr = []
            for(let i = 0; i < 60; i++) {
                arr.push(i)
            }
            this.columns = [arr, arr]
        },
        methods: {
            // åˆ‡æ¢ç»©æ•ˆç±»åž‹
            clickPerformanceType(i) {
                this.from.index = i
                this.arrType.forEach((item, index) => {
                    if (i === index) {
                        from.type = item.id
                    }
                    item.active = index === i
                })
            },
            // é€‰æ‹©ç‰©æ–™
            getValue(val) {
                let obj = JSON.parse(JSON.stringify(val))
                obj.total = val.num
                this.wuList.unshift(obj)
                let arr = this.wuList.map(item => item.id)
                this.ids = arr.join(',')
            },
            // èŽ·å–ä¸è‰¯é¡¹ç›®
            getData() {
                categoryExtList({
                    cateType: "3"
                }).then(res => {
                    if (res.code === 200) {
                        res.data.forEach(item => {
                            item.active = false
                            item.num = ''
                        })
                        this.cateList = res.data
                    }
                })
            },
            // é€‰æ‹©è®¾å¤‡
            onConfirm(e) {
                this.from.deviceId = e.id
                this.from.deviceName = e.name
                this.deviceId = e.id
                this.from.userId = ''
                this.from.userName = ''
                // getFindAll({
                //     deviceId: e.id,
                //     planId: from.processPlan.id
                // }).then(res => {
                //     if (res.code === 200) {
                //         res.data.forEach((item: any) => {
                //             item.name = item.umodel.name + '-' + item.tmodel.name
                //         })
                //         userList.value = res.data
                //     }
                // })
                this.deviceShow = false
            },
            // é€‰æ‹©ä¸è‰¯é¡¹
            onConfirm3() {
                let isOpen = false
                this.cateList.forEach((item, index) => {
                    if (item.active) {
                        isOpen = true
                    }
                })
                if (!isOpen) return uni.showToast({ title: '请选择不良项', icon: 'none', duration: 2000 });
                let arr = []
                let total = 0
                let name = ''
                for (let i = 0; i < this.cateList.length; i++) {
                    if (this.cateList[i].active) {
                        if (this.cateList[i].num <= 0) {
                            return uni.showToast({ title: '不良数量必须大于0', icon: 'none', duration: 2000 });
                        }
                        total = total += this.cateList[i].num
                        arr.push(this.cateList[i])
                        name += this.cateList[i].name + this.cateList[i].num + ';'
                    }
                }
                if (total !== this.from.undesirable) return uni.showToast({ title: '不良数必须等于产出不良数', icon: 'none', duration: 2000 });
                this.from.defective = arr
                this.from.defectiveName = name
                this.show = false
            },
            changeChecked(i) {
                this.cateList[i].active = !this.cateList[i].active
            },
            onConfirm2(e) {
                let h = e.value[0]
                let m = e.value[1]
                let s = 0
                if (h > 0) {
                    s += h * 60 * 60
                }
                if (m > 0) {
                    s += m * 60
                }
                this.from.duration = s
                this.from.durationName = `${h}小时${m}分钟`
                this.TimeShow = false
            },
            onConfirm1(e) {
                this.from.userId = e.userId
                this.from.userName = e.name
                this.userShow = false
            },
            selectPlan() {
                uni.navigateTo({
                    url: '/pages_adjust/pages/processPlan/processPlan'
                });
            },
            openDev() {
                if (!this.from.processPlan) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 });
                this.deviceShow = true
            },
            openMaterial() {
                if (!this.plansId) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 });
                if (!this.deviceId) return uni.showToast({ title: '请先选择生产设备', icon: 'none', duration: 2000 });
                this.$refs.selectMaterial.open({})
            },
            inputwl(i) {
                if (this.wuList[i].num > this.wuList[i].total) {
                    this.wuList[i].num = ''
                    uni.showToast({ title: '投料数量不能大于库存数量', icon: 'none', duration: 2000 });
                }
            },
            deleItem(index) {
                if (this.wuList.length === 1) return uni.showToast({ title: '至少保留一项内容', icon: 'none', duration: 2000 });
                this.wuList.splice(index, 1)
            },
            // äº§å‡ºæ•°é‡éªŒè¯
            changeNum(type) {
                let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable))
                if (type == 2) {
                    this.from.defective = []
                    this.from.defectiveName = ''
                }
                if (num < 0) {
                    uni.showToast({ title: '产出数量不能大于可产出数量!', icon: 'none', duration: 2000 });
                    if (type == 1) {
                        this.from.qualified = ''
                    } else {
                        this.from.undesirable = ''
                    }
                }
            },
            openBL() {
                this.cateList.forEach(item => {
                    if (!item.active) {
                        item.num = ''
                    }
                    if (item.active && item.num <= 0) {
                        item.active = false
                    }
                })
                this.show = true
            },
            // ç»§ç»­æŠ¥å·¥
            continueSubmit() {
                if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 });
                if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 });
                if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 });
                }
                if (this.from.qualified && this.from.qualified <= 0) {
                    return uni.showToast({ title: '良品数必须大于0', icon: 'none', duration: 2000 });
                }
                if (this.from.undesirable && this.from.undesirable <= 0) {
                    return uni.showToast({ title: '不良品数必须大于0', icon: 'none', duration: 2000 });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 });
                        this.from.processPlan = null
                        this.from.deviceId = ''
                        this.from.deviceName = ''
                        this.from.userId = ''
                        this.from.userName = ''
                        this.from.qualified = ''
                        this.from.undesirable = ''
                        this.from.duration = ''
                        this.from.durationName = '0小时0分钟'
                        this.from.time = ''
                        this.from.defective = []
                        this.from.defectiveName = ''
                        this.wuList = []
                        this.deviceId = ''
                        this.plansId = ''
                        this.ids = ''
                        this.total = ''
                    }
                })
            },
            // æŠ¥å·¥
            submit() {
                if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 });
                if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 });
                if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 });
                        setTimeout(() => {
                            uni.navigateBack({ delta: 1 });
                        }, 2000);
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .bg {
        width: 100%;
        position: absolute;
        background: #F7F7F7;
        .contanir {
            height: calc(env(safe-area-inset-bottom) + 720rpx);
            .content {
                margin-top: 20rpx;
                .type-style {
                    width: 325rpx;
                    margin-bottom: 20rpx;
                }
            }
        }
        .bg_plan {
            width: 100%;
            // height: 98rpx;
            padding: 30rpx;
            box-sizing: border-box;
            background: #FFFFFF;
            margin-bottom: 40rpx;
            display: flex;
            align-items: center;
            justify-content: space-between;
            text {
                font-size: 30rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #222222;
                b {
                    color: red;
                }
            }
            .bg_plan_nr {
                display: flex;
                flex-direction: column;
                text {
                    font-size: 24rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #666666;
                    margin-top: 20rpx;
                    &:first-child {
                        font-size: 32rpx;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                        margin-top: 0 !important;
                    }
                }
            }
            .bg_plan_label_val {
                display: flex;
                align-items: center;
                text {
                    font-size: 28rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #999999;
                }
                image {
                    width: 12rpx;
                    height: 24rpx;
                    margin-left: 20rpx;
                }
            }
        }
        .bg_list {
            width: 100%;
            display: flex;
            flex-direction: column;
            .bottomval {
                margin-bottom: 20rpx !important;
            }
            .bg_list_item {
                display: flex;
                flex-direction: column;
                margin-bottom: 40rpx;
                .kong {
                    text-align: center;
                    padding: 30rpx 0;
                    background: #ffffff;
                    font-size: 25rpx;
                    text {
                        color: #474747;
                    }
                }
                .bg_list_item_top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding-left: 30rpx;
                    padding-right: 30rpx;
                    margin-bottom: 30rpx;
                    .bg_list_item_top_left {
                        display: flex;
                        align-items: center;
                        .left {
                            margin-left: 12rpx;
                            font-size: 28rpx;
                        }
                        .warning {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor5 !important;
                        }
                        .error {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor4 !important;
                        }
                        .bg_list_item_top_left_x {
                            width: 8rpx;
                            height: 30rpx;
                            background: $nav-color;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 32rpx;
                            font-weight: 500;
                            color: #222222;
                            display: flex;
                            align-items: center;
                        }
                    }
                    .bg_list_item_top_right {
                        display: flex;
                        align-items: center;
                        image {
                            width: 28rpx;
                            height: 28rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 28rpx;
                            font-weight: 400;
                            color: $nav-color;
                        }
                    }
                }
                .top {
                    margin-top: 20rpx !important;
                }
                .bg_list_item_h {
                    width: 100%;
                    padding: 0 30rpx;
                    box-sizing: border-box;
                    background: white;
                    .bg_list_item_num {
                        width: 100%;
                        min-height: 98rpx;
                        background: white;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border-bottom: 1rpx solid #E5E5E5;
                        &:last-child {
                            border: none !important;
                        }
                        .kong {
                            text-align: center;
                            font-size: 25rpx;
                            padding: 30rpx 0;
                            background: #ffffff;
                        }
                        .bg_list_item_num_item {
                            width: 100%;
                            height: 100%;
                            display: flex;
                            align-items: center;
                            // height: 118rpx;
                            padding: 15rpx 0;
                            box-sizing: border-box;
                            justify-content: space-between;
                            border-bottom: 1rpx solid #E5E5E5;
                            &:last-child {
                                border: none;
                            }
                            .bg_list_item_num_item_list {
                                display: flex;
                                align-items: center;
                                .active {
                                    background: #305ED5 !important;
                                    color: #FFFFFF !important;
                                }
                                .bg_list_item_num_item_list_item {
                                    width: 116rpx;
                                    height: 62rpx;
                                    line-height: 62rpx;
                                    text-align: center;
                                    background: #F2F2F2;
                                    border-radius: 8rpx;
                                    font-size: 26rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                    margin-right: 20rpx;
                                    &:last-child {
                                        margin: 0 !important;
                                    }
                                }
                            }
                            .bg_list_item_num_item_wl {
                                flex-shrink: 0;
                                display: flex;
                                flex-direction: column;
                                text {
                                    font-size: 34rpx;
                                    color: #222222;
                                }
                                .bg_list_item_num_item_wl_lx {
                                    margin-top: 10rpx;
                                    text {
                                        color: #222222;
                                        font-size: 28rpx;
                                    }
                                }
                            }
                            .warning {
                                color: $nav-stateColor5 !important;
                            }
                            .err {
                                color: $nav-stateColor4 !important;
                            }
                            image {
                                width: 12rpx;
                                height: 24rpx;
                                margin-left: 20rpx;
                            }
                            text {
                                flex-shrink: 0;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                white-space: nowrap;
                                b {
                                    font-size: 30rpx;
                                    color: red;
                                    margin-right: 5rpx;
                                }
                                .warning {
                                    color: $nav-stateColor5 !important;
                                    margin-right: 5rpx;
                                }
                                .err {
                                    color: $nav-stateColor4 !important;
                                    margin-right: 5rpx;
                                }
                                &:nth-child(1) {
                                    font-size: 30rpx;
                                    font-weight: 400;
                                    color: #222222;
                                }
                                &:nth-child(2) {
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    flex-shrink: 0;
                                }
                            }
                            .bg_list_item_num_item_sr {
                                // flex: 1;
                                display: flex;
                                align-items: center;
                                justify-content: flex-end;
                                .color1 {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                }
                                input::-webkit-input-placeholder {
                                    font-size: 28rpx;
                                }
                                input {
                                    text-align: right;
                                    width: 180rpx;
                                    height: 60rpx;
                                    border-radius: 8rpx;
                                    border: 1rpx solid #E5E5E5;
                                    margin-right: 20rpx;
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    padding: 0 30rpx;
                                }
                                .wulll {
                                    width: 400rpx;
                                    text-align: right;
                                    overflow: hidden;
                                    white-space: nowrap;
                                    text-overflow: ellipsis;
                                }
                                text {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #999999;
                                }
                            }
                        }
                    }
                }
            }
        }
        .bh_zw {
            height: 160rpx;
        }
        .bg_footer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 9;
            padding: 0 30rpx 60rpx 30rpx;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .bg_footer_submit1 {
                width: 334rpx;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #FFFFFF;
                box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0,0,0,0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #305ED5;
            }
            .bg_footer_submit {
                width: 334rpx;
                height: 88rpx;
                background: $nav-color;
                box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-weight: 500;
                color: #FFFFFF;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
        .bl {
            width: 100%;
            height: 800rpx;
            padding: 30rpx;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            .bl_head {
                width: 100%;
                height: 50rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                text {
                    font-size: 28rpx;
                    color: #222222;
                    &:nth-child(2) {
                        font-size: 32rpx !important;
                    }
                }
                image {
                    width: 28rpx;
                    height: 28rpx;
                }
            }
            .bl_footer {
                width: 100%;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #305ED5;
                border-radius: 8rpx;
                font-size: 32rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #FFFFFF;
                margin-top: 30rpx;
            }
            .bl_list {
                width: 100%;
                height: calc(100% - 168rpx);
                overflow-y: scroll;
                margin-top: 30rpx;
                .bl_list_item {
                    width: 100%;
                    height: 96rpx;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    border-bottom: 1rpx solid #E5E5E5;
                    &:last-child {
                        border: none !important;
                    }
                    .bl_list_item_left {
                        flex: 1;
                        display: flex;
                        align-items: center;
                        input {
                            width: 30rpx;
                            height: 30rpx;
                            border: 1rpx solid #CCCCCC;
                            margin: 0 !important;
                        }
                        text {
                            font-size: 30rpx;
                            color: #222222;
                            margin-left: 10rpx;
                        }
                    }
                    .bl_list_item_right {
                        flex: 1;
                        height: 50rpx;
                        text-align: right;
                        input {
                            padding-left: 5rpx;
                            width: 160rpx;
                            height: 100%;
                            padding: 0 30rpx;
                            box-sizing: border-box;
                            text-align: right;
                            font-size: 28rpx;
                            color: #333333;
                            border-radius: 10rpx;
                            border: 1rpx solid #CCCCCC;
                            &::-webkit-input-placeholder {
                                font-size: 28rpx;
                                font-family: PingFangSC-Regular, PingFang SC;
                                font-weight: 400;
                                color: #999999;
                            }
                        }
                    }
                }
            }
        }
    }
</style>
minipro_standard/store/index.js
@@ -10,6 +10,7 @@
const token = uni.getStorageSync('token');
const userInfo = uni.getStorageSync('userInfo');
const Menu = uni.getStorageSync('MenuList');
const session = uni.getStorageSync('session');
// Vuex.Store æž„造器选项
@@ -22,6 +23,7 @@
        menuButtonWidth: menuButtonWidth || '0',
        statusbarHeight: statusbarHeight || '0',
        navHeight: navHeight || '0',
        session: session ? session : '',
        // èœå•权限
        Menu: Menu ? Menu : [],
        // å¾…办数量
@@ -54,6 +56,10 @@
        SETMENU (state, data) {
            state.Menu = data
            uni.setStorageSync('MenuList', JSON.stringify(data));
        },
        SETSESSION (state, data) {
            state.session = data;
            uni.setStorageSync('session', data);
        }
    },
    actions: {
minipro_standard/util/api/index.js
@@ -24,7 +24,7 @@
    return http.get(`/wechat/logout`)
}
// ç™»å½•
// å¾®ä¿¡å…¬ä¼—号登录
export function wxAccountLogin(data) {
    return http.post('/system/wxAccountLogin', data)
}
@@ -33,3 +33,13 @@
export function getUserInfo(params) {
    return http.get('/system/getUserInfo', {params})
}
// èŽ·å–å¾®ä¿¡openId
export function wxLogin(params) {
    return http.get('/system/wxLogin', {params})
}
// å¾®ä¿¡å°ç¨‹åºç™»å½•
export function wxProgramLogin(params) {
    return http.get('/system/wxProgramLogin', {params})
}
minipro_standard/util/request/index.js
@@ -5,7 +5,7 @@
    /* defaultConfig ä¸ºé»˜è®¤å…¨å±€é…ç½® */
    defaultConfig.baseURL = baseUrl /* æ ¹åŸŸå */
        defaultConfig.header = {
            'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
            'content-type': 'application/json;charset=utf-8',
        }
        defaultConfig.dataType = 'json'
    return defaultConfig
minipro_standard/util/request/requestInterceptors.js
@@ -3,19 +3,11 @@
 * @param {Object} http
 */
module.exports = (vm) => {
    // console.log(vm)
    uni.$u.http.interceptors.request.use((config) => { // å¯ä½¿ç”¨async await åšå¼‚步操作
            // åˆå§‹åŒ–请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
            console.log('请求拦截');
        console.log(config)
        config.header['Cookie'] = 'eva-auth-token=' + vm.$store.state.session
        uni.showLoading({ title: '请求中' });
            config.data = config.data || {}
            const token = vm.$store.state.token
            if (token) {
                config.header.token = token
            }
            // å¯ä»¥åœ¨æ­¤é€šè¿‡vm引用vuex中的变量,具体值在vm.$store.state中
            // console.log(vm.$store.state);
            return config
        }, (config) => // å¯ä½¿ç”¨async await åšå¼‚步操作
        Promise.reject(config))
    }, (config) => Promise.reject(config)) // å¯ä½¿ç”¨async await åšå¼‚步操作
}
minipro_standard/util/request/responseInterceptors.js
@@ -4,25 +4,38 @@
 */
module.exports = (vm) => {
    uni.$u.http.interceptors.response.use((response) => {
        /* å¯¹å“åº”成功做点什么 å¯ä½¿ç”¨async await åšå¼‚步操作*/
        uni.hideLoading();
        const data = response.data
        // è‡ªå®šä¹‰å‚æ•°
        // const custom = response.config?.custom
        // if (data.code !== 200) { // æœåŠ¡ç«¯è¿”å›žçš„çŠ¶æ€ç ä¸ç­‰äºŽ200,则reject()
        //     uni.$u.toast(data.message)
        //     if (data.code === 401) {
        //         // console.log('未登录、登录失效');
        //         // æœªç™»å½•、登录失效
        //         uni.reLaunch({
        //             url: '/pages/login/login'
        //         })
        //     }
        //     return Promise.reject(data)
        // }
        // console.log(data.data);
        return data.data || {}
        if (response.data.code === 401) {     // å¤„理登录过期
            uni.showToast({ title: '登录过期,准备自动重新登录', icon: 'none', duration: 2000, mask: true });
            setTimeout(() => {
                uni.reLaunch({ url: '/pages/login/login' });
            }, 2000)
            return
        }
        if (response.data.code !== 200) {     // è¯·æ±‚报错
            uni.showToast({ title: response.data.message, icon: 'none', duration: 2000 });
        }
        return data || {}
    }, (response) => {
        /*  å¯¹å“åº”错误做点什么 ï¼ˆstatusCode !== 200)*/
        uni.hideLoading();
        let code;
        if (error.code === "ECONNABORTED") {
            code = 999
        } else {
            code = error.response.status
        }
        switch (code) {
            case 404:
                uni.showToast({ title: '请求资源不存在', icon: 'none', duration: 2000 });
                break;
            case 500:
                uni.showToast({ title: '服务器资源错误', icon: 'none', duration: 2000 });
                break;
            case 999:
                uni.showToast({ title: '请求超时', icon: 'none', duration: 2000 });
                break;
        }
        return Promise.reject(response)
    })
}