chenhaozhe
5 天以前 3b695d385245530e646dd452e60a438db4e0be4a
设备 保养记录单 完成
添加 设备点检记录单 设备保养记录单
5个文件已修改
2个文件已添加
1841 ■■■■■ 已修改文件
pages.json 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBillList.vue 434 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue 718 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBillList.vue 434 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/MJGL/style/MJListStyle.scss 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab3.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -1431,6 +1431,22 @@
            {
                "navigationBarTitleText" : "在库检验单列表"
            }
        },
        {
            "path" : "pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBillList",
            "style" :
            {
                "navigationBarTitleText" : "设备点检记录单缓存",
                "enablePullDownRefresh": true
            }
        },
        {
            "path" : "pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBillList",
            "style" :
            {
                "navigationBarTitleText" : "设备保养记录单缓存",
                "enablePullDownRefresh": true
            }
        }
        
    ],
pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill.vue
@@ -50,13 +50,13 @@
                        <radio-group @change="radioChange" class="radio_Container">
                            <label>
                                <view>
                                    <radio value="OK" :checked="hform.HLastResult == 'OK'" />
                                    <radio value="OK" :checked="calcHLastResult == 'OK'" />
                                    <text>OK</text>
                                </view>
                            </label>
                            </label>
                            <view>
                                <radio value="NG" :checked="hform.HLastResult == 'NG'" />
                                <radio value="NG" :checked="calcHLastResult == 'NG'" />
                                <text>NG</text>
                            </view>
                            </label>
@@ -141,7 +141,10 @@
        </template>
        <!-- 明细信息 -->
        <template v-if="tabs == 1">
            <view class="form">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="left">
                        设备点检规程
@@ -289,7 +292,6 @@
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import "@/pages/MJGL/style/MJBillStyle.scss"
    import {
        getUserInfo
    } from "../../../utils/auth";
@@ -358,9 +360,36 @@
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
            calcHLastResult: {
                get() {
                    if (this.HCheckFileList.length == 0) {
                        return 'OK'
                    } else {
                        let okCount = this.HCheckFileList.reduce((acc, item) => {
                            if (item.HDotCheckResult) {
                                return acc + 1
                            }
                            return acc
                        }, 0)
                        if (okCount == this.HCheckFileList.length) {
                            return 'OK'
                        }
                        return 'NG'
                    }
                }
            }
        },
        methods: {
            addNew() {
                uni.redirectTo({
                    url: './Sb_EquipDotCheckBill?operationType=1'
                })
            },
            goBack() {
                uni.navigateBack()
            },
            checkBoxChangeHandler(index, e) {
                let cr = e.detail.value
                if (cr.length == 0) {
@@ -511,17 +540,28 @@
                        Message
                    } = res.data
                    console.log('data: ', data);
                    this.hform.HEquipID = data[0].HInterID
                    this.hform.HBarName = data[0].设备名称
                    this.hform.HBarSpec = data[0].设备规格
                    this.hform.HBarModel = data[0].设备型号
                    this.hform.HQty = 1
                    if (count == 1) {
                        console.log('data: ', data);
                        this.hform.HEquipID = data[0].HInterID
                        this.hform.HBarName = data[0].设备名称
                        this.hform.HBarSpec = data[0].设备规格
                        this.hform.HBarModel = data[0].设备型号
                        this.hform.HQty = 1
                    // 获取检验规程
                    this.GetItemByEquipFile()
                        // 获取检验规程
                        this.GetItemByEquipFile()
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async GetItemByEquipFile() {
@@ -626,13 +666,16 @@
                        },
                        method: "POST"
                    })
                    if(!res) {
                       return
                    if (!res) {
                        return
                    }
                    let {count, Message} = res.data
                    if(count == 1){
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
@@ -640,7 +683,7 @@
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill?operationType=1'
                                        url: '/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
@@ -650,14 +693,14 @@
                                }
                            }
                        });
                    }else {
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: "提交单据失败: " + Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
@@ -704,5 +747,6 @@
    }
