ll
liukangdong
2025-01-20 8f03d1529c77bd91c0764e7b25e7a356a614b435
ll
已添加10个文件
已修改6个文件
1411 ■■■■■ 文件已修改
h5/api/yw.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages.json 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/inventory/detail.vue 665 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/inventory/index.vue 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/operation/device.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/polling/detail.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/polling/point.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/workOrder/detail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/workOrder/problemEdit.vue 313 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/pages/workOrder/result.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/ic_paysuccess@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/side/btn_jia@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/side/btn_jian@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/side/btn_jian_grey@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/side/ic_pandian@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/static/side/ic_pandian_grey@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
h5/api/yw.js
@@ -28,6 +28,12 @@
    data
  })
}
export const ywProblemCreate = (data) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywProblem/create',
    data
  })
}
// é¡¹ç›®åˆ—表
export const ywProjectPost = (data) => {
  return http({
@@ -135,3 +141,45 @@
    data
  })
}
export const getFindByCode = (code) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywDevice/findByCode?deviceCode=' + code,
        method: 'get',
  })
}
export const getYwStocktaking = (data) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktaking/page',
    data
  })
}
export const ywStocktakingDetail = (id) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktaking/' + id,
        method: 'get'
  })
}
export const ywStocktakingBegin = (id) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktaking/beginById?id=' + id,
        method: 'get'
  })
}
export const ywStocktaFinishById = (id) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktaking/finishById?id=' + id,
        method: 'get'
  })
}
export const getYwStocktakingRecord = (data) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktakingRecord/page',
        data
  })
}
export const takingDataOpen = (data) => {
  return http({
    url: 'visitsAdmin/cloudService/business/ywStocktakingRecord/takingData',
        data
  })
}
h5/pages.json
@@ -83,6 +83,34 @@
            {
                "navigationBarTitleText" : "选择人员"
            }
        },
        {
            "path" : "pages/inventory/index",
            "style" :
            {
                "navigationBarTitleText" : "库存盘点"
            }
        },
        {
            "path" : "pages/inventory/detail",
            "style" :
            {
                "navigationBarTitleText" : "盘点单"
            }
        },
        {
            "path" : "pages/workOrder/problemEdit",
            "style" :
            {
                "navigationBarTitleText" : "问题上报"
            }
        },
        {
            "path" : "pages/workOrder/result",
            "style" :
            {
                "navigationBarTitleText" : "问题上报"
            }
        }
    ],
    "globalStyle": {
h5/pages/inventory/detail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,665 @@
<template>
    <view class="main_app">
        <view class="main_head">
            <view class="tabs">
                <view class="tab" :class="{active: activeTab == 0}" @click="tabsClick(0)">
                    <text>未盘({{info.unFinishAmount || 0}})</text>
                    <text class="border"></text>
                </view>
                <view class="tab" :class="{active: activeTab == 1}" @click="tabsClick(1)">
                    <text>已盘({{info.finishAmount || 0}})</text>
                    <text class="border"></text>
                </view>
            </view>
            <view class="head_wrap">
                <view class="search_wrap">
                    <image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
                    <input v-model="param.materialCode" @confirm="handleQuery" type="text" placeholder="搜索资产编码/资产名称"
                        placeholder-class="placeholder9" />
                </view>
            </view>
            <!--  -->
            <scroll-view scroll-y="true" class="scroll_Y" @scrolltolower="scrolltolower">
                <view class="list">
                    <view class="item" v-for="item in list">
                        <view class="line">
                            <view class="title">{{item.materialName}}</view>
                            <view class="status red" v-if="item.type == 1">盘亏</view>
                            <view class="status primaryColor" v-if="item.type == 2">盘盈</view>
                        </view>
                        <view class="line">资产编码:{{item.materialCode}}</view>
                        <view class="line">条码:{{item.materialQrcode}}</view>
                        <view class="line">规格型号:{{item.materialAttr}}</view>
                        <view class="line">
                            <view class="">账面数量:{{item.stock}}{{item.materialUnitName}}</view>
                            <view v-if="item.status == 0" @click="openEheck(item)" class="btn">执行盘点</view>
                        </view>
                        <view class="static" v-if="item.status == 1">
                            <view class="ite">
                                <view class="la">账面数量:</view>
                                <view class="val">{{item.stock}}</view>
                            </view>
                            <view class="spi"></view>
                            <view class="ite">
                                <view class="la">实际数量:</view>
                                <view class="val" :class="{
                                    primaryColor: item.type == 2,
                                    red: item.type == 1,
                                }">{{item.actStock}}</view>
                            </view>
                        </view>
                    </view>
                </view>
            </scroll-view>
            <view class="footer_btn">
                <view @click="openQrcode" v-if="activeTab== 0" class="sweep">
                    <image src="@/static/side/ic_saoma@2x.png" mode=""></image>
                    <view class="">扫码盘点</view>
                </view>
                <view @click="showTip = true" v-if="activeTab== 1" class="sweep sub_result">
                    <view class="">提交盘点结果</view>
                </view>
            </view>
            <!--  -->
            <u-popup :show="showModal" :round="10" @close="showModal = false" closeOnClickOverlay>
                <view class="modal_wrap">
                    <view class="modal_title">执行盘点</view>
                    <view class="title">{{modalForm.materialName}}</view>
                    <view class="item">资产编码:{{modalForm.materialCode}}</view>
                    <view class="item">条码:{{modalForm.materialQrcode}}</view>
                    <view class="item">品牌:{{modalForm.materialBrand}}</view>
                    <view class="item">规格型号:{{modalForm.materialAttr}}</view>
                    <view class="item">所在仓库:{{modalForm.warehouseName}}</view>
                    <view class="content">
                        <view class="line">
                            <view class="la">账面数量:</view>
                            <view class="val">
                                <view class="wrap">{{modalForm.stock}}</view>
                                <view class="unit">{{modalForm.materialUnitName}}</view>
                            </view>
                        </view>
                        <view class="line">
                            <view class="la">盘点数量:</view>
                            <view class="val">
                                <view class="wrap">
                                    <image v-if="!modalForm.actStock" src="@/static/side/btn_jian_grey@2x.png" mode=""></image>
                                    <image v-else @click="changeAct(-1)" src="@/static/side/btn_jian@3x.png" mode=""></image>
                                    <input type="number" v-model="modalForm.actStock"></input>
                                    <image @click="changeAct(1)" src="@/static/side/btn_jia@3x.png" mode=""></image>
                                </view>
                                <view class="unit">{{modalForm.materialUnitName}}</view>
                            </view>
                        </view>
                    </view>
                    <view class="remark">
                        <view class="la">备注:</view>
                        <textarea v-model="modalForm.remark" placeholder="请填写备注" :maxlength="-1" placeholder-class="placeholder9"
                            cols="30" rows="10"></textarea>
                    </view>
                    <view class="btns">
                        <view class="btn" @click="showModal = false">取消</view>
                        <view class="btn sub" @click="onSubmit">提交</view>
                    </view>
                </view>
            </u-popup>
            <!--  -->
            <u-popup :show="showTip" mode="center" :round="10" @close="showTip = false" closeOnClickOverlay>
                <view class="modal_t">
                    <view class="h1">温馨提示</view>
                    <view class="content">
                        <view v-if="info.unFinishAmount > 0">还有<text class="red">{{ info.unFinishAmount }}</text>项物料未盘点</view>
                        <view>提交后将无法修改</view>
                    </view>
                    <view class="btns">
                        <view class="btn" @click="showTip = false">取消</view>
                        <view class="btn sub" @click="tipSub">确认提交</view>
                    </view>
                </view>
            </u-popup>
        </view>
        <!--  -->
        <view class="reader-box" @click="stopScan" v-if="isScaning">
            <view class="reader" id="reader"></view>
        </view>
    </view>
