Mr.Shi
2023-09-07 e0673329aafe8fc5e17daa75f940807566813290
小程序
已修改6个文件
445 ■■■■■ 文件已修改
minipro_standard/common/config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/components/Search.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/api/QualityAPI.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/common/config.js
@@ -1,8 +1,8 @@
module.exports = {
    // baseUrl: 'http://106.14.20.42/test_hfznzz/',
    // baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
    baseUrl: 'http://192.168.0.15:10021',
    // baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
    // baseUrl: 'http://192.168.0.15:10021',
    baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
    phoneRegular: /^1[3456789]\d{9}$/,
    mailboxRegular: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
    positiveInteger: /^[0-9]*[1-9][0-9]*$/,
minipro_standard/components/Search.vue
@@ -66,6 +66,8 @@
        display: flex;
        align-items: center;
        .zhanwei {
            width: 100%;
            height: calc(88rpx + 30rpx);
            background: #ffffff;
        }
        .content {
@@ -81,7 +83,7 @@
            justify-content: space-between;
            padding-left: 40rpx;
            padding-right: 40rpx;
            padding-bottom: 64rpx;
            padding-bottom: env(safe-area-inset-bottom);
            box-sizing: border-box;
            position: fixed;
            bottom: 0;
@@ -91,6 +93,7 @@
            .footer_close {
                flex: 1;
                padding: 28rpx 0;
                height: 88rpx;
                box-sizing: border-box;
                margin-right: 22rpx;
                font-size: 32rpx;
@@ -103,6 +106,7 @@
            }
            .footer_submit {
                flex: 1;
                height: 88rpx;
                padding: 28rpx 0;
                box-sizing: border-box;
                font-size: 32rpx;
minipro_standard/pages.json
@@ -249,7 +249,8 @@
        },
        {
            "root": "pages_inspect",
            "pages": [{
            "pages": [
                {
                    "path": "pages/InspectionRecords/InspectionRecords",
                    "style": {
                        "navigationBarTitleText": "检验记录",
minipro_standard/pages_inspect/pages/InspectionDetails/InspectionDetails.vue
@@ -73,11 +73,41 @@
</template>
<script>
    import { getBYid } from '@/util/api/QualityAPI'
    import { deletejy } from "@/util/api/PlanningAPI"
    export default {
        data() {
            return {
                id: null,
                info: {}
            };
        },
        onLoad(option) {
            this.id = option.id
            this.getBYids()
        },
        methods: {
            getBYids() {
                getBYid(this.id)
                    .then(res => {
                        if (res.code === 200 && res.data) {
                            this.info = res.data
                        }
                    })
            },
            // 删除检验记录
            dele() {
                deletejy(this.id)
                    .then(res => {
                        if (res.code === 200) {
                            uni.showToast({ title: '删除成功', duration: 2000, mask: true })
                            setTimeout(() => {
                                uni.navigateBack({ delta: 1 });
                            }, 2000)
                        }
                    })
            }
        }
    }
</script>
minipro_standard/pages_inspect/pages/InspectionRecords/InspectionRecords.vue
@@ -1,7 +1,7 @@
<template>
    <view class="content">
        <view class="content_search">
            <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="搜索工单编码/物料编码2">
            <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="搜索工单编码/物料编码">
                <template v-slot:content>
                    <view class="Search_item">
                        <view class="Search_item_label">检验日期</view>
@@ -36,10 +36,17 @@
                </template>
            </Search>
        </view>
        <view class="content_total" :style="{top: top}">共{{listData.total}}条数据</view>
        <view class="content_total" :style="{top: top}">共{{pageData.total}}条数据</view>
        <view class="content_list">
            <scroll-view @scrolltolower="getLists" scroll-y :style="{height: height}">
                <view class="content_list_item" v-for="item in lists" :key="item.id" @click="jump(item)">
            <scroll-view
            :refresher-enabled="true"
            :refresher-triggered="isLoading"
            @refresherrefresh="onRefresh"
            refresher-background="#fff"
            @scrolltolower="onLoads"
            scroll-y
            :style="{height: height}">
                <view class="content_list_item" v-for="item in listData" :key="item.id" @click="jumpDesc(item)">
                    <view class="content_list_item_title">
                        <text>{{item.code}}</text>
                        <text class="warning" v-if="item.checkType === 0">巡线</text>
@@ -92,156 +99,48 @@
            </scroll-view>
        </view>
        <!-- 选择日期 -->
        <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm"></u-calendar>
        <u-calendar :show="timeShow" mode="range" @confirm="timeConfirm" @close="timeShow = false"></u-calendar>
    </view>
</template>
<script>
    import Search from '@/components/Search.vue'
    import { page } from '@/util/api/QualityAPI'
    import { getWorkingProcedure, deletejy } from "@/util/api/PlanningAPI"
    import { mapState } from 'vuex'
    export default {
        components: { Search },
        data() {
            return {
                height: '',
                top: '',
                listData: {
                isLoading: false,
                pageData: {
                    capacity: 10,
                    page: 0,
                    total: 0,
                    startDate: '',
                    endDate: '',
                    procedureIds: [],
                    departIds: '',
                    mixParam: '',
                    cateIds: []
                    checkStartDate: '',
                    checkEndDate: '',
                    minParam: '',
                    batch: '',
                    checkType: '',
                    procedureId: '',
                    workorderId: ''
                },
                data: [        // 检验类型
                    { id: '0', name: '巡线', isActive: false },
                    { id: '1', name: '巡检', isActive: false },
                    { id: '2', name: '完工检', isActive: false }
                ],
                minDate: new Date(2021, 0, 1),
                maxDate: new Date(new Date().getFullYear() + 1, 12, 30),
                listData: [],
                workingProcedure: [],    // 工序
                finished: true,
                loading: false,
                finished: false,
                refreshing: false,
                timeShow: false,
                lists: [
                    {
                        id: 1,
                        checkType: 0,
                        status: 0,
                        code: '1234543223',
                        urgent: 1,
                        num: 100,
                        batch: '11111',
                        planDate: '2023-08-29',
                        mmodel: {
                            name: '工序计划',
                            code: 'fbdseasafghb'
                        },
                        usermodel: {
                            realname: '计划人员'
                        },
                        pmodel: {
                            name: '工序计划'
                        },
                        fmodel: {
                            name: '工厂'
                        }
                    },
                    {
                        id: 2,
                        checkType: 1,
                        code: '1234543223',
                        status: 0,
                        urgent: 1,
                        num: 100,
                        batch: '11111',
                        planDate: '2023-08-29',
                        mmodel: {
                            name: '工序计划',
                            code: 'fbdseasafghb'
                        },
                        usermodel: {
                            realname: '计划人员'
                        },
                        pmodel: {
                            name: '工序计划'
                        },
                        fmodel: {
                            name: '工厂'
                        }
                    },
                    {
                        id: 3,
                        checkType: 2,
                        code: '1234543223',
                        status: 0,
                        urgent: 1,
                        num: 100,
                        batch: '11111',
                        planDate: '2023-08-29',
                        mmodel: {
                            name: '工序计划',
                            code: 'fbdseasafghb'
                        },
                        usermodel: {
                            realname: '计划人员'
                        },
                        pmodel: {
                            name: '工序计划'
                        },
                        fmodel: {
                            name: '工厂'
                        }
                    },
                    {
                        checkType: 2,
                        id: 4,
                        status: 0,
                        urgent: 1,
                        code: '1234543223',
                        num: 100,
                        batch: '11111',
                        planDate: '2023-08-29',
                        mmodel: {
                            name: '工序计划',
                            code: 'fbdseasafghb'
                        },
                        usermodel: {
                            realname: '计划人员'
                        },
                        pmodel: {
                            name: '工序计划'
                        },
                        fmodel: {
                            name: '工厂'
                        }
                    },
                    {
                        checkType: 1,
                        id: 5,
                        status: 0,
                        code: '1234543223',
                        urgent: 1,
                        num: 100,
                        batch: '11111',
                        planDate: '2023-08-29',
                        mmodel: {
                            name: '工序计划',
                            code: 'fbdseasafghb'
                        },
                        usermodel: {
                            realname: '计划人员'
                        },
                        pmodel: {
                            name: '工序计划'
                        },
                        fmodel: {
                            name: '工厂'
                        }
                    }
                ]
                timeShow: false
            };
        },
        onReady() {
@@ -253,51 +152,65 @@
                }).exec()
            })
        },
        computed: {
            ...mapState(['userInfo'])
        },
        onLoad(option) {
            if (option.id) {
                this.pageData.workorderId = option.id
            }
            this.onLoads()
            this.getWorkingProcedures()
        },
        methods: {
            // 跳转
            jump(item) {
            jumpDesc(item) {
                uni.navigateTo({
                    url: `/pages/InspectionDetails/InspectionDetails?id=${item.id}`
                    url: `/pages_inspect/pages/InspectionDetails/InspectionDetails?id=${item.id}`
                })
            },
            // 获取头部组件高度
            getHeight(height) {
                this.height = height
            },
            onRefresh() {
                if (this.isLoading) return
                this.isLoading = true
                this.listData = []
                this.pageData.page = 0
                this.onLoads()
            },
            // 重置
            reset() {
                this.listData.page = 0
                this.pageData.checkStartDate = ''
                this.pageData.checkEndDate = ''
                this.pageData.minParam = ''
                this.pageData.checkType = ''
                this.pageData.procedureId = ''
                this.pageData.batch = ''
                this.pageData.page = 0
                this.listData = []
                this.finished = false
                this.lists = []
                this.listData.mixParam = ''
                this.listData.startDate = ''
                this.listData.endDate = ''
                this.listData.procedureIds = []
                if (this.factoryList.length > 0) {
                    this.listData.departIds = this.factoryList[0].id
                }
                if (this.data.length > 0) {
                    this.data.forEach(item => { item.isActive = false })
                }
                // this.getLists()
                // this.pageCounts()
                this.data.forEach(item => { item.isActive = false })
                this.workingProcedure.forEach(item => { item.isActive = false })
                this.onLoads()
            },
            // 日期确定
            timeConfirm(val) {
                this.listData.startDate = val[0]
                this.listData.endDate = val[val.length - 1]
                this.pageData.checkStartDate = val[0]
                this.pageData.checkEndDate = val[val.length - 1]
                this.timeShow = false
            },
            // 切换工厂
            changeTags(i, id) {
                this.listData.departIds = id
                this.getWorkingProcedures(id)
                this.factoryList.forEach((item, index) => {
                    if (index === i) {
                        item.isActive = true
                    } else {
                        item.isActive = false
                    }
            // 切换检类型
            changeTag(i) {
                this.data.forEach((item, index) => {
                    item.isActive = index === i;
                })
            },
            // 切换检工序
            changeTag1(i) {
                this.workingProcedure.forEach((item, index) => {
                    item.isActive = index === i;
                })
            },
            // 打开日期插件
@@ -306,130 +219,85 @@
            },
            // 搜索
            searchInput(val) {
                this.listData.mixParam = val
                this.listData.page = 0
                this.pageData.minParam = val
                this.pageData.page = 0
                this.listData = []
                this.finished = false
                this.lists = []
                this.getLists()
            },
            // 点击标签搜索
            clickTag(ids) {
                this.listData.cateIds = ids
                this.listData.page = 0
                this.finished = false
                this.lists = []
                // this.getLists()
            },
            // 获取列表统计
            pageCounts() {
                pageCount({
                    factoryId: this.listData.departIds,
                    procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
                    startDate: this.listData.startDate,
                    endDate: this.listData.endDate,
                    statusList: this.listData.cateIds
                }).then(res => {
                    if (res.code === 200 && res.data) {
                        this.tagList[0].num = res.data.allNum.toString()
                        this.tagList[1].num = res.data.startNum.toString()
                        this.tagList[2].num = res.data.ingNum.toString()
                        this.tagList[3].num = res.data.endNum.toString()
                    }
                })
            },
            // 获取工厂数据
            getOrganizations() {
                getOrganization({
                    type: 1
                }).then(res => {
                    if (res.code === 200 && res.data && res.data.length !== 0) {
                        res.data.forEach((item, i) => {
                            item.isActive = i === 0;
                        })
                        if (res.data.length > 0) {
                            this.factoryList = res.data
                            this.listData.departIds = this.factoryList[0].id
                            this.listData.procedureIds = ''
                            this.finished = false
                            this.getWorkingProcedures(this.factoryList[0].id)
                            this.getLists()
                            this.pageCounts()
                        }
                    }
                })
                this.onLoads()
            },
            // 获取工序数据
            getWorkingProcedures(orgId) {
                this.data = []
                getWorkingProcedure({ orgId })
                    .then(res => {
                        if (res.code === 200 && res.data && res.data.length !== 0) {
                            res.data.forEach((item, i) => {
                                item.isActive = false;
                            })
                            this.data = res.data
                        }
                    })
            },
            // 搜索弹框提交
            submit()  {
                let pmodelOrgId = []
                this.data.forEach((item) => {
                    if (item.isActive) {
                        pmodelOrgId.push(item.id)
            getWorkingProcedures() {
                getWorkingProcedure({
                    capacity: 100,
                    page: 1,
                    model: {
                        userId: this.userInfo.id
                    }
                }).then(res => {
                    if (res.code === 200 && res.data.records.length !== 0) {
                        res.data.records.forEach((item, index) => {
                            // if (index === 0) {
                            //     workingProcedure.push({ id: item.id, name: item.name, isActive: true })
                            // } else {
                                this.workingProcedure.push({ id: item.id, name: item.name, isActive: false })
                            // }
                        })
                    }
                })
                this.listData.procedureIds = pmodelOrgId
                this.listData.page = 0
                this.finished = false
                this.lists = []
                // this.getLists()
                // this.pageCounts()
            },
            // 获取计划列表数据
            getLists() {
                console.log('getLists')
            // 搜索弹框提交
            submit() {
                this.data.forEach(item => {
                    if (item.isActive) {
                        this.pageData.checkType = item.id
                    }
                })
                this.workingProcedure.forEach(item => {
                    if (item.isActive) {
                        this.pageData.procedureId = item.id
                    }
                })
                this.pageData.page = 0
                this.listData = []
                this.finished = false
                this.onLoads()
            },
            // 列表
            onLoads() {
                if (!this.finished) {
                    this.pageData.page = this.pageData.page += 1
                    this.loading = true
                    this.listData.page = this.listData.page++
                    getList({
                        capacity: this.listData.capacity,
                    page({
                        capacity: this.pageData.capacity,
                        page: this.pageData.page,
                        model: {
                            mixParam: this.listData.mixParam,
                            startDate: this.listData.startDate,
                            endDate: this.listData.endDate,
                            procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
                            factoryId: this.listData.departIds,
                            statusList: this.listData.cateIds
                        },
                        page: this.listData.page,
                        sorts: [
                            {
                                direction: 'ASC',
                                property: 'publishDate'
                            }
                        ]
                            minParam: this.pageData.minParam,
                            checkStartDate: this.pageData.checkStartDate,
                            checkEndDate: this.pageData.checkEndDate,
                            checkType: this.pageData.checkType,
                            procedureId: this.pageData.procedureId,
                            workorderId: this.pageData.workorderId,
                            batch: this.pageData.batch
                        }
                    }).then(res => {
                        this.loading = false
                        this.listData.total = res.data.total
                        this.isLoading = false
                        if (this.refreshing) {
                            this.lists = []
                            this.listData = []
                            this.refreshing = false;
                        }
                        if (res.code === 200 && res.data.records.length !== 0) {
                            if (this.lists.length === 0) {
                                this.lists = res.data.records
                            } else {
                                this.lists.push(...res.data.records)
                            }
                        this.loading = false
                        if (res.code === 200 && res.data.records && res.data.records.length !== 0) {
                            this.pageData.total = res.data.total
                            this.listData.push(...res.data.records)
                        } else {
                            this.finished = true
                        }
                    }).catch(err => {
                        this.isLoading = false
                        this.loading = false
                        this.finished = true
                        if (this.refreshing) {
                            this.lists = []
                            this.listData = []
                            this.refreshing = false;
                        }
                    })
minipro_standard/util/api/QualityAPI.js
@@ -38,7 +38,7 @@
// 根据ID查询
export function getBYid (id) {
  return request.post(`/ext/workorderCheckExt/${id}`, data)
  return request.post(`/ext/workorderCheckExt/${id}`)
}
// export function getBYid(id: any): Promise<any> {
//     return httpRequest({
@@ -49,7 +49,7 @@
// 获取出入库信息
export function findById (id) {
  return request.post(`/ext/wOutboundExt/findById?id=${id}`, data)
  return request.post(`/ext/wOutboundExt/findById?id=${id}`)
}
// export function findById(id: Number): Promise<any> {
//     return httpRequest({
@@ -107,8 +107,8 @@
// }
// 根据ID查询设备
export function getBYid (id) {
  return request.post(`/ext/deviceExt/${id}`, data)
export function getsbInfo (id) {
  return request.post(`/ext/deviceExt/${id}`)
}
// export function getsbInfo (id: any): Promise<any> {
//     return httpRequest({