| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- var id = decodeURIComponent(helper.request.queryString("id"));
- $(document).ready(function() {
- var timestamp = new Date().getTime() //获得当前的时间戳
- laydate.render({
- elem: '#giveBackTime',
- type: 'datetime',
- theme: '#249fea',
- trigger:'click',
- value: new Date(timestamp)
- });
- // if (equipmentmanagementsname == null) {
- // $("#equipmentmanagementsname").val('')
- // }
- // if (equipmentmanagementsid == null) {
- // $("#equipmentmanagementsid").val('')
- // }
- // if (Qdepartment == null) {
- // $("#Qdepartment").val('')
- // }
- // if (borrowpeoplec == null) {
- // $("#borrowpeoplec").val('')
- // }
- // if (borrowpeoplej == null) {
- // $("#borrowpeoplej").val('')
- // }
- // if (plandleth == null) {
- // $("#plandleth").val('')
- // }
- // if (beom == null) {
- // $("#beom").val('')
- // }
- // if (zmoney == null) {
- // $('#zmoney').val('')
- // }
- //保存
- $("#HY_save").click(function() {
- addValue();
- })
- })
- detailsL();
- //获取详情
- function detailsL() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/getsbtpbyid",
- async: true,
- dataType: 'json',
- data: {
- id: id,
- },
- success: function(res) {
- detailsList = res.data;
- if (res.state.toLowerCase() == 'success') {
- $("#equipmentmanagementsname").val(detailsList.equipmentmanagementsname)
- $('#equipmentmanagementsid').val(detailsList.equipmentmanagementsid)
- $("#Qdepartment").val(detailsList.Qdepartment)
- $('#borrowpeoplec').val(detailsList.borrowpeoplec)
- $("#borrowpeoplej").val(detailsList.borrowpeoplej)
- $('#plandleth').val(detailsList.plandleth)
- $("#beoms").val(detailsList.beoms)
- $("#beom").val(detailsList.beom)
- $('#zmoney').val(detailsList.zmoney)
- $('#borrowpeopleg').val(detailsList.borrowpeopleg)
- $('#plandleths').val(detailsList.plandleths) }
- }
- });
- }
- //添加
- function addValue() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/upquipmentmanagementlistr",
- async: true,
- dataType: 'json',
- data: {
- id: id,
- borrowpeopleg: $("#borrowpeopleg").val(),
- // plandleths: $('#plandleths').val(),
- Rktime:$("#giveBackTime").val(),
- beoms: $("#beoms").val(),
- },
- success: function(data) {
- if (data.state.toLowerCase() == 'success') {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- layer.msg(data.message);
- parent.initTable();
- }
- }
- });
- }
|