</template>
<script>
    import {
        ywStocktakingDetail,
        getYwStocktakingRecord,
        takingDataOpen,
        ywStocktaFinishById
    } from '@/api'
    import {
        Html5Qrcode
    } from 'html5-qrcode';
    export default {
        data() {
            return {
                param: {},
                info: {},
                id: '',
                activeTab: 0,
                list: [],
                page: 0,
                total: 0,
                showModal: false,
                showTip: false,
                modalForm: {},
                html5Qrcode: null,
                isScaning: false,
            };
        },
        onLoad(op) {
            this.id = op.id
            this.getDetail()
            this.getList()
        },
        methods: {
            checkSub() {
                const {
                    modalForm
                } = this
                // let str = modalForm.unFinishAmount > 0 ? '还有三项物料'
            },
            getDetail() {
                const {
                    id
                } = this
                ywStocktakingDetail(id).then(res => {
                    this.info = res.data
                })
            },
            handleQuery() {
                this.list = []
                this.page = 1
                this.getList()
            },
            getList() {
                const {
                    page,
                    activeTab,
                    id,
                    param
                } = this
                getYwStocktakingRecord({
                    capacity: 20,
                    page,
                    model: {
                        status: activeTab,
                        stocktakingId: id,
                        ...param
                    }
                }).then(res => {
                    this.list = [...this.list, ...res.data.records]
                    this.total = res.data.total
                    if(this.param.materialQrcode && this.list.length == 1){
                        this.openEheck(this.list[0])
                        this.$set(this.param, 'materialQrcode', null)
                    }
                })
            },
            scrolltolower() {
                const {
                    total,
                    list
                } = this
                if (list.length < total) {
                    this.page = this.page + 1
                    this.getList()
                } else {
                    this.showToast('暂无更多数据')
                }
            },
            openEheck(item) {
                this.modalForm = {
                    ...item
                }
                this.showModal = true
            },
            onSubmit() {
                const {
                    modalForm
                } = this
                if (!modalForm.actStock) return this.showToast('请输入正确的盘点数量')
                takingDataOpen({
                    ...modalForm
                }).then(res => {
                    if (res.code == 200) {
                        this.showToast('提交成功')
                        this.handleQuery()
                        this.getDetail()
                        this.showModal = false
                    }
                })
            },
            changeAct(val) {
                const actStock = this.modalForm.actStock || 0
                this.$set(this.modalForm, 'actStock', actStock + val)
            },
            tabsClick(val) {
                this.activeTab = val
                this.page = 0
                this.list = []
                this.getList()
            },
            tipSub() {
                const { info } = this
                ywStocktaFinishById(info.id).then(res => {
                    this.showTip = false
                    uni.navigateBack()
                })
            },
            openQrcode() {
                this.isScaning = true;
                Html5Qrcode.getCameras().then((devices) => {
                    if (devices && devices.length) {
                        this.html5Qrcode = new Html5Qrcode('reader');
                        this.html5Qrcode.start({
                                facingMode: 'environment'
                            }, {
                                focusMode: 'continuous', //设置连续聚焦模式
                                fps: 5, //设置扫码识别速度
                                qrbox: 280 //设置二维码扫描框大小
                            },
                            (decodeText, decodeResult) => {
                                if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
                                    this.stopScan()
                                    this.$set(this.param, 'materialQrcode', decodeText)
                                    this.handleQuery()
                                }
                            },
                            (err) => {
                                // console.log(err);  //错误信息
                            }
                        );
                    }
                });
            },
            stopScan() {
                console.log('停止扫码')
                this.isScaning = false;
                if (this.html5Qrcode) {
                    this.html5Qrcode.stop();
                }
            }
        }
    }
