feat(rfid): 为RFID标签绑定功能添加资产类别筛选和状态显示优化

- 在AmsRfidTagController中注入IAmsAssetCategoryService服务
- 为selectAsset方法添加ModelMap参数并查询启用状态的资产类别列表
- 将资产状态标签显示逻辑从简单字典转换改为循环匹配确保正确显示
- 在前端模板中将资产类别输入框改为下拉选择框支持按类别筛选
- 添加资产类别数据绑定到前端模板的categories变量中
main
yangk 2 weeks ago
parent 5d17e05f3f
commit f79d622544

@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.asset.domain.AmsAsset;
import com.ruoyi.asset.domain.AmsAssetCategory;
import com.ruoyi.asset.domain.AmsRfidTag;
import com.ruoyi.asset.domain.RfidBindingContext;
import com.ruoyi.asset.service.IAmsAssetCategoryService;
import com.ruoyi.asset.service.IAmsAssetService;
import com.ruoyi.asset.service.IAmsRfidTagService;
import com.ruoyi.asset.service.IRfidBindingService;
@ -46,6 +48,9 @@ public class AmsRfidTagController extends BaseController
@Autowired
private IRfidBindingService rfidBindingService;
@Autowired
private IAmsAssetCategoryService amsAssetCategoryService;
@RequiresPermissions("asset:tag:view")
@GetMapping()
public String tag()
@ -198,8 +203,11 @@ public class AmsRfidTagController extends BaseController
*/
@RequiresPermissions("asset:tag:bind")
@GetMapping("/selectAsset")
public String selectAsset()
public String selectAsset(ModelMap mmap)
{
AmsAssetCategory categoryQuery = new AmsAssetCategory();
categoryQuery.setEnabled("Y");
mmap.put("categories", amsAssetCategoryService.selectAmsAssetCategoryList(categoryQuery));
return prefix + "/selectAsset";
}

@ -87,7 +87,14 @@
}
$("#assetCode").val(selectedAsset.assetCode);
$("#assetName").val(selectedAsset.assetName);
$("#assetStatusName").val($.table.selectDictLabel(assetStatusDatas, selectedAsset.assetStatus));
var statusLabel = "";
$.each(assetStatusDatas, function(index, dict) {
if (dict.dictValue == ('' + selectedAsset.assetStatus)) {
statusLabel = dict.dictLabel;
return false;
}
});
$("#assetStatusName").val(statusLabel || selectedAsset.assetStatus);
$("#assetLocation").val((selectedAsset.warehouseName || "-") + " / " + (selectedAsset.locationName || "-"));
$.modal.close(index);
}

@ -20,7 +20,10 @@
</li>
<li>
<label>资产类别:</label>
<input type="text" name="categoryName">
<select name="categoryName">
<option value="">所有</option>
<option th:each="c : ${categories}" th:text="${c.categoryName}" th:value="${c.categoryName}"></option>
</select>
</li>
<li>
<label>资产状态:</label>

Loading…
Cancel
Save