forked from xxhjsb/hbt-prevention-ui
feat:新增工作推进机制,三卡管理,奖惩机制,积分管理
parent
cf812d84e5
commit
3ad1304f15
|
|
@ -0,0 +1,236 @@
|
|||
export default [
|
||||
{
|
||||
title: "1.工作推进机制(10 分)",
|
||||
key: 1,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData: [
|
||||
{
|
||||
gradeB: "成立领导机构(2分)",
|
||||
key:1_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:2,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "编制实施方案(2分)",
|
||||
key:1_2,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:2,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "开展全员培训(4分)",
|
||||
key:1_3,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:4,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "完善管理制度(2分)",
|
||||
key:1_4,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:2,
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title:"2.安全风险分级管控(20 分)",
|
||||
key:2,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "划分安全风险分析单元(5 分)",
|
||||
key:2_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:5,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "辨识评估安全风险(5 分)",
|
||||
key:2_2,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:5,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "绘制安全风险空间分布图(2 分)",
|
||||
key:2_3,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:2,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "制定管控措施(4 分)",
|
||||
key:2_4,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:4,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "实施管控措施(4 分)",
|
||||
key:2_5,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:4,
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title:"3.隐患排查治理(24 分)",
|
||||
key:3,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "明确隐患排查任务(5分)",
|
||||
key:3_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:5,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "开展隐患排查(14分)",
|
||||
key:3_2,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:14,
|
||||
|
||||
},
|
||||
{
|
||||
gradeB: "隐患治理验收(5分)",
|
||||
key:3_3,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:5,
|
||||
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
title:"4.信息化系统(30 分)",
|
||||
key:4,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "信息化系统建设要求(30分)",
|
||||
key:4_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:30,
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
title:"5.激励约束机制(6 分)",
|
||||
key:5,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "激励约束(6分)",
|
||||
key:5_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:6,
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
title:"6.持续改进提升(10 分)",
|
||||
key:6,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "动态评估(10分)",
|
||||
key:6_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:10,
|
||||
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
title:"7.提升功能(10 分)",
|
||||
key:7,
|
||||
reject:false,
|
||||
score:0,
|
||||
tableData:[
|
||||
{
|
||||
gradeB: "提升功能(10分)",
|
||||
key:7_1,
|
||||
deductPoints: "--",
|
||||
getPoints: "--",
|
||||
record: "",
|
||||
pointFlag:false,
|
||||
recordFlag:false,
|
||||
score:10,
|
||||
|
||||
},
|
||||
]
|
||||
},
|
||||
];
|
||||
|
|
@ -0,0 +1,737 @@
|
|||
export default {
|
||||
1_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"企业应建立双重预防机制建设领导机构,主要负责人任组长,成员应包括分管负责人及各部门(车间)负责人,并明确各自职责。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "下发的正式文件、安全生产责任制度。",
|
||||
},
|
||||
{
|
||||
title: "询问",
|
||||
content:"企业主要负责人、分管负责人及各部门(车间)负责人是否掌握双重预防机制建设基 本要求及应履行的主要职责。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.未以正式文件明确双重预防机制建设领导机构的,扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"2.企业主要负责人未担任组长的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"3.未明确领导机构职责的,扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"企业主要负责人没有主持研究双重预防机制建设重大问题的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
1_2:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"企业应制定全员参与的双重预防机制建设实施方案,明确工作目标、任务、实施步骤、进度安排等,做到责任层层分解。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "查阅实施方案和相关记录等,并核对实施情况。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.未制定实施方案的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.未做到负有安全生产责任的岗位全员参与,每缺一个岗位扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"3.实施方案未明确工作目标、任务、实施步骤、进度安排等,一项扣0.5 分;实施方案未进行层层分解的,扣 2 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
1_3:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应制定培训计划,明确培训学时、培训内容、参加人员、考核方式等。"
|
||||
},
|
||||
{
|
||||
content:"2.企业应组织开展培训,主要培训双重预防机制建设的思路、安全风险分析清单编制流程、信息化系统操作使用等内容。"
|
||||
},
|
||||
{
|
||||
content:"3.培训考核结果应记入培训档案。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "培训计划、培训记录与档案、培训教育制度。",
|
||||
},
|
||||
{
|
||||
title: "抽查问询",
|
||||
content: "随机抽查、问询各层级、各岗位人员是否掌握双重预防机制培训内容。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业未制定培训计划的,扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"2.无培训记录的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"3.未对负有安全生产责任的岗位实现全员培训的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"4.随机抽查的人员不掌握相关培训内容的,一人扣 0.5 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"抽查至少50%的中层以上管理人员,有20%以上未参加培训的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
1_4:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应结合双重预防机制建设相关要求,制修订安全生产责任制、安全风险分级管控、隐患排查治理、培训教育、奖惩管理等相关管理制度。"
|
||||
},
|
||||
{
|
||||
content:"2.制度文件应符合企业实际、具有可操作性,并在岗位得到有效执行。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "1.相关制度文件。2.制度发放、传达和执行记录。",
|
||||
},
|
||||
{
|
||||
title: "抽查问询",
|
||||
content: "各部门/岗位是否已获取有效的相关制度文件并有效执行。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.无相关管理制度的或未按照双重预防机制相关要求,制修订管理制度的,一项扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"2.制度文件未有效执行的,扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
2_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.按照“功能独立、大小适中、易于管理”的原则,选取所有生产装置、储存设施或场所作为安全风险分析对象。按照《危险化学品重大危险源辨识》(GB18218)构成重大危险源的应独立作为安全风险分析对象。"
|
||||
},
|
||||
{
|
||||
content:"2.企业应根据生产工艺流程顺序或设备设施布局,将安全风险分析对象分解为若干相对独立的安全风险分析单元,主要设备设施均应纳入安全风险分析单元。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "安全风险清单。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业安全风险分析对象不全的,缺一项扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.企业未将主要设备设施纳入安全风险分析单元的,一项扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"企业安全风险分析对象没有覆盖所有重大危险源的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
2_2:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应组织各相关部门、专业、岗位,应用 SCL、JHA、HAZOP 等方法对安全风险分析单元进行安全风险辨识,评估可能导致的事故后果。"
|
||||
},
|
||||
{
|
||||
content:"2.企业应根据安全风险辨识结果,选择可能造成爆炸、火灾、中毒、窒息等严重后果的事件作为重点管控的安全风险事件。企业可根据安全管理实际补充其他安全风险事件。"
|
||||
},
|
||||
{
|
||||
content:"3.企业应建立安全风险清单,主要内容包括安全风险分析对象、责任部门、责任人、分析单元、安全风险事件等。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、查信息系统",
|
||||
content: "1.安全风险清单。2.安全风险辨识过程记录。",
|
||||
},
|
||||
{
|
||||
title: "抽查询问",
|
||||
content: "抽查企业相关部门、班组、岗位人员是否参与安全风险辨识。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业未组织全员开展风险辨识的,少一岗位扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.未选择严重后果事件作为重点管控的安全风险事件的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"3.企业未形成安全风险清单的,扣 5 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
2_3:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应根据安全风险事件可能造成的后果严重程度,对安全风险分析对象进行科学分级。"
|
||||
},
|
||||
{
|
||||
content:"2.从高到低依次划分为重大风险、较大风险、一般风险和低风险 4 个等级,分别采用红、橙、黄、蓝四种颜色进行标示。"
|
||||
},
|
||||
{
|
||||
content:"3.在信息系统中绘制安全风险空间分布图。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、查信息系统",
|
||||
content: "1.安全风险清单。2.安全风险空间分布图。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业未对安全风险分析对象进行分级的,扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.企业安全风险分级与辨识结果不一致的,扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"3.信息系统中未显示安全风险空间分布图的,扣 2 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
2_4:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.针对安全风险事件,企业应从工程技术、维护保养、人员操作、应急措施等方面识别评估现有管控措施的有效性,其中工程技术类管控措施主要针对关键设备部件、安全附件、工艺控制、安全仪表等方面;维护保养类管控措施主要保障动设备和静设备正常运行;人员操作类管控措施主要包括人员资质、操作规程、工艺指标等内容;应急措施类管控措施主要包括应急设施、个体防护、消防设施、应急预案等内容。管控措施应按照公司规定,经主要负责人评估确定。"
|
||||
},
|
||||
{
|
||||
content:"2.企业在以上管控措施的基础上,可结合实际情况,制定其他管控措施。"
|
||||
},
|
||||
{
|
||||
content:"3.根据运行情况,不断更新管控措施,及时纠正偏差。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、查信息系统",
|
||||
content: "检查管控措施是否经过评估确定,控制措施是否全面、无疏漏、可操作性强并有效落实。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.管控措施不全面、操作性不强,一项扣 0.5 分。"
|
||||
},
|
||||
{
|
||||
content:"2.情况发生变化后,管控措施未及时修正,一项扣"
|
||||
},
|
||||
{
|
||||
content:"3.管控措施未经过评估确定的,扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
2_5:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应将安全风险事件对应的管控措施分解到公司领导、部门、车间、班组和岗位人员等各层级,确保安全风险管控措施有效实施。"
|
||||
},
|
||||
{
|
||||
content:"2.上一级负责管控措施,责任相关的下一级必须同时负责管控,并逐级落实。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "现场检查",
|
||||
content: "核查岗位人员参与过程,及是否清楚并落实自身岗位相关管控措施。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"岗位人员未落实自身岗位管控措施的,一人扣 2 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
3_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应将安全风险管控措施作为隐患排查的任务,明确隐患排查责任人、频次等。隐患排查任务应涵盖全员、责任清晰、周期明确,且与日常巡检等计划性内容相融合。"
|
||||
},
|
||||
{
|
||||
content:"2.企业也应按照国家法律法规及标准要求,结合企业实际,制定综合性、专业性、季节性、重点时段及节假日前等形式的隐患排查任务。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、查信息系统",
|
||||
content: "安全风险分析和隐患排查任务清单。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.隐患排查任务未覆盖到负有安全生产责任的岗位和个人,或排查责任不清晰,或排查周期不明确,一项扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"2.隐患排查形式不全面的,扣 2 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"隐患排查任务覆盖岗位低于80%的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
3_2:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"企业应根据隐患排查任务,按期开展隐患排查,确保管控措施落实。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查信息系统",
|
||||
content: "1.隐患排查记录。2.隐患排查任务完成率。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.隐患排查任务完成率低于 80%的,扣 5 分。"
|
||||
},
|
||||
{
|
||||
content:"2.岗位人员未按期开展隐患排查,一人扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"3.同一岗位连续两个周期未完成隐患排查任务的,扣 5 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
3_3:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"排查发现的隐患,能立即整改的隐患必须立即整改,无法立即整改的隐患,制定隐患治理计划,切实做到整改措施、责任、资金、时限和预案“五到位”,确保按时整改。整改完成后要组织对隐患治理效果进行验收,完成隐患闭环管理。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料",
|
||||
content: "企业隐患台账。",
|
||||
},
|
||||
{
|
||||
title: "查信息系统",
|
||||
content: "查隐患整改记录。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.未制定隐患整改计划,一项扣 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.一般隐患超期未整改,一项扣 2 分;重大隐患超期未整改,一项扣 5 分。"
|
||||
},
|
||||
{
|
||||
content:"3.未组织隐患整改验收,一项扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
4_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应开发或改造信息化系统,包含电脑管理端和移动 APP 端,满足数据交换规范的要求。"
|
||||
},
|
||||
{
|
||||
content:"2.电脑管理端具备动态监控安全风险管控措施落实、隐患排查任务推送、隐患排查治理情况跟踪监督、机制运行效果评估、异常状态自动预警及考核奖惩等功能;移动 APP 端具备隐患排查任务和预警信息接收、现场隐患排查情况实时上报、隐患治理全程跟踪等功能。"
|
||||
},
|
||||
{
|
||||
content:"3.企业应利用移动终端开展隐患排查。"
|
||||
},
|
||||
{
|
||||
content:"4.企业信息化系统与政府系统实现数据互联互通。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查信息系统",
|
||||
content: "登录信息化系统查看系统功能及运行情况。",
|
||||
},
|
||||
{
|
||||
title: "现场检查",
|
||||
content:"抽查不同岗位人员信息系统使用情况。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.信息化系统功能不满足要求,一项扣 5 分。"
|
||||
},
|
||||
{
|
||||
content:"2.移动终端数量不满足隐患排查需求的,扣 5 分。"
|
||||
},
|
||||
{
|
||||
content:"3.企业信息化系统未与政府系统实现数据互联互通的,扣 10 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"企业未按照数据交换规范建设信息化系统或没有利用移动 APP 端进行隐患排查,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
5_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业建立双重预防机制运行激励约束制度,明确考核奖惩的标准、频次、方式方法等,并与员工工资薪酬(或奖金)挂钩。"
|
||||
},
|
||||
{
|
||||
content:"2.根据信息化系统自动生成的绩效考核结果,落实激励约束制度,定期兑现。"
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、信息化系统",
|
||||
content: "1.企业激励约束制度。2.考核奖惩记录。",
|
||||
},
|
||||
{
|
||||
title: "现场检查",
|
||||
content:"抽查不同岗位人员信息系统使用情况。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.激励约束制度未明确考核奖惩标准、频次、方式方法,一项扣 1 分。"
|
||||
},
|
||||
{
|
||||
content:"2.未按考核结果兑现的,扣 2 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"未制定考核奖惩办法或有奖惩办法从未兑现过的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
6_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"1.企业应根据每周双重预防机制运行效果,查找原因,及时制定整改措施,持续改进。"
|
||||
},
|
||||
{
|
||||
content:"2.企业至少每年一次对双重预防机制运行效果进行评估并加以改进,重点评估安全风险管控措施适宜性、隐患排查任务可操作性等内容。"
|
||||
},
|
||||
{
|
||||
content:"3.当发生下列情形时,应及时开展评估改进:1)新的或变更的法律法规或其他要求;2)操作条件变化或工艺改变;3)技术改造项目;4)有对事件、事故或其他信息的新认识;5)组织机构发生大的调整。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查资料、信息化系统",
|
||||
content: "企业评估记录和整改记录。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.未开展年度评估的,扣 5 分。"
|
||||
},
|
||||
{
|
||||
content:"2.评估发现的问题未及时整改,一项扣 1 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "否决项",
|
||||
key:"reject",
|
||||
content: [
|
||||
{
|
||||
content:"企业发生 5 种情况变化时,未及时开展评估的,评估为不合格。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
7_1:{
|
||||
standard: [
|
||||
{
|
||||
title: "机制建设标准与要求",
|
||||
key:"standard",
|
||||
content: [
|
||||
{
|
||||
content:"在双重预防机制信息化系统基础上,企业可根据实际情况拓展以下功能:1.特殊作业电子作业票;2.视频智能分析;3.其他功能。"
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评估方法",
|
||||
key:"method",
|
||||
content: [
|
||||
{
|
||||
title: "查信息系统",
|
||||
content: "1.特殊作业电子作业票。2.视频智能分析。3.其他。",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "评分标准",
|
||||
key:"scoringCriteria",
|
||||
content: [
|
||||
{
|
||||
content:"1.拓展 1 种功能的,加 2 分。"
|
||||
},
|
||||
{
|
||||
content:"2.拓展 2 种功能的,加 5 分。"
|
||||
},
|
||||
{
|
||||
content:"3.超过 2 种功能的,加 10 分。"
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,21 @@ import ActionComponent from "@/views/hiddenDanger/safe/action.component.vue"
|
|||
import HiddenDangerManagerComponent from "@/views/hiddenDanger/manager.component.vue"
|
||||
import HiddenDangerFilesComponent from "@/views/hiddenDanger/files.component.vue"
|
||||
import HiddenDangerClapComponent from "@/views/hiddenDanger/clap.component.vue"
|
||||
import LeadershipStructure from "@/views/workprogress/leader.component.vue"
|
||||
import ManagementSystem from "@/views/workprogress/managementSystem.component.vue"
|
||||
import Programme from "@/views/workprogress/programme.component.vue"
|
||||
import TrainRecords from "@/views/workprogress/trainRecords.component.vue"
|
||||
import RiskCard from "@/views/threecards/riskCard.component.vue"
|
||||
import SafeCard from "@/views/threecards/safeCard.component.vue"
|
||||
import EmergencyCard from "@/views/threecards/emergencyCard.component.vue"
|
||||
import SelfAssessment from '@/views/reward/selfAssessment/selfAssessment.component.vue'
|
||||
import RewardsRecord from '@/views/reward/rewardsRecord/rewardsRecord.component.vue'
|
||||
import IntegralRule from '@/views/integral/rule.component.vue'
|
||||
import IntegralCenter from '@/views/integral/center.component.vue'
|
||||
import IntegralEvent from '@/views/integral/event.component.vue'
|
||||
import IntegralMall from '@/views/integral/mall.component.vue'
|
||||
import IntegralExchange from '@/views/integral/exchange/exchange.component.vue'
|
||||
import IntegralExchangeRecord from '@/views/integral/exchange/exchangeRecord.component.vue'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
const routes: Array<RouteConfig> = [
|
||||
|
|
@ -134,6 +149,94 @@ const routes: Array<RouteConfig> = [
|
|||
path:"clap",
|
||||
component:HiddenDangerClapComponent
|
||||
}]
|
||||
},{
|
||||
path:"work-progress",
|
||||
name:"work-progress",
|
||||
component:BlankComponent,
|
||||
redirect:"work-progress/leader",
|
||||
children:[{
|
||||
name:"leader",
|
||||
path:"leader",
|
||||
component:LeadershipStructure
|
||||
},{
|
||||
name:"management-system",
|
||||
path:"management-system",
|
||||
component:ManagementSystem
|
||||
},{
|
||||
name:"programme",
|
||||
path:"programme",
|
||||
component:Programme
|
||||
},{
|
||||
name:"train-records",
|
||||
path:"train-records",
|
||||
component:TrainRecords
|
||||
|
||||
}]
|
||||
},{
|
||||
path:"three-cards",
|
||||
name:"three-cards",
|
||||
component:BlankComponent,
|
||||
redirect:"three-cards/risk-card",
|
||||
children:[{
|
||||
name:"risk-card",
|
||||
path:"risk-card",
|
||||
component:RiskCard
|
||||
},{
|
||||
name:"safe-card",
|
||||
path:"safe-card",
|
||||
component:SafeCard
|
||||
},{
|
||||
name:"emergency-card",
|
||||
path:"emergency-card",
|
||||
component:EmergencyCard
|
||||
}]
|
||||
},{
|
||||
path:"reward",
|
||||
name:"reward",
|
||||
component:BlankComponent,
|
||||
redirect:"reward/self-assessment",
|
||||
children:[{
|
||||
name:"self-assessment",
|
||||
path:"self-assessment",
|
||||
component:SelfAssessment
|
||||
},{
|
||||
name:"rewards-record",
|
||||
path:"rewards-record",
|
||||
component:RewardsRecord
|
||||
}]
|
||||
},{
|
||||
path:"integral",
|
||||
name:"integral",
|
||||
component:BlankComponent,
|
||||
redirect:"integral/rule",
|
||||
children:[{
|
||||
name:"rule",
|
||||
path:"rule",
|
||||
component:IntegralRule
|
||||
},{
|
||||
name:"center",
|
||||
path:"center",
|
||||
component:IntegralCenter
|
||||
},{
|
||||
name:"event",
|
||||
path:"event",
|
||||
component:IntegralEvent
|
||||
},{
|
||||
name:"mall",
|
||||
path:"mall",
|
||||
component:IntegralMall
|
||||
},{
|
||||
name:"exchange",
|
||||
path:"exchange",
|
||||
component:IntegralExchange
|
||||
},{
|
||||
name:"exchange-record",
|
||||
path:"exchange-record",
|
||||
component:IntegralExchangeRecord
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class EmergencyCardService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/handle/getList';
|
||||
return this.post(url,params)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/handle';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/card/handle';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/card/handle';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/handle/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/handle/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IdentifyCenterService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/user/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/user';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IdentifyEventService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/record/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/record';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IntegralExchangeService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/exchange/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/exchange';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/point/exchange';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/point/exchange';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/exchange/'+params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IntegralExchangeRecordService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/detail/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/detail';
|
||||
return this.deleteBatch(url,params,{},true)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IntegralMallService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/goods/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/goods';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/point/goods';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/point/goods';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/goods/'+params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class IntegralRuleService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/rule/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/rule';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/point/rule';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/point/rule';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/rule/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/point/rule/'+params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class LeaderService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/structure/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/structure/delete';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/process/structure/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/process/structure/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取领导机构编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/structure/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/structure/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class MangementSystemService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/institution/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/institution';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/process/institution';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/process/institution';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取领导机构编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/institution/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/institution/'+params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class ProgrammeService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+ '/process/plan/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/plan';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/process/plan';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/process/plan';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取方案编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/plan/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/plan/'+params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class RewardsRecordService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/record/getList';
|
||||
return this.post(url,params)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/record/delete';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/incentive/record/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/incentive/record/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/record/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class RiskCardService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/notify/getList';
|
||||
return this.post(url,params)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/notify';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/card/notify';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/card/notify';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/notify/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/notify/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class SafeCardService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/promise/getList';
|
||||
return this.post(url,params)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/promise';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/card/promise';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/card/promise';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
//获取编号
|
||||
public getNumber(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/promise/number';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/card/promise/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class SelfAssessmentService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/review/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/review';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/incentive/review';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/incentive/review';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/incentive/review/' + params.id;
|
||||
return this.get(url)
|
||||
}
|
||||
|
||||
public getFileUrls(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.file+'/getSysFiles';
|
||||
return this.get(url,params,false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class TrainRecordsService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/record/list';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/record/delete';
|
||||
return this.deleteBatch(url,params,{},showLoading)
|
||||
}
|
||||
|
||||
// 新增或更新
|
||||
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
|
||||
|
||||
if(add){
|
||||
const url = this.prefix.prevention+'/process/record/add';
|
||||
return this.post(url,params,{},showLoading)
|
||||
}else{
|
||||
const url = this.prefix.prevention+'/process/record/update';
|
||||
return this.put(url,params,{},showLoading)
|
||||
}
|
||||
}
|
||||
|
||||
//查询详情
|
||||
public getListDetail(params:any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/process/record/detail';
|
||||
return this.get(url,params)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import BaseService from "hbt-common/service/base.service"
|
||||
import type { AxiosResponse } from 'axios'
|
||||
import { ActionResult } from "hbt-common/models/actionResult";
|
||||
export default class UserService extends BaseService<any>{
|
||||
constructor(){
|
||||
super()
|
||||
}
|
||||
|
||||
|
||||
public getDetailsByIds(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.system+'/user/' + params.userId;
|
||||
return this.get(url,showLoading)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -31,7 +31,11 @@ export default new Vuex.Store({
|
|||
prevention_task_type:[],
|
||||
prevention_evaluate_status:[],
|
||||
prevention_task_status:[],
|
||||
prevention_hazard_category:[]
|
||||
prevention_hazard_category:[],
|
||||
prevention_training_methods:[],
|
||||
prevention_training_level:[],
|
||||
prevention_integral_eventtype:[],
|
||||
prevention_integral_type:[],
|
||||
},
|
||||
getters: {
|
||||
dept_map:(state)=>{
|
||||
|
|
@ -216,6 +220,34 @@ export default new Vuex.Store({
|
|||
})
|
||||
return map
|
||||
},
|
||||
prevention_training_methods_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_training_methods.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_training_level_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_training_level.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_integral_eventtype_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_integral_eventtype.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
prevention_integral_type_map:(state)=>{
|
||||
const map = {};
|
||||
state.prevention_integral_type.forEach((item:any)=>{
|
||||
map[item.value] = item.name
|
||||
})
|
||||
return map
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
setAnalCntrol(state,data){
|
||||
|
|
@ -300,6 +332,18 @@ export default new Vuex.Store({
|
|||
set_prevention_hazard_category(state,data){
|
||||
state.prevention_hazard_category = data
|
||||
},
|
||||
set_prevention_training_methods(state,data){
|
||||
state.prevention_training_methods = data
|
||||
},
|
||||
set_prevention_training_level(state,data){
|
||||
state.prevention_training_level = data
|
||||
},
|
||||
set_prevention_integral_eventtype(state,data){
|
||||
state.prevention_integral_eventtype = data
|
||||
},
|
||||
set_prevention_integral_type(state,data){
|
||||
state.prevention_integral_type = data
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
},
|
||||
|
|
|
|||
|
|
@ -40,7 +40,13 @@ export default class BlankComponent extends Vue {
|
|||
this.areaService.getAnalControls(),
|
||||
this.systemService.getDictData("prevention_task_status"),
|
||||
this.systemService.getDictData("prevention_hazard_category"),
|
||||
this.systemService.getDictData("prevention_training_level"),
|
||||
this.systemService.getDictData("prevention_training_methods"),
|
||||
|
||||
this.systemService.getDictData("prevention_integral_eventtype"),
|
||||
this.systemService.getDictData("prevention_integral_type"),
|
||||
]).then(((results: any) => {
|
||||
|
||||
this.$store.commit("setDeptTreeList", results[0].data);
|
||||
this.$store.commit("setUserList", results[2].data.datas.map((item) => {
|
||||
return {
|
||||
|
|
@ -196,8 +202,7 @@ export default class BlankComponent extends Vue {
|
|||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
console.log('results[26]',results[26]);
|
||||
|
||||
|
||||
this.$store.commit("set_prevention_hazard_category", results[26].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
|
|
@ -205,6 +210,34 @@ export default class BlankComponent extends Vue {
|
|||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_training_level", results[27].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
this.$store.commit("set_prevention_training_methods", results[28].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_integral_eventtype", results[29].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("set_prevention_integral_type", results[30].data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||
}
|
||||
}))
|
||||
|
||||
this.$store.commit("setDeptList", results[1].data.map((item) => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,191 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralCenterService from "@/service/integralCenter.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralCenter extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralCenterService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public hideOperate = true;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "姓名",
|
||||
key: "userName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
|
||||
|
||||
created() {
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '姓名', key: "userName" });
|
||||
this.tableColumn.push({ name: '部门', key: "deptName", });
|
||||
this.tableColumn.push({ name: '积分值', key: "totalPoints", });
|
||||
this.tableColumn.push({ name: '总计消耗', key: "consumePoints", });
|
||||
this.tableColumn.push({ name: '总计获得', key: "earnPoints", });
|
||||
this.tableColumn.push({ name: '最新变动时间', key: "updateTime", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
if (res.data) {
|
||||
this.tableData = res.data as any;
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="item.imgRender" :label="item.name" :width="item.width" :key="item.key">
|
||||
<template slot-scope="scope">
|
||||
<img :src="item.imgRender(scope.row)" min-width="70" height="70"
|
||||
style="cursor: pointer;" @click="onclickImg(item.imgRender(scope.row))">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!item.render && !item.imgRender" :prop="item.key" :label="item.name"
|
||||
:width="item.width" :key="item.key" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150" v-if="!hideOperate">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showModal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情':updateParams.id ?'编辑': '新增'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
|
||||
width="680px">
|
||||
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
|
||||
<!-- 积分兑换记录 -->
|
||||
<el-dialog :close-on-click-modal="false" :title="'申请信息'" :visible.sync="showSubUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralEventService from "@/service/integralEvent.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralEvent extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralEventService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "姓名",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "时间",
|
||||
key: "date",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
|
||||
|
||||
created() {
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '姓名', key: "userName" });
|
||||
this.tableColumn.push({ name: '部门', key: "deptName", });
|
||||
this.tableColumn.push({ name: '事件名称', key: "riskSource", });
|
||||
this.tableColumn.push({ name: '发生时间', key: "createTime", });
|
||||
this.tableColumn.push({ name: '变动值', key: "point", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="change" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<div class="full" v-if="isExchange">
|
||||
<el-radio-group text-color="#409EFF" fill="transparent" size="medium" v-model="params.type"
|
||||
@change="tabTableChange">
|
||||
<el-radio-button :label="item.value" v-for="item in tabs"
|
||||
:key="item.value">{{item.name}}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<TableComponent style="flex: 1; height: 1px;" :tableData="tableData" :tableColumn="tableColumn"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column v-if="!isAction && !(isManager && params.type>1)" type="selection"
|
||||
:selectable="selectable" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" @click="" v-html="item.render(scope.row)"
|
||||
style="pointer-events: none;" @click="rowCallback($event,scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="">查看</el-button>
|
||||
<el-button type="text" @click="">删除</el-button>
|
||||
<el-button type="text" @click="">作废</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'新增'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" :actions="operate?[]: updateActions" @actionCallback="subCallback"
|
||||
@change="changes" :full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">兑换清单</div>
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="subCallback($event)" :actions="tableActions" actionPosition="flex-start"
|
||||
:showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.pointExchangeDetails" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="">查看</el-button>
|
||||
<el-button type="text" @click="">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
<template v-if="operate">
|
||||
<div class="sub-title">审批</div>
|
||||
<FormComponent :options="approveOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'新增'" :visible.sync="subShowUpdate" width="952px">
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="triCallback" @change="changes" :actions="subUpdateActions" :full-btn="true"
|
||||
btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,479 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from './exchange.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralExchangeService from "@/service/integralExchange.service";
|
||||
import IntegralCenterService from '@/service/integralCenter.service';
|
||||
import IntegralMallService from '@/service/integralMall.service';
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralExchangeService();
|
||||
public userIntegral = new IntegralCenterService();
|
||||
public integralGoodsService = new IntegralMallService()
|
||||
|
||||
public params = {
|
||||
applicantId: null,
|
||||
applicantDeptId: null,
|
||||
type: 2,
|
||||
bpmSchemeCode: "prevention-jfdh"
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public operate = false;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public updateParams = {
|
||||
pointExchangeDetails: []
|
||||
} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public isExchange = true;
|
||||
|
||||
public photoList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
|
||||
public currentUrl = null;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
public goodsList = [] as any;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "申请人",
|
||||
key: "applicantId",
|
||||
type: "select",
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "申请部门",
|
||||
key: "applicantDeptId",
|
||||
type: "treeSelect",
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList,
|
||||
width: "250px"
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "提交",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}]
|
||||
|
||||
public subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
public tabs = [{
|
||||
name: "待办",
|
||||
value: 2
|
||||
}, {
|
||||
name: "已办",
|
||||
value: 3
|
||||
}, {
|
||||
name: "我发起的",
|
||||
value: 4
|
||||
}, {
|
||||
name: "作废",
|
||||
value: 5
|
||||
},
|
||||
]
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
|
||||
public tableActionWidth = "150";
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "申请人",
|
||||
type: "select",
|
||||
key: "applicantId",
|
||||
format: "applicantName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.userList,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "部门",
|
||||
type: "treeSelect",
|
||||
key: "applicantDeptId",
|
||||
format: "applicantDeptName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "我的积分",
|
||||
type: "number",
|
||||
key: "originalPoints",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "本次消耗",
|
||||
type: "number",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "兑换后剩余",
|
||||
type: "number",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
public approveOptions: FormOption<BtnOption>[] = [{
|
||||
name: "审核结果",
|
||||
type: "radio",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "100%",
|
||||
datas: [{
|
||||
name: "同意",
|
||||
value: 1
|
||||
}, {
|
||||
name: "不同意",
|
||||
value: 0
|
||||
}]
|
||||
}, {
|
||||
name: "审批人",
|
||||
type: "text",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "审批时间",
|
||||
type: "date",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
]
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildSubUpdateForm() {
|
||||
// console.log('this.goodsList',this.goodsList);
|
||||
this.subUpdateOptions = [{
|
||||
name: "商品名称",
|
||||
type: "select",
|
||||
key: "goodsId",
|
||||
format: "goodsName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.goodsList
|
||||
},
|
||||
|
||||
{
|
||||
name: "库存",
|
||||
type: "text",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "单价/积分",
|
||||
type: "text",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "兑换数量",
|
||||
type: "number",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
}, {
|
||||
name: "所需积分",
|
||||
type: "text",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
}, {
|
||||
name: "剩余库存",
|
||||
type: "text",
|
||||
key: "registerUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
public getIntegralGoods() {
|
||||
this.integralGoodsService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
console.log('resresres', res);
|
||||
|
||||
this.goodsList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
}
|
||||
});
|
||||
console.log(' this.goodsList', this.goodsList);
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '当前节点', key: "controlName" });
|
||||
this.tableColumn.push({ name: '当前节点', key: "analName", });
|
||||
this.tableColumn.push({ name: '申请人', key: "riskSource", });
|
||||
this.tableColumn.push({ name: '发起时间', key: "seriousResult", });
|
||||
this.tableColumn.push({ name: '兑换清单', key: "riskLevel", });
|
||||
this.tableColumn.push({ name: '消耗积分', key: "measureNum", });
|
||||
this.tableColumn.push({ name: '剩余积分', key: "measureNum", });
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '商品名称', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '库存', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '单位', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '单价', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '兑换数量', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '消耗积分', key: "measureNum", });
|
||||
this.subTableColumn.push({ name: '剩余库存', key: "measureNum", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.operate = false;
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
this.getUserIntegral()
|
||||
}
|
||||
}
|
||||
//获取用户数据
|
||||
public getUserIntegral() {
|
||||
this.userIntegral.selectByPage({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
userId: this.account.userId
|
||||
}).then((res: any) => {
|
||||
console.log('res', res);
|
||||
if (res.code === 200) {
|
||||
const datas = res.data.datas[0]
|
||||
this.updateParams.applicantId = datas.userId
|
||||
this.updateParams.applicantName = datas.userName
|
||||
this.updateParams.applicantDeptId = datas.deptId
|
||||
this.updateParams.applicantDeptName = datas.deptName
|
||||
this.updateParams.originalPoints = datas.totalPoints
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
this.operate = true;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public tabTableChange(type) {
|
||||
this.params.type = type;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data.value === "add") {
|
||||
this.getIntegralGoods()
|
||||
this.buildSubUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
} else if (data.value === "save") {
|
||||
this.doSave()
|
||||
}
|
||||
}
|
||||
|
||||
public doSave() {
|
||||
//
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public doSubSave(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
// 新增
|
||||
if (!this.subUpdateParams.index) {
|
||||
this.subUpdateParams.index = this.updateParams.pointExchangeDetails.length + 1;
|
||||
this.updateParams.pointExchangeDetails.push(this.subUpdateParams);
|
||||
} else {
|
||||
this.updateParams.pointExchangeDetails.splice(this.updateParams.pointExchangeDetails.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = !!goOn;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './exchange.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralExchangeRecordService from "@/service/integralExchangeRecord.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralExchangeRecord extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralExchangeRecordService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public showSubUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}
|
||||
];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "申请人",
|
||||
key: "applicantId",
|
||||
type: "select",
|
||||
datas: this.$store.state.userList
|
||||
}, {
|
||||
name: "部门",
|
||||
key: "applicantDeptId",
|
||||
type: "treeSelect",
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList,
|
||||
width: "250px"
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
// public
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "申请人",
|
||||
type: "text",
|
||||
key: "applicantName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: " 部门",
|
||||
type: "text",
|
||||
key: "applicantDeptName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "我的积分",
|
||||
type: "text",
|
||||
key: "originalPoints",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "申请时间",
|
||||
type: "text",
|
||||
key: "applyTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "本次消耗:",
|
||||
type: "text",
|
||||
key: "consumePoints",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "兑换后剩余",
|
||||
type: "text",
|
||||
key: "residuePoints",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
created() {
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '部门', key: "applicantDeptName" });
|
||||
this.tableColumn.push({ name: '申请人', key: "applicantName", });
|
||||
this.tableColumn.push({ name: '审批人', key: "approvalUserName", });
|
||||
this.tableColumn.push({ name: '申请日期', key: "applyTime", });
|
||||
this.tableColumn.push({ name: '审批时间', key: "approvalTime", });
|
||||
this.tableColumn.push({ name: '兑换清单', key: "goodsNumber", });
|
||||
this.tableColumn.push({ name: '消耗积分', key: "consumePoints", });
|
||||
this.tableColumn.push({ name: '剩余积分', key: "residuePoints", });
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", });
|
||||
this.subTableColumn.push({ name: '商品名称', key: "index", });
|
||||
this.subTableColumn.push({ name: '库存', key: "index", });
|
||||
this.subTableColumn.push({ name: '单位', key: "index", });
|
||||
this.subTableColumn.push({ name: '单价', key: "index", });
|
||||
this.subTableColumn.push({ name: '兑换数量', key: "index", });
|
||||
this.subTableColumn.push({ name: '消耗积分', key: "index", });
|
||||
this.subTableColumn.push({ name: '剩余库存', key: "index", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.buildUpdateForm()
|
||||
this.showSubUpdate = true
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,388 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralMallService from "@/service/integralMall.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralMall extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralMallService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public photoList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "商品号",
|
||||
key: "number",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "商品名",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "商品编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: " 商品名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "库存数量",
|
||||
type: "number",
|
||||
key: "stockNumber",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "单位",
|
||||
type: "text",
|
||||
key: "goodsUnit",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "单价/积分",
|
||||
type: "number",
|
||||
key: "goodsPrice",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
type: "select",
|
||||
key: "status",
|
||||
format: "statusName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: [
|
||||
{
|
||||
name: "可用",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: "冻结",
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "商品照片",
|
||||
key: "resourceId",
|
||||
ref: "photo",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
showError: false,
|
||||
autoUpload: true,
|
||||
onPreview: this.onPreview,
|
||||
accept: "image/png, image/jpeg",
|
||||
listType: "picture-card",
|
||||
fileList: this.photoList,
|
||||
icon: "el-icon-plus",
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '商品号', key: "number" });
|
||||
this.tableColumn.push({ name: '商品名', key: "name", });
|
||||
this.tableColumn.push({ name: '库存', key: "stockNumber", });
|
||||
this.tableColumn.push({ name: '单位', key: "goodsUnit", });
|
||||
this.tableColumn.push({
|
||||
name: '商品照片', key: "resourceUrl", imgRender: (data) => {
|
||||
if (data.resourceUrl) {
|
||||
return data.resourceUrl
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '单价/积分', key: "goodsPrice", });
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", render: (data) => {
|
||||
if (data.status === 1) {
|
||||
return `<span class="color_1">${'可用'}</span>`
|
||||
} else if (data.status === 0) {
|
||||
return `<span class="color_0">${'冻结'}</span>`
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.updateParams = {} as any;
|
||||
this.isReadonly = false;
|
||||
this.photoList = [] as any;
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
if (res.data) {
|
||||
this.tableData = res.data as any;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.photoList = [{
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
}]
|
||||
this.updateParams.resourceId = this.photoList.length || null;
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.photoList.splice(this.photoList.findIndex(item => item.id === file.id), 1)
|
||||
this.updateParams.resourceId = this.photoList.length || null;
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
if (this.photoList.length > 0) {
|
||||
let resourceId = this.photoList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
|
||||
let resourceName = this.photoList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(";")
|
||||
this.updateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = Object.assign({
|
||||
statusName: res.data.status === 0 ? '冻结' : res.data.status === 1 ? '可用' : "",
|
||||
}, res.data)
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId }).then((files: any) => {
|
||||
this.photoList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.updateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public onclickImg(data) {
|
||||
this.currentUrl = data
|
||||
this.showFile = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import IntegralRuleService from "@/service/integralRule.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class IntegralRule extends BaseRecordComponent<any> {
|
||||
public tableService = new IntegralRuleService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "规则名称",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "规则编码",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "规则类型",
|
||||
type: "select",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.prevention_integral_type
|
||||
},
|
||||
{
|
||||
name: "规则描述",
|
||||
type: "textarea",
|
||||
key: "description",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
{
|
||||
name: "事件",
|
||||
type: "select",
|
||||
key: "eventType",
|
||||
format: "eventTypeName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_integral_eventtype
|
||||
},
|
||||
{
|
||||
name: "分值",
|
||||
type: "number",
|
||||
key: "point",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "状态",
|
||||
type: "radio",
|
||||
key: "status",
|
||||
format: "statusName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: [{
|
||||
name: "开启",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
name: "关闭",
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '规则编号', key: "number" });
|
||||
this.tableColumn.push({
|
||||
name: '事件', key: "eventType", render: (data) => {
|
||||
return this.$store.getters.prevention_integral_eventtype_map[data.eventType]
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '规则说明', key: "description", });
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", render: (data) => {
|
||||
if (data.status === 0) {
|
||||
return "<span class='color_0'>" + ('关闭') + "</span>"
|
||||
} else if (data.status === 1) {
|
||||
return "<span class='color_1'>" + ('开启') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '类型', key: "type", render: (data) => {
|
||||
return this.$store.getters.prevention_integral_type_map[data.type]
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '分值', key: "point", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.isReadonly = false;
|
||||
this.updateParams = {} as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
//获取编号
|
||||
public getNumber() {
|
||||
console.log('1111111');
|
||||
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.showUpdate === false) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
if (res.data) {
|
||||
this.tableData = res.data as any;
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = Object.assign({
|
||||
typeName: this.$store.getters.prevention_integral_type_map[res.data.type],
|
||||
eventTypeName: this.$store.getters.prevention_integral_eventtype_map[res.data.eventType],
|
||||
statusName: res.data.status === 0 ? '关闭' : res.data.status === 1 ? '开启' : "",
|
||||
}, res.data)
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showModal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情': updateParams.id ?'编辑': '新增'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">奖惩记录</div>
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="subCallback($event)" :actions="isReadonly ? [] :tableActions"
|
||||
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.details" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubModal(scope.row,true)">查看</el-button>
|
||||
<el-button v-if="!isReadonly" type="text" @click="showSubModal(scope.row)">修改</el-button>
|
||||
<el-button v-if="!isReadonly" type="text"
|
||||
@click="deleteSubData([scope.row.index - 1])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||
width="952px">
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="triCallback" @change="subChanges" :isReadonly="subIsReadonly" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,485 @@
|
|||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './rewardsRecord.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import RewardsRecordService from "@/service/rewardsRecord.service";
|
||||
import UserService from '@/service/user.service'
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class RewardsRecord extends BaseRecordComponent<any> {
|
||||
public tableService = new RewardsRecordService();
|
||||
public userService = new UserService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {
|
||||
details: []
|
||||
} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
public subSelectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
|
||||
public fileList2 = [] as any;
|
||||
public photoList2 = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "姓名",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "岗位",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "职务",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public rewardsType = [{
|
||||
name: "不涉及",
|
||||
value: 1,
|
||||
}, {
|
||||
name: "奖励",
|
||||
value: 2,
|
||||
}, {
|
||||
name: "惩罚",
|
||||
value: 3,
|
||||
},]
|
||||
|
||||
public rewardsTypeName = {
|
||||
1: '不涉及',
|
||||
2: "奖励",
|
||||
3: "惩罚",
|
||||
}
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "姓名",
|
||||
type: "select",
|
||||
key: "userId",
|
||||
format: "userName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList
|
||||
},
|
||||
{
|
||||
name: "工号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "岗位:",
|
||||
type: "text",
|
||||
key: "postName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "职务",
|
||||
type: "text",
|
||||
key: "dutyName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
];
|
||||
this.subUpdateOptions = [{
|
||||
name: "奖惩日期",
|
||||
type: "date",
|
||||
key: "recordTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd",
|
||||
}, {
|
||||
name: "类型",
|
||||
type: "select",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.rewardsType
|
||||
}, {
|
||||
name: "发生金额/¥",
|
||||
type: "number",
|
||||
key: "money",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "奖惩事由",
|
||||
type: "textarea",
|
||||
key: "reason",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "实施人",
|
||||
type: "select",
|
||||
key: "operatorId",
|
||||
format: "operatorName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
}, {
|
||||
name: "实施部门",
|
||||
type: "treeSelect",
|
||||
key: "operateDeptId",
|
||||
format: "operateDeptName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
if (item && item.key === 'userId') {
|
||||
this.userService.getDetailsByIds({ userId: data }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
const postName = res.posts.map((item) => item.postName).join(",")
|
||||
this.updateParams.userName = res.data.nickName
|
||||
this.updateParams.postName = postName
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '姓名', key: "userName", });
|
||||
this.tableColumn.push({ name: '工号', key: "number", });
|
||||
this.tableColumn.push({ name: '职务', key: "dutyName", });
|
||||
this.tableColumn.push({ name: '岗位', key: "postName", });
|
||||
this.tableColumn.push({
|
||||
name: '奖惩记录', key: "counts", render: (data) => {
|
||||
return "<span class='color_2'>" + (data.counts) + "</span>" + '(' + "<span class='color_1'>" + (data.rewards) + "</span>" + ' / ' + "<span class='color_0'>" + (data.punishs) + "</span>" + ')'
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '最近更新时间', key: "updateTime", });
|
||||
this.tableColumn.push({ name: '最新变动', key: "latestDetailReason" });
|
||||
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", width: "80px" });
|
||||
this.subTableColumn.push({ name: '奖惩日期', key: "recordTime", });
|
||||
this.subTableColumn.push({
|
||||
name: '类型', key: "type", render: (data) => {
|
||||
if (data.type === 1) {
|
||||
return '不涉及'
|
||||
} else if (data.type === 2) {
|
||||
return '奖励'
|
||||
} else if (data.type === 3) {
|
||||
return '惩罚'
|
||||
}
|
||||
}
|
||||
});
|
||||
this.subTableColumn.push({ name: '事由', key: "reason", });
|
||||
this.subTableColumn.push({ name: '发生金额/¥', key: "money" });
|
||||
this.subTableColumn.push({ name: '实施人', key: "operatorName", });
|
||||
this.subTableColumn.push({ name: '实施部门', key: "operateDeptName", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.isReadonly = false;
|
||||
this.subIsReadonly = false;
|
||||
this.updateParams = { details: [] } as any;
|
||||
this.buildUpdateForm();
|
||||
this.showUpdate = true
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
public handleSubSelectionChange(data) {
|
||||
this.subSelectData = data;
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
this.subIsReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = res.data
|
||||
this.updateParams.details.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "add") {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = false;
|
||||
this.subShowUpdate = true
|
||||
} else if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === 'delete') {
|
||||
// 批量删除步骤
|
||||
this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
|
||||
}
|
||||
}
|
||||
public doSave(goOn?) {
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {
|
||||
details: [],
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSubSave(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
// 新增
|
||||
this.subUpdateParams.operatorName = this.$store.getters.user_map[this.subUpdateParams.operatorId]
|
||||
this.subUpdateParams.operateDeptName = this.$store.getters.dept_map[this.subUpdateParams.operateDeptId]
|
||||
if (!this.subUpdateParams.index) {
|
||||
this.subUpdateParams.index = this.updateParams.details.length + 1;
|
||||
this.updateParams.details.push(this.subUpdateParams);
|
||||
} else {
|
||||
this.updateParams.details.splice(this.updateParams.details.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = !!goOn;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//查看或者修改
|
||||
public showSubModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
this.subUpdateParams = Object.assign({
|
||||
typeName: this.rewardsTypeName[row.type]
|
||||
}, row)
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
this.subUpdateParams = row
|
||||
}
|
||||
this.subShowUpdate = true
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
//删除成员
|
||||
public deleteSubData(indexs) {
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
for (let i = this.updateParams.details.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
this.updateParams.details.splice(i, 1)
|
||||
}
|
||||
}
|
||||
this.updateParams.details.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
}).catch(() => {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<template>
|
||||
<div style="display: flex;width: auto;">
|
||||
<div class="total-title">总分</div>
|
||||
<div class="total-content">{{total}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<TableComponent :tableData="estimateStandard" :tableColumn="subTableColumn"
|
||||
@actionCallback="subCallback($event)" actionPosition="flex-start" :showFooter="false"
|
||||
style="margin-bottom: 20px;height: 600px;overflow: hidden;overflow-y: auto;padding-bottom: 20px;">
|
||||
<el-checkbox-group v-model="checkReject" @change="selectRadio">
|
||||
<template v-for="items in estimateStandard">
|
||||
<div class="sub-table-title">{{items.title}}
|
||||
<div style="float: right;padding-right: 20px;">
|
||||
<el-checkbox :disabled="isReadonly" class="check-reject" :label="items.key"
|
||||
v-model="items.key">否决项</el-checkbox>
|
||||
<span style="font-size: 14px;padding-left: 5px;">得分:{{items.score}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="multipleTable" :data="items.tableData" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%"
|
||||
@cell-click="cellClick">
|
||||
<el-table-column label="B级要素">
|
||||
<div slot-scope="scope">{{scope.row.gradeB}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deductPoints" label="扣分" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-popover popper-class="standard-content" trigger="click" placement="left"
|
||||
width="300">
|
||||
<div class="standard-content-title">{{scope.row.gradeB}}</div>
|
||||
<template v-for="standard in StandardDetails[scope.row.key].standard">
|
||||
<div v-if="standard.key === 'reject'"
|
||||
class="standard-content-item-reject-title">{{standard.title}}</div>
|
||||
<div v-else class="standard-content-item-title">{{standard.title}}</div>
|
||||
<div class="standard-content-item-content">
|
||||
<template v-for="content in standard.content">
|
||||
<div class="standard-item-title">{{content.title}}</div>
|
||||
<div v-if="standard.key === 'reject'"
|
||||
class="standard-item-reject-content">{{content.content}}</div>
|
||||
<div v-else class="standard-item-content">{{content.content}}</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <p>{{scope.row.standard}}</p> -->
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-input size="mini" type="number" min="0" v-model="scope.row.deductPoints"
|
||||
v-if="scope.row.pointFlag" @blur="inputClick(scope.row)" v-focus
|
||||
@input="pointInput($event,scope.row,items)"></el-input>
|
||||
<span v-if="!scope.row.pointFlag">{{scope.row.deductPoints}}</span>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="得分" :show-overflow-tooltip="true">
|
||||
<div slot-scope="scope" style="color: #919399;">{{scope.row.getPoints}}</div>
|
||||
</el-table-column>
|
||||
<el-table-column prop="record" label="评估记录" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input size="mini" type="textarea" placeholder="点击输入评估记录" v-model="scope.row.record"
|
||||
v-if="scope.row.recordFlag" @blur="inputClick(scope.row)" v-focus></el-input>
|
||||
<span
|
||||
style="font-size: 14px;font-weight: 400;color: rgba(0,0,0,0.3) ;line-height: 20px;"
|
||||
v-if="!scope.row.recordFlag && !scope.row.record">{{'点击输入评估记录'}}</span>
|
||||
<span v-if="!scope.row.recordFlag &&scope.row.record ">
|
||||
{{scope.row.record}}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-checkbox-group>
|
||||
</TableComponent>
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="subCallback" @change="changes" :isReadonly="isReadonly" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
|
||||
width="680px">
|
||||
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,628 @@
|
|||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './selfAssessment.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import SelfAssessmentService from "@/service/selfAssessment.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
import Standard from '@/mock/selfAssessment';
|
||||
import StandardContent from '@/mock/standard';
|
||||
import moment from "moment";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class SelfAssessment extends BaseRecordComponent<any> {
|
||||
public tableService = new SelfAssessmentService();
|
||||
|
||||
public params = {
|
||||
reviewerId: null,
|
||||
reviewerTime: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public estimateStandard = [] as any;
|
||||
|
||||
public account = JSON.parse(localStorage.getItem("account") as any);
|
||||
|
||||
|
||||
public updateParams = {
|
||||
reviewerId: this.account.userId,
|
||||
reviewTime: moment().format('YYYY-MM-DD'),
|
||||
} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
//否决项
|
||||
public checkReject = [] as any;
|
||||
|
||||
public clickPointFlag = false;
|
||||
|
||||
public StandardDetails = {} as any;
|
||||
|
||||
//总分
|
||||
public total = 0;
|
||||
|
||||
|
||||
public paramTable = [{
|
||||
factorLevel: 1,
|
||||
flag: false
|
||||
}, {
|
||||
factorLevel: 2,
|
||||
flag: false
|
||||
}, {
|
||||
factorLevel: 3,
|
||||
flag: false
|
||||
}]
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "评审时间",
|
||||
key: "reviewerId",
|
||||
type: "date",
|
||||
format: "yyyy-MM-dd",
|
||||
}, {
|
||||
name: "评审人",
|
||||
key: "reviewerId",
|
||||
type: "select",
|
||||
datas: this.$store.state.userList
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "线下评审记录",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "点击上传附件",
|
||||
value: "upload",
|
||||
hide: this.isReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
}, {
|
||||
name: "成效水平",
|
||||
type: "text",
|
||||
key: "level",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "评审人",
|
||||
type: "select",
|
||||
key: "reviewerId",
|
||||
format: "reviewerName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
}, {
|
||||
name: "评审时间",
|
||||
type: "date",
|
||||
key: "reviewTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},]
|
||||
}
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '评审时间', key: "reviewTime", });
|
||||
this.tableColumn.push({ name: '评审人', key: "reviewerName", });
|
||||
this.tableColumn.push({ name: '扣分', key: "deductPoints", });
|
||||
this.tableColumn.push({ name: '得分', key: "scorePoints", });
|
||||
this.tableColumn.push({ name: '线下评审记录', key: "resourceName", });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.buildUpdateForm()
|
||||
this.estimateStandard = [] as any;
|
||||
this.checkReject = [] as any;
|
||||
this.total = 0;
|
||||
this.updateParams = {
|
||||
reviewerId: this.account.userId,
|
||||
reviewTime: moment().format('YYYY-MM-DD'),
|
||||
} as any;
|
||||
const tmpStandard = JSON.parse(JSON.stringify(Standard))
|
||||
this.estimateStandard = tmpStandard
|
||||
const tmpStandardContent = JSON.parse(JSON.stringify(StandardContent))
|
||||
this.StandardDetails = tmpStandardContent
|
||||
this.showUpdate = true
|
||||
this.isReadonly = false
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(";")
|
||||
this.updateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
let tmpContent = {} as any;
|
||||
tmpContent.content = this.estimateStandard;
|
||||
tmpContent.checkReject = this.checkReject;
|
||||
tmpContent.total = this.total;
|
||||
tmpContent.level = this.updateParams.level;
|
||||
this.updateParams.content = JSON.stringify(tmpContent)
|
||||
this.updateParams.scorePoints = this.total
|
||||
this.updateParams.deductPoints = 110 - this.total
|
||||
this.updateParams.reviewerName = this.$store.getters.user_map[this.updateParams.reviewerId]
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
//保存清空
|
||||
this.estimateStandard = [] as any;
|
||||
this.checkReject = [] as any;
|
||||
this.total = 0;
|
||||
this.updateParams = {
|
||||
reviewerId: this.account.userId,
|
||||
reviewTime: moment().format('YYYY-MM-DD'),
|
||||
} as any;
|
||||
const tmpStandard = JSON.parse(JSON.stringify(Standard))
|
||||
this.estimateStandard = tmpStandard
|
||||
const tmpStandardContent = JSON.parse(JSON.stringify(StandardContent))
|
||||
this.StandardDetails = tmpStandardContent
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = res.data
|
||||
const tmpContent = JSON.parse(this.updateParams.content)
|
||||
this.estimateStandard = tmpContent.content
|
||||
this.total = tmpContent.total
|
||||
this.checkReject = tmpContent.checkReject
|
||||
this.updateParams.level = tmpContent.level
|
||||
const tmpStandardContent = JSON.parse(JSON.stringify(StandardContent))
|
||||
this.StandardDetails = tmpStandardContent
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.updateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public selectRadio(e) {
|
||||
if (e.length > 0) {
|
||||
this.total = 0
|
||||
}
|
||||
const level = this.compareLevel(0)
|
||||
this.updateParams.level = level
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
public cellClick(row, column) {
|
||||
if (this.isReadonly === false) {
|
||||
if (column.label === '扣分') {
|
||||
row.pointFlag = true
|
||||
this.clickPointFlag = true
|
||||
} else if (column.label === '评估记录') {
|
||||
row.recordFlag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
//input框失去焦点事件
|
||||
public inputClick(row) {
|
||||
if (row.pointFlag === true) {
|
||||
row.pointFlag = false
|
||||
this.clickPointFlag = false
|
||||
} else if (row.recordFlag === true) {
|
||||
row.recordFlag = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public pointInput(data, row, items) {
|
||||
if (data || data === 0) {
|
||||
let points = row.score - data
|
||||
row.getPoints = points > 0 ? points : 0
|
||||
let itemScore = 0
|
||||
items.tableData.forEach(item => {
|
||||
if (item.getPoints !== '--') {
|
||||
itemScore = itemScore + item.getPoints
|
||||
}
|
||||
})
|
||||
items.score = itemScore
|
||||
let totalScore = 0
|
||||
if (this.checkReject.length === 0) {
|
||||
this.estimateStandard.forEach(item => {
|
||||
totalScore = totalScore + item.score
|
||||
})
|
||||
}
|
||||
this.total = totalScore
|
||||
} else {
|
||||
items.score = items.score - row.getPoints
|
||||
let totalScore = 0
|
||||
if (this.checkReject.length === 0) {
|
||||
this.estimateStandard.forEach(item => {
|
||||
totalScore = totalScore + item.score
|
||||
})
|
||||
}
|
||||
this.total = totalScore
|
||||
row.deductPoints = '--'
|
||||
row.getPoints = '--'
|
||||
}
|
||||
const level = this.compareLevel(this.total)
|
||||
this.updateParams.level = level
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
//成效shuip
|
||||
public compareLevel(score) {
|
||||
if (this.checkReject.length > 0) {
|
||||
return '不合格'
|
||||
} else {
|
||||
if (score < 70) {
|
||||
return '不合格'
|
||||
} else if (score < 80) {
|
||||
return '合格'
|
||||
} else if (score < 90) {
|
||||
return '良好'
|
||||
} else if (score >= 90) {
|
||||
return '优秀'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep {
|
||||
.check-reject {
|
||||
|
||||
.el-checkbox__input.is-checked .el-checkbox__inner,
|
||||
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
||||
background-color: #F56C6C;
|
||||
border-color: #F56C6C;
|
||||
|
||||
}
|
||||
|
||||
.el-checkbox__inner {
|
||||
border-color: #F56C6C;
|
||||
}
|
||||
|
||||
.el-checkbox__inner:hover {
|
||||
border-color: #F56C6C;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-checked+.el-checkbox__label {
|
||||
color: #F56C6C;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-focus .el-checkbox__inner {
|
||||
border-color: #F56C6C;
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
color: #F56C6C;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.total-title {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
background: #F7F7F7;
|
||||
border-radius: 4px 0px 0px 4px;
|
||||
border: 1px solid #E6E6E6;
|
||||
line-height: 56px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.total-content {
|
||||
width: 159px;
|
||||
height: 56px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0px 4px 4px 0px;
|
||||
border: 1px solid #E6E6E6;
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #409EFF;
|
||||
line-height: 56px;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.el-popover.standard-content {
|
||||
width: 400px !important;
|
||||
background: #000000 !important;
|
||||
border-radius: 4px !important;
|
||||
opacity: 0.8 !important;
|
||||
color: #fff;
|
||||
padding: 20px;
|
||||
letter-spacing: 2px;
|
||||
|
||||
.standard-content-title {
|
||||
height: 22px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
line-height: 22px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.standard-content-item-title {
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
line-height: 20px;
|
||||
border-left: 5px solid #FFF;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.standard-content-item-content {
|
||||
background: #000000;
|
||||
border-radius: 4px;
|
||||
opacity: 0.8;
|
||||
padding-bottom: 24px;
|
||||
|
||||
.standard-item-title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
line-height: 22px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.standard-item-content {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
line-height: 22px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.standard-item-reject-content {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #F56C6C;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.standard-content-item-reject-title {
|
||||
height: 20px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #F56C6C;
|
||||
line-height: 20px;
|
||||
border-left: 5px solid #F56C6C;
|
||||
padding-left: 14px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -101,7 +101,6 @@
|
|||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showModal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'新增'" :visible.sync="showUpdate" width="952px"
|
||||
:before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly">
|
||||
</FormComponent>
|
||||
<div class="sub-title">处置步骤</div>
|
||||
<el-form class="step-form" v-if="!isReadonly" :model="setpsOptions" ref="setpsOptions" label-width="100px">
|
||||
<el-form-item v-for="(domain, index) in setpsOptions" :key="domain.key" :rules="{
|
||||
required: true, message: '不能为空', trigger: 'blur'
|
||||
}">
|
||||
<div class="form-group-name">
|
||||
<span class="form-label">步骤名称</span>
|
||||
<el-input v-model="domain.name" placeholder="步骤名称" width="110px"></el-input>
|
||||
|
||||
</div>
|
||||
<i v-if="index!==0" class="el-icon-error" @click.prevent="deleteSteps(domain)"></i>
|
||||
<i class="el-icon-circle-plus" @click.prevent="addSteps(domain)"></i>
|
||||
<div class="form-group-step">
|
||||
<span class="form-label">处置步骤 </span>
|
||||
<el-input class="form-content" type="textarea" v-model="domain.description"
|
||||
placeholder="请输入处置步骤"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="step-form" v-else>
|
||||
<template v-for="(domain, index) in setpsOptions">
|
||||
<div class="form-group">
|
||||
<span class="form-label">步骤名称</span>
|
||||
<span class="form-content">{{domain.name}}</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span class="form-label">处置步骤 </span>
|
||||
<span class="form-content">{{domain.description}}</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<FormComponent :options="updateStepsOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||
width="952px">
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="triCallback" :isReadonly="subIsReadonly" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close width="680px">
|
||||
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,650 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import emergencyCardService from "@/service/emergencyCard.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
import AreaService from '@/service/area.service';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class EmergencyCard extends BaseRecordComponent<any> {
|
||||
public tableService = new emergencyCardService();
|
||||
public areaService = new AreaService();
|
||||
|
||||
public params = {
|
||||
areaName: null,
|
||||
accidentRisk: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public areaList = [] as any;
|
||||
|
||||
public subUpdateParams = { index: null } as any;
|
||||
|
||||
public fileList = [] as any;
|
||||
public photoList = [] as any;
|
||||
|
||||
public fileList2 = [] as any;
|
||||
public photoList2 = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "事故风险",
|
||||
key: "accidentRisk",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public updateStepsOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "处置卡编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "处置卡名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "区域名称",
|
||||
type: "select",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.areaList
|
||||
},
|
||||
{
|
||||
name: "岗位名称",
|
||||
type: "select",
|
||||
key: "postCode",
|
||||
format: "postName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
datas: this.$store.state.postList
|
||||
},
|
||||
{
|
||||
name: "发生场所",
|
||||
type: "text",
|
||||
key: "occurPlace",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "事故风险",
|
||||
type: "text",
|
||||
key: "accidentRisk",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "工艺说明",
|
||||
type: "text",
|
||||
key: "technologyDescription",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "事故特征",
|
||||
type: "text",
|
||||
key: "accidentFeature",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "危害描述",
|
||||
type: "text",
|
||||
key: "harmDescription",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "注意事项",
|
||||
type: "text",
|
||||
key: "attention",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
},
|
||||
{
|
||||
name: "处置步骤说明",
|
||||
type: "textarea",
|
||||
key: "content",
|
||||
require: true,
|
||||
width: "100%",
|
||||
},
|
||||
];
|
||||
|
||||
this.updateStepsOptions = [{
|
||||
name: "主要负责人",
|
||||
type: "select",
|
||||
key: "chargeUserId",
|
||||
format: "chargeUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "联系方式",
|
||||
type: "text",
|
||||
key: "chargeUserPhone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "消防联络方式",
|
||||
type: "text",
|
||||
key: "fireControlPhone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "应急联络方式",
|
||||
type: "text",
|
||||
key: "emergencyPhone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "100%",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "上传",
|
||||
value: "upload",
|
||||
hide: this.isReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
},
|
||||
];
|
||||
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public setpsOptions = [] as any;
|
||||
public setpsOptionsForm() {
|
||||
this.setpsOptions = [{
|
||||
key: 1,
|
||||
index: 1,
|
||||
name: '',
|
||||
description: ''
|
||||
},]
|
||||
}
|
||||
|
||||
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '处置卡名称', key: "name" });
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName" });
|
||||
this.tableColumn.push({ name: '岗位', key: "postName" });
|
||||
this.tableColumn.push({ name: '发生场所', key: "occurPlace" });
|
||||
this.tableColumn.push({ name: '事故特征', key: "accidentFeature" });
|
||||
this.tableColumn.push({ name: '事故风险', key: "accidentRisk" });
|
||||
this.tableColumn.push({ name: '危害描述', key: "harmDescription" });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.setpsOptions = [] as any;
|
||||
this.setpsOptionsForm()
|
||||
|
||||
this.isReadonly = false;
|
||||
this.updateParams = {} as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
|
||||
//获取编号
|
||||
public getNumber() {
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.showUpdate) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public deleteSteps(data) {
|
||||
this.setpsOptions.splice(this.setpsOptions.findIndex(item => item.key === data.key), 1)
|
||||
|
||||
}
|
||||
|
||||
public addSteps(data) {
|
||||
let stepsParam = {
|
||||
name: '',
|
||||
description: ''
|
||||
} as any;
|
||||
|
||||
stepsParam.key = this.setpsOptions.length + 1
|
||||
stepsParam.index = this.setpsOptions.length + 1
|
||||
this.setpsOptions.push(stepsParam)
|
||||
}
|
||||
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(";")
|
||||
this.updateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
this.updateParams.postName = this.$store.getters.post_map[this.updateParams.postCode]
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId]
|
||||
this.updateParams.step = JSON.stringify(this.setpsOptions)
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
}
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = res.data
|
||||
this.setpsOptions = JSON.parse(res.data.step)
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.updateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
<style lang="scss" scoped >
|
||||
::v-deep {
|
||||
.step-form {
|
||||
max-height: 280px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 0px !important;
|
||||
|
||||
.form-group-name {
|
||||
width: calc(50% - 20px);
|
||||
display: inline-flex;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
.form-label {
|
||||
width: 110px;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
flex: none;
|
||||
height: 40px;
|
||||
align-self: flex-start;
|
||||
line-height: 40px;
|
||||
margin-right: 15px
|
||||
}
|
||||
|
||||
.form-content {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: calc(50% - 20px);
|
||||
|
||||
}
|
||||
|
||||
.el-icon-error {
|
||||
color: #F56C6C;
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.el-icon-error:hover {
|
||||
color: #fd8080;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.el-icon-circle-plus {
|
||||
color: #409EFF;
|
||||
float: right;
|
||||
margin-right: 5px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.el-icon-circle-plus:hover {
|
||||
color: #66b1ff;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.form-group-step {
|
||||
width: calc(100% - 20px);
|
||||
display: inline-flex;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.form-label {
|
||||
width: 110px;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
flex: none;
|
||||
height: 40px;
|
||||
align-self: flex-start;
|
||||
line-height: 40px;
|
||||
margin-right: 15px
|
||||
}
|
||||
|
||||
.form-content {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-textarea {
|
||||
position: relative;
|
||||
vertical-align: bottom;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.form-group {
|
||||
display: inline-flex;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
width: calc(100% - 20px);
|
||||
|
||||
.form-label {
|
||||
width: 110px;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
flex: none;
|
||||
height: 40px;
|
||||
align-self: flex-start;
|
||||
line-height: 40px;
|
||||
margin-right: 15px
|
||||
}
|
||||
|
||||
.form-content {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,530 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import riskCardService from "@/service/riskCard.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
import UnitService from '@/service/unit.service';
|
||||
import AreaService from '@/service/area.service';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class RiskCard extends BaseRecordComponent<any> {
|
||||
public tableService = new riskCardService();
|
||||
public unitService = new UnitService();
|
||||
public areaService = new AreaService();
|
||||
|
||||
public params = {
|
||||
areaName: null,
|
||||
riskLevel: null,
|
||||
postCode: null
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public areaList = [] as any;
|
||||
|
||||
public unitList = [] as any;
|
||||
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "areaName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "riskLevel",
|
||||
type: "select",
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
}, {
|
||||
name: "岗位名称",
|
||||
type: "treeSelect",
|
||||
key: "postCode",
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList,
|
||||
width: "270px",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "风险告知卡编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "区域名称",
|
||||
type: "select",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
},
|
||||
{
|
||||
name: "单元名称",
|
||||
type: "select",
|
||||
key: "unitId",
|
||||
format: "unitName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.unitList
|
||||
},
|
||||
{
|
||||
name: "岗位名称",
|
||||
type: "select",
|
||||
key: "postCode",
|
||||
format: "postName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.postList
|
||||
},
|
||||
{
|
||||
name: "危险有害因素",
|
||||
type: "textarea",
|
||||
key: "harmfulFactors",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "事故风险与后果",
|
||||
type: "textarea",
|
||||
key: "riskResult",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "风险等级",
|
||||
type: "select",
|
||||
key: "riskLevel",
|
||||
format: "riskLevelName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
},
|
||||
{
|
||||
name: "安全标志",
|
||||
type: "select",
|
||||
key: "safetySign",
|
||||
format: "safetySignName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_security_identifier,
|
||||
filterable: true,
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
name: "风险管控措施",
|
||||
type: "textarea",
|
||||
key: "riskControlMeasure",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "应急处置措施",
|
||||
type: "textarea",
|
||||
key: "emergencyHandleMeasure",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "100%",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.subIsReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "点击上传附件",
|
||||
value: "upload",
|
||||
hide: this.subIsReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
|
||||
created() {
|
||||
}
|
||||
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.unitList = [];
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(id?) {
|
||||
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
||||
this.unitList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
deptId: item.chargeDeptId,
|
||||
userId: item.chargeUserId,
|
||||
deptName: item.chargeDeptName,
|
||||
userName: item.chargeUserName,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
if (item && item.key === "areaId") {
|
||||
if (this.subUpdateParams.unitId) {
|
||||
this.subUpdateParams.unitId = null;
|
||||
}
|
||||
const areaData = this.areaList.find((itm: any) => itm.value === data) as any;
|
||||
this.subUpdateParams.areaName = areaData.name
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
|
||||
//单元
|
||||
if (item && item.key === 'unitId') {
|
||||
const unitData = this.unitList.find((itm: any) => itm.value === data) as any;
|
||||
this.subUpdateParams.unitName = unitData.name;
|
||||
}
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", });
|
||||
this.tableColumn.push({ name: '单元名称', key: "unitName", });
|
||||
this.tableColumn.push({ name: '岗位名称', key: "postName", });
|
||||
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
|
||||
this.tableColumn.push({
|
||||
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||
if (data.riskLevel) {
|
||||
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '事故风险与后果', key: "riskResult", });
|
||||
this.tableColumn.push({
|
||||
name: '安全警示标志', key: "safetySign", render: (data) => {
|
||||
if (data.safetySign) {
|
||||
return data.safetySign.split(";").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = false;
|
||||
this.fileList = [] as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
|
||||
//获取编号
|
||||
public getNumber() {
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.subShowUpdate) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.subUpdateParams.resourceId = resourceId.join(";")
|
||||
this.subUpdateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode]
|
||||
this.subUpdateParams.safetySign = this.subUpdateParams.safetySign.join(";")
|
||||
this.tableService.addOrUpdate(this.subUpdateParams, this.subUpdateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.subUpdateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams = Object.assign({
|
||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
||||
safetySignName: res.data.safetySign.split(";").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";")
|
||||
}, res.data)
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.subUpdateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
if (!isReadonly) {
|
||||
this.subUpdateParams.safetySign = this.stringChangeArray(res.data.safetySign)
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//字符串转数组
|
||||
public stringChangeArray(data) {
|
||||
if (data) {
|
||||
return data.split(";").map((item) => parseInt(item))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,449 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component, Watch } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import safeCardService from "@/service/safeCard.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
import AreaService from '@/service/area.service';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class SafeCard extends BaseRecordComponent<any> {
|
||||
public tableService = new safeCardService();
|
||||
public areaService = new AreaService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public areaList = [] as any;
|
||||
|
||||
public unitList = [] as any;
|
||||
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "区域名称",
|
||||
key: "controlName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "承诺人",
|
||||
key: "analName",
|
||||
type: "text",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "承诺卡编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "区域名称",
|
||||
type: "select",
|
||||
key: "areaId",
|
||||
format: "areaName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
},
|
||||
{
|
||||
name: "岗位名称",
|
||||
type: "select",
|
||||
key: "postCode",
|
||||
format: "postName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.postList
|
||||
},
|
||||
{
|
||||
name: "承诺人",
|
||||
type: "select",
|
||||
key: "promiserId",
|
||||
format: "promiserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "上级领导",
|
||||
type: "select",
|
||||
key: "leaderId",
|
||||
format: "leaderName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "承诺人联系方式",
|
||||
type: "text",
|
||||
key: "promiserPhone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "承诺事项",
|
||||
type: "textarea",
|
||||
key: "content",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.subIsReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "点击上传附件",
|
||||
value: "upload",
|
||||
hide: this.subIsReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
}, {
|
||||
name: "承诺时间",
|
||||
type: "date",
|
||||
key: "promiseTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd",
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@Watch("$store.state.deptList", { immediate: true, deep: true })
|
||||
onChanges() {
|
||||
this.loadAreaData()
|
||||
}
|
||||
|
||||
created() {
|
||||
}
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.id,
|
||||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '区域名称', key: "areaName", });
|
||||
this.tableColumn.push({ name: '承诺人', key: "promiserName", });
|
||||
this.tableColumn.push({ name: '岗位', key: "postName", });
|
||||
this.tableColumn.push({ name: '承诺事项', key: "content", });
|
||||
this.tableColumn.push({ name: '上级领导', key: "leaderName", });
|
||||
this.tableColumn.push({ name: '承诺日期', key: "promiseTime", });
|
||||
this.tableColumn.push({ name: '附件', key: "resourceName" });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = false;
|
||||
this.fileList = [] as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
|
||||
//获取编号
|
||||
public getNumber() {
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.subShowUpdate === false) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.subUpdateParams.resourceId = resourceId.join(";")
|
||||
this.subUpdateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode]
|
||||
this.subUpdateParams.promiserName = this.$store.getters.user_map[this.subUpdateParams.promiserId]
|
||||
this.subUpdateParams.leaderName = this.$store.getters.user_map[this.subUpdateParams.leaderId]
|
||||
|
||||
this.tableService.addOrUpdate(this.subUpdateParams, this.subUpdateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.subUpdateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams = res.data
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.subUpdateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//字符串转数组
|
||||
public stringChangeArray(data) {
|
||||
if (data) {
|
||||
return data.split(";").map((item) => parseInt(item))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')"
|
||||
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions">
|
||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="60">
|
||||
<template slot-scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="item in tableColumn">
|
||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
|
||||
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip"
|
||||
@click="showDetails($event,scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key"
|
||||
:filters="item.filters" :filter-method="item.filterMethod"
|
||||
:show-overflow-tooltip="item.showTip">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showModal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showModal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':updateParams.id?'编辑': '新增'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">{{subTitle}}</div>
|
||||
<TableComponent :tableData="currentStepTableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="subCallback($event)" :actions="isReadonly ? []:tableActions"
|
||||
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.members" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)">
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubModal(scope.row,true)">查看</el-button>
|
||||
<el-button v-if="!isReadonly" type="text" @click="showSubModal(scope.row)">修改</el-button>
|
||||
<el-button v-if="!isReadonly" type="text"
|
||||
@click="deleteSubData([scope.row.index - 1])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||
width="952px">
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" title="成员信息" :visible.sync="showDetailsTable" width="800"
|
||||
:before-close="handleTableClose">
|
||||
<TableComponent :tableData="currentDetailsTableData" :tableColumn="subTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentDetailsTableData.datas" tooltip-effect="dark" height="250"
|
||||
border style="width: 100%">
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close width="680px">
|
||||
<img :src="currentUrl" style="width: 100%;" alt="">
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,588 @@
|
|||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import LeaderService from "@/service/leader.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class LeadershipStructure extends BaseRecordComponent<any> {
|
||||
public tableService = new LeaderService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {
|
||||
members: []
|
||||
} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subSelectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public subTitle = '成员信息'
|
||||
|
||||
public currentDetailsTableData = { datas: [] } as any;
|
||||
|
||||
public showDetailsTable = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "机构名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "负责人",
|
||||
key: "chargeUserName",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "成立时间",
|
||||
key: "establishTime",
|
||||
type: "date",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "机构编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "机构名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "机构职责",
|
||||
type: "textarea",
|
||||
key: "duty",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "成立时间",
|
||||
type: "date",
|
||||
key: "establishTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
|
||||
},
|
||||
{
|
||||
name: "负责人",
|
||||
type: "select",
|
||||
key: "chargeUserId",
|
||||
format: 'chargeUserName',
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "单位名称",
|
||||
key: "orgId",
|
||||
format: "orgName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},
|
||||
{
|
||||
name: "审批人",
|
||||
type: "select",
|
||||
key: "approveUserId",
|
||||
format: 'approveUserName',
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "相关附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "点击上传附件",
|
||||
value: "upload",
|
||||
hide: this.isReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
}
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = []
|
||||
public buildSubForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "姓名",
|
||||
type: "select",
|
||||
key: "userId",
|
||||
format: "userName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
}, {
|
||||
name: "手机号码",
|
||||
type: "text",
|
||||
key: "phone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "单位",
|
||||
key: "deptId",
|
||||
format: "deptName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptTreeList
|
||||
}, {
|
||||
name: "职务",
|
||||
type: "text",
|
||||
key: "duty",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "职责描述",
|
||||
type: "textarea",
|
||||
key: "description",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},]
|
||||
}
|
||||
|
||||
created() {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '机构名称', key: "name", width: "200px" });
|
||||
this.tableColumn.push({ name: '机构负责人', key: "chargeUserName", width: "200px" });
|
||||
this.tableColumn.push({
|
||||
name: '成员信息', key: "memberNumber", width: "150px", render: (data) => {
|
||||
return "<span class='link'>" + (data.memberNumber ? data.memberNumber : 0) + "</span>"
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '机构主要职责', key: "duty", width: "200px", });
|
||||
this.tableColumn.push({ name: '单位名称', key: "orgName", width: "150px", });
|
||||
this.tableColumn.push({ name: '附件', width: "100px", key: "resourceName", });
|
||||
this.tableColumn.push({ name: '成立时间', key: "establishTime" });
|
||||
this.tableColumn.push({ name: '审批人', key: "approveUserName" });
|
||||
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", width: "80px" });
|
||||
this.subTableColumn.push({ name: '姓名', key: "userName", width: "80px" });
|
||||
this.subTableColumn.push({ name: '单位', key: "deptName", });
|
||||
this.subTableColumn.push({ name: '职务', key: "duty", });
|
||||
this.subTableColumn.push({ name: '联系方式', key: "phone" });
|
||||
this.subTableColumn.push({ name: '职责描述', key: "description", width: "300px" });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
// this.buildUpdateForm()
|
||||
this.isReadonly = false
|
||||
this.subIsReadonly = false
|
||||
this.updateParams = {
|
||||
members: []
|
||||
} as any;
|
||||
this.fileList = [] as any;
|
||||
this.getFormNumber()
|
||||
|
||||
}
|
||||
}
|
||||
//获取机构编号
|
||||
public getFormNumber() {
|
||||
this.tableService.getNumber({}).then(res => {
|
||||
this.updateParams.number = res.data
|
||||
this.buildUpdateForm()
|
||||
if (this.showUpdate === false) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(";")
|
||||
this.updateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
|
||||
// 新增
|
||||
this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId];
|
||||
this.updateParams.approveUserName = this.$store.getters.user_map[this.updateParams.approveUserId];
|
||||
this.updateParams.orgName = this.$store.getters.dept_map[this.updateParams.orgId]
|
||||
this.updateParams.memberNumber = this.updateParams.members.length
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {
|
||||
members: [],
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getFormNumber()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
public handleSubSelectionChange(data) {
|
||||
this.subSelectData = data;
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
this.subIsReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = res.data
|
||||
this.updateParams.members.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.updateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public showDetails(el, row) {
|
||||
const isTarget = el.target.classList.contains("link");
|
||||
if (isTarget) {
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.currentDetailsTableData.datas = res.data.members
|
||||
this.currentDetailsTableData.datas.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
this.showDetailsTable = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleTableClose() {
|
||||
this.showDetailsTable = false
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "add") {
|
||||
this.buildSubForm()
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = true
|
||||
} else if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === 'delete') {
|
||||
// 批量删除步骤
|
||||
this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
|
||||
}
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSubSave(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
// 新增
|
||||
this.subUpdateParams.userName = this.$store.getters.user_map[this.subUpdateParams.userId]
|
||||
this.subUpdateParams.deptName = this.$store.getters.dept_map[this.subUpdateParams.deptId]
|
||||
if (!this.subUpdateParams.index) {
|
||||
this.subUpdateParams.index = this.updateParams.members.length + 1;
|
||||
this.updateParams.members.push(this.subUpdateParams);
|
||||
} else {
|
||||
this.updateParams.members.splice(this.updateParams.members.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = !!goOn;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//查看或者修改
|
||||
public showSubModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
this.subUpdateParams = row
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
this.subUpdateParams = row
|
||||
}
|
||||
this.subShowUpdate = true
|
||||
this.buildSubForm()
|
||||
}
|
||||
|
||||
//删除成员
|
||||
public deleteSubData(indexs) {
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
this.updateParams.members.splice(i, 1)
|
||||
}
|
||||
}
|
||||
this.updateParams.members.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
}).catch(() => {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,458 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import ManagementSystemService from "@/service/managementSystem.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class ManagementSystem extends BaseRecordComponent<any> {
|
||||
public tableService = new ManagementSystemService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
public currentDetailsTableData = { datas: [] } as any;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "制度名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "适用部门",
|
||||
key: "suitDeptId",
|
||||
type: "treeSelect",
|
||||
datas: this.$store.state.deptTreeList,
|
||||
expandLevel: Infinity,
|
||||
width: "30%"
|
||||
}, {
|
||||
name: "实施日期",
|
||||
key: "publishTime",
|
||||
type: "date",
|
||||
format: "yyyy-MM-dd"
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "制度编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "制度名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "内容摘要",
|
||||
type: "textarea",
|
||||
key: "content",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "适用部门",
|
||||
key: "suitDeptId",
|
||||
format: "suitDeptName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},
|
||||
{
|
||||
name: "发布时间",
|
||||
type: "date",
|
||||
key: "publishTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},
|
||||
{
|
||||
name: "编制人",
|
||||
type: "select",
|
||||
key: "compileUserId",
|
||||
format: "compileUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "编制时间",
|
||||
type: "date",
|
||||
key: "compileTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},
|
||||
{
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.subIsReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "上传",
|
||||
value: "upload",
|
||||
hide: this.subIsReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
}, {
|
||||
name: "发布部门",
|
||||
type: "treeSelect",
|
||||
key: "publishDeptId",
|
||||
format: "publishDeptName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList
|
||||
}, {
|
||||
name: "状态",
|
||||
type: "select",
|
||||
key: "status",
|
||||
format: "statusName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: [{
|
||||
name: "在用",
|
||||
value: 1
|
||||
}, {
|
||||
name: "废除",
|
||||
value: 0
|
||||
}]
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '制度名称', key: "name", width: "200px" });
|
||||
this.tableColumn.push({ name: '适用部门', key: "suitDeptName", width: "200px" });
|
||||
this.tableColumn.push({ name: '内容摘要', key: "content", width: "150px" });
|
||||
this.tableColumn.push({ name: '发布部门', key: "publishDeptName", width: "200px", });
|
||||
this.tableColumn.push({ name: '发布时间', key: "publishTime", width: "150px", });
|
||||
this.tableColumn.push({ name: '附件', width: "100px", key: "resourceName", });
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status", render: (data) => {
|
||||
if (data.status) {
|
||||
if (data.status === 1) {
|
||||
return `<span class="color_1">${'在用'}</span>`
|
||||
} else if (data.status === 2) {
|
||||
return `<span class="color_0">${'废弃'}</span>`
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '编制人', key: "compileUserName" });
|
||||
this.tableColumn.push({ name: '编制时间', key: "compileTime" });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.fileList = [] as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
//获取制度编号
|
||||
public getNumber() {
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.subShowUpdate === false) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.subUpdateParams.resourceId = resourceId.join(";")
|
||||
this.subUpdateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId];
|
||||
this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId]
|
||||
this.subUpdateParams.suitDeptName = this.$store.getters.dept_map[this.subUpdateParams.suitDeptId]
|
||||
this.tableService.addOrUpdate(this.subUpdateParams, this.subUpdateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.subUpdateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams = res.data
|
||||
if (isReadonly) {
|
||||
this.subUpdateParams.statusName = res.data.status == 1 ? '在用' : '废弃'
|
||||
}
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.subUpdateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,460 @@
|
|||
|
||||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import ProgrammeService from "@/service/programme.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
import moment from 'moment';
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class Programme extends BaseRecordComponent<any> {
|
||||
public tableService = new ProgrammeService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
public currentDetailsTableData = { datas: [] } as any;
|
||||
|
||||
|
||||
public fileList = [] as any;
|
||||
|
||||
public showFile = false;
|
||||
public currentUrl = null;
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "制度名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "适用部门",
|
||||
key: "suitDeptId",
|
||||
type: "treeSelect",
|
||||
datas: this.$store.state.deptTreeList,
|
||||
expandLevel: Infinity,
|
||||
width: "30%"
|
||||
}, {
|
||||
name: "实施日期",
|
||||
key: "publishTime",
|
||||
type: "date",
|
||||
format: "yyyy-MM-dd"
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
public updateActions = [] as any;
|
||||
|
||||
public suitYearList = [{
|
||||
name: moment().format('YYYY'),
|
||||
value: moment().format('YYYY'),
|
||||
}, {
|
||||
name: moment().add(1, 'year').format('YYYY'),
|
||||
value: moment().add(1, 'year').format('YYYY'),
|
||||
}, {
|
||||
name: moment().add(2, 'year').format('YYYY'),
|
||||
value: moment().add(2, 'year').format('YYYY'),
|
||||
},
|
||||
{
|
||||
name: "永久",
|
||||
value: 1
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "方案编号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
disable: true,
|
||||
},
|
||||
{
|
||||
name: "方案名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "适用年度",
|
||||
type: "select",
|
||||
key: "suitYear",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.suitYearList
|
||||
},
|
||||
{
|
||||
name: "适用部门",
|
||||
key: "suitDeptId",
|
||||
format: "suitDeptName",
|
||||
type: "treeSelect",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},
|
||||
{
|
||||
name: "发布部门",
|
||||
type: "treeSelect",
|
||||
key: "publishDeptId",
|
||||
format: "publishDeptName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},
|
||||
{
|
||||
name: "发布时间",
|
||||
type: "date",
|
||||
key: "publishTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},
|
||||
{
|
||||
name: "编制人",
|
||||
type: "select",
|
||||
key: "compileUserId",
|
||||
format: "compileUserName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "编制时间",
|
||||
type: "date",
|
||||
key: "compileTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
format: "yyyy-MM-dd"
|
||||
},
|
||||
{
|
||||
name: "附件",
|
||||
key: "resourceId",
|
||||
ref: "file",
|
||||
type: "upload",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
onSucess: this.onSuccess,
|
||||
onMove: this.onRemove,
|
||||
onPreview: this.onPreview,
|
||||
autoUpload: true,
|
||||
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
|
||||
listType: "text",
|
||||
tip: this.subIsReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
|
||||
fileList: this.fileList,
|
||||
btn: [{
|
||||
name: "上传",
|
||||
value: "upload",
|
||||
hide: this.subIsReadonly,
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}]
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
created() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '方案名称', key: "name", width: "200px" });
|
||||
this.tableColumn.push({
|
||||
name: '适用年度', key: "suitYear", width: "200px", render: (data) => {
|
||||
if (data.suitYear === 1) {
|
||||
return '永久'
|
||||
} else {
|
||||
return data.suitYear
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '适用范围', key: "suitDeptName", width: "150px" });
|
||||
this.tableColumn.push({ name: '发布部门', key: "publishDeptName", width: "200px", });
|
||||
this.tableColumn.push({ name: '发布时间', key: "publishTime", width: "150px", });
|
||||
this.tableColumn.push({ name: '附件', width: "100px", key: "resourceName", });
|
||||
this.tableColumn.push({ name: '编制人', key: "compileUserName" });
|
||||
this.tableColumn.push({ name: '编制时间', key: "compileTime" });
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.fileList = [] as any;
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
//获取制度编号
|
||||
public getNumber() {
|
||||
this.tableService.getNumber({}).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams.number = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
if (this.subShowUpdate === false) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.subShowUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public onSuccess(res, file, fileList) {
|
||||
if (res.code === 200) {
|
||||
this.fileList.push({
|
||||
name: res.data.originalName,
|
||||
url: res.data.url,
|
||||
type: res.data.type,
|
||||
id: res.data.id
|
||||
})
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else {
|
||||
window.open(file.url, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.subUpdateParams.resourceId = resourceId.join(";")
|
||||
this.subUpdateParams.resourceName = resourceName.join(";")
|
||||
}
|
||||
this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId];
|
||||
this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId]
|
||||
this.subUpdateParams.suitDeptName = this.$store.getters.dept_map[this.subUpdateParams.suitDeptId]
|
||||
this.tableService.addOrUpdate(this.subUpdateParams, this.subUpdateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.subUpdateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.subUpdateParams = res.data
|
||||
if (isReadonly) {
|
||||
this.subUpdateParams.statusName = res.data.status == 1 ? '在用' : '废弃'
|
||||
}
|
||||
if (res.data.resourceId) {
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(";") }).then((files: any) => {
|
||||
this.fileList = files.data.map(item => {
|
||||
return {
|
||||
name: item.originalName,
|
||||
url: item.url,
|
||||
type: item.type,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
this.subUpdateParams.resourceId = ''
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
this.buildUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
@ -0,0 +1,536 @@
|
|||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from './common.component.html'
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue";
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue";
|
||||
import TrainRecordsService from "@/service/trainRecords.service";
|
||||
import FormOption from "hbt-common/models/formOptions";
|
||||
import BtnOption from "hbt-common/models/btnOptions";
|
||||
|
||||
@Component({
|
||||
template,
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
},
|
||||
})
|
||||
export default class TrainRecords extends BaseRecordComponent<any> {
|
||||
public tableService = new TrainRecordsService();
|
||||
|
||||
public params = {
|
||||
areaId: null,
|
||||
unitId: null,
|
||||
} as any;
|
||||
|
||||
public showProtable = false;
|
||||
|
||||
public tableColumn = [] as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public showUpdate = false;
|
||||
|
||||
public updateParams = {
|
||||
members: []
|
||||
} as any;
|
||||
|
||||
public subUpdateParams = {} as any;
|
||||
|
||||
public selectData = [];
|
||||
|
||||
public subSelectData = [];
|
||||
|
||||
public isReadonly = false;
|
||||
|
||||
public subIsReadonly = false;
|
||||
|
||||
public subTitle = '参加人员清单'
|
||||
|
||||
public subShowUpdate = false;
|
||||
|
||||
public currentDetailsTableData = { datas: [] } as any;
|
||||
|
||||
public showDetailsTable = false;
|
||||
|
||||
public typeList = [{
|
||||
name: '线上',
|
||||
value: 1
|
||||
}, {
|
||||
name: '线下',
|
||||
value: 2
|
||||
},]
|
||||
|
||||
public formActions = [{
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
value: "reset"
|
||||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
|
||||
public footerActions = [{
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "培训名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
}, {
|
||||
name: "培训类型",
|
||||
key: "type",
|
||||
type: "select",
|
||||
datas: this.typeList
|
||||
}, {
|
||||
name: "培训时间",
|
||||
key: "analName",
|
||||
type: "date",
|
||||
}];
|
||||
|
||||
public subActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "培训名称",
|
||||
type: "text",
|
||||
key: "name",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "培训类型",
|
||||
type: "select",
|
||||
key: "type",
|
||||
format: "typeName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.typeList
|
||||
},
|
||||
{
|
||||
name: "培训方式",
|
||||
type: "select",
|
||||
key: "mode",
|
||||
format: "modeName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_training_methods
|
||||
},
|
||||
{
|
||||
name: "培训层级",
|
||||
type: "select",
|
||||
key: "level",
|
||||
format: "levelName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_training_level
|
||||
},
|
||||
{
|
||||
name: "培训时长/h",
|
||||
type: "number",
|
||||
key: "duration",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "培训时间",
|
||||
type: "date",
|
||||
subType: "daterange",
|
||||
format: "yyyy-MM-dd",
|
||||
key: "trainingTime",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "讲师姓名",
|
||||
type: "select",
|
||||
key: "lecturerId",
|
||||
format: "lecturerName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
},
|
||||
{
|
||||
name: "课程主题",
|
||||
type: "text",
|
||||
key: "subject",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
public subUpdateOptions: FormOption<BtnOption>[] = []
|
||||
public buildSubForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "姓名",
|
||||
type: "select",
|
||||
key: "userId",
|
||||
format: "userName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: this.$store.state.userList,
|
||||
}, {
|
||||
name: "工号",
|
||||
type: "text",
|
||||
key: "number",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "联系方式",
|
||||
type: "text",
|
||||
key: "phone",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "培训课程名称",
|
||||
type: "text",
|
||||
key: "lessonName",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "是否考试",
|
||||
type: "select",
|
||||
key: "examStatus",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
datas: [{
|
||||
name: '已参加',
|
||||
value: 1
|
||||
}, {
|
||||
name: '未参加',
|
||||
value: 0
|
||||
}]
|
||||
}, {
|
||||
name: "得分",
|
||||
type: "text",
|
||||
key: "score",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
},]
|
||||
}
|
||||
|
||||
|
||||
created() {
|
||||
}
|
||||
|
||||
|
||||
public buildTable() {
|
||||
this.tableColumn.push({ name: '培训名称', key: "name", width: "200px" });
|
||||
this.tableColumn.push({
|
||||
name: '培训类型', key: "type", render: (data) => {
|
||||
if (data.type === 1) {
|
||||
return '线上'
|
||||
} else if (data.type === 2) {
|
||||
return '线下'
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '培训时间', key: "startTime", render: (data) => {
|
||||
return data.startTime + (data.endTime ? '~' + data.endTime : "")
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '培训方式', key: "mode", render: (data) => {
|
||||
if (data.mode) {
|
||||
return this.$store.getters.prevention_training_methods_map[data.mode]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '培训层级', key: "level", width: "150px", render: (data) => {
|
||||
if (data.level) {
|
||||
return this.$store.getters.prevention_training_level_map[data.level]
|
||||
}
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '参加人数', width: "100px", key: "memberNumber", });
|
||||
this.tableColumn.push({ name: '讲师姓名', key: "lecturerName" });
|
||||
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "index", width: "80px" });
|
||||
this.subTableColumn.push({ name: '姓名', key: "userName", width: "80px" });
|
||||
this.subTableColumn.push({ name: '工号', key: "number", });
|
||||
this.subTableColumn.push({ name: '联系方式', key: "phone", });
|
||||
this.subTableColumn.push({ name: '培训课程名称', key: "lessonName" });
|
||||
this.subTableColumn.push({ name: '是否考试', key: "examStatus", });
|
||||
this.subTableColumn.push({ name: '得分', key: "score", });
|
||||
}
|
||||
|
||||
public changes(data, item) {
|
||||
console.log(data);
|
||||
|
||||
if (item && item.key === "trainingTime") {
|
||||
if (data && data.length) {
|
||||
this.updateParams.startTime = data[0]
|
||||
this.updateParams.endTime = data[1]
|
||||
} else {
|
||||
this.updateParams.startTime = null
|
||||
this.updateParams.endTime = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data, type) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if (data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
} else if (data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
} else if (data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
} else if (data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.updateParams = { members: [] } as any;
|
||||
this.isReadonly = false;
|
||||
this.subIsReadonly = false;
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true;
|
||||
|
||||
}
|
||||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
})
|
||||
}
|
||||
// 重置数据
|
||||
public reset() {
|
||||
this.params = {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
this.showUpdate = true
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.userId === item.userId);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
public handleSubSelectionChange(data) {
|
||||
this.subSelectData = data;
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.isReadonly = true
|
||||
this.subIsReadonly = true
|
||||
} else {
|
||||
this.isReadonly = false
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = Object.assign({
|
||||
typeName: res.data.type === 1 ? '线上' : res.data.type === 2 ? '线下' : '',
|
||||
modeName: this.$store.getters.prevention_training_methods_map[res.data.mode],
|
||||
levelName: this.$store.getters.prevention_training_level_map[res.data.level],
|
||||
trainingTime: isReadonly ? res.data.startTime + "~" + res.data.endTime : [res.data.startTime, res.data.endTime]
|
||||
}, res.data)
|
||||
console.log(' this.updateParams', this.updateParams);
|
||||
|
||||
this.updateParams.members.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
|
||||
this.buildUpdateForm()
|
||||
this.showUpdate = true
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
public subCallback(data) {
|
||||
if (data.value === "add") {
|
||||
this.subIsReadonly = false
|
||||
this.buildSubForm()
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = true
|
||||
} else if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === 'delete') {
|
||||
// 批量删除步骤
|
||||
this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增
|
||||
this.updateParams.lecturerName = this.$store.getters.user_map[this.updateParams.lecturerId];
|
||||
this.updateParams.memberNumber = this.updateParams.members.length
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
this.updateParams = {
|
||||
members: [],
|
||||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
public doSubSave(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
// 新增
|
||||
this.subUpdateParams.userName = this.$store.getters.user_map[this.subUpdateParams.userId]
|
||||
if (!this.subUpdateParams.index) {
|
||||
this.subUpdateParams.index = this.updateParams.members.length + 1;
|
||||
this.updateParams.members.push(this.subUpdateParams);
|
||||
} else {
|
||||
this.updateParams.members.splice(this.updateParams.members.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subShowUpdate = !!goOn;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//查看或者修改
|
||||
public showSubModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
this.subIsReadonly = true
|
||||
this.subUpdateParams = row
|
||||
} else {
|
||||
this.subIsReadonly = false
|
||||
this.subUpdateParams = row
|
||||
}
|
||||
this.subShowUpdate = true
|
||||
this.buildSubForm()
|
||||
}
|
||||
|
||||
//删除成员
|
||||
public deleteSubData(indexs) {
|
||||
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
this.updateParams.members.splice(i, 1)
|
||||
}
|
||||
}
|
||||
this.updateParams.members.forEach((item, index) => {
|
||||
item.index = index + 1;
|
||||
});
|
||||
}).catch(() => {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
Loading…
Reference in New Issue