</script>
<style lang="scss">
    .main_app {
        padding: 0 30rpx;
        overflow: hidden;
    }
    .tabs {
        display: flex;
        width: 750rpx;
        margin: 12rpx -30rpx 20rpx;
        border-bottom: 1rpx solid #E5E5E5;
        .tab {
            font-size: 30rpx;
            color: #666666;
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            height: 72rpx;
            .name {
                display: flex;
                align-items: center;
            }
            .border {
                width: 54rpx;
                height: 6rpx;
                background-color: #fff;
                border-radius: 3rpx;
                margin-top: 12rpx;
            }
        }
        .active {
            font-weight: 600;
            font-size: 32rpx;
            color: #222222;
            .border {
                background-color: $primaryColor;
            }
        }
    }
    .head_wrap {
        display: flex;
        align-items: center;
        margin-bottom: 36rpx;
        .search_wrap {
            display: flex;
            align-items: center;
            width: 100%;
            height: 76rpx;
            background: #F7F7F7;
            border-radius: 38rpx;
            padding-left: 30rpx;
            input {
                flex: 1;
            }
            .search {
                width: 28rpx;
                height: 28rpx;
            }
        }
    }
    .scroll_Y {
        height: calc(100vh - 350rpx);
    }
    .list {
        .item {
            border-bottom: 1rpx solid #E5E5E5;
            padding-bottom: 24rpx;
            margin-bottom: 16rpx;
            .title {
                font-weight: 600;
                font-size: 34rpx;
                color: #222222;
                margin-bottom: 10rpx;
            }
            .line {
                height: 60rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                color: #666666;
                .btn {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    height: 60rpx;
                    padding: 0 20rpx;
                    background: #0068FF;
                    box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 104, 255, 0.3);
                    border-radius: 30rpx;
                    font-size: 26rpx;
                    color: #FFFFFF;
                }
            }
            .static {
                display: flex;
                height: 84rpx;
                background: #F7F7F7;
                font-size: 30rpx;
                margin-top: 12rpx;
                padding: 16rpx 0;
                .spi {
                    border: 1rpx solid #E5E5E5;
                }
                .ite {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    .val {
                        font-weight: 500;
                    }
                }
            }
        }
    }
    .footer_btn {
        padding: 20rpx 40rpx 0;
        border-top: 1px solid #e5e5e5;
        width: 750rpx;
        margin: 0 -30rpx;
        .sweep {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32rpx;
            font-weight: 500;
            width: 670rpx;
            height: 88rpx;
            background: #0068FF;
            box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
            border-radius: 44rpx;
            color: #FFFFFF;
        }
        .sub_result {
            background-color: #fff;
            color: #FF0000;
            border: 1rpx solid #FF0000;
            box-shadow: none
        }
        image {
            width: 32rpx;
            height: 32rpx;
            margin-right: 6rpx;
        }
    }
    .modal_wrap {
        padding: 36rpx 30rpx;
        .modal_title {
            font-weight: 500;
            font-size: 32rpx;
            color: #222222;
            margin-bottom: 40rpx;
            text-align: center;
        }
        .title {
            font-weight: 600;
            font-size: 34rpx;
            color: #222222;
        }
        .item {
            font-size: 28rpx;
            color: #666666;
            height: 56rpx;
            display: flex;
            align-items: center;
        }
        .content {
            border-top: 1rpx solid #E5E5E5;
            margin-top: 16rpx;
            .line {
                height: 84rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .la {
                    font-weight: 500;
                    font-size: 32rpx;
                    color: #222222;
                }
                .val {
                    display: flex;
                    justify-content: flex-end;
                    align-items: center;
                    flex: 1;
                    .wrap {
                        display: flex;
                        align-items: center;
                        input {
                            width: 120rpx;
                            height: 72rpx;
                            border-radius: 8rpx;
                            border: 2rpx solid #0068FF;
                            margin: 0 16rpx;
                            padding: 0 10rpx;
                            text-align: center;
                        }
                    }
                    .unit {
                        font-size: 30rpx;
                        color: #666666;
                        margin-left: 20rpx;
                    }
                }
                image {
                    width: 72rpx;
                    height: 72rpx;
                }
            }
        }
        .remark {
            margin-top: 16rpx;
            .la {
                font-size: 30rpx;
                color: #222222;
                margin-bottom: 16rpx;
            }
            textarea {
                width: 690rpx;
                height: 240rpx;
                background: #F7F7F7;
                border-radius: 12rpx;
                padding: 10rpx 20rpx;
            }
        }
        .btns {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 80rpx;
            .btn {
                width: 336rpx;
                height: 88rpx;
                border-radius: 44rpx;
                border: 2rpx solid $primaryColor;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 32rpx;
                color: $primaryColor;
            }
            .sub {
                background-color: $primaryColor;
                color: #fff;
            }
        }
    }
    .modal_t {
        width: 520rpx;
        text-align: center;
        display: flex;
        flex-direction: column;
        .h1 {
            height: 86rpx;
            font-weight: 500;
            font-size: 32rpx;
            color: #333333;
            display: flex;
            align-items: flex-end;
            justify-content: center;
        }
        .content {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 30rpx 0;
        }
        .btns {
            height: 102rpx;
            display: flex;
            align-items: center;
            border-top: 1rpx solid #E5E5E5;
            .btn {
                height: 102rpx;
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: center;
                border-right: 1rpx solid #E5E5E5;
                font-weight: 400;
                font-size: 32rpx;
                color: #999999;
                &:nth-last-child(1) {
                    border-right: none;
                }
            }
            .sub {
                color: $primaryColor;
            }
        }
    }
    .reader-box {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.5);
    }
    .reader {
        width: 100%;
        // width: 540rpx;
        // height: 540rpx;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
</style>
h5/pages/inventory/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,213 @@
<template>
    <view class="main_app">
        <view class="head_wrap">
            <view class="search_wrap">
                <image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
                <input v-model="param.name" @confirm="handleQuery" type="text" placeholder="搜索盘点单名称"
                    placeholder-class="placeholder9" />
            </view>
        </view>
        <!--  -->
        <view class="list">
            <view class="item" @click="itemClick(item)" v-for="item in list">
                <image v-if="item.status == 0 || item.status == 1" class="img" src="@/static/side/ic_pandian@2x.png" mode="">
                </image>
                <image v-else class="img" src="@/static/side/ic_pandian_grey@2x.png" mode=""></image>
                <view class="content">
                    <view class="head">
                        <view class="title">{{item.name}}</view>
                        <view class="status" v-if="item.status == 0">未开始</view>
                        <view class="status green" v-if="item.status == 1">盘点中</view>
                        <view class="status gray" v-if="item.status == 2">已完成</view>
                        <view class="status gray" v-if="item.status == 3">已取消</view>
                    </view>
                    <view class="line">盘点日期:{{item.planDate}}</view>
                    <view class="line">盘点仓库:{{item.warehouseName}}</view>
                    <view class="line">
                        <view class="">盘点人员:{{item.userName}}</view>
                        <view class="btn" v-if="item.status == 0" @click="startHandle(item)">开始盘点</view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
<script>
    import {
        getYwStocktaking,
        ywStocktakingBegin
    } from '@/api'
    export default {
        data() {
            return {
                param: {},
                list: [],
                page: 0,
                total: 0,
            };
        },
        onShow() {
            this.handleQuery()
        },
        methods: {
            getList() {
                const {
                    page,
                    param
                } = this
                getYwStocktaking({
                    capacity: 20,
                    page,
                    model: {
                        ...param
                    }
                }).then(res => {
                    this.list = [...this.list, ...res.data.records]
                    this.total = res.data.total
                })
            },
            itemClick(item) {
                if(item.status == 1){
                    uni.navigateTo({
                        url: '/pages/inventory/detail?id=' + item.id
                    })
                }
            },
            startHandle(item) {
                uni.showModal({
                    content: '盘点期间不可进行出入库操作',
                    success: (res) => {
                        if (res.confirm) {
                            ywStocktakingBegin(item.id).then(() => {
                                uni.navigateTo({
                                    url: '/pages/inventory/detail?id=' + item.id
                                })
                            })
                        }
                    }
                })
            },
            handleQuery() {
                this.list = []
                this.page = 1
                this.getList()
            },
            scrolltolower() {
                const {
                    total,
                    list
                } = this
                if (list.length < total) {
                    this.page = this.page + 1
                    this.getList()
                } else {
                    this.showToast('暂无更多数据')
                }
            },
        }
    }
</script>
<style lang="scss">
    .main_app {
        padding: 10rpx 30rpx 0;
        font-size: 28rpx;
    }
    .head_wrap {
        display: flex;
        align-items: center;
        margin-bottom: 40rpx;
        .search_wrap {
            display: flex;
            align-items: center;
            width: 100%;
            height: 76rpx;
            background: #F7F7F7;
            border-radius: 38rpx;
            padding-left: 30rpx;
            input {
                flex: 1;
            }
            .search {
                width: 28rpx;
                height: 28rpx;
            }
        }
    }
    .list {
        height: calc(100vh - 136rpx);
        .item {
            display: flex;
            border-bottom: 1rpx solid #E5E5E5;
            padding-bottom: 28rpx;
            margin-bottom: 20rpx;
            .img {
                width: 80rpx;
                height: 80rpx;
                background: rgba(0, 104, 255, 0.08);
                border-radius: 12rpx;
                margin-right: 24rpx;
            }
            .content {
                flex: 1;
                .head {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-bottom: 12rpx;
                    .title {
                        font-weight: 600;
                        font-size: 34rpx;
                        color: #222222;
                    }
                    .status {
                        color: $primaryColor;
                    }
                    .green {
                        color: #0ADE79;
                    }
                    .gray {
                        color: #AAAAAA;
                    }
                }
                .line {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    color: #666666;
                    height: 60rpx;
                    .btn {
                        width: 144rpx;
                        height: 60rpx;
                        background: $primaryColor;
                        box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 104, 255, 0.3);
                        border-radius: 30rpx;
                        color: #fff;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-size: 26rpx;
                    }
                }
            }
        }
    }
