From e126797e6062fde53359c9957c9da7fc51e284b2 Mon Sep 17 00:00:00 2001 From: seatonwan9 Date: 星期四, 28 八月 2025 02:15:14 +0800 Subject: [PATCH] 提交源码 --- src/views/productManage/product/index.vue | 82 +++++++++++------------------------------ 1 files changed, 22 insertions(+), 60 deletions(-) diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue index 1bd5240..0ed5d6c 100644 --- a/src/views/productManage/product/index.vue +++ b/src/views/productManage/product/index.vue @@ -24,9 +24,9 @@ > <el-table-column prop="id" label="浜у搧ID" width="120" /> <el-table-column prop="name" label="浜у搧鍚嶇О" min-width="200" /> - <el-table-column prop="productType" label="浜у搧绫诲瀷" width="120" /> - <el-table-column prop="industry" label="琛屼笟棰嗗煙" width="150" /> - <el-table-column prop="submitUnit" label="鎻愭姤鍗曚綅" width="150" /> + <el-table-column prop="typeName" label="浜у搧绫诲瀷" width="120" /> + <el-table-column prop="importantAreaName" label="琛屼笟棰嗗煙" width="150" /> + <el-table-column prop="submissionUnit" label="鎻愭姤鍗曚綅" width="150" /> <el-table-column prop="shelfStatus" label="涓婃灦鐘舵��" width="100"> <template #default="{ row }"> <el-tag :type="getStatusType(row.shelfStatus)" size="small"> @@ -56,11 +56,11 @@ </el-card> <!-- 浜у搧浠锋牸鏌ョ湅寮圭獥 --> - <ProductPriceViewer + <!-- <ProductPriceViewer v-model="priceViewerVisible" :product-id="currentProductId" @order="handleOrder" - /> + /> --> </div> </template> @@ -69,6 +69,7 @@ import { useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import ProductPriceViewer from '@/views/productManage/productPriceViewer/index.vue' +import productApi from '@/api/productApi' interface ProductItem { id: string @@ -91,57 +92,6 @@ const priceViewerVisible = ref(false) const currentProductId = ref('') -// 妯℃嫙浜у搧鏁版嵁 -const mockProductList: ProductItem[] = [ - { - id: '1', - name: '鏁板瓧鍖栦骇鍝丄', - productType: '杞欢/骞冲彴', - industry: '浜ら�氬熀纭�璁炬柦', - submitUnit: '涓氦涓�鍏眬', - submitter: '寮犱笁', - projectUnit: '鏌愰珮閫熷叕璺伐绋�', - industryStage: '搴旂敤闃舵', - description: '鏈骇鍝佸畾浣嶄负浠ュ缓璁炬湡BIM鏁板瓧璧勪骇浣滀负鏁板瓧搴曠洏锛岀粨鍚堥」鐩繍钀ョ淮淇濋渶姹傜殑瀹炴椂鎬с�佷氦浜掓�с�佷究鎹锋�х殑涓夌淮鍙鍖栬繍缁寸鐞嗙郴缁熴�傜郴缁熸彁渚涢」鐩暟瀛楀寲銆佹櫤鑳藉寲杩愮淮绠$悊鍔熻兘锛岃兘澶熻В鍐冲缓绛戣繍琛岀淮鎶ょ鐞嗕腑鐨勫疄闄呴棶棰橈紝瀹炵幇淇℃伅蹇�熸暣鍚堜笌鏌ヨ銆佷俊鎭湁鏁堝叡浜笌浼犻�掞紝鎻愬崌椤圭洰缁煎悎绠$悊涓庣淮鎶ゆ按骞炽��', - shelfStatus: '寰呬笂鏋�' - }, - { - id: '2', - name: '鏁板瓧鍖栦骇鍝丅', - productType: '纭欢/浼犳劅', - industry: '甯傛斂宸ョ▼', - submitUnit: '涓氦浜岃埅灞�', - submitter: '鏉庡洓', - projectUnit: '鏅烘収绠″粖椤圭洰', - industryStage: '鐮斿彂闃舵', - description: '闈㈠悜鍩庡競绠″粖鐩戞祴鐨勪紶鎰熻澶囦笌閲囬泦缃戝叧锛屾敮鎸佽竟缂樿绠椾笌杩滅▼杩愮淮銆�', - shelfStatus: '宸蹭笂鏋�' - }, - { - id: '3', - name: '鏁板瓧鍖栦骇鍝丆', - productType: '杞欢/骞冲彴', - industry: '寤虹瓚宸ョ▼', - submitUnit: '涓氦涓夎埅灞�', - submitter: '鐜嬩簲', - projectUnit: '鏅烘収寤虹瓚椤圭洰', - industryStage: '搴旂敤闃舵', - description: '鍩轰簬BIM鎶�鏈殑寤虹瓚宸ョ▼绠$悊骞冲彴锛屾彁渚涜璁°�佹柦宸ャ�佽繍缁村叏鐢熷懡鍛ㄦ湡绠$悊銆�', - shelfStatus: '宸蹭笅鏋�' - }, - { - id: '10004', - name: '鏁板瓧鍖栦骇鍝丏', - productType: '纭欢/浼犳劅', - industry: '姘村埄宸ョ▼', - submitUnit: '涓氦鍥涜埅灞�', - submitter: '璧靛叚', - projectUnit: '鏅烘収姘村埄椤圭洰', - industryStage: '鐮斿彂闃舵', - description: '姘村埄宸ョ▼鐩戞祴璁惧涓庢暟鎹噰闆嗙郴缁燂紝鏀寔瀹炴椂鐩戞祴鍜岄璀︺��', - shelfStatus: '宸蹭笂鏋�' - } -] // 鑾峰彇鐘舵�佺被鍨� const getStatusType = (status: string) => { @@ -162,8 +112,16 @@ loading.value = true try { // 妯℃嫙API璋冪敤 - await new Promise(resolve => setTimeout(resolve, 500)) - productList.value = mockProductList + // await new Promise(resolve => setTimeout(resolve, 500)) + let data = {"name":"","industrialChainId":"","importantAreaId":"","importantAreaIdList":[],"typeId":"","typeChildId":[],"startDate":"","endDate":"","page":{"current":1,"size":10,"total":3}} + const res: any = await productApi.getProductList(data) + if (res?.code === 200) { + productList.value = res.data.records || [] + } else { + productList.value = [] + ElMessage.error(res?.msg || '鑾峰彇浜у搧鍒楄〃澶辫触') + } + // productList.value = mockProductList } catch (error) { console.error('鍔犺浇浜у搧鍒楄〃澶辫触:', error) ElMessage.error('鍔犺浇浜у搧鍒楄〃澶辫触') @@ -187,8 +145,12 @@ // 鏌ョ湅瀹氫环 const handleViewPricing = (row: ProductItem) => { - currentProductId.value = row.id - priceViewerVisible.value = true + // currentProductId.value = row.id + // priceViewerVisible.value = true + router.push({ + path: '/product/priceViewer', + query: { productId: row.id} + }) } // 澶勭悊璁㈣喘 -- Gitblit v1.8.0