From a89fe32c353040bbb95d7519cf7bafc4b5934f10 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期三, 06 九月 2023 09:54:14 +0800
Subject: [PATCH] 小程序
---
minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue | 132 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 122 insertions(+), 10 deletions(-)
diff --git a/minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue b/minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue
index f08f604..e500034 100644
--- a/minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue
+++ b/minipro_standard/pages_adjust/pages/manualFeed/manualFeed.vue
@@ -1,11 +1,12 @@
<template>
<view class="tl">
- <workOrderInfo :orederMessage="{proUserList:[]}" />
+ <workOrderInfo :orederMessage="info" />
<div class="tl_title">
<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>
@@ -47,23 +48,57 @@
</div>
</u-swipe-action-item>
</u-swipe-action>
+ <SelectMaterial ref="selectMaterial" @selectAction="getValue" />
+ <!-- <SelectMultipleMaterial ref="selectMultipleMaterial" @selected="getMaterails"/> -->
</view>
</template>
<script>
import workOrderInfo from '@/components/workOrderInfo.vue'
+ import SelectMaterial from '@/components/selectMaterial.vue'
+ // import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
+ import {
+ queryById,
+ createMaterial,
+ createMaterialStandard
+ } from '@/util/api/WorkOrderAPI'
+ import {
+ positiveInteger,
+ number
+ } from '@/common/config'
export default {
components: {
- workOrderInfo
+ workOrderInfo,
+ SelectMaterial,
+ // SelectMultipleMaterial
},
data() {
return {
- total: 3,
- formList: [{
- dw: 'dasda'
- }],
+ deviceId: '',
+ workorderId: '',
+ // formList: [{
+ // id: Date.now(),
+ // toolingTypeId: '', // 宸ヨ绫诲瀷
+ // toolingTypeName: '', // 宸ヨ绫诲瀷鍚嶇О
+ // workClothesId: '', // 宸ヨ
+ // workClothesName: '', // 宸ヨ鍚嶇О
+ // num: '', // 鏁伴噺
+ // attribute: '', // 宸ヨ灞炴��
+ // attributeType: '', // 宸ヨ灞炴�х被鍨�
+ // dw: '', // 鐗╂枡鍗曚綅
+ // unitAttribute: ''
+ // }],
+ info: {},
materialList: [{
-
+ id: '',
+ materialName: '',
+ materialCode: '',
+ qualityType: '',
+ procedureName: '',
+ locationName: '',
+ batch: '',
+ num: '',
+ unitAttribute: ''
}],
options: [{
text: '鍒犻櫎',
@@ -73,14 +108,91 @@
}],
};
},
+ onLoad(obj) {
+ this.workorderId = obj.id
+ queryById(this.workorderId)
+ .then(res => {
+ if (res.code === 200) {
+ this.info = res.data
+ this.deviceId = res.data.pgmodel.id
+ }
+ })
+ },
methods: {
+ open1(index) {
+ // this.$refs.selectMaterial.open({})
+ this.index = index
+ this.$refs.selectMaterial.open({
+ workorderId: this.workorderId,
+ deviceId: this.deviceId
+ })
+ },
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: '鍙兘杈撳叆姝f暣鏁�'
+ })
+ this.materialList[index].num = ''
+ }
+ } else if (unitAttribute === 1 && num !== '') {
+ if (!number.test(num)) {
+ uni.$u.toast({
+ message: '鍙兘杈撳叆姝f暣鏁版垨灏忔暟锛堟渶澶氬洓浣嶏級'
+ })
+ this.materialList[index].num = ''
+ }
+ }
+ if (num <= 0) {
+ uni.$u.toast({
+ message: '鎶曟枡鏁伴噺涓嶈兘灏忎簬绛変簬0'
+ })
+ this.materialList[index].num = ''
+ }
+ },
+ getValue(v) {
+ for (let i = 0; i < this.materialList.length; i++) {
+ if (item.id === this.materialList[i].id) {
+ uni.$u.toast({
+ message: '涓嶈兘閲嶅閫夋嫨鐩稿悓鐗╂枡'
+ })
+ return
+ }
+ }
+ this.materialList[this.index].id = item.id
+ this.materialList[this.index].materialName = item.materialName
+ this.materialList[this.index].num = item.num
+ this.materialList[this.index].batch = item.batch
+ this.materialList[this.index].locationName = item.locationName
+ this.materialList[this.index].materialCode = item.materialCode
+ this.materialList[this.index].procedureName = item.procedureName
+ this.materialList[this.index].qualityType = item.qualityType
+ this.materialList[this.index].unitAttribute = item.unitAttribute
+ },
+ // getMaterails({materials}) {
+ // console.log(item);
+ // }
}
}
</script>
--
Gitblit v1.9.3