</style>
h5/pages/operation/device.vue
@@ -84,7 +84,7 @@
        uploadUrl,
        ywDevicePost,
        ywDeviceCreate,
        getPointRecordByCode
        getFindByCode
    } from '@/api'
    import dayjs from 'dayjs';
    import {
@@ -286,14 +286,13 @@
                            },
                            (decodeText, decodeResult) => {
                                if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
                                    this.$set(this.param, 'deviceCode', decodeText)
                                    this.stopScan(); //关闭扫码功能
                                    getPointRecordByCode({
                                        // taskId: this.id,
                                        pointCode: decodeText
                                    }).then(ress => {
                                    getFindByCode(decodeText).then(ress => {
                                        if (ress.data) {
                                            console.log('ress', ress.data);
                                            this.$set(this.param, 'deviceCode', ress.data.code)
                                            this.$set(this.param, 'deviceId', ress.data.id)
                                            this.$set(this.param, 'deviceName', ress.data.name)
                                        } else {
                                            this.showToast('未匹配到巡检点,请重新扫描')
                                        }
h5/pages/polling/detail.vue
@@ -48,7 +48,7 @@
                            <view class="la">巡检时间:</view>
                            <view class="val">
                                <text>{{item.dealDate}}</text>
                                <text v-if="item.status == 1" class="detail">查看详情</text>
                                <text @click="detailClick(item)" v-if="item.status == 1" class="detail">查看详情</text>
                            </view>
                        </view>
                    </template>
@@ -60,6 +60,7 @@
            <view class="sub_btn">扫码巡检</view>
        </view>
        <!--  -->
        <view class="reader-box" @click="stopScan" v-if="isScaning">
            <view class="reader" id="reader"></view>
        </view>
@@ -102,6 +103,8 @@
                ],
                html5Qrcode: null,
                isScaning: false,
            };
        },
        onLoad(option) {
@@ -156,12 +159,18 @@
                    this.html5Qrcode.stop();
                }
            },
            itemClick(item) {
                if (!this.flag) return
                uni.navigateTo({
                    url: '/pages/polling/point?id=' + item.id
                })
            },
            detailClick(item) {
                uni.navigateTo({
                    url: '/pages/polling/point?id=' + item.id
                })
            },
            getDetail() {
                const {
                    id
h5/pages/polling/point.vue
@@ -28,7 +28,12 @@
            <view class="files">
                <view class="adduser_list_item_ipt1_upload" v-for="(item, i) in info.multifileList" :key="i">
                    <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
                    <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
                    <!-- <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video> -->
                    <view v-if="item.type == 1" @click="videoClick(item)" class="video_wrap">
                        <video :src="item.fileurlFull" initial-time="0.01" :show-center-play-btn="false" :controls="false"
                            class="video" :enable-progress-gesture="false" muted />
                        <image src="@/static/play.png" class="play" mode=""></image>
                    </view>
                </view>
            </view>
            <view v-if="info.dealInfo" class="desc">{{ info.dealInfo }}</view>
@@ -96,7 +101,13 @@
            @cancel="isShowHandleDate = false" mode="datetime"></u-datetime-picker>
        <u-picker :show="isShowRes" keyName="name" @cancel="isShowRes = false" @confirm='confirmRes'
            :columns="columns"></u-picker>
            <!--  -->
            <view v-if="videoPlay" class="video_app">
                <video controls autoplay muted x5-video-player-type="h5" x5-video-player-fullscreen="true" id="myvideo"
                    :src="videoUrl" @fullscreenchange="screenChange"></video>
                <view class="bg" @click="closeVideo"></view>
            </view>
            <!--  -->
    </view>
</template>
@@ -136,6 +147,10 @@
                        },
                    ]
                ],
                videoPlay: false,
                videoContext: null,
                videoUrl: ''
            };
        },
        onLoad(option) {
@@ -204,6 +219,26 @@
                this.$set(this.handleParam, 'dealStatus', e.value[0].id)
                this.$set(this.handleParam, 'dealName', e.value[0].name)
                this.isShowRes = false
            },
            videoClick(item) {
                this.videoPlay = true;
                this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 å¿…ä¼ 
                this.videoUrl = item.fileurlFull;
                this.videoContext.requestFullScreen();
                this.$nextTick(() => {
                    this.videoContext.play();
                })
            },
            screenChange(e) {
                let fullScreen = e.detail.fullScreen // å€¼true为进入全屏,false为退出全屏
                if (!fullScreen) {
                    //退出全屏
                    this.videoPlay = false // éšè—æ’­æ”¾ç›’子
                }
            },
            closeVideo() {
                this.videoPlay = false
                this.videoContext = null
            },
            fileDel(str, i) {
                this[str].splice(i, 1);
@@ -471,10 +506,50 @@
            width: 100%;
            height: 100%;
        }
        video {
            width: 100%;
            height: 100%;
        }
        .video_wrap {
            position: relative;
            border: 1px solid;
            width: 156rpx;
            height: 156rpx;
            border-radius: 4rpx;
            .play {
                width: 60rpx !important;
                height: 60rpx !important;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
            }
        }
    }
    .video_app {
        overflow: hidden;
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        align-items: center;
        z-index: 9990;
        .bg {
            background-color: rgba(0, 0, 0, .6);
            position: absolute;
            width: 100%;
            height: 100%;
            z-index: -1;
        }
        video {
            width: 100%;
            height: 42vh;
        }
    }
