asd26269546 2 жил өмнө
parent
commit
149e01cf62

+ 4 - 2
src/components/common-list.vue

@@ -5,7 +5,7 @@
                 <!-- <div class="left-box">
                     <van-icon name="location-o" />
                 </div> -->
-                <div class="center-content">
+                <div class="center-content" style="line-height:24px">
                     <div v-for="j in config" :key="j.prop"><span>{{ j.label }}:</span>{{ i[j.prop] }}</div>
                 </div>
                 <div class="more-box">
@@ -36,6 +36,7 @@ const listCk = (item) => {
 <style lang="scss">
 .common-list{
     ul{
+        margin-top: 10px;
         li{
             list-style: none;
             position: relative;
@@ -43,8 +44,9 @@ const listCk = (item) => {
             box-sizing: border-box;
             align-items: center;
             justify-content: space-between;
-            padding: 16px;
+            padding: 12px 16px;
             background: #fff;
+            border-bottom: 1px solid #f1f1f1;
             .center-content{
                 flex: 1;
             }

+ 3 - 10
src/router/index.js

@@ -47,14 +47,7 @@ const routes = [{
 				name: '仓库新增',
 				component: () => import('../views/warehouse/warehouseConfig/add.vue')
 			},
-		]
-	},
-	{
-		path: '/purchase-sales',
-		name: 'purchase-sales',
-		// component: main,
-		// redirect: '/purchase-sales/equipment',
-		children: [{
+			{
 				path: 'manualOutbound',
 				name: '手动出库',
 				component: () => import('../views/purchase-sales/inbound-outbound/manualOutbound/index.vue')
@@ -66,12 +59,12 @@ const routes = [{
 			},
 			{
 				path: 'addDetails',
-				name: '手动入库',
+				name: '手动入12312312库',
 				component: () => import('../views/purchase-sales/inbound-outbound/addDetails.vue')
 			},
-
 		]
 	},
+	
 ]
 
 const router = createRouter({

+ 95 - 14
src/views/purchase-sales/inbound-outbound/manualInbound/index.vue

@@ -1,21 +1,102 @@
 <template>
-  <div></div>
+	<van-nav-bar
+		title="仓库维护"
+		left-text=""
+		left-arrow
+		@click-left="onClickLeft"
+		@click-right="onClickRight"
+	>
+		<template #right>
+			添加
+		</template>
+	</van-nav-bar>
+	<van-search v-model="req.keyword"  placeholder="请输入搜索关键词" @search="onRefresh" />
+	<van-pull-refresh v-model="loading" @refresh="onRefresh" >
+		
+		<div class="list">
+			<van-list
+				v-model:loading="loading"
+				:finished="finished"
+				finished-text="没有更多了"
+				@load="onLoad"
+				style="margin-bottom:60px"
+			>
+				<commonList :data="listData" @onClick="toDtl" :config="listConfig"></commonList>
+			</van-list>
+		</div>
+	</van-pull-refresh>
 </template>
-
 <script setup>
-const { proxy } = getCurrentInstance();
-const queryData = reactive({
-  pageNum: 1,
-  pageSize: 10,
-  keyword: "",
-  type: "2", // 2为手动出库
-});
-const getList = async () => {
-  const data = await proxy.post("/stockJournal/page", queryData);
-  console.log(data, "as");
-};
-getList();
+import { ref, getCurrentInstance, onMounted } from 'vue'
+import commonList from '@/components/common-list.vue'
+import { useRoute } from 'vue-router'
+const loading = ref(false)
+const router = useRoute()
+const req = ref({
+	pageNum:1,
+	keyword:null
+})
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy
+const listData = ref([])
+
+
+const listConfig = ref([
+	{
+		label: '仓库名称',
+		prop: 'name',
+	},
+	{
+		label: '仓库类型',
+		prop: 'type',
+	}
+])
+const onRefresh = () => {
+	req.value.pageNum = 1
+	finished.value = false
+	getList('refresh')
+}
+const onLoad = () => {
+    getList()
+}
+
+const onClickLeft = () => proxy.$router.push('/main/working')
+
+const onClickRight = () => {
+	proxy.$router.push('/main/warehouseConfigAdd')
+}
+
+const toDtl = (row) => {
+	console.log(row)
+	proxy.$router.push({
+        path: 'warehouseConfigAdd',
+		query: row
+      })
+}
+
+const getList = (type) => {
+	loading.value = true
+	proxy.post('/warehouse/page',req.value).then(res => {	
+		
+		console.log(req.value)
+		listData.value = type === 'refresh' ? res.data.rows : listData.value.concat(res.data.rows)
+		if(req.value.pageNum * 10 >= res.data.total) {
+			finished.value = true
+		}
+		req.value.pageNum++	
+		loading.value = false
+		
+		
+		
+	}).catch(err => {
+		loading.value = false
+	})
+}
+getList()
 </script>
 
 <style lang="scss" scoped>
+.list {
+	min-height: 70vh;
+}
 </style>

+ 1 - 1
src/views/warehouse/warehouseConfig/add.vue

@@ -78,7 +78,7 @@ const getDict = () => {
                 value: item.dictValue
             }
         })
-        formData.value.typeName = columns.value.find(item => item.value == formData.value.type).text
+        formData.value.typeName = formData.value.type ?  columns.value.find(item => item.value == formData.value.type).text : null
     })
 }
 

+ 4 - 3
src/views/warehouse/warehouseConfig/index.vue

@@ -1,17 +1,18 @@
 <template>
 	<van-nav-bar
 		title="仓库维护"
-		left-text="返回"
+		left-text=""
 		left-arrow
 		@click-left="onClickLeft"
 		@click-right="onClickRight"
 	>
 		<template #right>
-			<van-icon name="plus" />
+			添加
 		</template>
 	</van-nav-bar>
+	<van-search v-model="req.keyword"  placeholder="请输入搜索关键词" @search="onRefresh" />
 	<van-pull-refresh v-model="loading" @refresh="onRefresh" >
-		<van-search v-model="req.keyword"  placeholder="请输入搜索关键词" @search="onRefresh" />
+		
 		<div class="list">
 			<van-list
 				v-model:loading="loading"