|
|
@@ -39,6 +39,17 @@
|
|
|
</head>
|
|
|
<style>
|
|
|
.add_bach table input{margin-bottom:7px;}
|
|
|
+ .msg {
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .onError {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+
|
|
|
+ .onSuccess {
|
|
|
+ color: green;
|
|
|
+ }
|
|
|
</style>
|
|
|
<body class="easyui-layout">
|
|
|
<div data-options="region:'north',title:'批次信息',split:true" style="height: 300px;">
|
|
|
@@ -161,7 +172,7 @@
|
|
|
<if condition="$user_type eq 1">
|
|
|
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true" onclick="rePrintFun2(2)">自动打码(小件)</a>
|
|
|
</if>
|
|
|
-
|
|
|
+ <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true" onclick="rePrintFun3(3)">修改</a>
|
|
|
</div>
|
|
|
<table id=supTgGrid></table>
|
|
|
</div>
|
|
|
@@ -230,6 +241,24 @@
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
+<div id="reptWin3">
|
|
|
+ <form id="reptForm3" style="padding: 5px;">
|
|
|
+ <div>
|
|
|
+ <div id="type1"></div>
|
|
|
+ <select name="type" id="type" >
|
|
|
+ <option value="">---请选择---</option>
|
|
|
+ <option value="l_weight">大件重量</option>
|
|
|
+ <option value="l_num">大件数量</option>
|
|
|
+ </select>
|
|
|
+ <span class="l_weight">
|
|
|
+ <input id="reptQty3" name="reptQty3" style="margin-top: 10px;" class="easyui-validatebox"/>
|
|
|
+ </span>
|
|
|
+ <span class="l_num" style="display:none;">
|
|
|
+ <input id="reptQty33" name="reptQty33" style="margin-top: 10px;" class="easyui-validatebox"/>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
<div id="reptWins">
|
|
|
<div style="padding:5px 5px 5px 5px">
|
|
|
材料尺寸:<select name="newlabel_types" id="newlabel_types">
|
|
|
@@ -281,7 +310,7 @@
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
-
|
|
|
+<script src="__PUBLIC__/common/codeform.js"></script>
|
|
|
<script>
|
|
|
|
|
|
$('#small_label_enter').bind('keypress',function(event) {
|
|
|
@@ -668,7 +697,33 @@
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
+
|
|
|
+ $('#reptWin3').dialog({
|
|
|
+ title: '确认对话框',
|
|
|
+ width: 500,
|
|
|
+ height: 150,
|
|
|
+ closed: true,
|
|
|
+ cache: false,
|
|
|
+ modal: true,
|
|
|
+ buttons: [{
|
|
|
+ text: '修改',
|
|
|
+ handler: function () {
|
|
|
+ if($('#newlabel_type3').val()==0){
|
|
|
+ $.messager.alert('系统提示', '请先选择修改大件!', 'info');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ startPrint3();
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '取消',
|
|
|
+ handler: function () {
|
|
|
+ $('#reptWin3').window('close');
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ });
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
function addbach(value){
|
|
|
//追加批次
|
|
|
//alert(value);
|
|
|
@@ -800,6 +855,43 @@
|
|
|
$('#reptForm2').form('load', {'printType2': type, 'reptQty2': 1});
|
|
|
}
|
|
|
|
|
|
+ function rePrintFun3(type) {
|
|
|
+ var confirmMsg = "您确定要修改已选择标签?";
|
|
|
+
|
|
|
+ var checked = supTgGrid.datagrid("getChecked");
|
|
|
+ //console.log(checked);
|
|
|
+ if (checked == null || checked.length == 0) {
|
|
|
+ $.messager.alert('系统提示', '请先勾选需要修改的标签!', 'info');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (checked.length > 1) {
|
|
|
+ $.messager.alert('系统提示', '请先勾选单个标签!', 'info');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('#reptWin3').window('open'); // open a window
|
|
|
+ $('#reptForm3').form('load', {'reptQty3': ''});
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#type').change(function () {
|
|
|
+ var type = $(this).val();
|
|
|
+ if (type == 'l_num') {
|
|
|
+ //表示为箱
|
|
|
+ $('.l_num').show();
|
|
|
+ $('.l_weight').hide();
|
|
|
+ // $('input[name=small_num]').attr("readonly", "readonly");
|
|
|
+ // $('input[name=larger_num]').attr("readonly", "readonly");
|
|
|
+ // $('.big_weight').hide();
|
|
|
+ // $('.small_weight').hide();
|
|
|
+ }
|
|
|
+ if (type == 'l_weight') {
|
|
|
+ //表示为卷
|
|
|
+ $('.l_num').hide();
|
|
|
+ $('.l_weight').show();
|
|
|
+ // $('input[name=small_num]').removeAttr('readonly');
|
|
|
+ // $('input[name=larger_num]').removeAttr('readonly');
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
function searchTgFun() {
|
|
|
supTgGrid.datagrid('load', $('#searchTgForm').serializeObject());
|
|
|
}
|
|
|
@@ -1542,6 +1634,100 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ function startPrint3() {
|
|
|
+ if($('#type').val() == 'l_weight'){
|
|
|
+ //卷,修改大件重量
|
|
|
+ //校验reptQty3
|
|
|
+ var nameVal = $.trim($('#reptQty3').val()); //原生js去空格方式:this.replace(/(^\s*)|(\s*$)/g, "")
|
|
|
+ var regName = /[~#^$@%&!*()<>:;'"{}【】 ]/;
|
|
|
+ if(nameVal == "" || regName.test(nameVal) || nameVal.length <1 || nameVal < 1 ){
|
|
|
+ return
|
|
|
+ } else{
|
|
|
+ var rep = /[\.]/;
|
|
|
+ var reg = new RegExp("^[0-9]*$");
|
|
|
+ if (rep.test(nameVal)) {
|
|
|
+ //判断有没有小数点
|
|
|
+ if (!/^-?\d+.\d{2}$/.test(nameVal)) {
|
|
|
+ //判断是不是保留了小数点2位
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ //判断是不是6位
|
|
|
+ nameVal = Number(nameVal*100).toFixed(0);//强制转换成整数 避免精度温蒂
|
|
|
+ // console.log(Number(nameVal*100).toFixed(0))
|
|
|
+ if(!reg.test(nameVal) || nameVal > 999999){
|
|
|
+ //判断是不是数字且有没有大于6位数
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ var reptQty = $('#reptQty3').val();
|
|
|
+ var type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //没有小数点
|
|
|
+ if(!reg.test(nameVal * 1000) || nameVal.length > 6 || nameVal * 100 > 999999){
|
|
|
+ //判断是不是数字且有没有大于6位数
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ var reptQty = $('#reptQty3').val();
|
|
|
+ var type = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }else if($('#type').val() == 'l_num'){
|
|
|
+ //箱,修改大件张数
|
|
|
+ var nameVal = $.trim($('#reptQty33').val()); //原生js去空格方式:this.replace(/(^\s*)|(\s*$)/g, "")
|
|
|
+ var regName = /[~#^$@%&!*()<>:;'"{}【】. ]/;
|
|
|
+ if(nameVal == "" || nameVal.length < 1 || regName.test(nameVal) || Number(nameVal)<1){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ var reg = new RegExp("^[0-9]*$");
|
|
|
+ if(!reg.test(nameVal)){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ var reptQty = $('#reptQty33').val();
|
|
|
+ var type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //未选择
|
|
|
+ $('#type1').html("");
|
|
|
+ var errorMsg = "请选择修改类型";
|
|
|
+ $('#type1').html("<span class='msg onError'>" + errorMsg + "</span>");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(reptQty)
|
|
|
+ console.log(type)
|
|
|
+ var idList = new Array();
|
|
|
+ var chechRows = supTgGrid.datagrid('getChecked');
|
|
|
+ for (var i in chechRows) {
|
|
|
+ idList.push(chechRows[i].id);
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "index.php?s=/Admin/NewQcode/rePrintTg",
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ data: {
|
|
|
+ "idList": idList.toString(),
|
|
|
+ "reptQty": reptQty,
|
|
|
+ "status": 3,
|
|
|
+ "type": type,
|
|
|
+ },
|
|
|
+ success: function (result) {
|
|
|
+ if(result.code==0){
|
|
|
+ $.messager.alert('系统提示','修改成功','success');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
|
+ $.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#reptWin3').window('close');
|
|
|
+ }
|
|
|
function yes(id,large_id){
|
|
|
//alert(id,large_id);
|
|
|
//修改对应的小标签的状态为正常
|