</style>
h5/pages/workOrder/detail.vue
@@ -14,7 +14,7 @@
                    <!-- <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video> -->
                    <view v-if="item.type == 1" @click="videoClick(item)" class="video_wrap">
                        <video :src="item.fileurlFull" initial-time="0.01" :show-center-play-btn="false" :controls="false"
                            class="video" :enable-progress-gesture="false" autoplay muted />
                            class="video" :enable-progress-gesture="false" muted />
                        <image src="@/static/play.png" class="play" mode=""></image>
                    </view>
                </view>
h5/pages/workOrder/problemEdit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,313 @@
<template>
    <view class="main_app">
        <view class="list">
            <view class="item">
                <view class="la">位置</view>
                <view class="line input_wrap">
                    <input type="text" v-model="param.position" :maxlength="50" placeholder="请输入发现问题的详细位置" placeholder-class="placeholder9" />
                </view>
            </view>
            <view class="item">
                <view class="la"><text class="red">*</text>描述</view>
                <view class="line">
                    <textarea :maxlength="300" v-model="param.content" placeholder="请详细描述现场情况,便于工作人员及时处理" placeholder-class="placeholder9" />
                </view>
            </view>
            <view class="item">
                <view class="la">现场照片</view>
                <view class="upload_wrap">
                    <view class="upload_file" @click="showUpload = true">
                        <u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
                        <view class="mt6">图片/视频</view>
                    </view>
                    <view class="upload_file" v-for="(item, i) in fileList" :key="i">
                        <u-icon class="close" size="20" name="close-circle-fill" color="red"
                            @click="fileDel('fileList', i)"></u-icon>
                        <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
                        <video v-if="item.type == 1" :show-center-play-btn="false" :src="item.fileurlFull" :controls="false"></video>
                    </view>
                </view>
            </view>
            <view class="item">
                <view class="la"><text class="red">*</text>上报人</view>
                <view class="line input_wrap">
                    <input v-model="param.name" type="text" :maxlength="10" placeholder="请输入" placeholder-class="placeholder9" />
                </view>
            </view>
            <view class="item">
                <view class="la"><text class="red">*</text>上报人电话</view>
                <view class="line input_wrap">
                    <input v-model="param.phone" type="tel" :maxlength="18" placeholder="请输入" placeholder-class="placeholder9" />
                </view>
            </view>
        </view>
        <view class="sub_btn" @click="onSubmit">提交</view>
        <!--  -->
        <u-popup :show="showUpload" @close="showUpload = false" closeOnClickOverlay>
            <view class="sel_upload_wrap">
                <view class="btn" @click="uploadImage">选择图片</view>
                <view class="btn" @click="uploadVideo">选择视频</view>
            </view>
        </u-popup>
        <!--  -->
    </view>
