|
@@ -94,6 +94,132 @@ function userFormatter(row) {
|
|
|
};
|
|
|
|
|
|
|
|
|
+// 编辑盘点数量
|
|
|
+$("#edit").iMenubutton({
|
|
|
+ method: 'openDialog',
|
|
|
+ iconCls: 'fa fa-edit',
|
|
|
+ btnCls: 'topjui-btn-normal',
|
|
|
+ grid:{
|
|
|
+ type:'datagrid',
|
|
|
+ id:'myGrid',
|
|
|
+ unselectedMsg:'请先选中一条要调整的数据'
|
|
|
+ },
|
|
|
+ dialog: {
|
|
|
+ height: 480,
|
|
|
+ width: 470,
|
|
|
+ title:'调整盘点数量',
|
|
|
+ iconCls: 'fa fa-edit',
|
|
|
+ href: _ctx + '/views/inventory/check/checkDetail/updateCheckQty.html',
|
|
|
+ buttonsGroup: [{
|
|
|
+ text: '提交',
|
|
|
+ iconCls: 'fa fa-save',
|
|
|
+ btnCls: 'topjui-btn',
|
|
|
+ onClick:function(){
|
|
|
+ // alert("提交按钮事件")
|
|
|
+ var b = $(this).iLinkbutton("options");
|
|
|
+ var $dialogId=$("#" + b.dialogId)
|
|
|
+
|
|
|
+ var checkId = $("#checkId").val();
|
|
|
+ var newCheckQty = $("#newCheckQty").val();//调整数量
|
|
|
+ var data = {
|
|
|
+ checkId:checkId,
|
|
|
+ newCheckQty:newCheckQty
|
|
|
+ };
|
|
|
+
|
|
|
+ console.log(data);
|
|
|
+
|
|
|
+ $.iMessager.progress({text: '正在提交中....'});
|
|
|
+ $.ajax({
|
|
|
+ method:"POST",
|
|
|
+ url: "/inventory/inventoryCheckDetail/updateCheckQty",
|
|
|
+ data: JSON.stringify(data),
|
|
|
+ dataType:"json",
|
|
|
+ contentType:"application/json; charset=UTF8",
|
|
|
+ success: function(result){
|
|
|
+ // 关闭提示框
|
|
|
+ $.iMessager.progress('close');
|
|
|
+ if(!result.success){
|
|
|
+ $.iMessager.alert('错误', result.msg, 'messager-info');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $.iMessager.show({title: '温馨提示',msg: result.msg,timeout:4000}); // 右下角提示信息
|
|
|
+ refreshGrid(myGrid.type, myGrid.id);
|
|
|
+ // 关闭此窗口
|
|
|
+ $dialogId.dialog("close")
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ onLoad: function () {
|
|
|
+ // alert("加载中")
|
|
|
+ var row = getSelectedRowData(myGrid.type, myGrid.id);// 获取选中的行
|
|
|
+ console.log(row)
|
|
|
+ $("#checkQty").val(row.checkQty);
|
|
|
+ $("#checkId").val(row.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // onClick:function(){
|
|
|
+ // var rowList=getCheckedRowsData(myGrid.type, myGrid.id);
|
|
|
+ // if(!rowList || rowList.length==0){
|
|
|
+ // $.iMessager.alert('操作提示', '请至少选择一条数据', 'messager-info');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if(rowList.length!=1){
|
|
|
+ // $.iMessager.alert('操作提示', '请选择一条数据进行编辑', 'messager-info');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // // console.log(rowList)
|
|
|
+ // // updateDiffQtyAndShowResult(rowList);
|
|
|
+ // },
|
|
|
+
|
|
|
+});
|
|
|
+// function updateDiffQtyAndShowResult(rowList){
|
|
|
+// $("#updateDiffQtyDialog").iDialog({
|
|
|
+// title: '编辑盘点数量',
|
|
|
+// height: 300,
|
|
|
+// width: 400,
|
|
|
+// iconCls: 'fa fa-trash',
|
|
|
+// closed: true,
|
|
|
+// cache: false,
|
|
|
+// href: _ctx + '/views/inventory/check/checkDetail/updateCheckQty.html',
|
|
|
+// url:'/inventory/inventoryCheckDetail/get?id='+rowList[0].id,
|
|
|
+// modal: true,
|
|
|
+// buttons: [{
|
|
|
+// text: '确认',
|
|
|
+// iconCls: 'fa fa-save',
|
|
|
+// btnCls: 'topjui-btn',
|
|
|
+// handler: function () {
|
|
|
+// console.log($("updateCheckQtyFormId"))
|
|
|
+// console.log(123123)
|
|
|
+// var alltxt = $("updateCheckQtyFormId").children();//获取所有的子元素
|
|
|
+//
|
|
|
+// for(var i = 0; i < alltxt.length; i++) {
|
|
|
+// console.log("value:"+alltxt[i].value)//获取所有的value值
|
|
|
+// console.log("type:"+alltxt[i].getAttribute("type"))//获取属性
|
|
|
+// console.log("nodeName:"+alltxt[i].nodeName)//获取文本类型
|
|
|
+// console.log("--------------------------")
|
|
|
+// }
|
|
|
+// // $("#updateDiffQtyDialog").iDialog('close');
|
|
|
+// // $('#updateDiffQtyDialog').iDialog('clear', true);
|
|
|
+// }
|
|
|
+// },{
|
|
|
+// text: '取消',
|
|
|
+// iconCls: 'fa fa-close',
|
|
|
+// btnCls: 'topjui-btn-red',
|
|
|
+// handler: function () {
|
|
|
+// alert("取消")
|
|
|
+// $("#updateDiffQtyDialog").iDialog('close');
|
|
|
+// $('#updateDiffQtyDialog').iDialog('clear', true);
|
|
|
+// }
|
|
|
+// }],
|
|
|
+// });
|
|
|
+// $("#updateDiffQtyDialog").iDialog('open');
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//删除
|
|
|
$("#delete").iMenubutton({
|
|
|
iconCls: 'fa fa-trash',
|