Mr.Zhang
2023-08-30 05143990efdcad0e57341913480ab1fb112993bc
选择物料
已添加1个文件
已修改3个文件
164 ■■■■■ 文件已修改
minipro_standard/common/config.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/components/selectMaterial.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/request/index.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/common/config.js
@@ -1,5 +1,11 @@
module.exports = {
    // baseUrl: 'http://106.14.20.42/test_hfznzz/',
    // baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
    baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api/'
    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]*$/,
        decimal: /^0$|^[1-9]\d{0,15}$|^[1-9]\d{0,15}\.{1}\d{1,4}$|^0\.{1}\d{1,4}$/g,
        positiveIntegerDecimal: /^([1-9][0-9]*|0)(\.[0-9]?[1-9][1-9][1-9])?$/,
        number: /^\d+(?:\.\d{1,4})?$/
}
minipro_standard/components/selectMaterial.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
<template>
    <u-popup :show="show" :round="10" closeable @close="show=false">
        <view class="material-content">
            <u-list @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower">
                <u-list-item v-for="(item, index) in list" :key="index">
                    <view class="" style="height: 20px;">{{item}}</view>
                </u-list-item>
            </u-list>
        </view>
    </u-popup>
</template>
<script>
    export default {
        name: "selectMaterial",
        data() {
            return {
                show: false,
                pages: {
                    size: 10,
                    index: 1,
                    total: 0
                },
                list: [
                    1,2,3,4,5,6,7,8
                ]
            };
        },
        methods: {
            open(target) {
                this.show = true
                this.workorderId = target.workorderId
                this.deviceId = target.deviceId
                this.list = []
                this.pages = {
                    size: 10,
                    index: 1,
                    total: 0
                }
                this.loadData()
            },
            loadData() {
                this.list = [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,6]
            },
            scrolltoupper() {
                console.log('scrolltoupper');
                this.loadData()
            },
            scrolltolower() {
                console.log('scrolltolower');
                this.loadData()
            },
        }
    }
</script>
<style lang="scss" scoped>
    .material-content {
        height: 800rpx;
    }
</style>
minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue
@@ -5,7 +5,8 @@
            <div class="tl_title_left">
                <div class="tl_title_left_x"></div>
                <span>投料信息</span>
                <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span>
                <!-- <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span> -->
                <!-- <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span> -->
            </div>
            <div class="tl_title_right" @click="add">
                <image src="../../static/gongdan_ic_shoudong@2x.png" class="add-img" mode=""></image>
@@ -19,7 +20,7 @@
                    <div class="tl_list_item" @click="open1(index)">
                        <div class="tl_list_item_label">选择物料</div>
                        <div class="tl_list_item_go" v-if="!item.materialName">
                            <span>点击跳转到物料列表</span>
                            <span>点击跳转到物料列表</span>
                            <u-icon name="arrow-right"></u-icon>
                        </div>
                        <div class="tl_list_item_wl" v-else>
@@ -46,24 +47,48 @@
                    </div>
                </div>
            </u-swipe-action-item>
        </u-swipe-action>
        </u-swipe-action>
        <SelectMaterial ref="selectMaterial" />
    </view>
</template>
<script>
    import workOrderInfo from '@/components/workOrderInfo.vue'
    import workOrderInfo from '@/components/workOrderInfo.vue'
    import SelectMaterial from '@/components/selectMaterial.vue'
    import {
        positiveInteger,
        number
    } from '@/common/config'
    export default {
        components: {
            workOrderInfo
            workOrderInfo,
            SelectMaterial
        },
        data() {
            return {
                total: 3,
                formList: [{
                    dw: 'dasda'
                }],
                // formList: [{
                //     id: Date.now(),
                //     toolingTypeId: '', // å·¥è£…类型
                //     toolingTypeName: '', // å·¥è£…类型名称
                //     workClothesId: '', // å·¥è£…
                //     workClothesName: '', // å·¥è£…名称
                //     num: '', // æ•°é‡
                //     attribute: '', // å·¥è£…属性
                //     attributeType: '', // å·¥è£…属性类型
                //     dw: '', // ç‰©æ–™å•位
                //     unitAttribute: ''
                // }],
                materialList: [{
                    id: '',
                    materialName: '',
                    materialCode: '',
                    qualityType: '',
                    procedureName: '',
                    locationName: '',
                    batch: '',
                    num: '',
                    unitAttribute: ''
                }],
                options: [{
                    text: '删除',
@@ -72,14 +97,54 @@
                    }
                }],
            };
        },
        },
        methods: {
            open1(index) {
                this.$refs.selectMaterial.open({})
            },
            deleItem(index) {
                if (this.materialList.length === 1) {
                    uni.$u.toast('至少保留一条投料信息')
                    return
                }
                this.materialList.splice(index, 1)
            },
            add() {
                this.total += 1
                this.materialList.unshift({
                    id: '',
                    materialName: '',
                    materialCode: '',
                    qualityType: '',
                    procedureName: '',
                    locationName: '',
                    batch: '',
                    num: '',
                    unitAttribute: ''
                })
            },
            changeNumber(num, index, unitAttribute) {
                if (unitAttribute === 0 && num !== '') {
                    if (!positiveInteger.test(num)) {
                        uni.$u.toast({
                            message: '只能输入正整数'
                        })
                        this.materialList[index].num = ''
                    }
                } else if (unitAttribute === 1 && num !== '') {
                    if (!number.test(num)) {
                        uni.$u.toast({
                            message: '只能输入正整数或小数(最多四位)'
                        })
                        this.materialList[index].num = ''
                    }
                }
                if (num <= 0) {
                    uni.$u.toast({
                        message: '投料数量不能小于等于0'
                    })
                    this.materialList[index].num = ''
                }
            }
        }
    }
minipro_standard/util/request/index.js
@@ -1,13 +1,13 @@
// å¼•入配置
import config from '@/common/config'
import { baseUrl } from '@/common/config'
// åˆå§‹åŒ–请求配置
uni.$u.http.setConfig((defaultConfig) => {
    /* defaultConfig ä¸ºé»˜è®¤å…¨å±€é…ç½® */
    defaultConfig.baseURL = config.baseUrl /* æ ¹åŸŸå */
        config.header = {
    defaultConfig.baseURL = baseUrl /* æ ¹åŸŸå */
        defaultConfig.header = {
            'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
        }
        config.dataType = 'json'
        defaultConfig.dataType = 'json'
    return defaultConfig
})