检测报告管理
This commit is contained in:
parent
83b3a2cd98
commit
5d5af422ab
|
|
@ -156,5 +156,19 @@ public class SamplesManageController {
|
||||||
return ServerResponse.createErroe("操作失败");
|
return ServerResponse.createErroe("操作失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "getAuthority")
|
||||||
|
@DecryptAndVerify(decryptedClass = SamplesManageDto.class)
|
||||||
|
@LogAnnotation(operModul = "收样管理", operation = "查询是否具有派工/收样权限", operDesc = "业务级事件",operType="查询")
|
||||||
|
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
|
||||||
|
public ServerResponse getAuthority(EncryptedReq<SamplesManageDto> data) {
|
||||||
|
try {
|
||||||
|
Boolean res = samplesManageService.getAuthority(data.getData());
|
||||||
|
return ServerResponse.createSuccess(res);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createErroe("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.aqgqj.basis.controller;
|
||||||
|
|
||||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||||
|
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||||
import com.bonus.aqgqj.basis.service.TestReportManageService;
|
import com.bonus.aqgqj.basis.service.TestReportManageService;
|
||||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||||
|
|
@ -138,5 +139,10 @@ public class TestReportManageController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "viewTestData")
|
||||||
|
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理
|
||||||
|
public ServerResponse viewTestData(EncryptedReq<TestReportManageDto> data) {
|
||||||
|
return testReportManageService.viewTestData(data.getData());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
package com.bonus.aqgqj.basis.dao;
|
package com.bonus.aqgqj.basis.dao;
|
||||||
|
|
||||||
|
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||||
|
import com.bonus.aqgqj.basis.entity.vo.ConfigItemVo;
|
||||||
|
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
|
||||||
|
import com.bonus.aqgqj.basis.entity.vo.ExperDevVo;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
@ -105,4 +109,25 @@ public interface TestReportManageDao {
|
||||||
*/
|
*/
|
||||||
@MapKey("devCode")
|
@MapKey("devCode")
|
||||||
List<Map<String, String>> getExperDevItems(TestReportManageDto dto);
|
List<Map<String, String>> getExperDevItems(TestReportManageDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试验项信息
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ConfigItemsVo> getExperItems(TestReportManageDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试验项内容信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ConfigItemVo> getExperItem(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试验样品设备
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ExperDevVo> getExperDev(TestReportManageDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,10 +143,19 @@ public class SamplesManageDto extends PageEntity {
|
||||||
*/
|
*/
|
||||||
private Integer createBy;
|
private Integer createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
private Integer updateBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 试验项内容数量
|
* 试验项内容数量
|
||||||
*/
|
*/
|
||||||
private Integer experItemNum;
|
private Integer experItemNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程状态
|
||||||
|
*/
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,4 +63,11 @@ public interface SamplesManageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SamplesManageDto> getDeptSelectedById(SamplesManageDto data);
|
List<SamplesManageDto> getDeptSelectedById(SamplesManageDto data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询权限
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean getAuthority(SamplesManageDto data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.aqgqj.basis.service;
|
package com.bonus.aqgqj.basis.service;
|
||||||
|
|
||||||
|
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||||
import com.bonus.aqgqj.utils.ServerResponse;
|
import com.bonus.aqgqj.utils.ServerResponse;
|
||||||
|
|
||||||
|
|
@ -55,4 +56,11 @@ public interface TestReportManageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ServerResponse dispatchWork(TestReportManageDto data);
|
ServerResponse dispatchWork(TestReportManageDto data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试验数据详情
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ServerResponse viewTestData(TestReportManageDto data);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,7 @@ import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto;
|
||||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||||
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
import com.bonus.aqgqj.basis.service.ToolsManageService;
|
||||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
import com.bonus.aqgqj.utils.*;
|
||||||
import com.bonus.aqgqj.utils.ServerResponse;
|
|
||||||
import com.bonus.aqgqj.utils.StringHelper;
|
|
||||||
import com.bonus.aqgqj.utils.UserUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -131,9 +128,22 @@ public class SamplesManageServiceImpl implements SamplesManageService {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean getAuthority(SamplesManageDto data) {
|
||||||
|
if (StringHelper.isNotEmpty(data.getName())){
|
||||||
|
if ("派工".equals(data.getName())){
|
||||||
|
return SystemUtils.isComprehensiveTeamLeader();
|
||||||
|
}else if ("收样".equals(data.getName())){
|
||||||
|
return (SystemUtils.isComprehensiveTeam() || SystemUtils.isComprehensiveTeamLeader());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ServerResponse dispatchWork(SamplesManageDto data) {
|
public ServerResponse dispatchWork(SamplesManageDto data) {
|
||||||
|
Integer userId = Integer.parseInt(UserUtil.getLoginUser().getId().toString());
|
||||||
if (StringHelper.isNotEmpty(data.getIds())){
|
if (StringHelper.isNotEmpty(data.getIds())){
|
||||||
//拆分用逗号分隔的数据
|
//拆分用逗号分隔的数据
|
||||||
String[] ids = data.getIds().split(",");
|
String[] ids = data.getIds().split(",");
|
||||||
|
|
@ -141,6 +151,7 @@ public class SamplesManageServiceImpl implements SamplesManageService {
|
||||||
SamplesManageDto dto = new SamplesManageDto();
|
SamplesManageDto dto = new SamplesManageDto();
|
||||||
dto.setId(Integer.parseInt(id));
|
dto.setId(Integer.parseInt(id));
|
||||||
dto.setTeamId(data.getTeamId());
|
dto.setTeamId(data.getTeamId());
|
||||||
|
dto.setUpdateBy(userId);
|
||||||
//更新班组数据
|
//更新班组数据
|
||||||
int res = samplesManageDao.updateTeamId(dto);
|
int res = samplesManageDao.updateTeamId(dto);
|
||||||
if (res<=0){
|
if (res<=0){
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ package com.bonus.aqgqj.basis.service.impl;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.bonus.aqgqj.basis.dao.TestReportManageDao;
|
import com.bonus.aqgqj.basis.dao.TestReportManageDao;
|
||||||
|
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
import com.bonus.aqgqj.basis.entity.vo.*;
|
||||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||||
import com.bonus.aqgqj.basis.service.TestReportManageService;
|
import com.bonus.aqgqj.basis.service.TestReportManageService;
|
||||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||||
|
|
@ -188,6 +189,25 @@ public class TestReportManageServiceImpl implements TestReportManageService {
|
||||||
return ServerResponse.createBySuccessMsg("派工成功");
|
return ServerResponse.createBySuccessMsg("派工成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerResponse viewTestData(TestReportManageDto dto) {
|
||||||
|
TestVo testVo = new TestVo();
|
||||||
|
try {
|
||||||
|
List<ConfigItemsVo> configItemsVos = testReportManageDao.getExperItems(dto);
|
||||||
|
for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||||
|
List<ConfigItemVo> configItemVos = testReportManageDao.getExperItem(configItemsVo.getId());
|
||||||
|
configItemsVo.setItemList(configItemVos);
|
||||||
|
}
|
||||||
|
List<ExperDevVo> experDevVos = testReportManageDao.getExperDev(dto);
|
||||||
|
testVo.setConfigItemsVos(configItemsVos);
|
||||||
|
testVo.setExperDevVos(experDevVos);
|
||||||
|
return ServerResponse.createSuccess(testVo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return ServerResponse.createSuccess("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备编号--自动生成
|
* 设备编号--自动生成
|
||||||
* 生成规则:YYMMDDNNNN
|
* 生成规则:YYMMDDNNNN
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,42 @@ public class SystemUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是综合班组-班组长角色
|
||||||
|
*/
|
||||||
|
public static Boolean isComprehensiveTeamLeader() {
|
||||||
|
if (UserUtil.getLoginUser() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String roleCode = StringUtils.isNotBlank(UserUtil.getLoginUser().getRoleCode()) ? UserUtil.getLoginUser().getRoleCode() : null;
|
||||||
|
String teamId = StringUtils.isNotBlank(UserUtil.getLoginUser().getTeamId()) ? UserUtil.getLoginUser().getTeamId() : null;
|
||||||
|
if (Objects.equals(Constants.INTEGRATEDTEAMLEADER, roleCode) && teamId != null) {
|
||||||
|
return true;
|
||||||
|
} else if (Objects.equals(Constants.ADMIDMINISTRATORS, roleCode)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是综合班组-班组成员
|
||||||
|
*/
|
||||||
|
public static Boolean isComprehensiveTeam() {
|
||||||
|
if (UserUtil.getLoginUser() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String roleCode = StringUtils.isNotBlank(UserUtil.getLoginUser().getRoleCode()) ? UserUtil.getLoginUser().getRoleCode() : null;
|
||||||
|
String teamId = StringUtils.isNotBlank(UserUtil.getLoginUser().getTeamId()) ? UserUtil.getLoginUser().getTeamId() : null;
|
||||||
|
if (Objects.equals(Constants.INTEGRATEDTEAMMEMBER, roleCode) && teamId != null) {
|
||||||
|
return true;
|
||||||
|
} else if (Objects.equals(Constants.ADMIDMINISTRATORS, roleCode)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是技术负责人角色
|
* 是否是技术负责人角色
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,11 @@
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateTeamId">
|
<update id="updateTeamId">
|
||||||
UPDATE tb_sample
|
UPDATE tb_sample
|
||||||
SET team_id = #{teamId},dispatch_time=NOW()
|
SET team_id = #{teamId},
|
||||||
|
dispatch_time=NOW(),
|
||||||
|
dispatch_user= #{updateBy},
|
||||||
|
update_time=NOW(),
|
||||||
|
update_user=#{updateBy}
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
@ -90,7 +94,8 @@
|
||||||
tsd.dev_code as devCode,
|
tsd.dev_code as devCode,
|
||||||
tsd.customer_code as customerCode,
|
tsd.customer_code as customerCode,
|
||||||
tsd.dev_module as devModule,
|
tsd.dev_module as devModule,
|
||||||
tc.custom_name as sampleDepartment
|
tc.custom_name as sampleDepartment,
|
||||||
|
ts.process_status as processStatus
|
||||||
from
|
from
|
||||||
tb_sample_device tsd
|
tb_sample_device tsd
|
||||||
LEFT JOIN tb_sample ts on tsd.sample_id=ts.id
|
LEFT JOIN tb_sample ts on tsd.sample_id=ts.id
|
||||||
|
|
|
||||||
|
|
@ -210,4 +210,45 @@
|
||||||
and te.dev_type_name = #{sampleTools}
|
and te.dev_type_name = #{sampleTools}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getExperItems" resultType="com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo">
|
||||||
|
SELECT id,
|
||||||
|
exper_type_code AS experTypeCode,
|
||||||
|
exper_type_name AS experTypeName,
|
||||||
|
exper_num AS experNum,
|
||||||
|
items_sort AS itemsSort,
|
||||||
|
amount
|
||||||
|
FROM tb_exper_items
|
||||||
|
WHERE exper_id = #{id}
|
||||||
|
ORDER BY items_sort
|
||||||
|
</select>
|
||||||
|
<select id="getExperItem" resultType="com.bonus.aqgqj.basis.entity.vo.ConfigItemVo">
|
||||||
|
SELECT id,
|
||||||
|
items_id AS itemId,
|
||||||
|
item_sort AS itemNum,
|
||||||
|
item_name AS itemName
|
||||||
|
FROM tb_exper_item
|
||||||
|
WHERE items_id = #{id}
|
||||||
|
ORDER BY item_sort
|
||||||
|
</select>
|
||||||
|
<select id="getExperDev" resultType="com.bonus.aqgqj.basis.entity.vo.ExperDevVo">
|
||||||
|
SELECT ted.id,
|
||||||
|
ted.exper_id AS experId,
|
||||||
|
tsd.customer_code as customerCode,
|
||||||
|
ted.dev_code AS devCode,
|
||||||
|
ted.manufacturer,
|
||||||
|
ted.manufacture_date AS manufactureDate,
|
||||||
|
tsd.dev_module AS devModule,
|
||||||
|
ted.dev_status AS devStatus,
|
||||||
|
ted.dev_data AS devData,
|
||||||
|
ted.amount,
|
||||||
|
ted.remarks,
|
||||||
|
ted.department_id AS departmentId
|
||||||
|
FROM tb_exper_dev ted
|
||||||
|
LEFT JOIN tb_sample_device tsd on tsd.id=ted.dev_id and tsd.del_falg=0
|
||||||
|
WHERE ted.exper_id = #{id}
|
||||||
|
and ted.is_hg = #{isHg}
|
||||||
|
and ted.department_id = #{departmentId}
|
||||||
|
and tsd.dev_type_name = #{sampleTools}
|
||||||
|
ORDER BY ted.id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -17,7 +17,8 @@ function setParams(params) {
|
||||||
initTable(listData)
|
initTable(listData)
|
||||||
laydate.render({
|
laydate.render({
|
||||||
elem: '#sampleTime',
|
elem: '#sampleTime',
|
||||||
fullPanel: true
|
fullPanel: true,
|
||||||
|
value: new Date()
|
||||||
});
|
});
|
||||||
|
|
||||||
form.on('submit(formData)', function (data) {
|
form.on('submit(formData)', function (data) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ let form, layer, table, tableIns;
|
||||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||||
let orgData,selectOrgId;
|
let orgData,selectOrgId;
|
||||||
let idParam;
|
let idParam;
|
||||||
|
var modal = $('#myModal');
|
||||||
|
var span = $('.close');
|
||||||
|
|
||||||
function setParams(params){
|
function setParams(params){
|
||||||
idParam = JSON.parse(params).id;
|
idParam = JSON.parse(params).id;
|
||||||
|
|
@ -96,7 +98,7 @@ function initTable(dataList, limit, page) {
|
||||||
{
|
{
|
||||||
field: "view1", title: "收样标签", unresize: true, align: "center",
|
field: "view1", title: "收样标签", unresize: true, align: "center",
|
||||||
templet: function (d) {
|
templet: function (d) {
|
||||||
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\')">打印</a>';
|
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.sampleTools + '\',\'' + d.devCode + '\',\'' + d.customerCode + '\',\'' + d.devModule + '\',\'' + d.sampleDepartment + '\',\'' + d.processStatus + '\')">打印</a>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -110,16 +112,70 @@ function initTable(dataList, limit, page) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClick1(view1) {
|
/**
|
||||||
alert('Clicked on: ' + view1);
|
* 打印
|
||||||
|
*/
|
||||||
|
function handleClick1(sampleTools, devCode, customerCode, devModule, sampleDepartment, processStatus) {
|
||||||
|
if (processStatus == null){
|
||||||
|
processStatus = '待试验'
|
||||||
|
}else if (processStatus == 0){
|
||||||
|
processStatus = '待提交'
|
||||||
|
}else if (processStatus == 1){
|
||||||
|
processStatus = '待审阅'
|
||||||
|
}else if (processStatus == 2){
|
||||||
|
processStatus = '待审核'
|
||||||
|
}else if (processStatus == 3){
|
||||||
|
processStatus = '待审批'
|
||||||
|
}else if (processStatus == 4){
|
||||||
|
processStatus = '试验结束'
|
||||||
|
}
|
||||||
|
// 准备二维码内容
|
||||||
|
const qrCodeData = {
|
||||||
|
"设备类型": sampleTools,
|
||||||
|
"设备编号": devCode,
|
||||||
|
"设备编码": customerCode,
|
||||||
|
"规格型号": devModule,
|
||||||
|
"送检部门": sampleDepartment,
|
||||||
|
"流程状态": processStatus
|
||||||
|
};
|
||||||
|
// 将对象转换为字符串
|
||||||
|
const qrCodeString = JSON.stringify(qrCodeData, null, 2);
|
||||||
|
// 清空二维码容器
|
||||||
|
$('#Qrcode').empty();
|
||||||
|
// 生成二维码
|
||||||
|
$('#Qrcode').qrcode(utf16to8(qrCodeString));
|
||||||
|
// 显示模态对话框
|
||||||
|
modal.show();
|
||||||
|
// // 打印二维码
|
||||||
|
// printQRCode();
|
||||||
|
window.print();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClick2(view1) {
|
// 点击模态对话框外部区域也可以关闭模态对话框
|
||||||
alert('Clicked on: ' + view1);
|
$(window).click(function(event) {
|
||||||
|
if ($(event.target).is(modal)) {
|
||||||
|
modal.hide();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function handleClick3(view1) {
|
function utf16to8(str) {
|
||||||
alert('Clicked on: ' + view1);
|
var out, i, len, c;
|
||||||
|
out = "";
|
||||||
|
len = str.length;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
c = str.charCodeAt(i);
|
||||||
|
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||||
|
out += str.charAt(i);
|
||||||
|
} else if (c > 0x07FF) {
|
||||||
|
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||||
|
} else {
|
||||||
|
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取参数
|
// 获取参数
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,39 @@ function collectSamples(id) {
|
||||||
openIframe2("addOrEditUser", title, "child/samplesAdd.html", '70%', '90%', param);
|
openIframe2("addOrEditUser", title, "child/samplesAdd.html", '70%', '90%', param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否有权限
|
||||||
|
*/
|
||||||
|
function isHasAuth(name) {
|
||||||
|
//先去查一下是否有权限,后台接口查询
|
||||||
|
let url = dataUrl + '/samples/getAuthority';
|
||||||
|
let params = {
|
||||||
|
'name': name
|
||||||
|
}
|
||||||
|
params = {
|
||||||
|
encryptedData: encryptCBC(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
if (result.code === 200) {
|
||||||
|
if (result.data){
|
||||||
|
if (name=='派工'){
|
||||||
|
dispatch();
|
||||||
|
}else if (name=='收样'){
|
||||||
|
collectSamples('');
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return layer.msg('您不具有该功能权限', {icon: 7})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
layer.alert(result.msg, {icon: 2})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 派工
|
* 派工
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ function initTable(dataList, limit, page) {
|
||||||
{
|
{
|
||||||
field: "view1", title: "检测报告",width: 68, unresize: true, align: "center",
|
field: "view1", title: "检测报告",width: 68, unresize: true, align: "center",
|
||||||
templet: function (d) {
|
templet: function (d) {
|
||||||
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\')">查看</a>';
|
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\',\'' + d.isHg + '\',\'' + d.departmentId + '\',\'' + d.sampleTools + '\')">查看</a>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -197,10 +197,6 @@ function getMouseover(data){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleClick1(view1) {
|
|
||||||
alert('Clicked on: ' + view1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleClick2(view1) {
|
function handleClick2(view1) {
|
||||||
alert('Clicked on: ' + view1);
|
alert('Clicked on: ' + view1);
|
||||||
}
|
}
|
||||||
|
|
@ -287,6 +283,20 @@ function addData(id) {
|
||||||
openIframe2("addOrEditUser", title, "child/toolsFrom.html", '100%', '100%', param);
|
openIframe2("addOrEditUser", title, "child/toolsFrom.html", '100%', '100%', param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleClick1(id, isHg, departmentId, sampleTools) {
|
||||||
|
if (id) {
|
||||||
|
title = '试验报告';
|
||||||
|
}
|
||||||
|
let param = {
|
||||||
|
'experId': id,
|
||||||
|
'isHg': isHg,
|
||||||
|
'departmentId': departmentId,
|
||||||
|
'sampleTools': sampleTools
|
||||||
|
}
|
||||||
|
openIframe2("addOrEditUser", title, "testReportView.html", '100%', '100%', param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*删除用户*/
|
/*删除用户*/
|
||||||
function delData(id) {
|
function delData(id) {
|
||||||
layer.confirm("确定删除吗?", {
|
layer.confirm("确定删除吗?", {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
let form, layer,table;
|
||||||
|
let experIdParam = null,devTypeCodeParam = null;
|
||||||
|
let isHgParam = null,departmentIdParam=null,sampleToolsParam=null;
|
||||||
|
function setParams(params) {
|
||||||
|
experIdParam = JSON.parse(params).experId;
|
||||||
|
isHgParam = JSON.parse(params).isHg;
|
||||||
|
departmentIdParam=JSON.parse(params).departmentId;
|
||||||
|
sampleToolsParam=JSON.parse(params).sampleTools;
|
||||||
|
|
||||||
|
|
||||||
|
layui.use(['form', 'layer','table'], function () {
|
||||||
|
form = layui.form;
|
||||||
|
layer = layui.layer;
|
||||||
|
table = layui.table;
|
||||||
|
})
|
||||||
|
getDataById();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**详情*/
|
||||||
|
function getDataById() {
|
||||||
|
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||||
|
let url = dataUrl + "/testReport/viewTestData";
|
||||||
|
let obj = {
|
||||||
|
'id': experIdParam,
|
||||||
|
'isHg': isHgParam,
|
||||||
|
'departmentId':departmentIdParam,
|
||||||
|
'sampleTools':sampleToolsParam
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||||
|
}
|
||||||
|
ajaxRequest(url, "POST", params, true, function () {
|
||||||
|
}, function (result) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
if (result.status === 200) {
|
||||||
|
setFormData(result.data);
|
||||||
|
} else if (result.status === 500) {
|
||||||
|
layer.alert(result.msg, {icon: 2,move:false})
|
||||||
|
}
|
||||||
|
}, function (xhr) {
|
||||||
|
layer.close(loadingMsg); // 关闭提示层
|
||||||
|
error(xhr)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**表单赋值*/
|
||||||
|
function setFormData(obj){
|
||||||
|
// $('#devTypeName').val(obj.devTypeName);
|
||||||
|
// $('#devModule').val(obj.devModule);
|
||||||
|
// $('#sampleQuantity').val(obj.sampleQuantity);
|
||||||
|
// $('#sampleDate').val(obj.sampleDate);
|
||||||
|
// $('#experTime').val(obj.experTime);
|
||||||
|
// $('#nextExperTime').val(obj.nextExperTime);
|
||||||
|
// $('#customName').val(obj.customName);
|
||||||
|
// $('#experLocal').val(obj.experLocal);
|
||||||
|
// $('#experDev').val(obj.experDev);
|
||||||
|
// $('#experModule').val(obj.experModule);
|
||||||
|
// $('#experCode').val(obj.experCode);
|
||||||
|
// $('#checkTime').val(obj.checkTime);
|
||||||
|
// $('#yjList').after(setYjData(obj.basisVos));
|
||||||
|
initTable(obj.experDevVos,obj.configItemsVos);
|
||||||
|
// $('#experStand').val(obj.experStand);
|
||||||
|
// $('#experConclu').val(obj.experConclu);
|
||||||
|
// $('#remarsk').val(obj.remarsk);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**试验依据赋值*/
|
||||||
|
function setYjData(list){
|
||||||
|
let html = '';
|
||||||
|
if(list && list.length > 0){
|
||||||
|
$.each(list,function (index,item){
|
||||||
|
html += '<div class="layui-form-item">' +
|
||||||
|
'<div class="layui-inline">' +
|
||||||
|
'<div class="layui-input-inline yj">' +
|
||||||
|
'<input type="text" value="' + item.basisName + '" readonly autocomplete="off" class="layui-input">' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function initTable(dataList,configList) {
|
||||||
|
let handleDataList = handleData(dataList);
|
||||||
|
// dataList = [{"username":"12"},{"username":"12"},{"username":"12"}];
|
||||||
|
// let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, scrollbar: false, time: 0, });
|
||||||
|
table.render({
|
||||||
|
elem: '#testTable',
|
||||||
|
id: 'testTable',
|
||||||
|
data: handleDataList,
|
||||||
|
cols:setTableData(configList),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function setTableData(configList){
|
||||||
|
let tableTitle = [[
|
||||||
|
{field: 'number',type: 'numbers',title: '序号',width: 60,rowspan: 2,fixed: 'left',align: 'center',unresize: true,},
|
||||||
|
{field: 'customerCode',title: '样品编号',width: 120,fixed: 'left',rowspan: 2,align: 'center',unresize: true,},
|
||||||
|
{title: '样品信息',fixed: 'left', align: 'center', colspan: 4, unresize: true},
|
||||||
|
],[
|
||||||
|
{field: 'devCode',title: '客户自编号',width: 120,fixed: 'left',align: 'center',unresize: true,},
|
||||||
|
{field: 'manufacturer',fixed: 'left', title: '生产厂家', width: 120, align: 'center', unresize: true},
|
||||||
|
{field: 'manufactureDate',fixed: 'left', title: '生产日期', width: 120, align: 'center', unresize: true},
|
||||||
|
{field: 'devModule',fixed: 'left', title: '规格型号', width: 100, align: 'center', unresize: true},
|
||||||
|
]];
|
||||||
|
setFirstTitle();
|
||||||
|
setTwoTitle();
|
||||||
|
function setFirstTitle(){
|
||||||
|
$.each(configList,function (index,item){
|
||||||
|
tableTitle[0].push({title: item.experTypeName,colspan: item.experNum, width: 180 * (item.experNum), align: 'center', unresize: true})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function setTwoTitle(){
|
||||||
|
let indexNum = 0;
|
||||||
|
$.each(configList,function (index,item){
|
||||||
|
let itemList = item.itemList;
|
||||||
|
let length = itemList.length;
|
||||||
|
$.each(itemList,function (index2,item2){
|
||||||
|
indexNum = index * length + index2;
|
||||||
|
tableTitle[1].push({field: 'val' + indexNum ,title: item2.itemName, width: 180, align: 'center', unresize: true});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return tableTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**处理数据*/
|
||||||
|
function handleData(dataList){
|
||||||
|
$.each(dataList,function (index,item){
|
||||||
|
let arr = JSON.parse(item.devData);
|
||||||
|
$.each(arr,function (index2,item2){
|
||||||
|
item['val' + index2] = item2;
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
<script src="../../../js/openIframe.js"></script>
|
<script src="../../../js/openIframe.js"></script>
|
||||||
<script src="../../../js/my/aes.js"></script>
|
<script src="../../../js/my/aes.js"></script>
|
||||||
<script src="../../../js/ajaxRequest.js"></script>
|
<script src="../../../js/ajaxRequest.js"></script>
|
||||||
|
<script src="../../../js/libs/jquery.qrcode.min.js"></script>
|
||||||
<title>详情</title>
|
<title>详情</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -47,6 +48,58 @@
|
||||||
<div id="voi-page" class="layout"></div>
|
<div id="voi-page" class="layout"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="qr-canvas"></div>
|
||||||
|
<!-- 模态对话框 -->
|
||||||
|
<div id="myModal" class="modal" style="text-align: center;">
|
||||||
|
<div style="width: 380px; margin-left: 30%; margin-top: 11%">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div id="Qrcode"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<style>
|
||||||
|
#Qrcode {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
/* 模态对话框样式 */
|
||||||
|
.modal {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: rgb(0,0,0);
|
||||||
|
background-color: rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
.modal-content {
|
||||||
|
background-color: #fefefe;
|
||||||
|
margin: 15% auto;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid #888;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
.close {
|
||||||
|
color: #aaa;
|
||||||
|
float: right;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.close:hover,
|
||||||
|
.close:focus {
|
||||||
|
color: black;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 简单样式,仅用于演示 */
|
||||||
|
#qr-canvas {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../../../js/samples/child/samplesForm.js" charset="UTF-8" type="text/javascript"></script>
|
<script src="../../../js/samples/child/samplesForm.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -48,11 +48,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-inline btns">
|
<div class="layui-inline btns">
|
||||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="dispatch()">派工
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="isHasAuth('派工')">派工
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-inline btns">
|
<div class="layui-inline btns">
|
||||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="collectSamples()">收样
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="isHasAuth('收样')">收样
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="stylesheet" href="../../../js/layui-v2.9.14/layui/css/layui.css">
|
||||||
|
<link rel="stylesheet" href="../../../css/font.css">
|
||||||
|
<link rel="stylesheet" href="../../../css/basis/originalRecord.css">
|
||||||
|
<script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
|
<script src="../../../js/layui-v2.9.14/layui/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
|
<script src="../../../js/publicJs.js"></script>
|
||||||
|
<script src="../../../js/commonUtils.js"></script>
|
||||||
|
<script src="../../../js/openIframe.js"></script>
|
||||||
|
<script src="../../../js/my/aes.js"></script>
|
||||||
|
<script src="../../../js/ajaxRequest.js"></script>
|
||||||
|
<script src="../../../js/select.js"></script>
|
||||||
|
<title>检测报告</title>
|
||||||
|
<style>
|
||||||
|
.none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content">
|
||||||
|
<!--基本信息-->
|
||||||
|
<div class="basic-box">
|
||||||
|
<form class="layui-form" onsubmit="return false;">
|
||||||
|
<table id="testTable" class="layui-table"></table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<style>
|
||||||
|
.layui-table .layui-table-cell {
|
||||||
|
height: auto;
|
||||||
|
word-break: normal;
|
||||||
|
display: block;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="../../../js/testReport/child/testReportView.js" charset="UTF-8" type="text/javascript"></script>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue