Procházet zdrojové kódy

设备列表。添加设备功能

liujiankang před 7 roky
rodič
revize
262d94bd57

+ 21 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/EquipmentController.java

@@ -304,4 +304,25 @@ public class EquipmentController {
             return msg;
         }
     }
+    /**
+     * 查询数据库是否有已存在的信息
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/is_equipment")
+    public ResponseJson getEmployee(HttpServletRequest request){
+        String deviceNumber = request.getParameter("deviceNumber");
+        if(deviceNumber == null  || "".equals(deviceNumber)){
+            return new ResponseJson(500, "设备编号为空", 501);
+        }
+        PtsDevice ptsDevice = new PtsDevice();
+        ptsDevice.setDeviceNumber(deviceNumber);
+        List<PtsDevice>  ptsDevicelist = equipmentService.listDeviceByNo(ptsDevice);
+        if (ptsDevicelist != null && ptsDevicelist.size() > 0 ){
+            return new ResponseJson(200, "SUCCESS", 200);
+        }else {
+            return new ResponseJson(500, "设备不存在", 502);
+        }
+    }
 }

+ 4 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -36,7 +36,7 @@
                     <input  class="my-input" type="text" value="每个二维码打印数量:" readonly="readonly" style="border: 0;margin-top: 8px;margin-right: 0"/>
                 <input class="my-input" type="text" id="settingNumber" name="printNumber" value="3" placeholder="打印数量" style="margin-top: 10px;"/>
                 <button type="button" class="my-btn-search" onclick="printList();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">打印</button>
-                    <button type="button" class="my-btn-search" onclick="batchUpdatePring();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">修改为已打印</button>
+                    <button id="updatePrintId" type="button" class="my-btn-search" onclick="batchUpdatePring();" style="cursor:pointer; margin-right: 50px;margin-top: 10px;">修改为已打印</button>
 			</form>
 		</div>
 		<div class="mt-2" style="margin: 20px;">
@@ -50,7 +50,7 @@
 				</thead>
 				<tbody id="listid">
 					<#list machineList as list>
-						<tr class="text-c">
+						<tr class="text-c" id="${list.machineBarcode }">
                             <td width="2">
                                 <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
                             </td>
@@ -92,6 +92,7 @@
                 if(${machineIsPrint} == 2){
                     $("#havePrint").attr("class", "current");
                     $("#machineIsPrint").val(2);
+                    $("#updatePrintId").hide();//隐藏修改打印按钮
                 }
 
             function selectIsPrint(printState) {
@@ -211,6 +212,7 @@
                         "dataType" : "json",
                         "data" :{machineBarcode : machineBarcode},
                         "success" : function(data) {
+                            $("#"+machineBarcode).remove();
                             layer.msg('修改成功', {icon: 1, time: 2000});
                         },
                         "error":function(data){