</script>
<style lang="scss">
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBillList.vue
New file
@@ -0,0 +1,434 @@
<template>
    <view class="content">
        <view class="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">缓存列表</view>
            <!-- <view :class="tabs == 1 ? 'on':''" @tap="changeTab(1)">已上传列表</view> -->
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="form" v-if="tabs == 0">
            <view class="buttons" @tap="add">
                <uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>新增
            </view>
        </view>
        <view class="form" v-if="tabs == 1">
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="right">
                    <input v-model="hform.HBillNo" placeholder="请输入单据号" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">源单单号:</view>
                <view class="right">
                    <input v-model="hform.HSourceBillNo" placeholder="请输入源单单号" />
                </view>
            </view>
            <view class="buttons">
                <button class="btn-a" size="mini" type="default" @tap="clear">重置</button>
                <button class="btn-c" size="mini" type="default" @tap="search">查询</button>
            </view>
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
            <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.设备代码">
                        <text>设备代码:</text>{{item.设备代码}}
                    </view>
                    <view class="detail" v-if="item.设备名称">
                        <text>设备名称:</text>{{item.设备名称}}
                    </view>
                    <view class="detail" v-if="item.表头备注">
                        <text>表头备注:</text>{{item.表头备注}}
                    </view>
                    <view class="detail" v-if="item.开始日期">
                        <text>开始日期:</text>{{dayjs(item.开始日期).format("YYYY-MM-DD HH:mm:DD")}}
                    </view>
                    <view class="detail" v-if="item.结束日期">
                        <text>结束日期:</text>{{dayjs(item.结束日期).format("YYYY-MM-DD HH:mm:DD")}}
                    </view>
                    <view class="detail" v-if="item.点检计划编号">
                        <text>点检计划编号:</text>{{item.点检计划编号}}
                    </view>
                    <view class="detail" v-if="item.点检计划">
                        <text>点检计划:</text>{{item.点检计划}}
                    </view>
                    <view class="detail" v-if="item.摘要">
                        <text>摘要:</text>{{item.摘要}}
                    </view>
                    <view class="detail" v-if="item.点检规格摘要">
                        <text>点检规格摘要:</text>{{item.点检规格摘要}}
                    </view>
                    <view class="detail" v-if="item.hmainid">
                        <text>内部单据号:</text>{{item.hmainid}}
                    </view>
                    <view class="detail" v-if="item.最终结论">
                        <text>最终结论:</text>{{item.最终结论}}
                    </view>
                </view>
                <view class="more">
                    <!-- <view class="part" style="border-right: 1px solid #eee;color: #3a78ff;" @tap.stop="edit(item)">
                        <uni-icons type="compose" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>编辑
                    </view> -->
                    <view style="flex: 1"></view>
                    <view class="part" style="color: #da0000;" @tap.stop="del(item)">
                        <uni-icons type="trash" style="color: #da0000;margin-right: 10rpx;" size="18"></uni-icons>删除
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==1">
            <uni-card :title="item.日期" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.状态">
                        <text>状态:</text>{{item.状态}}
                    </view>
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.数量">
                        <text>数量:</text>{{item.数量}}
                    </view>
                    <view class="detail" v-if="item.源单单号">
                        <text>源单单号:</text>{{item.源单单号}}
                    </view>
                    <view class="detail" v-if="item.物料代码">
                        <text>物料代码:</text>{{item.物料代码}}
                    </view>
                    <view class="detail" v-if="item.物料名称">
                        <text>物料名称:</text>{{item.物料名称}}
                    </view>
                    <view class="detail" v-if="item.规格型号">
                        <text>规格型号:</text>{{item.规格型号}}
                    </view>
                    <view class="detail" v-if="item.组织">
                        <text>组织:</text>{{item.组织}}
                    </view>
                </view>
                <view class="more">
                    <view class="part" style="color: #3a78ff;width: 100%;" @tap.stop="qrCodeDisplay(item)">
                        <uni-icons type="scan" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>显示二维码
                    </view>
                    <view class="part" style="color: #d98d00;width: 100%;" @tap.stop="revoke(item)">
                        <uni-icons type="undo" style="color: #d98d00;margin-right: 10rpx;" size="18"></uni-icons>撤销
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="!listData || listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
        <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
    </view>
