ysy 2 년 전
부모
커밋
4e41cdadaf
4개의 변경된 파일84개의 추가작업 그리고 75개의 파일을 삭제
  1. 11 0
      api/pda/workOrder.js
  2. 44 15
      pages/pda/components/bottomOperate.vue
  3. 26 58
      pages/pda/sample/components/inspectionBom.vue
  4. 3 2
      pages/pda/workOrder/extrusionMolding/index.vue

+ 11 - 0
api/pda/workOrder.js

@@ -79,6 +79,17 @@ export async function getTwoTreeByPid(parentId) {
 	return Promise.reject(data.message);
 }
 
+// 只查最后一层的分类
+export async function getLastTreeByPid(parentId) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/main/categoryLevel/getLastTreeByPid/${parentId}`
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
 
 
 

+ 44 - 15
pages/pda/components/bottomOperate.vue

@@ -4,10 +4,11 @@
 		<view class="nav_box rx-cc" @click="open">
 			<image class="open_icon" :class="{open_icon_reversal : isOperate}" src="~@/static/pda/open.svg"></image>
 		</view>
-           
+
 
 		<view class="operate_list" v-show="isOperate">
-			<view v-for="(item, index) in btnList[btnState]" :key="index" class="list rx-bc" @click="operate(item.type)">
+			<view v-for="(item, index) in btnList[btnState]" :key="index" class="list rx-bc"
+				@click="operate(item.type, item)">
 				<view class="round">{{index + 1}}</view>
 				<view class="name">{{item.name}}</view>
 				<image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
@@ -29,10 +30,14 @@
 </template>
 
 <script>
+	import {
+		getTwoTreeByPid,
+
+	} from '@/api/pda/workOrder.js'
 	export default {
 		props: {
 			state: String | Number,
-			
+
 		},
 
 		watch: {
@@ -44,7 +49,7 @@
 					this.btnsList = newVal
 				}
 			},
-			
+
 			state: {
 				immediate: true,
 				deep: true,
@@ -80,8 +85,7 @@
 
 
 					],
-					2: [
-						{
+					2: [{
 							name: '取样',
 							type: 'sample'
 						},
@@ -90,24 +94,49 @@
 							type: 'sampleJob'
 						},
 					],
-					
-					3: [
-						{
-							name: '报工',
-							type: 'inspection'
-						},
-					]
+
+					3: [{
+						name: '报工',
+						type: 'inspection'
+					}, ]
 				}
 			}
 		},
 
+
+		created() {
+			this.getTwoTree()
+		},
+
 		methods: {
+			getTwoTree() {
+				getTwoTreeByPid(12).then(res => {
+					let _arr = res.map(m => {
+						m.type = 'inspection'
+						return m
+					})
+					this.btnList[3] = []
+
+
+					this.btnList[3] = [
+						..._arr,
+						{
+							name: '报工',
+							type: ''
+						}
+					]
+
+
+				})
+			},
+
 			open() {
 				this.isOperate = !this.isOperate
 			},
 
-			operate(type) {
-				this.$emit('operate', type)
+			operate(type, item) {
+		
+				this.$emit('operate', type, item)
 			},
 		}
 	}

+ 26 - 58
pages/pda/sample/components/inspectionBom.vue

@@ -6,15 +6,6 @@
 
 
 
-		<u-form labelPosition="left" :model="formData" labelWidth="140" labelAlign="left" class="baseForm">
-			<u-form-item label="质检类型:" class="required-form" prop="assetType">
-				<zxz-uni-data-select :localdata="typeList" v-model="formData.parentId" dataValue='id' format='{name}'
-					dataKey="name" filterable></zxz-uni-data-select>
-
-				<view class="btn_box rx-cc" @click="add">新增质检</view>
-			</u-form-item>
-		</u-form>
-
 
 		<view class="content_table2">
 			<view class="head row rx-sc">
@@ -35,15 +26,12 @@
 
 
 						<view class="ww20 rx-ac">
-							<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
-								color="#fa3534"></uni-icons>
-								
-								<uni-icons custom-prefix="iconfont" type="icon-eye" size="20"
-									color="#157A2C"></uni-icons>
+							<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"
+								@click="handleDel(idx)"></uni-icons>
+							<uni-icons type="eye-filled" size="20" @click="handleView(it)"></uni-icons>
 						</view>
 
 
-
 					</view>
 				</u-list>
 
@@ -57,14 +45,6 @@
 
 
 
-
-
-
-
-
-
-
-
 		<ba-tree-picker ref="treePicker" :selectedData='selectedData' key="verify" :multiple="false"
 			@select-change="confirm" title="选择分类" :localdata="classificationList" valueKey="id" textKey="name"
 			childrenKey="children" multiple :selectParent='false' />
@@ -74,8 +54,7 @@
 
 <script>
 	import {
-		getTwoTreeByPid,
-		treeByPid
+		getLastTreeByPid,
 
 	} from '@/api/pda/workOrder.js'
 	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
@@ -83,64 +62,52 @@
 
 		components: {
 			baTreePicker,
-
 		},
 
 		data() {
 			return {
 
 
-				typeList: [],
-				formData: {
-					parentId: null
-				},
+
+
 				classificationList: [],
-				selectedData: [
-					'1772569297810362370', '1772569381088268289', '1773270364621639681'
-				],
+				selectedData: [],
 
 				List: []
 			}
 		},
 
 		created() {
-			this.getTwoTree()
+			this.getLastTree()
 		},
 
 		methods: {
-			getTwoTree() {
-				getTwoTreeByPid(12).then(res => {
-					this.typeList = res
+
+			getLastTree() {
+				getLastTreeByPid(this.$route.query.inspectionId).then(res => {
+					this.List = res
 				})
 			},
 
-			add() {
-				if (!this.formData.parentId) {
-					uni.showToast({
-						icon: 'none',
-						title: '请先选择质检类型'
-					})
-					return false
-				} else {
-					let params = {
-						'ids': [this.formData.parentId]
-					}
-
-
-					treeByPid(params).then(res => {
-						this.classificationList = res[0].children
-						this.$refs.treePicker._show()
-					})
-				}
-			},
 
-			confirm(id, name, list) {
 
+			confirm(id, name, list) {
 				this.List = list
+				this.selectedData = []
+				this.selectedData = this.List.map(m => {
+					return m.id
+				})
+
+			},
+
+			handleDel(idx) {
+				this.List.splice(idx, 1)
 
 
 			},
 
+			handleView(it) {},
+
 			scrolltolower() {},
 		}
 
@@ -199,6 +166,7 @@
 
 	.content_table2 {
 		width: 100%;
+		margin-top: 18rpx;
 
 		.row {
 			width: 100%;
@@ -284,6 +252,6 @@
 	}
 
 	.z_list {
-		max-height: 400rpx;
+		max-height: 800rpx;
 	}
 </style>

+ 3 - 2
pages/pda/workOrder/extrusionMolding/index.vue

@@ -273,7 +273,8 @@
 				this.feedStatus()
 			},
 
-			operate(type) {
+			operate(type, item) {
+			
 				let url
 				let taskId = this.currentTaskId || this.taskId
 				let taskName = this.currentTaskName || this.info.taskName
@@ -335,7 +336,7 @@
 					})
 				} else if (type == 'inspection') {
 					url = '/pages/pda/sample/inspection/index'
-					url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
+					url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}&inspectionId=${item.id}&inspectionName=${item.name}`
 					uni.navigateTo({
 						url
 					})