瀏覽代碼

修改详情页面

MS-FUUVYHVOEAYJ\Administrator 11 月之前
父節點
當前提交
c662f9dbfb

+ 36 - 27
RuoYi-Vue-v3.8.7/ruoyi-admin/src/main/resources/static/page/goods/detail.html

@@ -275,35 +275,44 @@
 			if (params.get('type') == 1) {
 				$('#go-back').css({ 'display': 'block' })
 			}
-			var result = JSON.parse(sessionStorage.getItem("detailData"));
-			if (result) {
-				$('#goodsNode').text(result.zcbm)
-				$('#kfName').text(result.kfm)
-				$('#kfAdmin').text(result.kfgly)
-				$('#goodsName').text(result.name)
-				$('#goodType').text(result.zclx)
-				$('#goodsType').text(result.xhgg ? result.xhgg : "无")
-				$('#goodsUnit').text(result.dw)
-				$('#goodsNum').text(result.zbsl + " " + result.dws)
-				$('#upTime').text(result.rknx)
-				$('#saveYear').text(result.ccnx)
-				$('#scrapNum').text(result.bfsl)
-				$('#leaveNum').text(result.sysl)
-				$('#makeTime').text(result.grsj)
-				$('#remark').text(result.bz)
-				$('#goodStadus').text(result.zt)
-				if (result.tp != "null") {
-					var imgList = result.tp.split(",");
-					// var imgList = ['upload/2024-05-28/20240528023654.jpg']
-					let html = '';
-					for (let i = 0; i < imgList.length; i++) {
-						html += '<img src="http://58.144.199.81:8011/' + imgList[i] + '" id="zoom-img"' + (i + 1) + '></img>'
+			mui.ajax({
+				url: window.location.origin+'/system/dept/getAsset',
+				type: 'get',
+				data: {
+					id: params.get('id'),
+				},
+				success: function (json) {
+					if (json.data) {
+						var result = json.data;
+						$('#goodsNode').text(result.assetno)
+						$('#kfName').text(result.savedepartment)
+						$('#kfAdmin').text(result.duty)
+						$('#goodsName').text(result.name)
+						$('#goodType').text(result.assettype)
+						$('#goodsType').text(result.model ? result.model : "无")
+						$('#goodsUnit').text(result.savecompany)
+						$('#goodsNum').text(result.quantity + " " + result.assetunit)
+						$('#upTime').text(result.buyed.split('T00')[0])
+						$('#saveYear').text(result.predictyear)
+						$('#scrapNum').text(result.scrapNum?result.scrapNum:0)
+						$('#leaveNum').text(result.quantity?result.quantity:"")
+						$('#makeTime').text(result.created.split('T00')[0])
+						$('#remark').text("")
+						$('#goodStadus').text(result.assetstate)
+						if (result.photo) {
+							var imgList = result.photo.split(",");
+							// var imgList = ['upload/2024-05-28/20240528023654.jpg']
+							let html = '';
+							for (let i = 0; i < imgList.length; i++) {
+								html += '<img src="http://58.144.199.81:8011/' + imgList[i] + '" id="zoom-img"' + (i + 1) + '></img>'
+							}
+							$('#imgList').append(html)
+						} else {
+							$('#imgList').append("无")
+						}
 					}
-					$('#imgList').append(html)
-				} else {
-					$('#imgList').append("无")
 				}
-			}
+			})
 		})
 	</script>
 </body>

+ 3 - 43
RuoYi-Vue-v3.8.7/ruoyi-admin/src/main/resources/static/page/goods/goods.html

@@ -115,10 +115,7 @@
 					if (json.rows && json.rows.length) {
 						let html = ''
 						for (let i = 0; i < json.rows.length; i++) {
-							html += `<li class="mui-table-view-cell" data-assetno="${json.rows[i].assetno}" data-name="${json.rows[i].name}" data-zclx="${json.rows[i].assettype}" data-kfm="${json.rows[i].savedepartment}" data-kfgly="${json.rows[i].duty}"
-								data-xhgg="${json.rows[i].model}" data-dw="${json.rows[i].savecompany}" data-zbsl="${json.rows[i].quantity}" data-rknx="${json.rows[i].buyed.split('T00')[0]}" data-ccnx="${json.rows[i].predictyear}"
-								data-bfsl="${json.rows[i].scrapNum ? json.rows[i].scrapNum : 0}" data-sysl="${json.rows[i].quantity ? json.rows[i].quantity : ''}" data-grsj="${json.rows[i].created.split('T00')[0]}" data-bz="" data-tp="${json.rows[i].photo}"
-								data-dws="${json.rows[i].assetunit}" data-zt="${json.rows[i].assetstate}">
+							html += `<li class="mui-table-view-cell" data-id="${json.rows[i].id}" >
 									<div class="mui-table">
 										<div class="mui-table-cell mui-col-xs-10">
 											<div class="mui-ellipsis">${json.rows[i].name}</div>
@@ -137,47 +134,10 @@
 				}
 			})
 			mui("#kfList").on('tap', '.mui-table-view-cell', function () {
-				const dws = this.getAttribute('data-dws')
-				const kfm = this.getAttribute('data-kfm')
-				const kfgly = this.getAttribute('data-kfgly')
-				const zcbm = this.getAttribute('data-assetno')
-				const name = this.getAttribute('data-name')
-				const xhgg = this.getAttribute('data-xhgg')
-				const zclx = this.getAttribute('data-zclx')
-				const dw = this.getAttribute('data-dw')
-				const zbsl = this.getAttribute('data-zbsl')
-				const rknx = this.getAttribute('data-rknx')
-				const ccnx = this.getAttribute('data-ccnx')
-				const bfsl = this.getAttribute('data-bfsl')
-				const sysl = this.getAttribute('data-sysl')
-				const grsj = this.getAttribute('data-grsj')
-				const bz = this.getAttribute('data-bz')
-				const tp = this.getAttribute('data-tp')
-				const zt = this.getAttribute('data-zt')
-				var jsonData = {
-					zt: zt,
-					dws: dws,
-					kfm: kfm,
-					kfgly: kfgly,
-					zcbm: zcbm,
-					name: name,
-					zclx: zclx,
-					xhgg: xhgg,
-					dw: dw,
-					zbsl: zbsl,
-					rknx: rknx,
-					ccnx: ccnx,
-					bfsl: bfsl,
-					sysl: sysl,
-					grsj: grsj,
-					bz: bz,
-					tp: tp
-				}
-				console.log(jsonData)
-				sessionStorage.setItem("detailData", JSON.stringify(jsonData));
+				const id = this.getAttribute('data-id')
 				mui.openWindow({
 					id: 'detail',
-					url: 'detail.html?type=1'
+					url: 'detail.html?type=1&id='+id
 				});
 			})
 		}