</template>
<script>
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
    import {
        CommonUtils
    } from "../../../utils/common";
    import dayjs from "dayjs";
    export default {
        data() {
            return {
                dayjs,
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                tabs: 0,
                urls: '/Web/GetEquipmentBillsList',
                MvarReportTitle: '设备点检记录单缓存',
                hform: {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3903,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    Type: "DJ",
                    sWhere: "",
                },
                sWhere: '',
                listData: [],
                showList: [],
                showDetail: -1,
                page: 1,
            }
        },
        onShow() {
            //用户模块权限判断
            this.CheckModRight()
            this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        components: {
            BarCodePopupVue
        },
        onReachBottom: function() {
            this.page++
            setTimeout(() => {
                this.showList = this.showList.concat(this.getPage(this.page, this.listData))
            }, 100)
        },
        onPullDownRefresh: function() {
            this.clear()
            setTimeout(() => {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        methods: {
            async qrCodeDisplay(item) {
                this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
                await this.$nextTick()
                this.$refs.barcodePopup.open()
            },
            CheckModRight() {
                uni.request({
                    url: this.serverUrl + '/WEBSController/CheckModRight_Json',
                    data: {
                        ModRightName: 'CE_OtherOut',
                        HUserName: uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        if (res.data.count == 1) {} else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            getPage(page, list) {
                let sindex = (parseInt(page) - 1) * 20
                let eindex = parseInt(page) * 20
                let newList = list.slice(sindex, eindex)
                return newList
            },
            changeTab(e) {
                this.tabs = e
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/Web/GetEquipmentBillsList'
                }
                // if (this.tabs == 1) {
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
                this.getList()
            },
            async getList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: this.urls,
                        data: this.hform
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.listData = data
                        this.showList = this.getPage(this.page, data)
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取设备点检记录单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取设备点检记录单失败: ${err}`
                    })
                }
            },
            search() {
                this.sWhere = ''
                this.listData = []
                this.page = 1
                this.showList = []
                console.log(this.hform)
                // if (this.hform.HBillNo) {
                //     this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
                // }
                // if (this.hform.HSourceBillNo) {
                //     this.sWhere += " and 设备类型 like '%" + this.hform.HSourceBillNo + "%'";
                // }
                this.getList()
            },
            clear() {
                this.listData = []
                this.page = 1
                this.showList = []
                this.sWhere = ''
                this.hform = {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 1206,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    sWhere: '',
                    Type: "DJ"
                }
                this.getList()
            },
            add() {
                uni.navigateTo({
                    url: '/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill?operationType=1'
                })
            },
            //编辑
            edit(item) {
                console.log(item)
                uni.request({
                    url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
                    data: {
                        "HInterID": item.HInterID,
                        "HBillNo": item.单据号,
                        "HBillType": this.hform.HBillType
                    },
                    success: (res) => {
                        console.log(1, res);
                        if (res.data.count == 1) {
                            uni.navigateTo({
                                url: './OtherOutBill?OperationType=2&HInterID=' + item.HInterID
                            })
                        } else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                })
            },
            //删除
            del(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/Sb_EquipDotCheckBill/DeltetEquipDotCheckBillList',
                                data: {
                                    HInterID: item.hmainid,
                                    user: uni.getStorageSync('HUserName'),
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
            //撤销
            revoke(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '是否确认撤销',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DeleteICStockBillAndWMS_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    HBillNo: item.单据号,
                                    HBillType: this.hform.HBillType,
                                    HMaker: uni.getStorageSync('HUserName'),
                                    MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJListStyle.scss"
</style>
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill.vue
@@ -1,19 +1,727 @@
<template>
    <view>
        <view class="tabs" id="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">基本信息</view>
            <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">明细信息</view>
            <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">其他信息</view>
            <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</view>
        </view>
        <!-- 基本信息 -->
        <template v-if="tabs == 0">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">设备条码:</view>
                    <view class="right">
                        <input v-model="hform.HBarCode" @confirm="GetMessageByBarCode(hform.HBarCode)"
                            placeholder="请输入(或扫描)设备条码" />
                    </view>
                    <view class="icon-wrapper">
                        <uni-icons type="scan" size="20" @click="toScanCode"></uni-icons>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">保养开始:</view>
                    <view class="right">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HBeginDate">
                            <input :value="hform.HBeginDate" />
                        </uni-datetime-picker>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">保养结束:</view>
                    <view class="right">
                        <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HEndDate">
                            <input :value="hform.HEndDate" />
                        </uni-datetime-picker>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">最终结论:</view>
                    <view class="right none-border">
                        <radio-group @change="radioChange" class="radio_Container">
                            <label>
                                <view>
                                    <radio value="OK" :checked="calcHLastResult == 'OK'" />
                                    <text>OK</text>
                                </view>
                            </label>
                            </label>
                            <view>
                                <radio value="NG" :checked="calcHLastResult == 'NG'" />
                                <text>NG</text>
                            </view>
                            </label>
                        </radio-group>
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">单据号:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HBillNo" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">单据日期:</view>
                    <view class="righton">
                        <input disabled v-model="hform.HDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">部门:</view>
                    <zxz-uni-data-select class="right" :localdata="HDeptList" dataKey="部门名称" dataValue="HItemID"
                        v-model="hform.HDeptID">
                    </zxz-uni-data-select>
                    <!-- <input disabled v-model="hform.HDeptName" placeholder="请选择部门" /> -->
                </view>
                <view class="form-item">
                    <view class="title">备注:</view>
                    <view class="right">
                        <input v-model="hform.HRemark" placeholder="请输入备注" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备名称:</view>
                    <view class="righton">
                        <input v-model="hform.HBarName" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备规格:</view>
                    <view class="righton">
                        <input v-model="hform.HBarSpec" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">设备型号:</view>
                    <view class="righton">
                        <input v-model="hform.HBarModel" disabled />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">保养计划:</view>
                    <view class="righton">
                        <input v-model="hform.HPlanNo" disabled />
                    </view>
                </view>
            </view>
        </template>
        <!-- 明细信息 -->
        <template v-if="tabs == 1">
            <view :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form">
                    <view class="form-item">
                        <view class="left">
                            设备保养规程
                        </view>
                        <view class="right">
                            <input type="text" :value="hform.HEquipMaintainRuleInterNo" />
                        </view>
                        <view class="icon-wrapper">
                            <uni-icons type="search" size="20" @click="toCheckFile"></uni-icons>
                        </view>
                    </view>
                </view>
                <view class="list" v-for="(item,index) in HCheckFileList" :key="index">
                    <uni-card style="margin: 10px;">
                        <view class="card-detail">
                            <view class="detail">
                                <text>序号:</text>{{index+1}}
                            </view>
                            <view class="detail">
                                <text>结果:</text>
                                <checkbox-group style="display: inline-block;"
                                    @change="checkBoxChangeHandler(index, $event)">
                                    <checkbox value="enabled" :checked="item.HMaintainResult" />
                                </checkbox-group>
                            </view>
                            <view class="detail">
                                <text>保养项目:</text>{{item.HMaintainItem}}
                            </view>
                            <view class="detail" v-if="item.HMaintainPart">
                                <text>保养部位:</text>{{item.HMaintainPart}}
                            </view>
                            <view class="detail" v-if="item.HClaim">
                                <text>具体要求:</text>{{item.HClaim}}
                            </view>
                            <view class="detail">
                                <text>负责人:</text>{{item.HManagerName}}
                            </view>
                            <view class="detail" v-if="item.Remark">
                                <text>备注:</text>{{item.Remark}}
                            </view>
                        </view>
                    </uni-card>
                </view>
                <view class="over" v-if="HCheckFileList.length == 0">暂无数据</view>
            </view>
        </template>
        <!-- 其他信息 -->
        <template v-if="tabs == 2">
            <view class="form" :style="{
                height: containerHeight + 'px',
                overflow: 'auto'
            }">
                <view class="form-item">
                    <view class="title">创建人:</view>
                    <view class="righton">
                        <input v-model="hform.HMaker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">创建日期:</view>
                    <view class="righton">
                        <input v-model="hform.HMakeDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改人:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDater" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">修改日期:</view>
                    <view class="righton">
                        <input v-model="hform.HUpDateDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核人:</view>
                    <view class="righton">
                        <input v-model="hform.HChecker" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">审核时间:</view>
                    <view class="righton">
                        <input v-model="hform.HCheckDate" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废人:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteMan" />
                    </view>
                </view>
                <view class="form-item">
                    <view class="title">作废日期:</view>
                    <view class="righton">
                        <input v-model="hform.HDeleteDate" />
                    </view>
                </view>
            </view>
        </template>
        <!-- 附件信息 -->
        <template v-if="tabs == 3">
            <view class="card-item-wrapper">
                <view class="attachment-btns">
                    <button type="primary" size="mini" @tap="fileUpload">选择文件</button>
                    <view style="flex: 1;"></view>
                </view>
                <view v-for="(item, index) in attachmentInfo" :key="index">
                    <uni-card :title="item['fileName']" :thumbnail="item.filePath">
                        <view class="card-detail">
                            <view class="detail">
                                <text>大小:</text>{{item["size"]}}
                            </view>
                            <view class="detail">
                                <text>状态:</text>{{item["status"]}}
                            </view>
                            <view class="detail operation" v-if="item['status']!='上传成功'">
                                <text>操作:</text>
                                <button class="btn-a" size="mini" @tap.stop="uploadFile(index)">上传</button>
                                <button class="btn-b" size="mini" @tap.stop="delFile(index)">删除</button>
                            </view>
                        </view>
                    </uni-card>
                </view>
            </view>
        </template>
        <!-- 操作按钮 -->
        <view class="buttons" id="buttons">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1;"></view>
            <button class="btn-a" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <xe-upload ref="XeUpload" :options="uploadOptions" @callback="handleUploadCallback"></xe-upload>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "@/utils/common";
    import {
        MpaasScan
    } from "@/utils/mpaasScan.js"
    import {
        getUserInfo
    } from "../../../utils/auth";
    import {
        TrackOpTypes
    } from "vue";
    export default {
        name: 'sb_EquipMaintainBill',
        data() {
            return {
                tabs: 0,
                HMainSourceBillType: "",
                btnTop: 0,
                tabsBottom: 0,
                HModName: "sb_EquipMaintainBill",
                HBillType: '3901',
                operationType: 1,
                uploadOptions: {},
                HDeptList: [],
                HShiftsList: [],
                HCheckFileList: [],
                attachmentInfo: [],
                hform: {
                    HBarCode: "",
                    HBeginDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HEndDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HQty: 0,
                    HErrNote: "",
                    HBigSafeNote: "",
                    HShiftsName: "",
                    HShiftsID: 0,
                    HBillNo: "",
                    HInterID: 0,
                    HDate: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
                    HDeptName: "",
                    HDeptID: 0,
                    HRemark: "",
                    HBarName: "",
                    HEquipID: 0,
                    HBarSpec: "",
                    HBarModel: "",
                    HPlanNo: "",
                    HPlanInterID: 0,
                    HPlanEntryID: 0,
                    HEquipMaintainPlanInterID: 0,
                    HEquipMaintainPlanEntryID: "",
                    HMaker: getUserInfo()['Czymc'],
                    HMakeDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HUpDater: "",
                    HUpDateDate: "",
                    HChecker: "",
                    HCheckDate: "",
                    HDeleteMan: "",
                    HDeleteDate: "",
                    lngBillKey: 0,
                    lngBillSubKey: 0,
                    HLastResult: "OK"
                }
            };
        },
        computed: {
            containerHeight: {
                get() {
                    return this.btnTop - this.tabsBottom - 5
                }
            },
            calcHLastResult: {
                get() {
                    if (this.HCheckFileList.length == 0) {
                        return 'OK'
                    } else {
                        let okCount = this.HCheckFileList.reduce((acc, item) => {
                            if (item.HMaintainResult) {
                                return acc + 1
                            }
                            return acc
                        }, 0)
                        if (okCount == this.HCheckFileList.length) {
                            return 'OK'
                        }
                        return 'NG'
                    }
                }
            }
        },
        methods: {
            addNew() {
                uni.redirectTo({
                    url: './Sb_EquipMaintainBill?operationType=1'
                })
            },
            goBack() {
                uni.navigateBack()
            },
            checkBoxChangeHandler(index, e) {
                let cr = e.detail.value
                if (cr.length == 0) {
                    this.HCheckFileList[index]["HMaintainResult"] = false
                } else {
                    this.HCheckFileList[index]["HMaintainResult"] = true
                }
            },
            uploadFile(index) {
                console.log('filePath: ', this.attachmentInfo[index].filePath);
                // 通过临时路径读取文件
                uni.uploadFile({
                    url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile",
                    filePath: this.attachmentInfo[index].filePath,
                    name: 'file',
                    formData: {
                        HBillNo: this.hform.HBillNo,
                        HRemark: "",
                        HUserName: getUserInfo()["Czymc"]
                    },
                    success: (uploadRes) => {
                        CommonUtils.showTips({
                            message: "上传成功"
                        })
                        this.attachmentInfo[index].status = "上传成功"
                    },
                    fail: (err) => {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `上传失败: ${err}`
                        })
                    }
                })
            },
            delFile(index) {
                console.log('attachmentInfo: ', this.attachmentInfo[index]);
                uni.showModal({
                    title: '提示',
                    content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!',
                    success: (res) => {
                        if (res.confirm) {
                            this.attachmentInfo.splice(index, 1)
                        }
                    },
                })
            },
            handleUploadCallback(res) { // 文件上传回调
                console.log('file: ', res);
                let fileInfo = res.data[0]
                this.attachmentInfo.push({
                    fileName: fileInfo.name,
                    size: fileInfo.size,
                    status: '等待上传',
                    filePath: fileInfo.tempFilePath
                })
            },
            // 上传文件
            fileUpload() {
                this.$refs.XeUpload.upload('file', {});
            },
            //获取班次数据
            async getShiftList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Web/GetGy_ShiftsList_Json',
                        data: {
                            Shifts: "",
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HShiftsList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            //获取使用部门数据
            async getHDeptList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: '/Gy_Department/list',
                        data: {
                            sWhere: "",
                            user: uni.getStorageSync('HUserName'),
                            Organization: uni.getStorageSync('Organization')
                        }
                    })
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.HDeptList = data
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: err
                    })
                }
            },
            toScanCode() {
                MpaasScan.scanCode(cb => {
                    this.hfrom.HBarCode = cb
                    this.GetMessageByBarCode(cb)
                })
            },
            async GetMessageByBarCode(HBarCode) {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Gy_EquipFileBill/txtHBarCode_KeyDown",
                        data: {
                            HBarCode: HBarCode,
                            user: getUserInfo()["Czymc"]
                        },
                    })
                    if (!res) {
                        return
                    }
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    if (count == 1) {
                        this.hform.HEquipID = data[0].HInterID
                        this.hform.HBarName = data[0].设备名称
                        this.hform.HBarSpec = data[0].设备规格
                        this.hform.HBarModel = data[0].设备型号
                        this.hform.HQty = 1
                        // 获取检验规程
                        this.GetItemByEquipFile()
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: err
                    })
                }
            },
            async GetItemByEquipFile() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetItemByEquipFile",
                        data: {
                            "EquipProjectID": this.hform.HEquipID,
                            "Type": "BY",
                            "HDate": this.hform.HBeginDate
                        }
                    })
                    let {
                        data,
                        Message,
                        count
                    } = res.data
                    if (count == 1) {
                        this.hform.HEquipMaintainRuleInterID = data[0].保养规程ID
                        this.hform.HEquipMaintainRuleInterNo = data[0].保养规程单号
                        this.hform.HPlanNo = data[0].保养计划单
                        this.hform.HEquipMaintainPlanInterID = (data[0].保养计划ID == null ? 0 : data[0].保养计划ID) == "" ?
                            0 : data[0].保养计划ID
                        this.hform.HEquipMaintainPlanEntryID = (data[0].保养计划子ID == null ? 0 : data[0].保养计划子ID) ==
                            "" ? 0 : data[0].保养计划子ID
                        this.hform.HMainSourceBillNo = data[0].保养计划单
                        this.hform.HMainSourceInterID = (data[0].保养计划ID == null ? 0 : data[0].保养计划ID) == "" ? 0 :
                            data[0].保养计划ID
                        this.hform.HMainSourceEntryID = (data[0].保养计划子ID == null ? 0 : data[0].保养计划子ID) == "" ? 0 :
                            data[0].保养计划子ID
                        this.HCheckFileList = Array.from(data).map(item => {
                            return {
                                "HMaintainResult": item.默认结论 == 1 ? true : false,
                                "HMaintainItemID": item.保养项目ID,
                                "HMaintainNumber": item.保养项目代码,
                                "HMaintainItem": item.保养项目名称,
                                "HMaintainPart": item.保养部位,
                                "HClaim": item.具体要求,
                                "HManagerID": item.负责人ID,
                                "HManagerNumber": item.负责人代码,
                                "HManagerName": item.负责人名称,
                                "HRemark": "",
                                "HSourceInterID": item.保养计划ID,
                                "HSourceEntryID": item.保养计划子ID,
                                "HSourceBillNo": item.保养计划单
                            }
                        })
                    } else {
                        CommonUtils.showTips({
                            title: '温馨提示',
                            message: `获取点检规程错误: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: '温馨提示',
                        message: `获取点检规程错误: ${err}`
                    })
                }
            },
            radioChange({
                detail: {
                    value
                }
            }) {
                this.HLastResult = value
            },
            async getMaxNum() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetMAXNum",
                        data: {
                            "HBillType": this.HBillType
                        }
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    console.log('data: ', data);
                    this.hform.HInterID = 0
                    this.hform.HBillNo = data[0]["HBillNo"]
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "获取单据信息异常: " + err
                    })
                }
            },
            async submit() {
                try {
                    let oMain = JSON.stringify(this.hform);
                    let sSubStr = JSON.stringify(this.HCheckFileList);
                    let sMainSub = oMain + ';' + sSubStr;
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Sb_PDA_EquipMaintainBill/SaveGetEquipMaintainBillList",
                        data: {
                            "msg": sMainSub
                        },
                        method: "POST"
                    })
                    if (!res) {
                        return
                    }
                    let {
                        count,
                        Message
                    } = res.data
                    if (count == 1) {
                        uni.showModal({
                            title: '提示',
                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                            success: (res) => {
                                if (res.confirm) {
                                    console.log('用户点击确定');
                                    uni.redirectTo({
                                        url: '/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill?operationType=1'
                                    })
                                } else if (res.cancel) {
                                    console.log('用户点击取消');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            }
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: "提交单据失败: " + Message
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "提交单据失败: " + err
                    })
                }
            }
        },
        onLoad(e) {
            console.log('e: ', e);
            if (!e.operationType) {
                this.operationType = 1
            } else {
                this.operationType = e.operationType
            }
            if (this.operationType == 1) {
                // 新增
                this.getMaxNum()
            } else if (this.operationType == 2) {
                // 复制
            } else if (this.operationType == 3) {
                // 编辑
            } else if (this.operationType == 4) {
                // 浏览
            }
            this.getHDeptList()
            this.getShiftList()
        },
        onReady() {
            const query = uni.createSelectorQuery().in(this)
            query.select("#buttons")
                .boundingClientRect()
                .select("#tabs")
                .boundingClientRect()
                .exec(res => {
                    this.btnTop = Math.floor(res[0].top)
                    this.tabsBottom = Math.ceil(res[1].bottom)
                })
        }
    }
