forked from xxhjsb/hbt-prevention-ui
feat:隐患流程相关bug
parent
969e3d2127
commit
6be98c6962
|
|
@ -227,7 +227,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
key: "name",
|
||||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
width: "100%",
|
||||
disable: true,
|
||||
showError: false,
|
||||
}, {
|
||||
|
|
@ -259,9 +259,9 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
{
|
||||
name: "作业步骤描述",
|
||||
key: "description",
|
||||
type: "text",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "calc(100% - 20px)",
|
||||
width: "100%",
|
||||
disable: true,
|
||||
showError: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default class AreaService extends BaseService<any>{
|
|||
}
|
||||
// 查询列表
|
||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/area/list';
|
||||
const url = this.prefix.prevention+'/risk/area/analList';
|
||||
return this.get(url,params,true)
|
||||
}
|
||||
// 批量删除
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export default class UnitService extends BaseService<any>{
|
|||
super()
|
||||
}
|
||||
public selectByPage(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/list';
|
||||
const url = this.prefix.prevention+'/risk/unit/listAll';
|
||||
return this.get(url,params,showLoading)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
value: item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
|
|
@ -149,7 +148,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
value: item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
const option = this.updateOptions.find(item => item.key === "unitId") as any;
|
||||
option.datas = this.unitList
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -293,6 +293,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
require: true,
|
||||
expandLevel: Infinity,
|
||||
showError: false,
|
||||
clearable: true,
|
||||
datas: this.$store.state.deptTreeList
|
||||
}, {
|
||||
name: "整改人员",
|
||||
|
|
@ -321,6 +322,11 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < moment(new Date()).subtract(1, 'day').toDate().getTime();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: "问题描述",
|
||||
key: "description",
|
||||
|
|
@ -477,6 +483,14 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
if (item && item.key === "verifyUserId") {
|
||||
this.updateParams.verifyUserName = this.$store.getters.user_map[data]
|
||||
}
|
||||
if (item && item.key === 'reformDeadline') {
|
||||
const now = moment().format("YYYY-MM-DD HH");
|
||||
if (now > data) {
|
||||
this.$message.error("要求整改日期不能早于当前时间")
|
||||
this.updateParams.reformDeadline = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
|
|
@ -517,6 +531,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -533,7 +548,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
inspectUserName: this.account.nickName,
|
||||
number: null,
|
||||
photo: null,
|
||||
inspectTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
inspectTime: moment().format("YYYY-MM-DD HH:mm"),
|
||||
dangerType: 4
|
||||
}
|
||||
if (!row) {
|
||||
this.tableService.getNumber().then(res => {
|
||||
|
|
@ -559,7 +575,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
}, res.data)
|
||||
this.updateParams.majorHazard = +this.updateParams.majorHazard
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
|
||||
// 地图定位
|
||||
this.center = [res.data.locationLng, res.data.locationLat];
|
||||
this.buildUpdateForm()
|
||||
|
|
@ -651,7 +666,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
}
|
||||
|
||||
public onPreview(file) {
|
||||
console.log(file)
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
|
|
@ -669,8 +683,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
this.updateParams.resourceName = this.photoList.map(item => item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
|
||||
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
||||
this.tableService.addOrUpdate(JSON.parse(JSON.stringify(this.updateParams)), !this.updateParams.id).then(res => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
|
||||
if (isSubmit) {
|
||||
this.startWorkFlow(res.data, [this.updateParams.reformUserId])
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<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>
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<div class="full" v-if="isManager">
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
||||
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)" @click="deleteData([scope.row.id])">删除</el-button>
|
||||
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
|
||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
|
||||
|
|
|
|||
|
|
@ -662,6 +662,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
require: true,
|
||||
datas: this.$store.state.prevention_major_type,
|
||||
}, {
|
||||
name: "属性分类",
|
||||
|
|
@ -517,19 +518,22 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
}, {
|
||||
name: "治理资金",
|
||||
type: "number",
|
||||
width: "35%",
|
||||
width: "calc(50% - 20px)",
|
||||
key: "executeMoney",
|
||||
require: true,
|
||||
hide: this.updateParams.reformConfirmFlag === 0,
|
||||
showError: false,
|
||||
rules: [
|
||||
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
|
||||
],
|
||||
unit: {
|
||||
name: "元",
|
||||
type: "text"
|
||||
}
|
||||
}, {
|
||||
name: "",
|
||||
name: "资金来源",
|
||||
type: "textarea",
|
||||
width: "calc(65% - 40px)",
|
||||
width: "calc(50% - 20px)",
|
||||
key: "executeMoneySource",
|
||||
hide: this.updateParams.reformConfirmFlag === 0,
|
||||
placeholder: "请输入资金来源"
|
||||
|
|
@ -549,6 +553,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
key: "realConfirmTime",
|
||||
format: "yyyy-MM-dd HH:mm",
|
||||
showError: false,
|
||||
disable:true,
|
||||
pickerOptions: this.getPickerOptions(this.updateParams.createTime),
|
||||
}]
|
||||
this.updateOptions3 = [{
|
||||
|
|
@ -777,6 +782,12 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
this.getTableCallback()
|
||||
return
|
||||
}
|
||||
if (item && item.key === 'executeMoney') {
|
||||
this.updateParams.executeMoney = null;
|
||||
setTimeout(() => {
|
||||
this.updateParams.executeMoney = +data.toFixed(2)
|
||||
}, 0)
|
||||
}
|
||||
if (item && item.key === "reformDeadline") {
|
||||
const now = moment().format("YYYY-MM-DD HH");
|
||||
if (now > data) {
|
||||
|
|
@ -1053,7 +1064,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",")
|
||||
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",")
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功");
|
||||
this.$message.success(!this.updateParams.id ? "新增成功" : "提交成功");
|
||||
if (!preStatus) {
|
||||
if (isSubmit) {
|
||||
this.startWorkFlow(this.updateParams.id || res.data, [this.updateParams.reformUserId])
|
||||
|
|
@ -1167,17 +1178,17 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
}
|
||||
|
||||
public onRemove(file, fileList) {
|
||||
this.photoList.splice(this.photoList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
this.photoList.splice(this.photoList.findIndex(item => item.id === file.id), 1)
|
||||
this.updateParams.photo = this.photoList.length || null
|
||||
}
|
||||
public onRemove2(file, fileList) {
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
|
||||
this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1)
|
||||
}
|
||||
public onRemove3(file, fileList) {
|
||||
this.fileList2.splice(this.fileList2.findIndex(item => item.id === file.response.data.id), 1)
|
||||
this.fileList2.splice(this.fileList2.findIndex(item => item.id === file.id), 1)
|
||||
}
|
||||
public onRemove4(file, fileList) {
|
||||
this.photoList2.splice(this.photoList2.findIndex(item => item.id === file.response.data.id), 1)
|
||||
this.photoList2.splice(this.photoList2.findIndex(item => item.id === file.id), 1)
|
||||
}
|
||||
|
||||
public onPreview(file) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@actionCallback="subCallback($event)" actionPosition="flex-start"
|
||||
:actions="!isReadonly?updateTableActions:[]" :showFooter="false" style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border
|
||||
<el-table ref="submultipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly">
|
||||
</el-table-column>
|
||||
|
|
@ -80,9 +80,9 @@
|
|||
|
||||
|
||||
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'"
|
||||
:visible.sync="showSubUpdate" :before-close="handleClose">
|
||||
:visible.sync="showSubUpdate" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="subUpdateParams" @actionCallback="subCallback" :actions="updateActions" :full-btn="true"
|
||||
:data.sync="subUpdateParams" @actionCallback="subCallback" :actions="subUpdateActions" :full-btn="true"
|
||||
@change="subChange" btn-position="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
|
@ -93,8 +93,7 @@
|
|||
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn"
|
||||
@pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
|
||||
:showFooter="true">
|
||||
|
||||
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
|
||||
<el-table ref="checkMultipleTable" :data="updateTableData.datas" tooltip-effect="dark" max-height="600px" border
|
||||
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
|
||||
<el-table-column type="selection" fixed label="全选" width="40px">
|
||||
</el-table-column>
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
require: true,
|
||||
multiple: true,
|
||||
showError: false,
|
||||
clearable: true,
|
||||
datas: this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
this.updateActions = [{
|
||||
|
|
@ -193,6 +194,7 @@ export default class RulesComponent extends BaseRecordComponent<any> {
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
/**
|
||||
* 数据保存
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import AreaService from '@/service/area.service';
|
|||
import RuleService from '@/service/rule.service';
|
||||
@Component({
|
||||
template,
|
||||
components:{
|
||||
components: {
|
||||
FormComponent,
|
||||
TableComponent,
|
||||
DrawComponent,
|
||||
|
|
@ -38,10 +38,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
public unitList = [];
|
||||
|
||||
public formActions = [{
|
||||
name:"查询",
|
||||
value:"search",
|
||||
icon:"el-icon-search",
|
||||
type:"primary"
|
||||
name: "查询",
|
||||
value: "search",
|
||||
icon: "el-icon-search",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "清空",
|
||||
icon: "el-icon-tickets",
|
||||
|
|
@ -49,482 +49,517 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
}];
|
||||
|
||||
public tableActions = [{
|
||||
name:"添加",
|
||||
value:"add",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"delete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
name: "添加",
|
||||
value: "add",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "delete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}];
|
||||
public updateTableActions = [{
|
||||
name:"添加",
|
||||
value:"subAdd",
|
||||
plain:true,
|
||||
icon:"el-icon-plus",
|
||||
type:"success"
|
||||
},{
|
||||
name:"批量删除",
|
||||
value:"subDelete",
|
||||
plain:true,
|
||||
icon:"el-icon-delete",
|
||||
type:"danger"
|
||||
},{
|
||||
name:"批量添加",
|
||||
value:"subMutilAdd",
|
||||
icon:"el-icon-plus",
|
||||
type:"primary"
|
||||
name: "添加",
|
||||
value: "subAdd",
|
||||
plain: true,
|
||||
icon: "el-icon-plus",
|
||||
type: "success"
|
||||
}, {
|
||||
name: "批量删除",
|
||||
value: "subDelete",
|
||||
plain: true,
|
||||
icon: "el-icon-delete",
|
||||
type: "danger"
|
||||
}, {
|
||||
name: "批量添加",
|
||||
value: "subMutilAdd",
|
||||
icon: "el-icon-plus",
|
||||
type: "primary"
|
||||
}];
|
||||
public footerActions = [{
|
||||
name:"选择全部",
|
||||
value:"selectAll",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"反向选择",
|
||||
value:"reverse"
|
||||
name: "选择全部",
|
||||
value: "selectAll",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "反向选择",
|
||||
value: "reverse"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"检查表名称",
|
||||
key:"name",
|
||||
type:"text"
|
||||
public formOptions: FormOption<BtnOption>[] = [{
|
||||
name: "检查表名称",
|
||||
key: "name",
|
||||
type: "text"
|
||||
}];
|
||||
public mutilAddOptions:FormOption<BtnOption>[] = [];
|
||||
public mutilAddOptions: FormOption<BtnOption>[] = [];
|
||||
|
||||
public showUpdate = false;
|
||||
public currentId = -1;
|
||||
public updateParams = {} as any;
|
||||
public subUpdateParams = {} as any;
|
||||
public updateOptions:FormOption<BtnOption>[] = [];
|
||||
public updateTableData = {datas:[]};
|
||||
public updateTableColumn = [] as any;
|
||||
public updateParams = {} as any;
|
||||
public subUpdateParams = {} as any;
|
||||
public updateOptions: FormOption<BtnOption>[] = [];
|
||||
public updateTableData = { datas: [] };
|
||||
public updateTableColumn = [] as any;
|
||||
public showSubUpdate = false;
|
||||
public showSubMutilUpdate = false;
|
||||
public ruleParams = {
|
||||
pageSize:10,
|
||||
pageNum:1
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
|
||||
public updateActions = [{
|
||||
name:"取消",
|
||||
value:"cancel"
|
||||
},{
|
||||
name:"保存并继续添加",
|
||||
value:"saveAndContinue",
|
||||
type:"primary"
|
||||
},{
|
||||
name:"保存",
|
||||
value:"save",
|
||||
type:"primary"
|
||||
}];
|
||||
public updateActions = [] as any;
|
||||
|
||||
public subUpdateOptions = [{
|
||||
name:"检查项目",
|
||||
type:"text",
|
||||
require:true,
|
||||
showError:false,
|
||||
width:"100%",
|
||||
key:"name",
|
||||
},{
|
||||
name:"检查内容",
|
||||
type:"textarea",
|
||||
require:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
key:"content",
|
||||
},{
|
||||
name:"检查依据",
|
||||
type:"textarea",
|
||||
require:true,
|
||||
width:"100%",
|
||||
showError:false,
|
||||
key:"reason",
|
||||
}]
|
||||
public checkUpdateActions = [] as any;
|
||||
|
||||
public subUpdateOptions = [] as any;
|
||||
|
||||
public subUpdateActions = [{
|
||||
name:"取消",
|
||||
value:"cancelSub"
|
||||
},{
|
||||
name:"确定",
|
||||
value:"saveSub",
|
||||
type:"primary"
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "确定",
|
||||
value: "saveSub",
|
||||
type: "primary"
|
||||
}];
|
||||
|
||||
public selectData = [];
|
||||
|
||||
|
||||
created(){
|
||||
created() {
|
||||
this.loadAreaData();
|
||||
this.loadRuleTable();
|
||||
}
|
||||
|
||||
public loadRuleTable(num?,type?){
|
||||
if(type && num){
|
||||
public loadRuleTable(num?, type?) {
|
||||
if (type && num) {
|
||||
this.ruleParams[type] = num
|
||||
}else{
|
||||
} else {
|
||||
this.ruleParams = {
|
||||
pageSize:10,
|
||||
pageNum:1
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
}
|
||||
this.ruleService.selectByPage(this.ruleParams).then((res:any)=>{
|
||||
this.ruleService.selectByPage(this.ruleParams).then((res: any) => {
|
||||
this.updateTableData = res.data;
|
||||
this.updateTableData.datas.forEach((item:any,index)=>{
|
||||
item.index = index+1;
|
||||
this.updateTableData.datas.forEach((item: any, index) => {
|
||||
item.index = index + 1;
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
public buildUpdateForm(){
|
||||
public buildUpdateForm() {
|
||||
|
||||
this.mutilAddOptions = [{
|
||||
name:"检查项目",
|
||||
key:"name",
|
||||
type:"text"
|
||||
},{
|
||||
name:"类型",
|
||||
key:"type",
|
||||
clearable:true,
|
||||
type:"select",
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "text"
|
||||
}, {
|
||||
name: "类型",
|
||||
key: "type",
|
||||
clearable: true,
|
||||
type: "select",
|
||||
datas: this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
this.updateOptions = [{
|
||||
name:"检查表编号",
|
||||
key:"number",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
disable:true,
|
||||
},{
|
||||
name:"检查表名称",
|
||||
key:"name",
|
||||
type:"text",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
},{
|
||||
name:"适用区域",
|
||||
key:"areas",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.areaList
|
||||
},{
|
||||
name:"适用单元",
|
||||
key:"units",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.unitList
|
||||
},{
|
||||
name:"适用对象",
|
||||
key:"targets",
|
||||
type:"select",
|
||||
multiple:true,
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.analControlList,
|
||||
},{
|
||||
name:"适用部门",
|
||||
key:"depts",
|
||||
multiple:true,
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.deptList
|
||||
},{
|
||||
name:"适用类型",
|
||||
key:"types",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
multiple:true,
|
||||
showError:false,
|
||||
datas:this.$store.state.prevention_dangrous_type
|
||||
name: "检查表编号",
|
||||
key: "number",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
disable: true,
|
||||
}, {
|
||||
name: "检查表名称",
|
||||
key: "name",
|
||||
type: "text",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "适用区域",
|
||||
key: "areas",
|
||||
type: "select",
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.areaList
|
||||
}, {
|
||||
name: "适用单元",
|
||||
key: "units",
|
||||
type: "select",
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.unitList
|
||||
}, {
|
||||
name: "适用对象",
|
||||
key: "targets",
|
||||
type: "select",
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.analControlList,
|
||||
}, {
|
||||
name: "适用部门",
|
||||
key: "depts",
|
||||
multiple: true,
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.deptList
|
||||
}, {
|
||||
name: "适用类型",
|
||||
key: "types",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
multiple: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_dangrous_type
|
||||
}]
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData(){
|
||||
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
|
||||
this.areaList = res.data.datas.map(item=>{
|
||||
public subBuildUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "检查项目",
|
||||
type: "text",
|
||||
require: true,
|
||||
showError: false,
|
||||
width: "100%",
|
||||
key: "name",
|
||||
}, {
|
||||
name: "检查内容",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
key: "content",
|
||||
}, {
|
||||
name: "检查依据",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
key: "reason",
|
||||
}]
|
||||
this.checkUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.index
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
// 加载区域列表
|
||||
public loadAreaData() {
|
||||
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
|
||||
this.areaList = res.data.datas.map(item => {
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
name: item.name,
|
||||
value: item.id
|
||||
}
|
||||
});
|
||||
this.loadUnitData()
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
public loadUnitData(ids?){
|
||||
this.unitService.getListByIds({areaIds:ids},false).then((res:any)=>{
|
||||
this.unitList = res.data.map(item=>{
|
||||
public loadUnitData(ids?) {
|
||||
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
|
||||
this.unitList = res.data.map(item => {
|
||||
return {
|
||||
name:item.name,
|
||||
value:item.id
|
||||
name: item.name,
|
||||
value: item.id
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
const option = this.updateOptions.find(item => item.key === "units") as any;
|
||||
option.datas = this.unitList
|
||||
})
|
||||
}
|
||||
|
||||
public getNumber(){
|
||||
this.tableService.getNumber().then(res=>{
|
||||
public getNumber() {
|
||||
this.tableService.getNumber().then(res => {
|
||||
this.updateParams.number = res.data
|
||||
})
|
||||
}
|
||||
|
||||
public buildTable(){
|
||||
public buildTable() {
|
||||
this.tableColumn = [];
|
||||
this.tableColumn.push({name:'检查表名称',key:"name"});
|
||||
this.tableColumn.push({name:'区域名称',key:"areas"});
|
||||
this.tableColumn.push({name:'单元名称',key:"units"});
|
||||
this.tableColumn.push({name:'对象名称',key:"targets"});
|
||||
this.tableColumn.push({name:'适用部门',key:"depts"});
|
||||
this.tableColumn.push({name:'适用类型',key:"types",filters:this.$store.state.prevention_dangrous_type.map(item=>{
|
||||
return {
|
||||
text:item.name,
|
||||
value:item.name,
|
||||
}
|
||||
}),filterMethod:(data,row)=>{
|
||||
return row.types.indexOf(data)>=0;
|
||||
}, render: (data) => {
|
||||
this.tableColumn.push({ name: '检查表名称', key: "name" });
|
||||
this.tableColumn.push({ name: '区域名称', key: "areas" });
|
||||
this.tableColumn.push({ name: '单元名称', key: "units" });
|
||||
this.tableColumn.push({ name: '对象名称', key: "targets" });
|
||||
this.tableColumn.push({ name: '适用部门', key: "depts" });
|
||||
this.tableColumn.push({
|
||||
name: '适用类型', key: "types", filters: this.$store.state.prevention_dangrous_type.map(item => {
|
||||
return {
|
||||
text: item.name,
|
||||
value: item.name,
|
||||
}
|
||||
}), filterMethod: (data, row) => {
|
||||
return row.types.indexOf(data) >= 0;
|
||||
}, render: (data) => {
|
||||
return data.types.split(',').map(item => {
|
||||
return this.$store.getters.prevention_dangrous_type_map[item]
|
||||
}).join(",")
|
||||
}});
|
||||
this.tableColumn.push({name:'编制人',key:"createName"});
|
||||
this.tableColumn.push({name:'编制时间',key:"createTime"});
|
||||
}
|
||||
});
|
||||
this.tableColumn.push({ name: '编制人', key: "createName" });
|
||||
this.tableColumn.push({ name: '编制时间', key: "createTime" });
|
||||
this.updateTableColumn = [];
|
||||
|
||||
this.updateTableColumn.push({name:'序号',key:"index",width:"60px"});
|
||||
this.updateTableColumn.push({name:'检查项目',key:"name",showTip:true});
|
||||
this.updateTableColumn.push({name:'检查内容',key:"content",showTip:true});
|
||||
this.updateTableColumn.push({name:'检查依据',key:"reason",showTip:true});
|
||||
if(this.showSubMutilUpdate){
|
||||
this.updateTableColumn.push({name:'检查类型',key:"reason",render:(data)=>{
|
||||
return this.$store.getters.prevention_dangrous_type_map[data.type]
|
||||
}});
|
||||
this.updateTableColumn.push({ name: '序号', key: "index", width: "60px" });
|
||||
this.updateTableColumn.push({ name: '检查项目', key: "name", showTip: true });
|
||||
this.updateTableColumn.push({ name: '检查内容', key: "content", showTip: true });
|
||||
this.updateTableColumn.push({ name: '检查依据', key: "reason", showTip: true });
|
||||
if (this.showSubMutilUpdate) {
|
||||
this.updateTableColumn.push({
|
||||
name: '检查类型', key: "type", render: (data) => {
|
||||
return this.$store.getters.prevention_dangrous_type_map[data.type]
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public change(data,item){
|
||||
public change(data, item) {
|
||||
|
||||
// 区域
|
||||
if(item && item.key==="areas"){
|
||||
if(this.updateParams.units.length){
|
||||
if (item && item.key === "areas") {
|
||||
if (this.updateParams.units.length) {
|
||||
this.updateParams.units = [];
|
||||
}
|
||||
this.loadUnitData(data)
|
||||
}
|
||||
}
|
||||
|
||||
public callback(data,type?){
|
||||
if(type){
|
||||
public callback(data, type?) {
|
||||
if (type) {
|
||||
this.params[type] = data;
|
||||
this.getTableData();
|
||||
return
|
||||
}
|
||||
// 查询
|
||||
if(data && data.value==="search"){
|
||||
if (data && data.value === "search") {
|
||||
this.getTableData()
|
||||
// 重置
|
||||
}else if(data &&data.value === "reset"){
|
||||
// 重置
|
||||
} else if (data && data.value === "reset") {
|
||||
this.reset()
|
||||
// 反选
|
||||
}else if(data &&data.value === "reverse"){
|
||||
// 反选
|
||||
} else if (data && data.value === "reverse") {
|
||||
this.toggleAll()
|
||||
// 全选
|
||||
}else if(data && data.value === "selectAll"){
|
||||
// 全选
|
||||
} else if (data && data.value === "selectAll") {
|
||||
this.selectAll()
|
||||
}else if(data && data.value === "add"){
|
||||
} else if (data && data.value === "add") {
|
||||
this.showUpdateModel()
|
||||
}else if(data && data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSave(data.value!=="save")
|
||||
}else if(data && data.value === "cancel"){
|
||||
} else if (data && data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === "cancel") {
|
||||
this.handleClose()
|
||||
}
|
||||
}
|
||||
|
||||
public subChange(data,item){
|
||||
public subChange(data, item) {
|
||||
//
|
||||
}
|
||||
|
||||
public subCallback(data){
|
||||
if(data && data.value==="subAdd"){
|
||||
public subCallback(data) {
|
||||
if (data && data.value === "subAdd") {
|
||||
this.showSubUpdateModel()
|
||||
}else if(data && data.value.indexOf("save")>=0){
|
||||
this.doSubSave(data.value!=="save")
|
||||
}else if(data && data.value==="cancel"){
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
} else if (data && data.value === "cancel") {
|
||||
this.handleClose()
|
||||
}else if(data && data.value==="subDelete"){
|
||||
this.doSubDelete(this.selectData.map((item:any)=>item.index -1))
|
||||
}else if(data && data.value==="subMutilAdd"){
|
||||
} else if (data && data.value === "subDelete") {
|
||||
this.doSubDelete(this.selectData.map((item: any) => item.index - 1))
|
||||
} else if (data && data.value === "subMutilAdd") {
|
||||
this.showSubMutilUpdate = true;
|
||||
this.buildTable()
|
||||
this.clearSelect()
|
||||
this.loadRuleTable();
|
||||
}
|
||||
}
|
||||
|
||||
public doMutilAdd(){
|
||||
this.selectData.forEach((item:any)=>{
|
||||
if(!this.updateParams.tableItems.find(itm=>itm.id===item.id)){
|
||||
public doMutilAdd() {
|
||||
this.selectData.forEach((item: any) => {
|
||||
if (!this.updateParams.tableItems.find(itm => itm.id === item.id)) {
|
||||
const data = JSON.parse(JSON.stringify(item))
|
||||
delete data.id;
|
||||
this.updateParams.tableItems.push(data)
|
||||
}
|
||||
})
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
this.updateParams.tableItems.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.clearSelect()
|
||||
this.showSubMutilUpdate=false;
|
||||
this.ruleParams = {
|
||||
pageSize: 10,
|
||||
pageNum: 1
|
||||
}
|
||||
this.showSubMutilUpdate = false;
|
||||
this.buildTable();
|
||||
}
|
||||
|
||||
public cancelMutilAdd(){
|
||||
public cancelMutilAdd() {
|
||||
this.clearSelect();
|
||||
this.ruleParams = {
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
this.showSubMutilUpdate=false;
|
||||
this.showSubMutilUpdate = false;
|
||||
this.buildTable();
|
||||
|
||||
}
|
||||
|
||||
public clearSelect(){
|
||||
public clearSelect() {
|
||||
(this.$refs.multipleTable as any).clearSelection();
|
||||
this.selectData = [];
|
||||
}
|
||||
// 重置数据
|
||||
public reset(){
|
||||
public reset() {
|
||||
this.params = {
|
||||
name:"",
|
||||
pageNum:1,
|
||||
pageSize:20,
|
||||
name: "",
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
|
||||
this.ruleParams = {
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public showSubUpdateModel(row?,isRead?){
|
||||
public showSubUpdateModel(row?, isRead?) {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = !!isRead;
|
||||
if(row){
|
||||
if (row) {
|
||||
this.subUpdateParams = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
this.subBuildUpdateForm()
|
||||
this.showSubUpdate = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public showUpdateModel(row?,isRead?){
|
||||
this.updateParams = {number:null,tableItems:[]} as any;
|
||||
public showUpdateModel(row?, isRead?) {
|
||||
this.updateParams = { number: null, tableItems: [] } as any;
|
||||
this.isReadonly = !!isRead;
|
||||
this.clearSelect()
|
||||
|
||||
this.buildUpdateForm();
|
||||
if(!row){
|
||||
if (!row) {
|
||||
this.currentId = -1;
|
||||
this.getNumber();
|
||||
this.buildUpdateForm();
|
||||
this.showUpdate = true;
|
||||
}else{
|
||||
} else {
|
||||
this.currentId = row.id;
|
||||
this.tableService.selectById(this.currentId,true).then((res:any)=>{
|
||||
if(isRead){
|
||||
this.updateParams = Object.assign(res.data,row)
|
||||
}else{
|
||||
this.tableService.selectById(this.currentId, true).then((res: any) => {
|
||||
if (isRead) {
|
||||
this.updateParams = Object.assign(res.data, row)
|
||||
} else {
|
||||
this.updateParams = res.data;
|
||||
this.loadUnitData(res.data.areas)
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
this.updateParams.tableItems.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.buildUpdateForm();
|
||||
this.showUpdate = true;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
public doSubSave(goOn?){
|
||||
if(!this.subUpdateParams.index){
|
||||
this.subUpdateParams.index = this.updateParams.tableItems.length+1;
|
||||
public doSubSave(goOn?) {
|
||||
if (!this.subUpdateParams.index) {
|
||||
this.subUpdateParams.index = this.updateParams.tableItems.length + 1;
|
||||
this.updateParams.tableItems.push(this.subUpdateParams);
|
||||
}else{
|
||||
this.updateParams.tableItems.splice(this.updateParams.tableItems.findIndex(item=>item.index ===this.subUpdateParams.index),1,this.subUpdateParams)
|
||||
} else {
|
||||
this.updateParams.tableItems.splice(this.updateParams.tableItems.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
this.updateParams.tableItems.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.subUpdateParams = {} as any;
|
||||
this.showSubUpdate = !!goOn
|
||||
this.showSubUpdate = false;
|
||||
}
|
||||
|
||||
public doSubDelete(indexs){
|
||||
for(let i = this.updateParams.tableItems.length-1;i>=0;i--){
|
||||
if(indexs.includes(i)){
|
||||
this.updateParams.tableItems.splice(i,1)
|
||||
public doSubDelete(indexs) {
|
||||
for (let i = this.updateParams.tableItems.length - 1; i >= 0; i--) {
|
||||
if (indexs.includes(i)) {
|
||||
this.updateParams.tableItems.splice(i, 1)
|
||||
}
|
||||
}
|
||||
|
||||
this.updateParams.tableItems.forEach((item,i)=>{
|
||||
item.index = i+1
|
||||
this.updateParams.tableItems.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
this.clearSelect()
|
||||
}
|
||||
|
||||
public doSave(goOn?){
|
||||
this.updateParams.depts = this.updateParams.depts.map(item=>{
|
||||
public doSave(goOn?) {
|
||||
this.updateParams.depts = this.updateParams.depts.map(item => {
|
||||
return {
|
||||
id:item,
|
||||
name:this.$store.getters.dept_map[item]
|
||||
id: item,
|
||||
name: this.$store.getters.dept_map[item]
|
||||
}
|
||||
})
|
||||
|
||||
this.updateParams.targets = this.updateParams.targets.map(item=>{
|
||||
this.updateParams.targets = this.updateParams.targets.map(item => {
|
||||
return {
|
||||
id:item,
|
||||
name:this.$store.getters.prevention_anal_control_map[item]
|
||||
id: item,
|
||||
name: this.$store.getters.prevention_anal_control_map[item]
|
||||
}
|
||||
})
|
||||
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then(res=>{
|
||||
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
|
||||
this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then(res => {
|
||||
this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功");
|
||||
this.getTableData();
|
||||
this.showUpdate = !!goOn;
|
||||
this.updateParams = {areas:[],depts:[],units:[],types:[],targets:[],number:null,tableItems:[]} as any;
|
||||
if(!!goOn){
|
||||
this.updateParams = { areas: [], depts: [], units: [], types: [], targets: [], number: null, tableItems: [] } as any;
|
||||
if (!!goOn) {
|
||||
this.getNumber();
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.updateParams.depts = this.updateParams.depts.map(item=>item.id)
|
||||
}).catch(() => {
|
||||
this.updateParams.depts = this.updateParams.depts.map(item => item.id)
|
||||
|
||||
this.updateParams.targets = this.updateParams.targets.map(item=>item.id)
|
||||
this.updateParams.targets = this.updateParams.targets.map(item => item.id)
|
||||
})
|
||||
}
|
||||
|
||||
public handleClose(){
|
||||
if(this.showSubMutilUpdate){
|
||||
public handleClose() {
|
||||
if (this.showSubMutilUpdate) {
|
||||
this.showSubMutilUpdate = false;
|
||||
this.buildTable();
|
||||
return
|
||||
}
|
||||
if(this.showSubUpdate){
|
||||
if (this.showSubUpdate) {
|
||||
this.showSubUpdate = false;
|
||||
return
|
||||
}
|
||||
|
|
@ -534,24 +569,24 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
public selectAll(){
|
||||
if(!this.selectData.length){
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
}else{
|
||||
this.tableData.datas.forEach((item,index)=>{
|
||||
const find = this.selectData.find((data:any)=>data.id === item.id);
|
||||
if(!find){
|
||||
} else {
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
const find = this.selectData.find((data: any) => data.id === item.id);
|
||||
if (!find) {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleSelectionChange(data){
|
||||
public handleSelectionChange(data) {
|
||||
this.selectData = data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情': updateParams.id ?'编辑': '新增'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<TableComponent :tableData="updateParams.details" :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
|
||||
<el-table ref="subMultipleTable" :data="updateParams.details" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
|
|
@ -80,10 +80,10 @@
|
|||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||
width="952px" destroy-on-close>
|
||||
width="952px" destroy-on-close>
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="triCallback" :isReadonly="subIsReadonly" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
@actionCallback="triCallback" :isReadonly="subIsReadonly" :actions="subUpdateActions" :full-btn="true" @change="changes"
|
||||
btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -120,6 +120,7 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public updateActions = [] as any;
|
||||
public subUpdateActions = [] as any;
|
||||
|
||||
public rewardsType = [{
|
||||
name: "不涉及",
|
||||
|
|
@ -178,6 +179,22 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
showError: false,
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public buildSubUpdateForm() {
|
||||
this.subUpdateOptions = [{
|
||||
name: "奖惩日期",
|
||||
type: "date",
|
||||
|
|
@ -202,6 +219,10 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
hide: !(this.subUpdateParams.type && this.subUpdateParams.type !== 1),
|
||||
rules: [
|
||||
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
|
||||
]
|
||||
}, {
|
||||
name: "奖惩事由",
|
||||
type: "textarea",
|
||||
|
|
@ -229,14 +250,14 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
expandLevel: Infinity,
|
||||
datas: this.$store.state.deptTreeList
|
||||
},];
|
||||
this.updateActions = [{
|
||||
this.subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.updateParams.id
|
||||
hide: this.subUpdateParams.index
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
|
|
@ -266,6 +287,22 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
}
|
||||
})
|
||||
}
|
||||
if (item && item.key === 'type') {
|
||||
if (data === 1) {
|
||||
const option = this.subUpdateOptions.find(item => item.key === "money") as any;
|
||||
option.hide = true;
|
||||
this.subUpdateParams.money = null
|
||||
} else {
|
||||
const option = this.subUpdateOptions.find(item => item.key === "money") as any;
|
||||
option.hide = false
|
||||
}
|
||||
}
|
||||
if (item && item.key === 'money') {
|
||||
this.subUpdateParams.money = null;
|
||||
setTimeout(() => {
|
||||
this.subUpdateParams.money = +data.toFixed(2)
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public buildTable() {
|
||||
|
|
@ -350,8 +387,8 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
}
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
if(this.params.postName){
|
||||
this.params.postName = this.$store.state.postList.find((item: any) => item.value === this.params.postName)?.name??""
|
||||
if (this.params.postName) {
|
||||
this.params.postName = this.$store.state.postList.find((item: any) => item.value === this.params.postName)?.name ?? ""
|
||||
}
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
this.tableData = res.data as any;
|
||||
|
|
@ -375,7 +412,6 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
|
|
@ -410,7 +446,6 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
this.isReadonly = false
|
||||
this.subIsReadonly = false
|
||||
}
|
||||
|
||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
this.updateParams = res.data
|
||||
|
|
@ -431,7 +466,8 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
if (data.value === "add") {
|
||||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = false;
|
||||
this.subShowUpdate = true
|
||||
this.buildSubUpdateForm()
|
||||
this.subShowUpdate = true;
|
||||
} else if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
|
|
@ -441,6 +477,10 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 保存数据
|
||||
* @param goOn
|
||||
*/
|
||||
public doSave(goOn?) {
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
|
|
@ -455,12 +495,15 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
this.subShowUpdate = false;
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSubSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增奖惩记录
|
||||
* @param goOn
|
||||
*/
|
||||
public doSubSave(goOn) {
|
||||
// 如果是新增步骤
|
||||
if (this.subShowUpdate) {
|
||||
|
|
@ -474,27 +517,31 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
|
|||
this.updateParams.details.splice(this.updateParams.details.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
this.buildSubUpdateForm()
|
||||
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()
|
||||
}
|
||||
/**
|
||||
* 奖惩记录查看或者修改
|
||||
* @param row 当前行数据
|
||||
* @param isReadonly 是否是查看
|
||||
*/
|
||||
public showSubModal(row: any, isReadonly = false) {
|
||||
this.subIsReadonly = isReadonly
|
||||
this.subUpdateParams = Object.assign({
|
||||
typeName: this.rewardsTypeName[row.type]
|
||||
}, row)
|
||||
|
||||
//删除成员
|
||||
this.buildSubUpdateForm()
|
||||
this.subShowUpdate = true
|
||||
|
||||
}
|
||||
/**
|
||||
* 删除奖惩记录
|
||||
* @param indexs
|
||||
*/
|
||||
public deleteSubData(indexs) {
|
||||
this.$confirm('确认删除所选数据', '确认数据', {
|
||||
confirmButtonText: '确定',
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
<div slot="reference" class="name-wrapper">
|
||||
<el-input size="mini" type="number" min="0" :max="scope.row.score"
|
||||
v-model="scope.row.deductPoints" v-if="scope.row.pointFlag"
|
||||
@blur="inputClick(scope.row)" v-focus
|
||||
@blur="inputClick(scope.row)" v-focus="true" ref="score"
|
||||
@input="pointInput($event,scope.row,items)" @keyup.native="proving($event)"
|
||||
oninput="if(isNaN(value)) { value = parseFloat(value) } if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+2)}"></el-input>
|
||||
<span v-if="!scope.row.pointFlag">{{scope.row.deductPoints}}</span>
|
||||
|
|
@ -104,10 +104,12 @@
|
|||
<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>
|
||||
v-if="scope.row.recordFlag" ref="record" @blur="inputClick(scope.row)"
|
||||
v-focus="true"></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">{{isReadonly?'--': '点击输入评估记录'}}</span>
|
||||
v-if="!scope.row.recordFlag && !scope.row.record">{{isReadonly?'--':
|
||||
'点击输入评估记录'}}</span>
|
||||
<span v-if="!scope.row.recordFlag &&scope.row.record ">
|
||||
{{scope.row.record}}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
},{
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
|
|
@ -248,23 +248,32 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
} else if (data.value === "delete") {
|
||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||
} else if (data.value === 'add') {
|
||||
this.estimateStandard = [] as any;
|
||||
this.checkReject = [] as any;
|
||||
this.total = 10;
|
||||
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
|
||||
this.fileList = [] as any;
|
||||
this.buildUpdateForm()
|
||||
//添加
|
||||
this.addUpdateMethod();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 添加按钮操作
|
||||
*/
|
||||
public addUpdateMethod() {
|
||||
this.estimateStandard = [] as any;
|
||||
this.checkReject = [] as any;
|
||||
this.total = 10;
|
||||
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.isReadonly = false;
|
||||
this.buildUpdateForm();
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod();
|
||||
this.showUpdate = true;
|
||||
}
|
||||
|
||||
// 分页数据
|
||||
public getTableData() {
|
||||
this.tableService.selectByPage(this.params).then(res => {
|
||||
|
|
@ -282,6 +291,8 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -363,26 +374,23 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
return item.id
|
||||
//无否决项 判断自评项是否均已填写
|
||||
if (this.checkReject.length === 0) {
|
||||
let tips: any = false;
|
||||
this.estimateStandard.forEach((item: any) => {
|
||||
item.tableData.forEach((dataitem: any) => {
|
||||
if (dataitem.deductPoints === '--') {
|
||||
tips = true
|
||||
}
|
||||
})
|
||||
})
|
||||
let resourceName = this.fileList.map((item) => {
|
||||
return item.name
|
||||
})
|
||||
this.updateParams.resourceId = resourceId.join(",")
|
||||
this.updateParams.resourceName = resourceName.join(",")
|
||||
if (tips === true) {
|
||||
this.$message.warning('您有自评项未填写!!')
|
||||
return
|
||||
}
|
||||
}
|
||||
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.reorganizeParamsDataMethod();
|
||||
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
|
||||
//保存清空
|
||||
|
|
@ -402,6 +410,30 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
this.getTableData();
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 整理传参数据
|
||||
*/
|
||||
public reorganizeParamsDataMethod() {
|
||||
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];
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
if (isReadonly) {
|
||||
|
|
@ -458,10 +490,16 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
public cellClick(row, column) {
|
||||
if (this.isReadonly === false) {
|
||||
if (column.label === '扣分') {
|
||||
row.pointFlag = true
|
||||
this.clickPointFlag = true
|
||||
row.pointFlag = true;
|
||||
this.clickPointFlag = true;
|
||||
this.$nextTick(() => {
|
||||
(this.$refs.score as any)[0].focus();
|
||||
})
|
||||
} else if (column.label === '评估记录') {
|
||||
row.recordFlag = true
|
||||
row.recordFlag = true;
|
||||
this.$nextTick(() => {
|
||||
(this.$refs.record as any)[0].focus();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -490,7 +528,12 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取输入焦点
|
||||
* @param data
|
||||
* @param row
|
||||
* @param items
|
||||
*/
|
||||
public pointInput(data, row, items) {
|
||||
// 过滤0后面接数值
|
||||
if (data.replace(/^0+(\d)/, "$1")) {
|
||||
|
|
@ -565,9 +608,6 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//预览附件
|
||||
public previewFile(url, file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
|
|
@ -602,6 +642,15 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除附件数据
|
||||
*/
|
||||
public clearFileListMethod() {
|
||||
this.fileList = [];
|
||||
const option = this.updateOptions.find(item => item.key === "resourceId") as any;
|
||||
option.fileList = [];
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -65,11 +65,11 @@
|
|||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" fixed="right" width="200" v-if="!isReadonly">
|
||||
<el-table-column label="操作" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="showSubmodal(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" @click="showSubmodal(scope.row)">修改</el-button>
|
||||
<el-button type="text" @click="deleteProData([scope.row.index - 1])">删除</el-button>
|
||||
<el-button type="text" v-if="!isReadonly" @click="showSubmodal(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="!isReadonly" @click="deleteProData([scope.row.index - 1])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||
width="952px" destroy-on-close>
|
||||
width="952px" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
|
||||
@actionCallback="triCallback" :isReadonly="subIsReadonly" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center" :labelWidth="labelWidth">
|
||||
|
|
|
|||
|
|
@ -376,7 +376,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
this.updateParams = {} as any;
|
||||
this.setpsOptions = [] as any;
|
||||
this.isReadonly = false;
|
||||
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
|
|
@ -414,6 +415,7 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public showUpdateModel(id) {
|
||||
|
|
@ -422,6 +424,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -477,7 +481,9 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
|
||||
public subCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
this.showUpdate = false;
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
|
|
@ -544,7 +550,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
this.updateParams = {} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
|
|
@ -599,6 +606,16 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除附件数据
|
||||
*/
|
||||
public clearFileListMethod() {
|
||||
this.fileList = [];
|
||||
const option = this.updateStepsOptions.find(item => item.key === "resourceId") as any;
|
||||
option.fileList = [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
created() {
|
||||
this.buildUpdateForm()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -284,7 +285,9 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
// this.buildUpdateForm()
|
||||
const option = this.subUpdateOptions.find(item => item.key === "areaId") as any;
|
||||
option.datas = this.areaList;
|
||||
})
|
||||
}
|
||||
// 加载单元列表
|
||||
|
|
@ -300,7 +303,9 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
userName: item.chargeUserName,
|
||||
}
|
||||
});
|
||||
this.buildUpdateForm()
|
||||
// this.buildUpdateForm()
|
||||
const option = this.subUpdateOptions.find(item => item.key === "unitId") as any;
|
||||
option.datas = this.unitList;
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -407,15 +412,17 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
//清除附件数据
|
||||
this.clearFileListMethod();
|
||||
}
|
||||
|
||||
|
||||
public toggleAll() {
|
||||
|
||||
this.tableData.datas.forEach((item, index) => {
|
||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
|
|
@ -468,10 +475,20 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
//清除附件数据
|
||||
this.clearFileListMethod();
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 清除附件数据
|
||||
*/
|
||||
public clearFileListMethod() {
|
||||
this.fileList = [];
|
||||
const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any;
|
||||
option.fileList = [];
|
||||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
// 新增清单
|
||||
|
|
@ -492,7 +509,8 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
|||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
//清除文件缓存
|
||||
this.clearFileListMethod()
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,6 +301,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
this.subUpdateParams = {} as any;
|
||||
this.subIsReadonly = false;
|
||||
this.fileList = [] as any;
|
||||
//清除文件缓存
|
||||
this.clearFileListMethod()
|
||||
this.getNumber()
|
||||
}
|
||||
}
|
||||
|
|
@ -340,6 +342,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
|
||||
public handleClose() {
|
||||
this.subShowUpdate = false;
|
||||
//清除文件缓存
|
||||
this.clearFileListMethod()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -399,7 +403,9 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
|
||||
public triCallback(data) {
|
||||
if (data.value === "cancel") {
|
||||
this.subShowUpdate = false
|
||||
this.subShowUpdate = false;
|
||||
//清除文件缓存
|
||||
this.clearFileListMethod()
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
}
|
||||
|
|
@ -427,7 +433,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
this.subUpdateParams = {} as any
|
||||
this.subShowUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
|
||||
//清除文件缓存
|
||||
this.clearFileListMethod()
|
||||
if (goOn === true) {
|
||||
this.getNumber()
|
||||
}
|
||||
|
|
@ -512,7 +519,11 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
|
||||
//下载附件
|
||||
/**
|
||||
* 下载附件
|
||||
* @param url 下载url
|
||||
* @param file 文件信息
|
||||
*/
|
||||
public downLoadFile(url, file) {
|
||||
let DownUrl = url;
|
||||
fetch(DownUrl)
|
||||
|
|
@ -535,6 +546,15 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
window.URL.revokeObjectURL(href); // 释放掉blob对象
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除附件数据
|
||||
*/
|
||||
public clearFileListMethod() {
|
||||
this.fileList = [];
|
||||
const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any;
|
||||
option.fileList = [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<TableComponent :tableData="updateParams.members" :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
|
||||
<el-table ref="subMultipleTable" :data="updateParams.members" tooltip-effect="dark" max-height="500" border
|
||||
row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
|
||||
<el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40">
|
||||
</el-table-column>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
:before-close="handleTableClose" destroy-on-close>
|
||||
<TableComponent :tableData="currentDetailsTableData" :tableColumn="subTableColumn" :showFooter="false"
|
||||
style="margin-bottom: 20px;">
|
||||
<el-table ref="multipleTable" :data="currentDetailsTableData.datas" tooltip-effect="dark" height="250"
|
||||
<el-table ref="subMultipleTable" :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"
|
||||
|
|
|
|||
|
|
@ -278,6 +278,19 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
width: "100%",
|
||||
showError: false,
|
||||
},]
|
||||
this.subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary",
|
||||
hide: this.subUpdateParams.index
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
created() {
|
||||
|
|
@ -343,7 +356,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
} as any;
|
||||
this.fileList = [] as any;
|
||||
this.getFormNumber()
|
||||
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
}
|
||||
}
|
||||
//获取机构编号
|
||||
|
|
@ -385,7 +399,6 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
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];
|
||||
|
|
@ -398,7 +411,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
} as any
|
||||
this.showUpdate = !!goOn;
|
||||
this.getTableData();
|
||||
this.fileList = [];
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
if (goOn === true) {
|
||||
this.getFormNumber()
|
||||
}
|
||||
|
|
@ -411,6 +425,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -419,6 +435,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||
})
|
||||
}
|
||||
|
||||
public selectAll() {
|
||||
if (!this.selectData.length) {
|
||||
this.toggleAll()
|
||||
|
|
@ -548,11 +565,13 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
|
||||
public subCallback(data) {
|
||||
if (data.value === "add") {
|
||||
this.buildSubForm()
|
||||
this.subUpdateParams = {} as any;
|
||||
this.buildSubForm()
|
||||
this.subShowUpdate = true
|
||||
} else if (data.value === "cancel") {
|
||||
this.showUpdate = false
|
||||
this.showUpdate = false;
|
||||
//清除附件缓存数据
|
||||
this.clearFileListMethod()
|
||||
} else if (data && data.value.indexOf("save") >= 0) {
|
||||
this.doSave(data.value !== "save")
|
||||
} else if (data && data.value === 'delete') {
|
||||
|
|
@ -640,7 +659,11 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
|
||||
//下载附件
|
||||
/**
|
||||
* 下载附件
|
||||
* @param url 下载url
|
||||
* @param file 文件信息
|
||||
*/
|
||||
public downLoadFile(url, file) {
|
||||
let DownUrl = url;
|
||||
fetch(DownUrl)
|
||||
|
|
@ -663,6 +686,14 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
|
|||
window.URL.revokeObjectURL(href); // 释放掉blob对象
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 清除附件数据
|
||||
*/
|
||||
public clearFileListMethod() {
|
||||
this.fileList = [];
|
||||
const option = this.updateOptions.find(item => item.key === "resourceId") as any;
|
||||
option.fileList = [];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../common.component.scss"></style>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
|
|||
type: "treeSelect",
|
||||
datas: this.$store.state.deptTreeList,
|
||||
expandLevel: Infinity,
|
||||
width:"280px"
|
||||
width: "280px"
|
||||
}, {
|
||||
name: "发布时间",
|
||||
key: "publishTime",
|
||||
|
|
@ -238,7 +238,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
|
|||
}]
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
this.subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
|
|
@ -256,14 +256,14 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
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", showTip: true, });
|
||||
this.tableColumn.push({ name: '内容摘要', key: "content", width: "150px", showTip: true, });
|
||||
this.tableColumn.push({ name: '发布部门', key: "publishDeptName", width: "100px", });
|
||||
this.tableColumn.push({ name: '发布时间', key: "publishTime", width: "150px", });
|
||||
this.tableColumn.push({
|
||||
|
|
@ -274,7 +274,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
|
|||
}
|
||||
});
|
||||
this.tableColumn.push({
|
||||
name: '状态', key: "status",width:"80px", render: (data) => {
|
||||
name: '状态', key: "status", width: "80px", render: (data) => {
|
||||
if (data.status === 1) {
|
||||
return `<span class="color_1">${'在用'}</span>`
|
||||
} else if (data.status === 0) {
|
||||
|
|
@ -511,12 +511,12 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
//预览附件
|
||||
public previewFile(url,file) {
|
||||
public previewFile(url, file) {
|
||||
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
|
||||
this.currentUrl = file.url;
|
||||
this.showFile = true;
|
||||
} else{
|
||||
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
|
||||
} else {
|
||||
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ export default class Programme extends BaseRecordComponent<any> {
|
|||
}]
|
||||
},
|
||||
];
|
||||
this.updateActions = [{
|
||||
this.subUpdateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
|
|
@ -272,7 +272,7 @@ export default class Programme extends BaseRecordComponent<any> {
|
|||
res.data.forEach((item) => {
|
||||
let itemList = {} as any;
|
||||
itemList.name = item;
|
||||
itemList.value = item === '永久'?'1': item;
|
||||
itemList.value = item === '永久' ? '1' : item;
|
||||
this.suitList.push(itemList)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -383,15 +383,19 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
|||
*/
|
||||
public durationChange(data: any, item: any) {
|
||||
if (item && item.key === 'duration') {
|
||||
this.updateParams.duration = null;
|
||||
this.$set(this.updateParams, item.key, +data.toFixed(1))
|
||||
this.$set(this.updateParams, item.key, null);
|
||||
setTimeout(() => {
|
||||
this.$set(this.updateParams, item.key, +data.toFixed(1))
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public scoreFormat(data: any, item: any) {
|
||||
if (item && item.key === 'score') {
|
||||
this.updateParams.score = null;
|
||||
this.$set(this.subUpdateParams, item.key, +data.toFixed(2))
|
||||
setTimeout(() => {
|
||||
this.$set(this.subUpdateParams, item.key, +data.toFixed(2))
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -560,6 +564,8 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
|||
this.updateParams.members.splice(this.updateParams.members.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
|
||||
}
|
||||
this.subUpdateParams = {} as any;
|
||||
const option = this.subUpdateOptions.find(item => item.key === "score") as any;
|
||||
option.hide = true
|
||||
this.subShowUpdate = !!goOn;
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue