Mr.Shi
2023-09-11 239c5308af49780bf45a09a05c519e669caec939
小程序
已添加1个文件
已修改18个文件
763 ■■■■■ 文件已修改
minipro_standard/pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/allocation/allocation.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/index/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/mine/mine.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/plannedDistribution/plannedDistribution.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/plannedProgress/plannedProgress.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/components/multipleMaterial.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/outboundList/outboundList.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/transferList/transferList.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/warehousingDetails/warehousingDetails.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/warehousingList/warehousingList.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/equipmentInspection/equipmentInspection.vue 563 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/api/QualityAPI.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/api/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/utils.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages.json
@@ -263,6 +263,13 @@
                        "navigationBarTitleText": "检验详情",
                        "enablePullDownRefresh": false
                    }
                },
                {
                    "path": "pages/equipmentInspection/equipmentInspection",
                    "style": {
                        "navigationBarTitleText": "设备巡检",
                        "enablePullDownRefresh": false
                    }
                }
            ]
        }
minipro_standard/pages/allocation/allocation.vue
@@ -137,6 +137,7 @@
                    if (res.code === 200) {
                        uni.showToast({ title: '分配成功', icon: 'success', duration: 2000, mask: true });
                        setTimeout(() => {
                            uni.$emit('update', { msg:'刷新列表' })
                            uni.navigateBack({ delta: 1 });
                        }, 2000)
                    }
@@ -195,6 +196,9 @@
                    display: flex;
                    flex-direction: column;
                }
                .u-icon__icon {
                    margin-right: 0 !important;
                }
                .fp_list_item_right_dis {
                    display: flex;
                    align-items: center;
@@ -217,15 +221,15 @@
                .black {
                    color: black !important;
                }
                input {
                    width: 180rpx;
                    height: 60rpx;
                    border-radius: 8rpx;
                    border: 2rpx solid #E5E5E5;
                    padding: 0 30rpx;
                    text-align: right;
                    font-size: 25rpx;
                }
                // input {
                //     width: 180rpx;
                //     height: 60rpx;
                //     border-radius: 8rpx;
                //     border: 2rpx solid #E5E5E5;
                //     padding: 0 30rpx;
                //     text-align: right;
                //     font-size: 25rpx;
                // }
                text {
                    font-size: 28rpx;
                    font-weight: 400;
@@ -256,9 +260,12 @@
                    font-weight: 400;
                }
            }
            .fp_list_item_right {
            .fp_list_item_right::v-deep {
                display: flex;
                align-items: center;
                .u-icon__icon {
                    margin-right: 0 !important;
                }
                .wu {
                    text-align: center;
                    text {
@@ -269,15 +276,15 @@
                .black {
                    color: black !important;
                }
                input {
                    width: 180rpx;
                    height: 60rpx;
                    border-radius: 8rpx;
                    border: 1rpx solid #E5E5E5;
                    padding: 0 30rpx;
                    text-align: right;
                    font-size: 25rpx;
                }
                // input {
                //     width: 180rpx;
                //     height: 60rpx;
                //     border-radius: 8rpx;
                //     border: 1rpx solid #E5E5E5;
                //     padding: 0 30rpx;
                //     text-align: right;
                //     font-size: 25rpx;
                // }
                text {
                    font-size: 28rpx;
                    font-weight: 400;
minipro_standard/pages/index/index.vue
@@ -4,9 +4,9 @@
        <!-- {{$store.state.statusbarHeight}} -->
        <u-sticky>
            <view class="plr50 pb30 nav-style">
            <view class="plr30 pb30 nav-style">
                <view
                    :style="{paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
                    :style="{background: '#fff', zIndex: '999', paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
                    å¾…办</view>
                <view class="cY">
                    <u-search placeholder="搜索关键字" bgColor="#f7f7f7" :showAction="false" @search="search"
minipro_standard/pages/mine/mine.vue
@@ -2,7 +2,7 @@
<view>
    <div class="box">
        <div class="box_info" :style="{background: 'url(' + img + ')'}">
            <image :src="userInfo.avatar ? userInfo.avatar : avatar" mode="widthFix" />
            <image :src="avatar" mode="widthFix" />
            <div class="box_info_box">
                <text>{{userInfo.realname}}</text>
                <div class="box_info_box_x" @click="switchOrganization">
minipro_standard/pages/plannedDistribution/plannedDistribution.vue
@@ -93,6 +93,13 @@
        },
        onLoad() {
            this.getLists()
            uni.$on('update', (data) => {
                this.isLoading = true
                this.search.page = 0
                this.list = []
                this.finished = false
                this.getLists()
            })
        },
        methods: {
            // ä¸‹æ‹‰åˆ·æ–°
@@ -107,7 +114,9 @@
            // ç‚¹å‡»å½“前项
            clickItem(i) {
                this.list.forEach((item, index) => {
                    item.isActive = i === index;
                    if (i === index) {
                        item.isActive = !item.isActive
                    }
                })
            },
            // æœç´¢
@@ -139,7 +148,7 @@
                    return
                }
                uni.navigateTo({
                    url: `/pages/allocation/allocation?gxid=${data.procedureId}&jhid=${data.id}&num=${data.workorderDistributNum ? data.num - data.workorderDistributNum : data.num}`
                    url: `/pages/allocation/allocation?gxid=${data.procedureId}&jhid=${data.id}&num=${data.num - data.workorderDistributNum - data.distributNoDoneNum}`
                });
            },
            // èŽ·å–å½“å‰ç”¨æˆ·æ‰€åˆ†é…çš„å·¥åº
minipro_standard/pages/plannedProgress/plannedProgress.vue
@@ -102,7 +102,9 @@
            </scroll-view>
        </view>
        <!-- é€‰æ‹©æ—¥æœŸ -->
        <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm"></u-calendar>
        <!-- <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar> -->
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -217,8 +219,8 @@
            },
            // æ—¥æœŸç¡®å®š
            timeConfirm(val) {
                this.listData.startDate = val[0]
                this.listData.endDate = val[val.length - 1]
                this.listData.startDate = val.startDate
                this.listData.endDate = val.endDate
                this.timeShow = false
            },
            // åˆ‡æ¢å·¥åŽ‚
@@ -247,7 +249,8 @@
            },
            // ç‚¹å‡»æ ‡ç­¾æœç´¢
            clickTag(ids) {
                this.listData.cateIds = ids
                // ids ? ids.split(',') : []
                this.listData.cateIds = ids ? ids.split(',') : []
                this.listData.page = 0
                this.finished = false
                this.lists = []
@@ -332,7 +335,8 @@
                            endDate: this.listData.endDate,
                            procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
                            factoryId: this.listData.departIds,
                            statusList: this.listData.cateIds ? this.listData.cateIds.split(',') : []
                            statusList: this.listData.cateIds
                            // this.listData.cateIds ? this.listData.cateIds.split(',') : []
                        },
                        page: this.listData.page,
                        sorts: [
minipro_standard/pages_adjust/components/multipleMaterial.vue
@@ -63,8 +63,8 @@
            </view> -->
            <view class="fixedBottom bottom cY">
                <view class="fx1 bbox plr30">
                    <u-checkbox-group style="display: block;" name="" @change="selectAll()">
                        <u-checkbox :checked="isAll" label="全选"></u-checkbox>
                    <u-checkbox-group v-model="isAll" style="display: block;" @change="selectAll()">
                        <u-checkbox label="全选" name="all"></u-checkbox>
                    </u-checkbox-group>
                </view>
                <view class="submit sbtn_green bbox tc" @click="submitAction">{{ `提交(${totalNum})`}}</view>
@@ -97,6 +97,7 @@
                loading: false,
                finished: false,
                refreshing: false,
                isAll: false,
                total: 0
            };
        },
@@ -135,6 +136,7 @@
        },
        methods: {
            open() {
                this.isAll = false
                this.show = true
                this.refreshing = false
                this.finished = false
@@ -212,9 +214,11 @@
                this.pages.page = 1
                this.loadData()
            },
            selectAll() {
            selectAll(e) {
                console.log(e)
                console.log(this.isAll)
                this.list.forEach(element => {
                    element.isActive = this.all
                    element.isActive = e.length > 0 ? true : false
                })
            },
            submitAction () {
minipro_standard/pages_adjust/pages/InventoryQuery/InventoryQuery.vue
@@ -2,7 +2,7 @@
    <view class="content">
        <view class="content_search">
            <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true"
                placeholder="搜索仓库名称/物料名称">
                placeholder="搜索仓库名称/物料编码">
                <template v-slot:content>
                    <view class="Search_item">
                        <view class="Search_item_label">汇总依据</view>
minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue
@@ -71,7 +71,7 @@
                    <view class="content_list_item_content_item">
                        <view class="content_list_item_content_item_label">批次号:</view>
                        <view class="content_list_item_content_item_nr">
                            {{ item.batch }}
                            {{ item.batch ? item.batch : '-' }}
                        </view>
                    </view>
                    <view class="content_list_item_content_item">
minipro_standard/pages_adjust/pages/outboundList/outboundList.vue
@@ -90,8 +90,10 @@
            </scroll-view>
        </view>
        <!-- é€‰æ‹©æ—¥æœŸ -->
        <u-calendar mode="range" :show="timeShow" :minDate="minDate" :maxDate="maxDate" @close="timeShow = false"
            @confirm="timeConfirm"></u-calendar>
        <!-- <u-calendar mode="range" :show="timeShow" :minDate="minDate" :maxDate="maxDate" @close="timeShow = false"
            @confirm="timeConfirm"></u-calendar> -->
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -360,8 +362,8 @@
            },
            // æ—¥æœŸç¡®å®š
            timeConfirm(val) {
                this.listData.planDateEnd = val[val.length - 1]
                this.listData.planDateStart = val[0]
                this.listData.planDateEnd = val.endDate
                this.listData.planDateStart = val.startDate
                this.timeShow = false
            },
            // åˆ‡æ¢å·¥åº
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
@@ -2,7 +2,7 @@
    <view class="bg">
        <view class="bg_plan" @click="selectPlan">
            <view class="bg_plan_label" v-if="!from.processPlan">
                <text><b>*</b>工序生产计划</text>
                <text><text>*</text>工序生产计划</text>
            </view>
            <view class="bg_plan_nr" v-else>
                <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} | {{ from.processPlan.produceName }}</text>
@@ -109,7 +109,7 @@
                <view class="bg_list_item_h">
                    <view class="bg_list_item_num">
                        <view class="bg_list_item_num_item">
                            <text><b>*</b>良品数</text>
                            <text><text>*</text>良品数</text>
                            <view class="bg_list_item_num_item_sr">
                                <u--input
                                    placeholder="请输入"
@@ -143,7 +143,8 @@
                    </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>
                            <!-- <text>*</text> -->
                            <text>不良项</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="" />
@@ -161,7 +162,7 @@
                    <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" v-if="arrType && arrType.length > 0 && from.duration > 0">
                <view class="bg_list_item_top">
                    <view class="bg_list_item_top_left">
                        <view class="bg_list_item_top_left_x"></view>
@@ -258,9 +259,9 @@
                    processPlan: null,
                    deviceId: '',
                    deviceName: '',
                    // userId: store.state.userInfo.id,
                    // userId: userInfo.id,
                    userId: '',
                    // userName: store.state.userInfo.companyUser.name,
                    // userName: userInfo.companyUser.name,
                    userName: '',
                    qualified: '',  // è‰¯å“æ•°
                    undesirable: '', // ä¸è‰¯æ•°
@@ -333,8 +334,13 @@
            }
        },
        onReady() {
            let timer = setInterval(() => {
                if (this.userInfo) {
            this.from.userId = this.userInfo.id
            this.form.userName = this.userInfo.realname
                    this.from.userName = this.userInfo.realname
                    clearInterval(timer)
                }
            }, 500)
        },
        onLoad() {
            let arr = []
@@ -722,7 +728,7 @@
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #222222;
                b {
                text {
                    color: red;
                }
            }
@@ -932,9 +938,9 @@
                                overflow: hidden;
                                text-overflow: ellipsis;
                                white-space: nowrap;
                                b {
                                text {
                                    font-size: 30rpx;
                                    color: red;
                                    color: red !important;
                                    margin-right: 5rpx;
                                }
                                .warning {
minipro_standard/pages_adjust/pages/transferList/transferList.vue
@@ -103,13 +103,15 @@
            </scroll-view>
        </view>
        <!-- é€‰æ‹©æ—¥æœŸ -->
        <u-calendar
        <!-- <u-calendar
        :show="timeShow"
        mode="range"
        @close="timeShow = false"
        :minDate="minDate"
        :maxDate="maxDate"
        @confirm="timeConfirm"></u-calendar>
        @confirm="timeConfirm"></u-calendar> -->
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -416,8 +418,8 @@
            // æ—¥æœŸç¡®å®š
            timeConfirm(val) {
                this.listData.outPlanDateStart = val[0]
                this.listData.outPlanDateEnd = val[val.length - 1]
                this.listData.outPlanDateStart = val.startDate
                this.listData.outPlanDateEnd = val.endDate
                this.timeShow = false
            },
            // åˆ‡æ¢å·¥åŽ‚
minipro_standard/pages_adjust/pages/warehousingDetails/warehousingDetails.vue
@@ -86,7 +86,7 @@
                        <view class="content_list_item_content_item">
                            <view class="content_list_item_content_item_label">批次号:</view>
                            <view class="content_list_item_content_item_nr">
                                {{ item.batch }}
                                {{ item.batch ? item.batch : '-' }}
                            </view>
                        </view>
                        <view class="content_list_item_content_item">
@@ -140,6 +140,7 @@
    export default {
        data() {
            return {
                id: null,
                types: [{
                        name: '全部',
                        id: '',
@@ -255,6 +256,7 @@
            };
        },
        onLoad(option) {
            this.id = option.id
            wTransferExtDetail(option.id)
                .then(res => {
                    this.data = res.data
@@ -269,6 +271,9 @@
                if (this.data.status === 0) { // å‡ºåº“
                    console.log('出库')
                    // router.push({ name: 'issueOperation', query: { id: route.query.id, type: 7 } })
                    uni.navigateTo({
                        url: `/pages/OutOperation/OutOperation?id=${this.id}&type=7`
                    });
                } else if (this.data.status === 1) { // å…¥åº“
                    if (this.data.type === 3) { // å¤‡æ–™ç¡®è®¤
                        console.log('备料确认')
@@ -276,6 +281,9 @@
                        return
                    }
                    console.log('入库')
                    uni.navigateTo({
                        url: `/pages/InOperation/InOperation?id=${this.id}&type=7`
                    });
                    // router.push({ name: 'warehousing', query: { id: route.query.id, type: 7 } })
                }
            },
minipro_standard/pages_adjust/pages/warehousingList/warehousingList.vue
@@ -89,8 +89,10 @@
            </scroll-view>
        </view>
        <!-- é€‰æ‹©æ—¥æœŸ -->
        <u-calendar :show="timeShow" mode="range" :minDate="minDate" :maxDate="maxDate" @close="timeShow = false"
            @confirm="timeConfirm"></u-calendar>
        <!-- <u-calendar :show="timeShow" mode="range" :minDate="minDate" :maxDate="maxDate" @close="timeShow = false"
            @confirm="timeConfirm"></u-calendar> -->
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -385,8 +387,8 @@
            },
            // æ—¥æœŸç¡®å®š
            timeConfirm(val) {
                this.listData.planDateStart = val[0]
                this.listData.planDateEnd = val[val.length - 1]
                this.listData.planDateStart = val.startDate
                this.listData.planDateEnd = val.endDate
                this.timeShow = false
            },
            // åˆ‡æ¢å•据类型
minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue
@@ -99,7 +99,9 @@
            </scroll-view>
        </view>
        <!-- é€‰æ‹©æ—¥æœŸ -->
        <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar>
        <!-- <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar> -->
        <l-calendar :lunar="false" v-model="timeShow" @change="timeConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -197,8 +199,8 @@
            },
            // æ—¥æœŸç¡®å®š
            timeConfirm(val) {
                this.pageData.checkStartDate = val[0]
                this.pageData.checkEndDate = val[val.length - 1]
                this.pageData.checkStartDate = val.startDate
                this.pageData.checkEndDate = val.endDate
                this.timeShow = false
            },
            // åˆ‡æ¢æ£€ç±»åž‹
minipro_standard/pages_inspect/pages/equipmentInspection/equipmentInspection.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,563 @@
<template>
    <view class="box1">
        <!--    è®¾å¤‡+日期   -->
        <view class="box_list">
            <view class="box_list_item" @click="open">
                <view class="box_list_item_left">
                    <text>检验设备</text><text>*</text>
                </view>
                <view class="box_list_item_right">
                    <text :style="form.equipmentName ? 'color: #000' : ''">{{ form.equipmentName ? form.equipmentName : '点击选择巡检设备' }}</text>
                    <u-icon name="arrow-right" color="#999999" size="18"></u-icon>
                </view>
            </view>
            <view class="box_list_code" @click.stop="openCode">
                <view class="boxs">
                    <image src="@/static/jianyan_ic_saoma@2x.png" alt="" />
                    <text>扫描设备</text>
                </view>
            </view>
            <view class="box_list_item" @click="showTime = true">
                <view class="box_list_item_left">
                    <text>巡检时间</text><text>*</text>
                </view>
                <view class="box_list_item_right">
                    <text class="black">{{form.time}}</text>
                    <u-icon name="arrow-right" color="#999999" size="18"></u-icon>
                </view>
            </view>
        </view>
        <!--    çŠ¶æ€+图片/视频   -->
        <view class="box_list1">
            <view class="box_list1_item">
                <view class="box_list1_item_left">
                    <text>设备状态</text><text>*</text>
                </view>
                <view class="box_list1_item_right">
                    <view class="box_list1_item_right_item" :class="{'active': item.active}"
                        v-for="(item, index) in status" :key="index" @click="changeItem(index, item.id)">{{item.name}}
                    </view>
                </view>
            </view>
            <view class="box_list1_club">
                <view class="box_list1_club_label">巡检现场照片<text v-show="form.status == '1'">*</text></view>
                <view class="box_list1_club_list">
                    <view class="box_list1_club_list_item" @click="uploadFile">
                        <view class="type">
                            <image class="type_img" src="@/static/btn_upload@2x.png" alt="" />
                        </view>
                    </view>
                    <view class="box_list1_club_list_item" v-for="(item, index) in form.files" :key="index"
                        @click="seeBigFile(index)">
                        <image class="close" src="@/static/ic_delete@2x.png" @click.stop="dele(index)" />
                        <image class="play" src="@/static/ic_play@2x.png" v-if="item.type === 1" />
                        <view class="type">
                            <video :src="item.url" v-if="item.type === 1"></video>
                            <image v-else class="type_img" :src="item.url" mode="widthFix" />
                        </view>
                    </view>
                    <view class="box_list1_club_list_item1"></view>
                    <view class="box_list1_club_list_item1"></view>
                </view>
            </view>
        </view>
        <view class="box_list2">
            <view class="box_list2_label">备注</view>
            <textarea name="" id="" v-model="form.remarks" cols="20" rows="5" maxlength="300"
                placeholder="请详细描述巡检情况"></textarea>
        </view>
        <view class="box_footer">
            <button class="box_footer_submit" v-preventReClick @click="submit">提交</button>
        </view>
        <!-- é€‰æ‹©æ—¶é—´ -->
        <u-datetime-picker :show="showTime" v-model="currentDate" @cancel="showTime = false" @confirm="queding" mode="datetime"></u-datetime-picker>
    </view>
</template>
<script>
    import { getBarcodeContent } from '@/util/api/WorkOrderAPI'
    import { saveBean, getDeviceByCondition, getsbInfo } from '@/util/api/QualityAPI'
    import { queryListByCode, uploadFiles } from '@/util/api/index'
    import { QRCodeType, baseUrl } from '@/common/config.js'
    import { setTime, judgmentType } from '@/util/utils.js'
    import { mapState } from 'vuex'
    export default {
        data() {
            return {
                status: [{
                        name: '正常',
                        active: true,
                        id: '0'
                    },
                    {
                        name: '异常',
                        active: false,
                        id: '1'
                    }
                ],
                columns: [],
                path: '',
                showTime: false,
                currentDate: new Date(),
                form: {
                    equipmentId: '', // è®¾å¤‡id
                    equipmentName: '', //设备名称
                    time: '', // å·¡æ£€æ—¶é—´
                    status: '0', // è®¾å¤‡çŠ¶æ€
                    files: [], // å·¡æ£€å›¾ç‰‡/视频
                    remarks: '' // å¤‡æ³¨
                }
            };
        },
        onLoad() {
            this.form.time = setTime(new Date(), '-')
            this.getqueryListByCode()
        },
        computed: {
            ...mapState(['session'])
        },
        methods: {
            // ç¡®è®¤é€‰æ‹©æ—¥æœŸ
            queding(val) {
                this.form.time = uni.$u.timeFormat(val.value, 'yyyy-mm-dd hh:MM:ss')
                this.showTime = false
            },
            // æ‰«ç 
            openCode() {
                uni.scanCode({
                    onlyFromCamera: true,
                    success: function (result) {
                        getBarcodeContent({
                            barcode: result.result
                        }).then(res => {
                            if (res.code === 200) {
                                if (res.data.barcodeType === QRCodeType.SB) {
                                    getsbInfo(res.data.id)
                                        .then(res1 => {
                                            if (res1.code === 200) {
                                                this.form.equipmentId = res1.data.id
                                                this.form.equipmentName = res1.data.name
                                            }
                                        })
                                } else {
                                    uni.showToast({
                                        title: '请扫描正确的设备码',
                                        icon: 'none',
                                        duration: 2000
                                    });
                                }
                            }
                        })
                    }
                });
            },
            // æ”¹å˜çŠ¶æ€
            changeItem(i, id) {
                this.status.forEach((item, index) => {
                    item.active = index === i;
                })
                this.form.status = id
            },
            submit() {
                if (!this.form.equipmentId) return uni.showToast({
                    title: '设备不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.form.time) return uni.showToast({
                    title: '时间不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.form.status) return uni.showToast({
                    title: '状态不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (this.form.status == '1') {
                    if (this.form.files.length === 0) return uni.showToast({
                        title: '现场照片不能为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                saveBean({
                    checkDate: this.form.time,
                    content: this.form.remarks,
                    deviceId: this.form.equipmentId,
                    status: this.form.status,
                    multiFilesSaveBeans: this.form.files
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({
                            title: '提交成功',
                            icon: 'success',
                            duration: 2000,
                            mask: true
                        });
                        setTimeout(() => {
                            uni.navigateBack({
                                delta: 1
                            });
                        }, 2000)
                    }
                })
            },
            // èŽ·å–å½“å‰ç”¨æˆ·ä¸‹æ‰€æœ‰è®¾å¤‡
            getSB() {
                getDeviceByCondition({})
                    .then(res => {
                        if (res.code === 200 && res.data && res.data.length > 0) {
                            this.columns = []
                            res.data.forEach(item => {
                                this.columns.push({ text: item.name, id: item.id })
                            })
                        }
                    })
            },
            // èŽ·å–æ–‡ä»¶
            async upFile(e) {
                if (this.form.files.length + e.target.files.length > 9) {
                    uni.showToast({
                        title: '最多只能上传9个图片/视频',
                        icon: 'none',
                        duration: 2000
                    });
                    return
                }
                for (let i = 0; i < e.target.files.length; i++) {
                    let type = e.target.files[i].type
                    let index = type.indexOf('/')
                    let data = type.substring(index + 1, type.length)
                    const format = new FormData()
                    format.append('file', e.target.files[i])
                    format.append('folder', this.path)
                    let res = await uploadFiles(format)
                    if (res.code === 200) {
                        form.files.push({
                            fileUrl: res.data.imgaddr,
                            filename: res.data.imgname,
                            filesize: e.target.files[i].size,
                            type: judgmentType(data.toLowerCase()) ? 0 : 1,
                            url: res.data.url
                        })
                    }
                }
                // upload.value.value = ''
            },
            // ç‚¹å‡»ä¸Šä¼ 
            uploadFile() {
                uni.chooseImage({
                    success: (chooseImageRes) => {
                        const tempFilePaths = chooseImageRes.tempFilePaths;
                        console.log(tempFilePaths)
                        uni.uploadFile({
                            url: baseUrl + '/ext/routeCardExt/upload',
                            filePath: tempFilePaths[0],
                            name: 'file',
                            header: {
                                'Cookie': 'eva-auth-token=' + this.session
                            },
                            formData: {
                                'folder': this.path
                            },
                            success: (uploadFileRes) => {
                                console.log(JSON.parse(uploadFileRes.data));
                                let res = JSON.parse(uploadFileRes.data)
                                this.form.files.push({
                                    fileUrl: res.data.imgaddr,
                                    filename: res.data.imgname,
                                    // filesize: e.target.files[i].size,
                                    type: judgmentType(tempFilePaths[0]) ? 0 : 1,
                                    url: res.data.url
                                })
                            }
                        });
                    }
                });
            },
            // èŽ·å–å­—å…¸çº¸
            getqueryListByCode() {
                queryListByCode({
                    dicCode: 'FOLDER',
                    label: 'DEVICE_CHECK'
                }).then(res => {
                    if (res.code === 200) {
                        this.path = res.data[0].code
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .box1 {
        width: 100%;
        height: 100%;
        position: absolute;
        background: #F7F7F7;
        .box_list {
            padding: 0 30rpx 0 30rpx;
            background: white;
            display: flex;
            flex-direction: column;
            .box_list_code {
                margin: 20rpx 0;
                .boxs {
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
                    image {
                        width: 28rpx;
                        height: 28rpx;
                        margin-right: 12rpx;
                    }
                    text {
                        font-size: 28rpx;
                        font-weight: 400;
                        color: $nav-color;
                    }
                }
            }
            .box_list_item {
                height: 98rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-bottom: 1rpx solid #E5E5E5;
                &:last-child {
                    border: none;
                }
                .box_list_item_left {
                    text {
                        font-size: 30rpx;
                        font-weight: 400;
                        &:first-child {
                            color: #222222;
                        }
                        &:last-child {
                            color: #DE5243;
                            margin-left: 8rpx;
                        }
                    }
                }
                .box_list_item_right {
                    display: flex;
                    align-items: center;
                    .black {
                        color: black;
                    }
                    text {
                        font-size: 28rpx;
                        font-weight: 400;
                        color: #999999;
                        margin-right: 10rpx;
                    }
                }
            }
        }
        .box_list1 {
            padding: 30rpx;
            background: white;
            margin-top: 20rpx;
            .box_list1_item {
                height: 98rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-bottom: 1rpx solid #E5E5E5;
                &:last-child {
                    border: none;
                }
                .box_list1_item_left {
                    text {
                        font-size: 30rpx;
                        font-weight: 400;
                        color: #222222;
                        &:last-child {
                            font-size: 30rpx;
                            font-weight: 400;
                            color: #DE5243;
                            margin-left: 4rpx;
                        }
                    }
                }
                .box_list1_item_right {
                    display: flex;
                    align-items: center;
                    .active {
                        color: white !important;
                        background: $nav-color !important;
                    }
                    .box_list1_item_right_item {
                        padding: 18rpx 32rpx;
                        background: #F2F2F2;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-size: 26rpx;
                        font-weight: 400;
                        color: #333333;
                        margin-left: 20rpx;
                        border-radius: 8rpx;
                    }
                }
            }
            .box_list1_club {
                display: flex;
                flex-direction: column;
                margin-top: 36rpx;
                .box_list1_club_label {
                    font-size: 30rpx;
                    font-weight: 400;
                    color: #222222;
                    margin-bottom: 32rpx;
                    text {
                        font-size: 30rpx;
                        font-weight: 400;
                        color: #DE5243;
                        margin-left: 4rpx;
                    }
                }
                .box_list1_club_list {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    flex-wrap: wrap;
                    .box_list1_club_list_item1 {
                        width: 170rpx;
                        height: 0;
                    }
                    .box_list1_club_list_item {
                        width: 150rpx;
                        height: 150rpx;
                        border-radius: 8rpx;
                        position: relative;
                        margin-right: 22rpx;
                        margin-bottom: 22rpx;
                        .type {
                            width: 100%;
                            height: 100%;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            overflow: hidden;
                            position: absolute;
                            top: 0;
                            left: 0;
                            .type_img {
                                width: 100%;
                                height: 100%;
                            }
                            video {
                                height: 100%;
                                z-index: 1;
                            }
                        }
                        .play {
                            position: absolute;
                            left: 50%;
                            top: 50%;
                            width: 56rpx;
                            height: 56rpx;
                            z-index: 9;
                            transform: translate(-50%, -50%);
                        }
                        .close {
                            position: absolute;
                            right: -16rpx;
                            top: -16rpx;
                            width: 32rpx;
                            height: 32rpx;
                            z-index: 9;
                        }
                    }
                }
            }
        }
        .box_list2 {
            padding: 30rpx;
            background: white;
            margin-top: 20rpx;
            display: flex;
            flex-direction: column;
            .box_list2_label {
                font-size: 30rpx;
                font-weight: 400;
                color: #222222;
                margin-bottom: 32rpx;
            }
            textarea {
                border: none;
                font-size: 28rpx;
            }
            textarea::-webkit-input-placeholder {
                font-size: 28rpx;
                font-weight: 400;
                color: #B2B2B2;
            }
        }
        .box_footer {
            width: 100%;
            padding: 0 30rpx 68rpx 30rpx;
            box-sizing: border-box;
            position: fixed;
            bottom: 0;
            left: 0;
            background: #F7F7F7;
            .box_footer_submit {
                width: 100%;
                height: 88rpx;
                background: #4275FC;
                box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.0800);
                border-radius: 8rpx;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 30rpx;
                font-weight: 500;
                color: #FFFFFF;
                border: none;
            }
        }
    }
</style>
minipro_standard/util/api/QualityAPI.js
@@ -38,7 +38,7 @@
// æ ¹æ®ID查询
export function getBYid (id) {
  return request.post(`/ext/workorderCheckExt/${id}`)
  return request.get(`/ext/workorderCheckExt/${id}`)
}
// export function getBYid(id: any): Promise<any> {
//     return httpRequest({
minipro_standard/util/api/index.js
@@ -58,3 +58,8 @@
export function getOrganization(data) {
    return http.post('/ext/departmentExt/getDepartmentListByConditon', data)
}
// èŽ·å–ä¸Šä¼ å­—å…¸å€¼
export function queryListByCode(params) {
    return http.get('/system/dictData/queryListByCode', {params})
}
minipro_standard/util/utils.js
@@ -59,4 +59,20 @@
    number: /^\d+(?:\.\d{1,4})?$/
}
export { gsdate, setTime, setTimeO, REGULAR }
/***
 *
 * @param type æ–‡ä»¶ç±»åž‹
 */
function judgmentType (type) {
    let arr = ['jpg', 'jpeg', 'png']
    // arr.includes(type)
    let open = false
    arr.forEach(item => {
        if (type === item) {
            open = true
        }
    })
    return open;
}
export { gsdate, setTime, setTimeO, REGULAR, judgmentType }