曹鹤洋 2 жил өмнө
parent
commit
8e07ba757f

+ 4 - 4
Application/Admin/Controller/NewQcodeController.class.php

@@ -402,15 +402,15 @@ class  NewQcodeController extends AddonController
         echo $bachlist;
         //echo json_encode($BatchList);
     }
-    
+
     public function GetLargeLabelApi(){//获取关联批次的大件标签列表
-        $field = "code,print_date,p_nums,id,code_cp1,l_print,l_status,archive,l_weight";
+        $field = "code,print_date,p_nums,id,code_cp1,l_print,l_status,archive,l_weight,l_num";
         $LargeLabelList = M('qcode_large')->field($field)->where('bach_id='.I('get.product_id'))->select();
        // var_dump($LargeLabelList);
         foreach($LargeLabelList as $key=>$val){
             $qcode_small=$val['archive']?"qcode_small_".$val['archive']:"qcode_small";
             $smalltotal=M('qcode_small')->field('count(large_id)')->where('large_id='.$val['id'])->find();
-            
+
             $LargeLabelList[$key]['code_cp1']=ltrim(substr($LargeLabelList[$key]['code_cp1'],6,10),'0');
             $LargeLabelList[$key]['smalltotal']=$smalltotal['count(large_id)'];
             if( $LargeLabelList[$key]['l_print']==0){
@@ -575,7 +575,7 @@ class  NewQcodeController extends AddonController
                 $this->ajaxReturn(['code'=>0]);
             }
             if(I('post.type')==2){//修改大件总张数
-                $data['l_num'] = intval(I('post.reptQty'));//2023年4月17日 批次列表页修改大件重量
+                $data['l_num'] = intval(I('post.reptQty'));//2023年4月17日 批次列表页修改大件张数
                 foreach($ids as $val){
                     //修改大件总张数
                     $largelabel = M('qcode_large')->where('id='.$val)->save($data);

+ 31 - 9
Application/Admin/View/Qcode/budadetail.html

@@ -530,7 +530,10 @@
                 {field: 'p_nums', title: '打印次数', align: 'right', sortable: true, width: 50},
                 {field: 'smalltotal', title: '小件数量', align: 'center', sortable: true, width: 80},
                 {field: 'l_weight', title: '大件重量', align: 'center', sortable: true, width: 80,
-					formatter: function(value,row,index){return value/100;}
+					formatter: function(value,row,index){return value/100}
+				},
+				{field: 'l_num', title: '大件数量', align: 'center', sortable: true, width: 80,
+					formatter: function(value,row,index){return value/10000}
 				},
                 {field: 'type', title: '打印状态', align: 'center', sortable: true, width: 80},
                 {field: 'l_status', title: '导出状态', align: 'center', sortable: true, width: 80,
@@ -549,7 +552,17 @@
                 $.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');
             },
 
-            onClickRow: function (rowIndex, rowData) {
+			onLoadSuccess:function(data){
+				if(data.rows[0].l_num == null || data.rows[0].l_num == 0){
+					$("#supTgGrid").datagrid("hideColumn", "l_num"); // 设置隐藏列
+					$("#supTgGrid").datagrid("showColumn", "l_weight"); // 设置显示列
+				}else{
+					$("#supTgGrid").datagrid("hideColumn", "l_weight"); // 设置隐藏列
+					$("#supTgGrid").datagrid("showColumn", "l_num"); // 设置显示列
+				}
+			},
+
+			onClickRow: function (rowIndex, rowData) {
 
                 //点击大标签,弹出小标签列表
                 $('#supTgGridS').html("");
@@ -867,10 +880,7 @@
 			$.messager.alert('系统提示', '请先勾选需要修改的标签!', 'info');
 			return;
 		}
-		if (checked.length > 1) {
-			$.messager.alert('系统提示', '请先勾选单个标签!', 'info');
-			return;
-		}
+
 		$('#reptWin3').window('open');  // open a window
 		$('#reptForm3').form('load', {'reptQty3': '','reptQty33': ''});
 	}
@@ -1742,7 +1752,10 @@
 							{field: 'p_nums', title: '打印次数', align: 'right', sortable: true, width: 50},
 							{field: 'smalltotal', title: '小件数量', align: 'center', sortable: true, width: 80},
 							{field: 'l_weight', title: '大件重量', align: 'center', sortable: true, width: 80,
-								formatter: function(value,row,index){return value/100;}
+								formatter: function(value,row,index){return value/100}
+							},
+							{field: 'l_num', title: '大件数量', align: 'center', sortable: true, width: 80,
+								formatter: function(value,row,index){return value/10000}
 							},
 							{field: 'type', title: '打印状态', align: 'center', sortable: true, width: 80},
 							{field: 'l_status', title: '导出状态', align: 'center', sortable: true, width: 80,
@@ -1761,6 +1774,16 @@
 							$.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');
 						},
 
+						onLoadSuccess:function(data){
+							if(data.rows[0].l_num == null || data.rows[0].l_num == 0){
+								$("#supTgGrid").datagrid("hideColumn", "l_num"); // 设置隐藏列
+								$("#supTgGrid").datagrid("showColumn", "l_weight"); // 设置显示列
+							}else{
+								$("#supTgGrid").datagrid("hideColumn", "l_weight"); // 设置隐藏列
+								$("#supTgGrid").datagrid("showColumn", "l_num"); // 设置显示列
+							}
+						},
+
 						onClickRow: function (rowIndex, rowData) {
 
 							//点击大标签,弹出小标签列表
@@ -1834,8 +1857,7 @@
 							}
 							return true;
 						}
-					});
-				}
+					});				}
 			},
 			error: function (XMLHttpRequest, textStatus, errorThrown) {
 				$.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');

+ 6 - 2
static/basejs/tg_small_v010.js

@@ -88,10 +88,12 @@ function small_v010_print(result,type,idList,reptQty,sign_type) {
                     var proportion = '';
                 }
             }else if(data['largrlabel'][j][k]['l_num']==0){
+                //判断是否是公斤
                 if(data['largrlabel'][j][k]['main_unit']=='公斤'){
+                    //公斤使用l_weight
                     var proportion = data['largrlabel'][j][k]['l_weight'];
                 }else{
-                    //走转换关系
+                    //不是公斤走转换关系
                     if (data['largrlabel'][j][k]['proportion']){
                         var proportion = data['largrlabel'][j][k]['numn']*data['largrlabel'][j][k]['proportion'];
                         proportion = Math.floor(proportion * 100) / 100;
@@ -248,10 +250,12 @@ function small_v010_print(result,type,idList,reptQty,sign_type) {
                             var proportion = '';
                         }
                     }else if(data['largrlabel'][j][k]['l_num']==0){
+                        //判断是否是公斤
                         if(data['largrlabel'][j][k]['main_unit']=='公斤'){
+                            //公斤使用l_weight
                             var proportion = data['largrlabel'][j][k]['l_weight'];
                         }else{
-                            //走转换关系
+                            //不是公斤走转换关系
                             if (data['largrlabel'][j][k]['proportion']){
                                 var proportion = data['largrlabel'][j][k]['numn']*data['largrlabel'][j][k]['proportion'];
                                 proportion = Math.floor(proportion * 100) / 100;