ysy vor 2 Jahren
Ursprung
Commit
84a07f8922
3 geänderte Dateien mit 179 neuen und 10 gelöschten Zeilen
  1. 82 0
      pages/pda/common.js
  2. 1 1
      pages/pda/workOrder/index/index.vue
  3. 96 9
      pages/pda/workOrder/search/index.vue

+ 82 - 0
pages/pda/common.js

@@ -0,0 +1,82 @@
+export const tableHeader = selectEquiType => {
+  switch (+selectEquiType) {
+    case 3:
+      return [{ label: '牌号', prop: 'brandNum' }]
+    case 8:
+      return [
+        { label: '型号', prop: 'modelType' },
+        { label: '规格', prop: 'specification' }
+      ]
+    case 4:
+      return [
+        { label: '牌号', prop: 'brandNum' },
+        { label: '型号', prop: 'modelType' }
+      ]
+    case 5: //'周转车'
+      return [
+        { label: '规格', prop: 'specification' },
+        {
+          label: '材质',
+          prop: 'texture',
+          formatter (row) {
+            if (!row?.extendField) return ''
+            const extendField = JSON.parse(row.extendField)
+            return extendField.texture
+          }
+        },
+        {
+          label: '长宽高',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return ''
+            const extendField = JSON.parse(row.extendField)
+            return `${extendField.length || '-'}*${extendField.width || '-'}*${
+              extendField.high || '-'
+            }`
+          }
+        }
+      ]
+    case 2: //'舟皿'
+      return [
+        { label: '规格', prop: 'specification' },
+        { label: '型号', prop: 'modelType' },
+        {
+          label: '长宽高',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return ''
+            const extendField = JSON.parse(row.extendField)
+            return `${extendField.length || '-'}*${extendField.width || '-'}*${
+              extendField.high || '-'
+            }`
+          }
+        }
+      ]
+    case 1: //'设备'
+      return [
+        { label: '型号', prop: 'modelType' },
+        { label: '规格', prop: 'specification' }
+      ]
+    case 6: //'模具'
+      return [
+        { label: '牌号', prop: 'brandNum' },
+        { label: '型号', prop: 'modelType' },
+        {
+          label: '收缩系数',
+          prop: '',
+          formatter (row) {
+            if (!row?.extendField) return ''
+            const extendField = JSON.parse(row.extendField)
+            return extendField.shrinkageCoefficient
+          }
+        }
+      ]
+    case 7: //'备品备件'
+      return [
+        { label: '规格', prop: 'specification' },
+        { label: '型号', prop: 'modelType' }
+      ]
+  }
+
+  return []
+}

+ 1 - 1
pages/pda/workOrder/index/index.vue

@@ -26,7 +26,7 @@
 
 
 				<u-list-item v-if="dataList.length === 0">
-					<u-empty iconSize='150' textSize='32' text='暂无工单'>
+					<u-empty iconSize='150' style='margin-top: 20vh;' textSize='32' text='暂无工单'>
 					</u-empty>
 				</u-list-item>
 

+ 96 - 9
pages/pda/workOrder/search/index.vue

@@ -24,9 +24,41 @@
 
 		<view class="list_box">
 			<u-list>
-				<view v-for="(item,index) in list">
-					<view>{{item}}</view>
-				</view>
+
+
+				<checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
+					<label class="listBox rx-bs">
+
+						<view class="listBox-sel">
+							<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
+								:checked="item.checked" />
+						</view>
+
+						<view class="listBox-con">
+							<view class="listBox-top rx-bc">
+								<view> {{ item.assetName }}</view>
+								<view class="code">{{ item.assetCode}}</view>
+							</view>
+
+							<view class="listBox-bottom rx">
+								<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
+									class="items">
+									{{ itm.label }}:{{ item[itm.prop] }}
+								</view>
+							</view>
+
+						</view>
+
+
+					</label>
+
+				</checkbox-group>
+
+
+				<u-empty v-if='list.length == 0' style='margin-top: 20vh;' iconSize='150' textSize='32' text='暂无数据'>
+				</u-empty>
+
+
 			</u-list>
 		</view>
 
@@ -44,7 +76,7 @@
 			</view>
 		</view>
 
-		<ba-tree-picker  ref="treePicker"  key="verify" :multiple="false" @select-change="confirm" title="选择分类"
+		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
 			:localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
 
 	</view>
@@ -52,6 +84,9 @@
 
 <script>
 	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
+	import {
+		tableHeader
+	} from '../../common.js'
 	import {
 		treeByPid,
 		pageeLedgerMain
@@ -73,6 +108,13 @@
 				checkListLen: 0,
 			}
 		},
+
+		//选择的列表长度
+		computed: {
+
+
+		},
+
 		onLoad(option) {
 			this.getTreeList()
 		},
@@ -83,11 +125,13 @@
 			_seletedAll() {
 				this.seletedAll = !this.seletedAll
 			},
-			
+
 			openTreePicker() {
-				
 				this.$refs.treePicker._show()
-				
+
+			},
+			tableH(type) {
+				return tableHeader(type)
 			},
 
 			getTreeList() {
@@ -113,8 +157,16 @@
 					pageNum: 1,
 					size: -1
 				}
+				this.list = []
 				pageeLedgerMain(param).then(res => {
-					this.list = res.list
+					this.list.push(
+						...res.list.map(i => {
+							return {
+								checked: false,
+								...i
+							}
+						})
+					)
 				})
 			},
 		}
@@ -139,7 +191,6 @@
 			height: 80rpx;
 			width: 540rpx;
 			background: #f9f9f9 !important;
-
 			padding-left: 10rpx;
 			border-radius: 5rpx;
 		}
@@ -167,4 +218,40 @@
 			border-color: $theme-color !important;
 		}
 	}
+
+	.listBox {
+		padding: 4rpx 24rpx;
+		background: #fff;
+
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+
+		.listBox-con {
+			width: 650rpx;
+
+			font-weight: 400;
+		}
+
+		.listBox-top {
+			margin-top: 6rpx;
+			color: #090A0A;
+			font-size: 28rpx;
+			font-style: normal;
+		}
+
+		.listBox-bottom {
+			color: #090A0A;
+			font-size: 24rpx;
+			font-style: normal;
+			flex-wrap: wrap;
+
+			.items {
+				width: 50%;
+			margin-top: 6rpx;
+			}
+		}
+	}
 </style>