</template>
<script>
    import {
        uploadUrl,
        ywProblemCreate,
    } from '@/api'
    import dayjs from 'dayjs';
    export default {
        data() {
            return {
                param: {},
                showUpload: false,
                fileList: [],
            };
        },
        onLoad() {
        },
        methods: {
            onSubmit() {
                const {
                    param,
                    fileList
                } = this
                if (!param.content) return this.showToast('请输入现场情况描述')
                if (!param.name) return this.showToast('请输入上报人姓名')
                if (!param.phone) return this.showToast('请输入上报人电话')
                ywProblemCreate({
                    ...param,
                    fileList
                }).then(res => {
                    this.showToast('提交成功')
                    this.param = {}
                    uni.navigateTo({
                        url: '/pages/workOrder/result'
                    })
                })
            },
            fileDel(str, i) {
                this[str].splice(i, 1);
            },
            uploadImage() {
                this.showUpload = false;
                let token = uni.getStorageSync('token') || '';
                uni.chooseImage({
                    count: 6,
                    success: chooseImageRes => {
                        uni.showLoading({
                            title: '上传中',
                            mask: true
                        });
                        const tempFilePaths = chooseImageRes.tempFilePaths;
                        let imgs = tempFilePaths.map((value, index) => {
                            return {
                                name: 'file',
                                uri: value
                            };
                        });
                        uni.uploadFile({
                            url: `${uploadUrl}`,
                            files: imgs,
                            name: 'file',
                            formData: {
                                folder: 'YW_WORKORDER_FILE'
                            },
                            header: {
                                Dm_user_token: token
                            },
                            success: uploadFileRes => {
                                let res = JSON.parse(uploadFileRes.data);
                                if (res.data && res.data.length > 0) {
                                    res.data.forEach(i => {
                                        i.type = 0;
                                        i.fileurl = i.imgaddr;
                                        i.fileurlFull = i.url;
                                        if(this.fileList.length < 9){
                                            this.fileList.push(i);
                                        }
                                    });
                                }
                            },
                            fail(err) {
                                console.log('err', err);
                            },
                            complete() {
                                uni.hideLoading();
                                // if (i === chooseImageRes.tempFilePaths.length - 1) {
                                //   uni.hideLoading()
                                // }
                            }
                        });
                    }
                });
            },
            uploadVideo() {
                this.showUpload = false;
                let token = uni.getStorageSync('token') || '';
                uni.chooseVideo({
                    success: chooseImageRes => {
                        uni.showLoading({
                            title: '上传中',
                            mask: true
                        });
                        uni.uploadFile({
                            url: `${uploadUrl}`,
                            filePath: chooseImageRes.tempFilePath,
                            header: {
                                Dm_user_token: token
                            },
                            name: 'file',
                            formData: {
                                folder: 'YW_WORKORDER_FILE'
                            },
                            success: uploadFileRes => {
                                let res = JSON.parse(uploadFileRes.data);
                                if (res.data && res.data.length > 0) {
                                    res.data.forEach(i => {
                                        i.type = 1;
                                        i.fileurl = i.imgaddr;
                                        i.fileurlFull = i.url;
                                        if(this.fileList.length < 9){
                                            this.fileList.push(i);
                                        }
                                    });
                                }
                            },
                            complete() {
                                uni.hideLoading();
                            }
                        });
                    }
                });
            }
        }
    }
