Mr.Zhang
2023-09-07 044b6f50a7cc57565409f67b62d4766f2e7cbf52
小程序
已修改3个文件
250 ■■■■ 文件已修改
minipro_standard/pages/inspectComplete/inspectComplete.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/inspectPatrol/inspectPatrol.vue 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/linePatrol/linePatrol.vue 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/inspectComplete/inspectComplete.vue
@@ -22,8 +22,7 @@
            <div class="inspection_list_item" v-if="form.gdmc">
                <span>计划数量</span>
                <div class="right1">
                    <span
                        style="color: black;">{{info.planNum}}{{info.umodel ? info.umodel.name : ''}}</span>
                    <span style="color: black;">{{info.planNum}}{{info.umodel ? info.umodel.name : ''}}</span>
                </div>
            </div>
        </div>
@@ -54,28 +53,34 @@
        <div class="inspection_footer">
            <button class="inspection_footer_sub" @click="submit" v-preventReClick>提交</button>
        </div>
        <u-picker :show="show1" title="请选择不良说明" :columns="columns" @cancel="show1=false" @confirm="badConfirm"></u-picker>
        <u-picker :show="show1" title="请选择不良说明" :columns="columns" keyName="name" @cancel="show1=false"
            @confirm="badConfirm">
        </u-picker>
    </view>
</template>
<script>
    import { createStandard } from '@/util/api/QualityAPI'
    import { checkAllList, getListByCondition, toolingQueryById } from "@/util/api/WorkOrderAPI"
    import {
        createStandard
    } from '@/util/api/QualityAPI'
    import {
        checkAllList
    } from "@/util/api/WorkOrderAPI"
    import { REGULAR } from '@/util/utils'
    export default {
        data() {
            return {
                info: {},
                show1: false,
                columns: [['中国', '美国', '日本']],
                columns1: [],
                columns: [],
                form: {
                    status: '0',
                    status: '2',
                    gdid: '',
                    gdmc: '',
                    jygz: '',
                    jygzmc: '',
                    hgsl: 0,
                    blsl: 1,
                    blsl: 0,
                    blgz: '',
                    blgzmc: '',
                    blsm: '',
@@ -84,6 +89,18 @@
            };
        },
        onLoad() {
            checkAllList({
                    bmodelCateType: '3'
                })
                .then(res => {
                    let bad = res.data.map(item => {
                        return {
                            name: item.combinationName,
                            id: item.id
                        }
                    })
                    this.columns = [bad]
                })
            uni.$on('workOrder', (data) => {
                this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name
                this.form.gdid = data.id
@@ -94,18 +111,60 @@
        methods: {
            jumpGD() {
                uni.navigateTo({
                    url: '/pages/selectWorkOrder/selectWorkOrder'
                    url: '/pages/selectWorkOrder/selectWorkOrder?type=2'
                })
            },
            openBL() {},
            getValue1() {},
            selectBad() {
                console.log('------0-----');
                this.show1 = true
            },
            badConfirm(value) {
                console.log(value);
            badConfirm({
                value
            }) {
                this.form.blsm = value[0].name
                this.show1 = false
            },
            submit() {
                if (!this.form.gdid) return uni.$u.toast('工单不能为空')
                if (this.form.hgsl || this.form.blsl) {
                    if (this.form.hgsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数')
                        }
                    }
                    if (this.form.blsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.blsl)) {
                                return uni.$u.toast('不良数量只能为正整数或四位小数')
                            }
                        }
                    }
                } else {
                    return uni.$u.toast('良品和不良不能同时为空')
                }
                let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0)
                if (total > this.info.planNum) {
                    return  uni.$u.toast('合格不良相加不能超过计划数量')
                }
                if (Number(this.form.blsl) > 0) {
                    if (!this.form.blsm) return uni.$u.toast('不良说明不能为空')
                }
                createStandard({
                    workorderId: this.form.gdid,
                    qualifiedNum: this.form.hgsl ? this.form.hgsl : 0,
                    unqualifiedNum: this.form.blsl ? this.form.blsl : 0,
                    checkInfo: this.form.blsm,
                    checkType: this.form.status
                }).then(res => {
                    if (res.code === 200) {
                        uni.$u.toast('检验成功')
                        uni.navigateBack()
                    }
                })
            }
        }
    }
minipro_standard/pages/inspectPatrol/inspectPatrol.vue
@@ -59,21 +59,27 @@
</template>
<script>
    import {
        createStandard
    } from '@/util/api/QualityAPI'
    import {
        checkAllList
    } from "@/util/api/WorkOrderAPI"
    import { REGULAR } from '@/util/utils'
    export default {
        data() {
            return {
                info: {},
                show1: false,
                columns: [['中国', '美国', '日本']],
                columns1: [],
                columns: [],
                form: {
                    status: '0',
                    status: '1',
                    gdid: '',
                    gdmc: '',
                    jygz: '',
                    jygzmc: '',
                    hgsl: 0,
                    blsl: 1,
                    blsl: 0,
                    blgz: '',
                    blgzmc: '',
                    blsm: '',
@@ -82,8 +88,19 @@
            };
        },
        onLoad() {
            checkAllList({
                    bmodelCateType: '3'
                })
                .then(res => {
                    let bad = res.data.map(item => {
                        return {
                            name: item.combinationName,
                            id: item.id
                        }
                    })
                    this.columns = [bad]
                })
            uni.$on('workOrder', (data) => {
                console.log(data);
                this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name
                this.form.gdid = data.id
                this.info = data
@@ -93,17 +110,60 @@
        methods: {
            jumpGD() {
                uni.navigateTo({
                    url: '/pages/selectWorkOrder/selectWorkOrder'
                    url: '/pages/selectWorkOrder/selectWorkOrder?type=1'
                })
            },
            openBL() {},
            getValue1() {},
            selectBad() {
                console.log('------0-----');
                this.show1 = true
            },
            badConfirm(value) {
                this.show1 = false;
            badConfirm({
                value
            }) {
                this.form.blsm = value[0].name
                this.show1 = false
            },
            submit() {
                if (!this.form.gdid) return uni.$u.toast('工单不能为空')
                if (this.form.hgsl || this.form.blsl) {
                    if (this.form.hgsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数')
                        }
                    }
                    if (this.form.blsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.blsl)) {
                                return uni.$u.toast('不良数量只能为正整数或四位小数')
                            }
                        }
                    }
                } else {
                    return uni.$u.toast('良品和不良不能同时为空')
                }
                let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0)
                if (total > this.info.planNum) {
                    return  uni.$u.toast('合格不良相加不能超过计划数量')
                }
                if (Number(this.form.blsl) > 0) {
                    if (!this.form.blsm) return uni.$u.toast('不良说明不能为空')
                }
                createStandard({
                    workorderId: this.form.gdid,
                    qualifiedNum: this.form.hgsl ? this.form.hgsl : 0,
                    unqualifiedNum: this.form.blsl ? this.form.blsl : 0,
                    checkInfo: this.form.blsm,
                    checkType: this.form.status
                }).then(res => {
                    if (res.code === 200) {
                        uni.$u.toast('检验成功')
                        uni.navigateBack()
                    }
                })
            }
        }
    }
minipro_standard/pages/linePatrol/linePatrol.vue
@@ -57,13 +57,19 @@
</template>
<script>
    import {
        createStandard
    } from '@/util/api/QualityAPI'
    import {
        checkAllList
    } from "@/util/api/WorkOrderAPI"
    import { REGULAR } from '@/util/utils'
    export default {
        data() {
            return {
                info: {},
                show1: false,
                columns: [['中国', '美国', '日本']],
                columns1: [],
                columns: [],
                form: {
                    status: '0',
                    gdid: '',
@@ -71,7 +77,7 @@
                    jygz: '',
                    jygzmc: '',
                    hgsl: 0,
                    blsl: 1,
                    blsl: 0,
                    blgz: '',
                    blgzmc: '',
                    blsm: '',
@@ -80,6 +86,18 @@
            };
        },
        onLoad() {
            checkAllList({
                    bmodelCateType: '3'
                })
                .then(res => {
                    let bad = res.data.map(item => {
                        return {
                            name: item.combinationName,
                            id: item.id
                        }
                    })
                    this.columns = [bad]
                })
            uni.$on('workOrder', (data) => {
                this.form.gdmc = data.mmodel.name + '-' + data.pgmodel.name
                this.form.gdid = data.id
@@ -90,17 +108,60 @@
        methods: {
            jumpGD() {
                uni.navigateTo({
                    url: '/pages/selectWorkOrder/selectWorkOrder'
                    url: '/pages/selectWorkOrder/selectWorkOrder?type=1'
                })
            },
            openBL() {},
            getValue1() {},
            selectBad() {
                console.log('------0-----');
                this.show1 = true
            },
            badConfirm() {
                this.show1 = false;
            badConfirm({
                value
            }) {
                this.form.blsm = value[0].name
                this.show1 = false
            },
            submit() {
                if (!this.form.gdid) return uni.$u.toast('工单不能为空')
                if (this.form.hgsl || this.form.blsl) {
                    if (this.form.hgsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.hgsl)) return uni.$u.toast('良品数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.hgsl)) uni.$u.toast('良品数量只能为正整数或四位小数')
                        }
                    }
                    if (this.form.blsl) {
                        if (this.form.dw == '0') { // 整数
                            if (!REGULAR.positiveInteger.test(this.form.blsl)) return uni.$u.toast('不良数量只能为正整数')
                        } else if (this.form.dw == '1') { // 小数
                            if (!REGULAR.number.test(this.form.blsl)) {
                                return uni.$u.toast('不良数量只能为正整数或四位小数')
                            }
                        }
                    }
                } else {
                    return uni.$u.toast('良品和不良不能同时为空')
                }
                let total = (this.form.hgsl ? Number(this.form.hgsl) : 0) + (this.form.blsl ? Number(this.form.blsl) : 0)
                if (total > this.info.planNum) {
                    return  uni.$u.toast('合格不良相加不能超过计划数量')
                }
                if (Number(this.form.blsl) > 0) {
                    if (!this.form.blsm) return uni.$u.toast('不良说明不能为空')
                }
                createStandard({
                    workorderId: this.form.gdid,
                    qualifiedNum: this.form.hgsl ? this.form.hgsl : 0,
                    unqualifiedNum: this.form.blsl ? this.form.blsl : 0,
                    checkInfo: this.form.blsm,
                    checkType: this.form.status
                }).then(res => {
                    if (res.code === 200) {
                        uni.$u.toast('检验成功')
                        uni.navigateBack()
                    }
                })
            }
        }
    }