</script>
<style lang="scss">
</style>
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJBillStyle.scss"
</style>
pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBillList.vue
New file
@@ -0,0 +1,434 @@
<template>
    <view class="content">
        <view class="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">缓存列表</view>
            <!-- <view :class="tabs == 1 ? 'on':''" @tap="changeTab(1)">已上传列表</view> -->
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="form" v-if="tabs == 0">
            <view class="buttons" @tap="add">
                <uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>新增
            </view>
        </view>
        <view class="form" v-if="tabs == 1">
            <view class="form-item">
                <view class="title">单据号:</view>
                <view class="right">
                    <input v-model="hform.HBillNo" placeholder="请输入单据号" />
                </view>
            </view>
            <view class="form-item">
                <view class="title">源单单号:</view>
                <view class="right">
                    <input v-model="hform.HSourceBillNo" placeholder="请输入源单单号" />
                </view>
            </view>
            <view class="buttons">
                <button class="btn-a" size="mini" type="default" @tap="clear">重置</button>
                <button class="btn-c" size="mini" type="default" @tap="search">查询</button>
            </view>
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
            <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.设备代码">
                        <text>设备代码:</text>{{item.设备代码}}
                    </view>
                    <view class="detail" v-if="item.设备名称">
                        <text>设备名称:</text>{{item.设备名称}}
                    </view>
                    <view class="detail" v-if="item.表头备注">
                        <text>表头备注:</text>{{item.表头备注}}
                    </view>
                    <view class="detail" v-if="item.开始日期">
                        <text>开始日期:</text>{{dayjs(item.开始日期).format("YYYY-MM-DD HH:mm:DD")}}
                    </view>
                    <view class="detail" v-if="item.结束日期">
                        <text>结束日期:</text>{{dayjs(item.结束日期).format("YYYY-MM-DD HH:mm:DD")}}
                    </view>
                    <view class="detail" v-if="item.保养计划编号">
                        <text>保养计划编号:</text>{{item.保养计划编号}}
                    </view>
                    <view class="detail" v-if="item.保养计划">
                        <text>保养计划:</text>{{item.保养计划}}
                    </view>
                    <view class="detail" v-if="item.摘要">
                        <text>摘要:</text>{{item.摘要}}
                    </view>
                    <view class="detail" v-if="item.点检规格摘要">
                        <text>点检规格摘要:</text>{{item.点检规格摘要}}
                    </view>
                    <view class="detail" v-if="item.hmainid">
                        <text>内部单据号:</text>{{item.hmainid}}
                    </view>
                    <view class="detail" v-if="item.最终结论">
                        <text>最终结论:</text>{{item.最终结论}}
                    </view>
                </view>
                <view class="more">
                    <!-- <view class="part" style="border-right: 1px solid #eee;color: #3a78ff;" @tap.stop="edit(item)">
                        <uni-icons type="compose" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>编辑
                    </view> -->
                    <view style="flex: 1"></view>
                    <view class="part" style="color: #da0000;" @tap.stop="del(item)">
                        <uni-icons type="trash" style="color: #da0000;margin-right: 10rpx;" size="18"></uni-icons>删除
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==1">
            <uni-card :title="item.日期" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.状态">
                        <text>状态:</text>{{item.状态}}
                    </view>
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.数量">
                        <text>数量:</text>{{item.数量}}
                    </view>
                    <view class="detail" v-if="item.源单单号">
                        <text>源单单号:</text>{{item.源单单号}}
                    </view>
                    <view class="detail" v-if="item.物料代码">
                        <text>物料代码:</text>{{item.物料代码}}
                    </view>
                    <view class="detail" v-if="item.物料名称">
                        <text>物料名称:</text>{{item.物料名称}}
                    </view>
                    <view class="detail" v-if="item.规格型号">
                        <text>规格型号:</text>{{item.规格型号}}
                    </view>
                    <view class="detail" v-if="item.组织">
                        <text>组织:</text>{{item.组织}}
                    </view>
                </view>
                <view class="more">
                    <view class="part" style="color: #3a78ff;width: 100%;" @tap.stop="qrCodeDisplay(item)">
                        <uni-icons type="scan" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>显示二维码
                    </view>
                    <view class="part" style="color: #d98d00;width: 100%;" @tap.stop="revoke(item)">
                        <uni-icons type="undo" style="color: #d98d00;margin-right: 10rpx;" size="18"></uni-icons>撤销
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="!listData || listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
        <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
    </view>