</script>
<style lang="scss" scoped>
    .list {
        .item {
            .la {
                margin-top: 30rpx;
            }
            .line {
                textarea {
                    box-sizing: border-box;
                    width: 690rpx;
                    height: 200rpx;
                    background-color: #f7f7f7;
                    font-size: 28rpx;
                    color: #333333;
                    padding: 24rpx;
                    border-radius: 8rpx;
                    margin-bottom: 30rpx;
                    margin-top: 20rpx;
                }
            }
            .sel_wrap {
                height: 90rpx;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1rpx solid #E5E5E5;
            }
            .input_wrap{
                width: 100%;
                height: 90rpx;
                display: flex;
                align-items: center;
                border-bottom: 1rpx solid #e5e5e5;
                input{
                    width: 100%;
                }
            }
            .upload_wrap {
                display: flex;
                flex-wrap: wrap;
                margin-bottom: 30rpx;
            }
            .upload_file {
                margin-top: 24rpx;
                width: 156rpx;
                height: 156rpx;
                margin-right: 20rpx;
                border: 2rpx solid #e5e5e5;
                background: #f7f7f7;
                color: #666666;
                font-size: 22rpx;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                position: relative;
                &:nth-of-type(4n) {
                    margin-right: 0;
                }
                .close {
                    position: absolute;
                    right: -20rpx;
                    top: -20rpx;
                    z-index: 9999;
                    background-color: #fff;
                    border-radius: 50%;
                    overflow: hidden;
                }
                image {
                    width: 100%;
                    height: 100%;
                }
                video {
                    width: 100%;
                    height: 100%;
                }
            }
        }
    }
    .sub_btn {
        // position: fixed;
        // bottom: 68rpx;
        // left: 40rpx;
        width: 670rpx;
        height: 88rpx;
        margin-top: 80rpx;
        background: $primaryColor;
        box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
        border-radius: 44rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 500;
        font-size: 32rpx;
        color: #FFFFFF;
    }
    .sel_upload_wrap {
        width: 100%;
        border-top: 1px solid #666666;
        box-shadow: 0 1 1 #333333;
        .btn {
            height: 90rpx;
            line-height: 90rpx;
            text-align: center;
        }
    }
</style>
h5/pages/workOrder/result.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
    <view class="main_app">
        <image class="logo" src="/static/ic_paysuccess@2x.png" mode=""></image>
        <view class="title">提交成功</view>
        <view class="">感谢您的上报,我们将尽快核实处理</view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
            };
        }
    }
</script>
<style lang="scss">
.main_app{
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 200rpx;
    font-size: 26rpx;
    color: #999999;
    .title{
        font-weight: 500;
        font-size: 36rpx;
        color: #333333;
        margin-bottom: 26rpx;
    }
    .logo{
        width: 180rpx;
        height: 180rpx;
        margin-bottom: 40rpx;
    }
}
</style>
h5/static/ic_paysuccess@2x.png
h5/static/side/btn_jia@3x.png
h5/static/side/btn_jian@3x.png
h5/static/side/btn_jian_grey@2x.png
h5/static/side/ic_pandian@2x.png
h5/static/side/ic_pandian_grey@2x.png