You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>物资详情</title>
<script language="javascript" src="/admin/jquery.js"></script>
<style>
.btn {
width: 80%;
background: #0077CC;
border: none;
padding: 10px;
margin: 0 auto;
display: block;
margin-top: 30px;
color:#fff;
}
</style>
</head>
<body>
<div class="wuzibianma">
</div>
</body>
<script>
var id = getIds("id")
// var VUE_APP_BASE_API = window.location.protocol+"//"+window.location.host;
// var VUE_APP_BASE_API="http://192.168.60.99:9004"
var VUE_APP_BASE_API = "http://hd-wuziguanli-test.ali251.langye.net"
var printObj = {}
var zaikushuliang = 0
// var wuzibianma = getIds('bm')
$(function() {
getWuzi()
// $(".wuzibianma").html("")
// $(".wuzibianma").html(id)
})
function getIds(name) {
var reg = new RegExp("(^|&)" + name.toLowerCase() + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).toLowerCase().match(reg);
if (r != null) {
return unescape(r[2].replace(new RegExp(/(%25)/g), '%').replace(new RegExp(/(%25)/g), '%'));
}
return null
}
function getWuzi() {
$.ajax({
type: "get",
timeout: 15000,
async: false,
contentType: 'application/json',
data: {
id: id,
table_name: 'inventorys'
},
url: VUE_APP_BASE_API + '/api/admin/base-form/show',
dataType: "json",
success: function(result) {
printObj = result
$(".wuzibianma").html("")
// $(".wuzibianma").html(id)
$(".wuzibianma").append(
"<p style='text-align:center;margin-bottom:0;padding-top:5px;'>苏州河道处</p>" +
"<div style='padding:15px;padding-top:5pxfont-size:24px'>" +
"<div>" +
"<p style='margin-bottom:0px'>物资编码:" + printObj['wuzibianma'] + "</p>" +
"<p style='margin-bottom:0px'>物资名称:" + printObj['zichanmingcheng'] + "</p>" +
"<p style='margin-bottom:0px'>物资类型:" + printObj['wuzileixing'] + "</p>" +
"<p style='margin-bottom:0px'>物资型号:" + printObj['guigexinghao'] + "</p>" +
"<p style='margin-bottom:0px'>计量单位:" + printObj['jiliangdanwei'] + "</p>" +
"<p style='margin-bottom:0px'>入库批次:" + printObj['rukupici'] + "</p>" +
"<p style='margin-bottom:0px'>在库数量:<input id='input' value='" + printObj['zaikushuliang'] +
"'/></p>" +
// "<p style='margin-bottom:0px'>在库数量:"+printObj['zaikushuliang']+"</p>"+
"</div>" +
"<button class='btn' onClick='saveWuzishuliang()'>提交</button>" +
"</div>")
// createCode("#page" + index, printObj)
// $(".load").remove()
},
complete: function(xhr, textStatus) {
}
});
}
function saveWuzishuliang() {
printObj.zaikushuliang = $("#input").val()
return
$.ajax({
type: "post",
timeout: 15000,
async: false,
contentType: 'application/json',
data: {
id: id,
table_name: 'inventorys',
...printObj
},
url: VUE_APP_BASE_API + '/api/admin/base-form/save',
dataType: "json",
success: function(result) {
console.log(result)
alert("更新成功")
},
complete: function(xhr, textStatus) {
}
});
}
</script>
</html>