</template>
<script>
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
    import {
        CommonUtils
    } from "../../../utils/common";
    import dayjs from "dayjs";
    export default {
        data() {
            return {
                dayjs,
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                tabs: 0,
                urls: '/Web/GetEquipmentBillsList',
                MvarReportTitle: '设备点检记录单缓存',
                hform: {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3901,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    Type: "BY",
                    sWhere: "",
                },
                sWhere: '',
                listData: [],
                showList: [],
                showDetail: -1,
                page: 1,
            }
        },
        onShow() {
            //用户模块权限判断
            this.CheckModRight()
            this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        components: {
            BarCodePopupVue
        },
        onReachBottom: function() {
            this.page++
            setTimeout(() => {
                this.showList = this.showList.concat(this.getPage(this.page, this.listData))
            }, 100)
        },
        onPullDownRefresh: function() {
            this.clear()
            setTimeout(() => {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        methods: {
            async qrCodeDisplay(item) {
                this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
                await this.$nextTick()
                this.$refs.barcodePopup.open()
            },
            CheckModRight() {
                uni.request({
                    url: this.serverUrl + '/WEBSController/CheckModRight_Json',
                    data: {
                        ModRightName: 'CE_OtherOut',
                        HUserName: uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        if (res.data.count == 1) {} else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            getPage(page, list) {
                let sindex = (parseInt(page) - 1) * 20
                let eindex = parseInt(page) * 20
                let newList = list.slice(sindex, eindex)
                return newList
            },
            changeTab(e) {
                this.tabs = e
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/Web/GetEquipmentBillsList'
                }
                // if (this.tabs == 1) {
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
                this.getList()
            },
            async getList() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: this.urls,
                        data: this.hform
                    })
                    let {
                        count,
                        data,
                        Message
                    } = res.data
                    if (count == 1) {
                        this.listData = data
                        this.showList = this.getPage(this.page, data)
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取设备点检记录单失败: ${Message}`
                        })
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取设备点检记录单失败: ${err}`
                    })
                }
            },
            search() {
                this.sWhere = ''
                this.listData = []
                this.page = 1
                this.showList = []
                console.log(this.hform)
                // if (this.hform.HBillNo) {
                //     this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
                // }
                // if (this.hform.HSourceBillNo) {
                //     this.sWhere += " and 设备类型 like '%" + this.hform.HSourceBillNo + "%'";
                // }
                this.getList()
            },
            clear() {
                this.listData = []
                this.page = 1
                this.showList = []
                this.sWhere = ''
                this.hform = {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3901,
                    user: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    sWhere: '',
                    Type: "BY"
                }
                this.getList()
            },
            add() {
                uni.navigateTo({
                    url: '/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill?operationType=1'
                })
            },
            //编辑
            edit(item) {
                console.log(item)
                uni.request({
                    url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
                    data: {
                        "HInterID": item.HInterID,
                        "HBillNo": item.单据号,
                        "HBillType": this.hform.HBillType
                    },
                    success: (res) => {
                        console.log(1, res);
                        if (res.data.count == 1) {
                            uni.navigateTo({
                                url: './OtherOutBill?OperationType=2&HInterID=' + item.HInterID
                            })
                        } else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                })
            },
            //删除
            del(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/Sb_EquipMaintainBill/DeltetEquipMaintainBillList',
                                data: {
                                    HInterID: item.hmainid,
                                    user: uni.getStorageSync('HUserName'),
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
            //撤销
            revoke(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '是否确认撤销',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DeleteICStockBillAndWMS_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    HBillNo: item.单据号,
                                    HBillType: this.hform.HBillType,
                                    HMaker: uni.getStorageSync('HUserName'),
                                    MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import "@/pages/MJGL/style/MJListStyle.scss"
</style>
pages/MJGL/style/MJListStyle.scss
@@ -0,0 +1,133 @@
    .form {
        width: 640rpx;
        margin: 20rpx auto;
        margin-top: 90rpx;
    }
    .tabs {
        width: 100%;
        position: fixed;
        left: 0;
        z-index: 9;
        display: flex;
        background-color: #e5e5e5;
        view {
            width: 50%;
            font-size: 30rpx;
            color: #333;
            text-align: center;
            padding: 16rpx 0;
        }
        .on {
            color: #3a78ff;
            font-weight: bold;
            border-bottom: 3px solid #3a78ff;
        }
    }
    .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .form-item {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
        .title {
            width: 180rpx;
            text {
                color: red;
                font-weight: bold;
            }
        }
        .right {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
        .righton {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
        input {
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
    .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more {
            color: #888;
            font-size: 26rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    }
pages/index/tab3.vue
@@ -154,6 +154,13 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备保养记录单列表",
                        "url": "/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBillList",
                        "id": 52,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备保养记录单",
                        "url": "/pages/MJGL/Sb_EquipMaintainBill/Sb_EquipMaintainBill",
                        "id": 53,
@@ -161,6 +168,13 @@
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备点检记录单列表",
                        "url": "/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBillList",
                        "id": 54,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "设备点检记录单",
                        "url": "/pages/MJGL/Sb_EquipDotCheckBill/Sb_EquipDotCheckBill",
                        "id": 55,