| | |
| | | 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})?$/ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | |
| | | <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>
|
| | |
| | | </div>
|
| | | </u-swipe-action-item>
|
| | | </u-swipe-action>
|
| | | <SelectMaterial ref="selectMaterial" />
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | 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: 'å é¤',
|
| | |
| | | };
|
| | | },
|
| | | 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 = ''
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | // å¼å
¥é
ç½®
|
| | | 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
|
| | | })
|
| | |
|