feat:隐患流程相关bug

dev
kongyeqing 2023-09-12 18:08:00 +08:00
parent 969e3d2127
commit 6be98c6962
24 changed files with 694 additions and 443 deletions

View File

@ -227,7 +227,7 @@ export default class AnalEvaluationComponent extends Vue {
key: "name", key: "name",
type: "text", type: "text",
require: true, require: true,
width: "calc(50% - 20px)", width: "100%",
disable: true, disable: true,
showError: false, showError: false,
}, { }, {
@ -259,9 +259,9 @@ export default class AnalEvaluationComponent extends Vue {
{ {
name: "作业步骤描述", name: "作业步骤描述",
key: "description", key: "description",
type: "text", type: "textarea",
require: true, require: true,
width: "calc(100% - 20px)", width: "100%",
disable: true, disable: true,
showError: false, showError: false,
}, },

View File

@ -7,7 +7,7 @@ export default class AreaService extends BaseService<any>{
} }
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<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) return this.get(url,params,true)
} }
// 批量删除 // 批量删除

View File

@ -6,7 +6,7 @@ export default class UnitService extends BaseService<any>{
super() super()
} }
public selectByPage(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ 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) return this.get(url,params,showLoading)
} }

View File

@ -137,7 +137,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
value: item.id value: item.id
} }
}); });
this.buildUpdateForm()
}) })
} }
// //
@ -149,7 +148,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
value: item.id 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, require: true,
expandLevel: Infinity, expandLevel: Infinity,
showError: false, showError: false,
clearable: true,
datas: this.$store.state.deptTreeList datas: this.$store.state.deptTreeList
}, { }, {
name: "整改人员", name: "整改人员",
@ -321,6 +322,11 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() < moment(new Date()).subtract(1, 'day').toDate().getTime();
}
}
}, { }, {
name: "问题描述", name: "问题描述",
key: "description", key: "description",
@ -477,6 +483,14 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
if (item && item.key === "verifyUserId") { if (item && item.key === "verifyUserId") {
this.updateParams.verifyUserName = this.$store.getters.user_map[data] 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, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
@ -533,7 +548,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
inspectUserName: this.account.nickName, inspectUserName: this.account.nickName,
number: null, number: null,
photo: null, photo: null,
inspectTime: moment().format("YYYY-MM-DD HH:mm") inspectTime: moment().format("YYYY-MM-DD HH:mm"),
dangerType: 4
} }
if (!row) { if (!row) {
this.tableService.getNumber().then(res => { this.tableService.getNumber().then(res => {
@ -558,8 +574,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
type: "随手拍", type: "随手拍",
}, res.data) }, res.data)
this.updateParams.majorHazard = +this.updateParams.majorHazard this.updateParams.majorHazard = +this.updateParams.majorHazard
this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[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.center = [res.data.locationLng, res.data.locationLat];
this.buildUpdateForm() this.buildUpdateForm()
@ -651,7 +666,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
} }
public onPreview(file) { public onPreview(file) {
console.log(file)
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) { if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url; this.currentUrl = file.url;
this.showFile = true; 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.resourceName = this.photoList.map(item => item.name).join(",")
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",") this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",") this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
this.tableService.addOrUpdate(JSON.parse(JSON.stringify(this.updateParams)), !this.updateParams.id).then(res => {
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
if (isSubmit) { if (isSubmit) {
this.startWorkFlow(res.data, [this.updateParams.reformUserId]) this.startWorkFlow(res.data, [this.updateParams.reformUserId])

View File

@ -2,7 +2,7 @@
<div class="common-content-box dis-flex flex-col flex-1"> <div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box"> <div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions" <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>
<div class="table-box flex-1"> <div class="table-box flex-1">
<div class="full" v-if="isManager"> <div class="full" v-if="isManager">
@ -42,7 +42,7 @@
@click="showUpdateModel(scope.row,true)">查看</el-button> @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)" <el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
@click="showUpdateModel(scope.row)">修改</el-button> @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" @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" <el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"

View File

@ -662,6 +662,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }

View File

@ -426,6 +426,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
type: "select", type: "select",
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
showError: false, showError: false,
require: true,
datas: this.$store.state.prevention_major_type, datas: this.$store.state.prevention_major_type,
}, { }, {
name: "属性分类", name: "属性分类",
@ -517,19 +518,22 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
}, { }, {
name: "治理资金", name: "治理资金",
type: "number", type: "number",
width: "35%", width: "calc(50% - 20px)",
key: "executeMoney", key: "executeMoney",
require: true, require: true,
hide: this.updateParams.reformConfirmFlag === 0, hide: this.updateParams.reformConfirmFlag === 0,
showError: false, showError: false,
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
],
unit: { unit: {
name: "元", name: "元",
type: "text" type: "text"
} }
}, { }, {
name: "", name: "资金来源",
type: "textarea", type: "textarea",
width: "calc(65% - 40px)", width: "calc(50% - 20px)",
key: "executeMoneySource", key: "executeMoneySource",
hide: this.updateParams.reformConfirmFlag === 0, hide: this.updateParams.reformConfirmFlag === 0,
placeholder: "请输入资金来源" placeholder: "请输入资金来源"
@ -549,6 +553,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
key: "realConfirmTime", key: "realConfirmTime",
format: "yyyy-MM-dd HH:mm", format: "yyyy-MM-dd HH:mm",
showError: false, showError: false,
disable:true,
pickerOptions: this.getPickerOptions(this.updateParams.createTime), pickerOptions: this.getPickerOptions(this.updateParams.createTime),
}] }]
this.updateOptions3 = [{ this.updateOptions3 = [{
@ -777,6 +782,12 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.getTableCallback() this.getTableCallback()
return return
} }
if (item && item.key === 'executeMoney') {
this.updateParams.executeMoney = null;
setTimeout(() => {
this.updateParams.executeMoney = +data.toFixed(2)
}, 0)
}
if (item && item.key === "reformDeadline") { if (item && item.key === "reformDeadline") {
const now = moment().format("YYYY-MM-DD HH"); const now = moment().format("YYYY-MM-DD HH");
if (now > data) { 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.verifyResourceId = this.photoList2.map(item => item.id).join(",")
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",") this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",")
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => { 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 (!preStatus) {
if (isSubmit) { if (isSubmit) {
this.startWorkFlow(this.updateParams.id || res.data, [this.updateParams.reformUserId]) 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) { 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 this.updateParams.photo = this.photoList.length || null
} }
public onRemove2(file, fileList) { 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) { 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) { 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) { public onPreview(file) {

View File

@ -51,7 +51,7 @@
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn" <TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
@actionCallback="subCallback($event)" actionPosition="flex-start" @actionCallback="subCallback($event)" actionPosition="flex-start"
:actions="!isReadonly?updateTableActions:[]" :showFooter="false" style="margin-bottom: 20px;"> :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;"> @selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
<el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly"> <el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly">
</el-table-column> </el-table-column>
@ -80,9 +80,9 @@
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'" <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" <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"> @change="subChange" btn-position="center">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
@ -93,8 +93,7 @@
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn" <TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn"
@pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')" @pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
:showFooter="true"> :showFooter="true">
<el-table ref="checkMultipleTable" :data="updateTableData.datas" tooltip-effect="dark" max-height="600px" border
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;"> @selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
<el-table-column type="selection" fixed label="全选" width="40px"> <el-table-column type="selection" fixed label="全选" width="40px">
</el-table-column> </el-table-column>

View File

@ -122,6 +122,7 @@ export default class RulesComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
showError: false, showError: false,
clearable: true,
datas: this.$store.state.prevention_dangrous_type datas: this.$store.state.prevention_dangrous_type
}] }]
this.updateActions = [{ this.updateActions = [{
@ -193,6 +194,7 @@ export default class RulesComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
/** /**
* 数据保存 * 数据保存

View File

@ -14,7 +14,7 @@ import AreaService from '@/service/area.service';
import RuleService from '@/service/rule.service'; import RuleService from '@/service/rule.service';
@Component({ @Component({
template, template,
components:{ components: {
FormComponent, FormComponent,
TableComponent, TableComponent,
DrawComponent, DrawComponent,
@ -38,10 +38,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public unitList = []; public unitList = [];
public formActions = [{ public formActions = [{
name:"查询", name: "查询",
value:"search", value: "search",
icon:"el-icon-search", icon: "el-icon-search",
type:"primary" type: "primary"
}, { }, {
name: "清空", name: "清空",
icon: "el-icon-tickets", icon: "el-icon-tickets",
@ -49,482 +49,517 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
}]; }];
public tableActions = [{ public tableActions = [{
name:"添加", name: "添加",
value:"add", value: "add",
icon:"el-icon-plus", icon: "el-icon-plus",
type:"primary" type: "primary"
},{ }, {
name:"批量删除", name: "批量删除",
value:"delete", value: "delete",
plain:true, plain: true,
icon:"el-icon-delete", icon: "el-icon-delete",
type:"danger" type: "danger"
}]; }];
public updateTableActions = [{ public updateTableActions = [{
name:"添加", name: "添加",
value:"subAdd", value: "subAdd",
plain:true, plain: true,
icon:"el-icon-plus", icon: "el-icon-plus",
type:"success" type: "success"
},{ }, {
name:"批量删除", name: "批量删除",
value:"subDelete", value: "subDelete",
plain:true, plain: true,
icon:"el-icon-delete", icon: "el-icon-delete",
type:"danger" type: "danger"
},{ }, {
name:"批量添加", name: "批量添加",
value:"subMutilAdd", value: "subMutilAdd",
icon:"el-icon-plus", icon: "el-icon-plus",
type:"primary" type: "primary"
}]; }];
public footerActions = [{ public footerActions = [{
name:"选择全部", name: "选择全部",
value:"selectAll", value: "selectAll",
type:"primary" type: "primary"
},{ }, {
name:"反向选择", name: "反向选择",
value:"reverse" value: "reverse"
}]; }];
public formOptions:FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name:"检查表名称", name: "检查表名称",
key:"name", key: "name",
type:"text" type: "text"
}]; }];
public mutilAddOptions:FormOption<BtnOption>[] = []; public mutilAddOptions: FormOption<BtnOption>[] = [];
public showUpdate = false; public showUpdate = false;
public currentId = -1; public currentId = -1;
public updateParams = {} as any; public updateParams = {} as any;
public subUpdateParams = {} as any; public subUpdateParams = {} as any;
public updateOptions:FormOption<BtnOption>[] = []; public updateOptions: FormOption<BtnOption>[] = [];
public updateTableData = {datas:[]}; public updateTableData = { datas: [] };
public updateTableColumn = [] as any; public updateTableColumn = [] as any;
public showSubUpdate = false; public showSubUpdate = false;
public showSubMutilUpdate = false; public showSubMutilUpdate = false;
public ruleParams = { public ruleParams = {
pageSize:10, pageSize: 10,
pageNum:1 pageNum: 1
} }
public updateActions = [{ public updateActions = [] as any;
name:"取消",
value:"cancel"
},{
name:"保存并继续添加",
value:"saveAndContinue",
type:"primary"
},{
name:"保存",
value:"save",
type:"primary"
}];
public subUpdateOptions = [{ public checkUpdateActions = [] as any;
name:"检查项目",
type:"text", public subUpdateOptions = [] as any;
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 subUpdateActions = [{ public subUpdateActions = [{
name:"取消", name: "取消",
value:"cancelSub" value: "cancel"
},{ }, {
name:"确定", name: "确定",
value:"saveSub", value: "saveSub",
type:"primary" type: "primary"
}]; }];
public selectData = []; public selectData = [];
created(){
created() {
this.loadAreaData(); this.loadAreaData();
this.loadRuleTable(); this.loadRuleTable();
} }
public loadRuleTable(num?,type?){ public loadRuleTable(num?, type?) {
if(type && num){ if (type && num) {
this.ruleParams[type] = num this.ruleParams[type] = num
}else{ } else {
this.ruleParams = { this.ruleParams = {
pageSize:10, pageSize: 10,
pageNum:1 pageNum: 1
} }
} }
this.ruleService.selectByPage(this.ruleParams).then((res:any)=>{ this.ruleService.selectByPage(this.ruleParams).then((res: any) => {
this.updateTableData = res.data; this.updateTableData = res.data;
this.updateTableData.datas.forEach((item:any,index)=>{ this.updateTableData.datas.forEach((item: any, index) => {
item.index = index+1; item.index = index + 1;
}) })
}) })
} }
public buildUpdateForm(){ public buildUpdateForm() {
this.mutilAddOptions = [{ this.mutilAddOptions = [{
name:"检查项目", name: "检查项目",
key:"name", key: "name",
type:"text" type: "text"
},{ }, {
name:"类型", name: "类型",
key:"type", key: "type",
clearable:true, clearable: true,
type:"select", type: "select",
datas:this.$store.state.prevention_dangrous_type datas: this.$store.state.prevention_dangrous_type
}] }]
this.updateOptions = [{ this.updateOptions = [{
name:"检查表编号", name: "检查表编号",
key:"number", key: "number",
type:"text", type: "text",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
disable:true, disable: true,
},{ }, {
name:"检查表名称", name: "检查表名称",
key:"name", key: "name",
type:"text", type: "text",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
},{ }, {
name:"适用区域", name: "适用区域",
key:"areas", key: "areas",
type:"select", type: "select",
multiple:true, multiple: true,
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
datas:this.areaList datas: this.areaList
},{ }, {
name:"适用单元", name: "适用单元",
key:"units", key: "units",
type:"select", type: "select",
multiple:true, multiple: true,
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
datas:this.unitList datas: this.unitList
},{ }, {
name:"适用对象", name: "适用对象",
key:"targets", key: "targets",
type:"select", type: "select",
multiple:true, multiple: true,
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
datas:this.$store.state.analControlList, datas: this.$store.state.analControlList,
},{ }, {
name:"适用部门", name: "适用部门",
key:"depts", key: "depts",
multiple:true, multiple: true,
type:"select", type: "select",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
datas:this.$store.state.deptList datas: this.$store.state.deptList
},{ }, {
name:"适用类型", name: "适用类型",
key:"types", key: "types",
type:"select", type: "select",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
multiple:true, multiple: true,
showError:false, showError: false,
datas:this.$store.state.prevention_dangrous_type 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 subBuildUpdateForm() {
public loadAreaData(){ this.subUpdateOptions = [{
this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{ name: "检查项目",
this.areaList = res.data.datas.map(item=>{ 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 { return {
name:item.name, name: item.name,
value:item.id value: item.id
} }
}); });
this.loadUnitData()
}) })
} }
// //
public loadUnitData(ids?){ public loadUnitData(ids?) {
this.unitService.getListByIds({areaIds:ids},false).then((res:any)=>{ this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
this.unitList = res.data.map(item=>{ this.unitList = res.data.map(item => {
return { return {
name:item.name, name: item.name,
value:item.id value: item.id
} }
}); });
this.buildUpdateForm() const option = this.updateOptions.find(item => item.key === "units") as any;
option.datas = this.unitList
}) })
} }
public getNumber(){ public getNumber() {
this.tableService.getNumber().then(res=>{ this.tableService.getNumber().then(res => {
this.updateParams.number = res.data this.updateParams.number = res.data
}) })
} }
public buildTable(){ public buildTable() {
this.tableColumn = []; this.tableColumn = [];
this.tableColumn.push({name:'检查表名称',key:"name"}); this.tableColumn.push({ name: '检查表名称', key: "name" });
this.tableColumn.push({name:'区域名称',key:"areas"}); this.tableColumn.push({ name: '区域名称', key: "areas" });
this.tableColumn.push({name:'单元名称',key:"units"}); this.tableColumn.push({ name: '单元名称', key: "units" });
this.tableColumn.push({name:'对象名称',key:"targets"}); this.tableColumn.push({ name: '对象名称', key: "targets" });
this.tableColumn.push({name:'适用部门',key:"depts"}); this.tableColumn.push({ name: '适用部门', key: "depts" });
this.tableColumn.push({name:'适用类型',key:"types",filters:this.$store.state.prevention_dangrous_type.map(item=>{ this.tableColumn.push({
return { name: '适用类型', key: "types", filters: this.$store.state.prevention_dangrous_type.map(item => {
text:item.name, return {
value:item.name, text: item.name,
} value: item.name,
}),filterMethod:(data,row)=>{ }
return row.types.indexOf(data)>=0; }), filterMethod: (data, row) => {
}, render: (data) => { return row.types.indexOf(data) >= 0;
}, render: (data) => {
return data.types.split(',').map(item => { return data.types.split(',').map(item => {
return this.$store.getters.prevention_dangrous_type_map[item] return this.$store.getters.prevention_dangrous_type_map[item]
}).join(",") }).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 = [];
this.updateTableColumn.push({name:'序号',key:"index",width:"60px"}); this.updateTableColumn.push({ name: '序号', key: "index", width: "60px" });
this.updateTableColumn.push({name:'检查项目',key:"name",showTip:true}); this.updateTableColumn.push({ name: '检查项目', key: "name", showTip: true });
this.updateTableColumn.push({name:'检查内容',key:"content",showTip:true}); this.updateTableColumn.push({ name: '检查内容', key: "content", showTip: true });
this.updateTableColumn.push({name:'检查依据',key:"reason",showTip:true}); this.updateTableColumn.push({ name: '检查依据', key: "reason", showTip: true });
if(this.showSubMutilUpdate){ if (this.showSubMutilUpdate) {
this.updateTableColumn.push({name:'检查类型',key:"reason",render:(data)=>{ this.updateTableColumn.push({
return this.$store.getters.prevention_dangrous_type_map[data.type] 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 (item && item.key === "areas") {
if(this.updateParams.units.length){ if (this.updateParams.units.length) {
this.updateParams.units = []; this.updateParams.units = [];
} }
this.loadUnitData(data) this.loadUnitData(data)
} }
} }
public callback(data,type?){ public callback(data, type?) {
if(type){ if (type) {
this.params[type] = data; this.params[type] = data;
this.getTableData(); this.getTableData();
return return
} }
// //
if(data && data.value==="search"){ if (data && data.value === "search") {
this.getTableData() this.getTableData()
// //
}else if(data &&data.value === "reset"){ } else if (data && data.value === "reset") {
this.reset() this.reset()
// //
}else if(data &&data.value === "reverse"){ } else if (data && data.value === "reverse") {
this.toggleAll() this.toggleAll()
// //
}else if(data && data.value === "selectAll"){ } else if (data && data.value === "selectAll") {
this.selectAll() this.selectAll()
}else if(data && data.value === "add"){ } else if (data && data.value === "add") {
this.showUpdateModel() this.showUpdateModel()
}else if(data && data.value === "delete"){ } else if (data && data.value === "delete") {
this.deleteData(this.selectData.map((item:any)=>item.id)) this.deleteData(this.selectData.map((item: any) => item.id))
}else if(data && data.value.indexOf("save")>=0){ } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value!=="save") this.doSave(data.value !== "save")
}else if(data && data.value === "cancel"){ } else if (data && data.value === "cancel") {
this.handleClose() this.handleClose()
} }
} }
public subChange(data,item){ public subChange(data, item) {
// //
} }
public subCallback(data){ public subCallback(data) {
if(data && data.value==="subAdd"){ if (data && data.value === "subAdd") {
this.showSubUpdateModel() this.showSubUpdateModel()
}else if(data && data.value.indexOf("save")>=0){ } else if (data && data.value.indexOf("save") >= 0) {
this.doSubSave(data.value!=="save") this.doSubSave(data.value !== "save")
}else if(data && data.value==="cancel"){ } else if (data && data.value === "cancel") {
this.handleClose() this.handleClose()
}else if(data && data.value==="subDelete"){ } else if (data && data.value === "subDelete") {
this.doSubDelete(this.selectData.map((item:any)=>item.index -1)) this.doSubDelete(this.selectData.map((item: any) => item.index - 1))
}else if(data && data.value==="subMutilAdd"){ } else if (data && data.value === "subMutilAdd") {
this.showSubMutilUpdate = true; this.showSubMutilUpdate = true;
this.buildTable() this.buildTable()
this.clearSelect() this.clearSelect()
this.loadRuleTable();
} }
} }
public doMutilAdd(){ public doMutilAdd() {
this.selectData.forEach((item:any)=>{ this.selectData.forEach((item: any) => {
if(!this.updateParams.tableItems.find(itm=>itm.id===item.id)){ if (!this.updateParams.tableItems.find(itm => itm.id === item.id)) {
const data = JSON.parse(JSON.stringify(item)) const data = JSON.parse(JSON.stringify(item))
delete data.id; delete data.id;
this.updateParams.tableItems.push(data) this.updateParams.tableItems.push(data)
} }
}) })
this.updateParams.tableItems.forEach((item,i)=>{ this.updateParams.tableItems.forEach((item, i) => {
item.index = i+1 item.index = i + 1
}) })
this.clearSelect() this.clearSelect()
this.showSubMutilUpdate=false; this.ruleParams = {
pageSize: 10,
pageNum: 1
}
this.showSubMutilUpdate = false;
this.buildTable(); this.buildTable();
} }
public cancelMutilAdd(){ public cancelMutilAdd() {
this.clearSelect(); this.clearSelect();
this.ruleParams = { this.ruleParams = {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
} }
this.showSubMutilUpdate=false; this.showSubMutilUpdate = false;
this.buildTable(); this.buildTable();
} }
public clearSelect(){ public clearSelect() {
(this.$refs.multipleTable as any).clearSelection(); (this.$refs.multipleTable as any).clearSelection();
this.selectData = []; this.selectData = [];
} }
// //
public reset(){ public reset() {
this.params = { this.params = {
name:"", name: "",
pageNum:1, pageNum: 1,
pageSize:20, pageSize: 20,
} as any; } as any;
this.ruleParams = { this.ruleParams = {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
} }
this.getTableData()
} }
public showSubUpdateModel(row?,isRead?){ public showSubUpdateModel(row?, isRead?) {
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.subIsReadonly = !!isRead; this.subIsReadonly = !!isRead;
if(row){ if (row) {
this.subUpdateParams = JSON.parse(JSON.stringify(row)) this.subUpdateParams = JSON.parse(JSON.stringify(row))
} }
this.subBuildUpdateForm()
this.showSubUpdate = true; this.showSubUpdate = true;
} }
public showUpdateModel(row?,isRead?){ public showUpdateModel(row?, isRead?) {
this.updateParams = {number:null,tableItems:[]} as any; this.updateParams = { number: null, tableItems: [] } as any;
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
this.clearSelect() this.clearSelect()
if (!row) {
this.buildUpdateForm();
if(!row){
this.currentId = -1; this.currentId = -1;
this.getNumber(); this.getNumber();
this.buildUpdateForm();
this.showUpdate = true; this.showUpdate = true;
}else{ } else {
this.currentId = row.id; this.currentId = row.id;
this.tableService.selectById(this.currentId,true).then((res:any)=>{ this.tableService.selectById(this.currentId, true).then((res: any) => {
if(isRead){ if (isRead) {
this.updateParams = Object.assign(res.data,row) this.updateParams = Object.assign(res.data, row)
}else{ } else {
this.updateParams = res.data; this.updateParams = res.data;
this.loadUnitData(res.data.areas) this.loadUnitData(res.data.areas)
} }
this.updateParams.tableItems.forEach((item,i)=>{ this.updateParams.tableItems.forEach((item, i) => {
item.index = i+1 item.index = i + 1
}) })
this.buildUpdateForm();
this.showUpdate = true; this.showUpdate = true;
}) })
} }
} }
public doSubSave(goOn?){ public doSubSave(goOn?) {
if(!this.subUpdateParams.index){ if (!this.subUpdateParams.index) {
this.subUpdateParams.index = this.updateParams.tableItems.length+1; this.subUpdateParams.index = this.updateParams.tableItems.length + 1;
this.updateParams.tableItems.push(this.subUpdateParams); this.updateParams.tableItems.push(this.subUpdateParams);
}else{ } else {
this.updateParams.tableItems.splice(this.updateParams.tableItems.findIndex(item=>item.index ===this.subUpdateParams.index),1,this.subUpdateParams) this.updateParams.tableItems.splice(this.updateParams.tableItems.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
} }
this.updateParams.tableItems.forEach((item,i)=>{ this.updateParams.tableItems.forEach((item, i) => {
item.index = i+1 item.index = i + 1
}) })
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.showSubUpdate = !!goOn this.showSubUpdate = false;
} }
public doSubDelete(indexs){ public doSubDelete(indexs) {
for(let i = this.updateParams.tableItems.length-1;i>=0;i--){ for (let i = this.updateParams.tableItems.length - 1; i >= 0; i--) {
if(indexs.includes(i)){ if (indexs.includes(i)) {
this.updateParams.tableItems.splice(i,1) this.updateParams.tableItems.splice(i, 1)
} }
} }
this.updateParams.tableItems.forEach((item,i)=>{ this.updateParams.tableItems.forEach((item, i) => {
item.index = i+1 item.index = i + 1
}) })
this.clearSelect() this.clearSelect()
} }
public doSave(goOn?){ public doSave(goOn?) {
this.updateParams.depts = this.updateParams.depts.map(item=>{ this.updateParams.depts = this.updateParams.depts.map(item => {
return { return {
id:item, id: item,
name:this.$store.getters.dept_map[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 { return {
id:item, id: item,
name:this.$store.getters.prevention_anal_control_map[item] name: this.$store.getters.prevention_anal_control_map[item]
} }
}) })
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then(res=>{ this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then(res => {
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功"); this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功");
this.getTableData(); this.getTableData();
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.updateParams = {areas:[],depts:[],units:[],types:[],targets:[],number:null,tableItems:[]} as any; this.updateParams = { areas: [], depts: [], units: [], types: [], targets: [], number: null, tableItems: [] } as any;
if(!!goOn){ if (!!goOn) {
this.getNumber(); this.getNumber();
} }
}).catch(()=>{ }).catch(() => {
this.updateParams.depts = this.updateParams.depts.map(item=>item.id) 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(){ public handleClose() {
if(this.showSubMutilUpdate){ if (this.showSubMutilUpdate) {
this.showSubMutilUpdate = false; this.showSubMutilUpdate = false;
this.buildTable(); this.buildTable();
return return
} }
if(this.showSubUpdate){ if (this.showSubUpdate) {
this.showSubUpdate = false; this.showSubUpdate = false;
return return
} }
@ -533,25 +568,25 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public toggleAll() { public toggleAll() {
this.tableData.datas.forEach((item,index)=>{ this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
} }
public selectAll(){ public selectAll() {
if(!this.selectData.length){ if (!this.selectData.length) {
this.toggleAll() this.toggleAll()
}else{ } else {
this.tableData.datas.forEach((item,index)=>{ this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data:any)=>data.id === item.id); const find = this.selectData.find((data: any) => data.id === item.id);
if(!find){ if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
} }
}) })
} }
} }
public handleSelectionChange(data){ public handleSelectionChange(data) {
this.selectData = data; this.selectData = data;
} }
} }

View File

@ -43,7 +43,7 @@
<el-dialog :close-on-click-modal="false" :title="isReadonly ?'详情': updateParams.id ?'编辑': '新增'" <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" <FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions" :isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center"> :full-btn="true" btnPosition="center">
@ -51,7 +51,7 @@
<TableComponent :tableData="updateParams.details" :tableColumn="subTableColumn" <TableComponent :tableData="updateParams.details" :tableColumn="subTableColumn"
@actionCallback="subCallback($event)" :actions="isReadonly ? [] :tableActions" @actionCallback="subCallback($event)" :actions="isReadonly ? [] :tableActions"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;"> 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%"> row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
<el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40"> <el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40">
</el-table-column> </el-table-column>
@ -80,10 +80,10 @@
<el-dialog :close-on-click-modal="false" <el-dialog :close-on-click-modal="false"
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate" :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" <FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
@actionCallback="triCallback" :isReadonly="subIsReadonly" :actions="updateActions" @actionCallback="triCallback" :isReadonly="subIsReadonly" :actions="subUpdateActions" :full-btn="true" @change="changes"
:full-btn="true" btnPosition="center"> btnPosition="center">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
</div> </div>

View File

@ -120,6 +120,7 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
public updateActions = [] as any; public updateActions = [] as any;
public subUpdateActions = [] as any;
public rewardsType = [{ public rewardsType = [{
name: "不涉及", name: "不涉及",
@ -178,6 +179,22 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
showError: false, 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 = [{ this.subUpdateOptions = [{
name: "奖惩日期", name: "奖惩日期",
type: "date", type: "date",
@ -202,6 +219,10 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
require: true, require: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
showError: false, showError: false,
hide: !(this.subUpdateParams.type && this.subUpdateParams.type !== 1),
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
]
}, { }, {
name: "奖惩事由", name: "奖惩事由",
type: "textarea", type: "textarea",
@ -229,14 +250,14 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
expandLevel: Infinity, expandLevel: Infinity,
datas: this.$store.state.deptTreeList datas: this.$store.state.deptTreeList
},]; },];
this.updateActions = [{ this.subUpdateActions = [{
name: "取消", name: "取消",
value: "cancel" value: "cancel"
}, { }, {
name: "保存并继续添加", name: "保存并继续添加",
value: "saveAndContinue", value: "saveAndContinue",
type: "primary", type: "primary",
hide: this.updateParams.id hide: this.subUpdateParams.index
}, { }, {
name: "保存", name: "保存",
value: "save", 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() { public buildTable() {
@ -350,8 +387,8 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
} }
// //
public getTableData() { public getTableData() {
if(this.params.postName){ if (this.params.postName) {
this.params.postName = this.$store.state.postList.find((item: any) => item.value === this.params.postName)?.name??"" this.params.postName = this.$store.state.postList.find((item: any) => item.value === this.params.postName)?.name ?? ""
} }
this.tableService.selectByPage(this.params).then(res => { this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any; this.tableData = res.data as any;
@ -375,7 +412,6 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
public toggleAll() { public toggleAll() {
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
@ -410,7 +446,6 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
this.isReadonly = false this.isReadonly = false
this.subIsReadonly = false this.subIsReadonly = false
} }
this.tableService.getListDetail({ id: row.id }).then((res: any) => { this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
this.updateParams = res.data this.updateParams = res.data
@ -431,7 +466,8 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
if (data.value === "add") { if (data.value === "add") {
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.subIsReadonly = false; this.subIsReadonly = false;
this.subShowUpdate = true this.buildSubUpdateForm()
this.subShowUpdate = true;
} else if (data.value === "cancel") { } else if (data.value === "cancel") {
this.showUpdate = false this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) { } 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)) this.deleteSubData(this.subSelectData.map((itm: any) => itm.index - 1))
} }
} }
/**
* 保存数据
* @param goOn
*/
public doSave(goOn?) { public doSave(goOn?) {
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => { this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
@ -455,12 +495,15 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
public triCallback(data) { public triCallback(data) {
if (data.value === "cancel") { if (data.value === "cancel") {
this.subShowUpdate = false this.subShowUpdate = false;
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
this.doSubSave(data.value !== "save") this.doSubSave(data.value !== "save")
} }
} }
/**
* 新增奖惩记录
* @param goOn
*/
public doSubSave(goOn) { public doSubSave(goOn) {
// //
if (this.subShowUpdate) { 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.updateParams.details.splice(this.updateParams.details.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
} }
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.buildSubUpdateForm()
this.subShowUpdate = !!goOn; this.subShowUpdate = !!goOn;
return return
} }
} }
// /**
public showSubModal(row, isReadonly) { * 奖惩记录查看或者修改
if (isReadonly) { * @param row 当前行数据
this.subIsReadonly = true * @param isReadonly 是否是查看
this.subUpdateParams = Object.assign({ */
typeName: this.rewardsTypeName[row.type] public showSubModal(row: any, isReadonly = false) {
}, row) this.subIsReadonly = isReadonly
} else { this.subUpdateParams = Object.assign({
this.subIsReadonly = false typeName: this.rewardsTypeName[row.type]
this.subUpdateParams = row }, row)
}
this.subShowUpdate = true
this.buildUpdateForm()
}
// this.buildSubUpdateForm()
this.subShowUpdate = true
}
/**
* 删除奖惩记录
* @param indexs
*/
public deleteSubData(indexs) { public deleteSubData(indexs) {
this.$confirm('确认删除所选数据', '确认数据', { this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定', confirmButtonText: '确定',

View File

@ -90,7 +90,7 @@
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-input size="mini" type="number" min="0" :max="scope.row.score" <el-input size="mini" type="number" min="0" :max="scope.row.score"
v-model="scope.row.deductPoints" v-if="scope.row.pointFlag" 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)" @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> 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> <span v-if="!scope.row.pointFlag">{{scope.row.deductPoints}}</span>
@ -104,10 +104,12 @@
<el-table-column prop="record" label="评估记录" :show-overflow-tooltip="true"> <el-table-column prop="record" label="评估记录" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="mini" type="textarea" placeholder="点击输入评估记录" v-model="scope.row.record" <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 <span
style="font-size: 14px;font-weight: 400;color: rgba(0,0,0,0.3) ;line-height: 20px;" 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 "> <span v-if="!scope.row.recordFlag &&scope.row.record ">
{{scope.row.record}} {{scope.row.record}}
</span> </span>

View File

@ -188,7 +188,7 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
public updateActions = [{ public updateActions = [{
name: "取消", name: "取消",
value: "cancel" value: "cancel"
},{ }, {
name: "保存", name: "保存",
value: "save", value: "save",
type: "primary" type: "primary"
@ -248,23 +248,32 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
} else if (data.value === "delete") { } else if (data.value === "delete") {
this.deleteData(this.selectData.map((item: any) => item.id)) this.deleteData(this.selectData.map((item: any) => item.id))
} else if (data.value === 'add') { } else if (data.value === 'add') {
this.estimateStandard = [] as any; //
this.checkReject = [] as any; this.addUpdateMethod();
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()
} }
} }
/**
* 添加按钮操作
*/
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() { public getTableData() {
this.tableService.selectByPage(this.params).then(res => { this.tableService.selectByPage(this.params).then(res => {
@ -282,6 +291,8 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
public handleClose() { public handleClose() {
this.showUpdate = false; this.showUpdate = false;
//
this.clearFileListMethod()
} }
@ -363,26 +374,23 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
public doSave(goOn?) { public doSave(goOn?) {
// //
if (this.fileList.length > 0) { if (this.checkReject.length === 0) {
let resourceId = this.fileList.map((item) => { let tips: any = false;
return item.id this.estimateStandard.forEach((item: any) => {
item.tableData.forEach((dataitem: any) => {
if (dataitem.deductPoints === '--') {
tips = true
}
})
}) })
let resourceName = this.fileList.map((item) => { if (tips === true) {
return item.name this.$message.warning('您有自评项未填写!!')
}) return
this.updateParams.resourceId = resourceId.join(",") }
this.updateParams.resourceName = resourceName.join(",")
} }
let tmpContent = {} as any; //
tmpContent.content = this.estimateStandard; this.reorganizeParamsDataMethod();
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.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
// //
@ -402,6 +410,30 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
this.getTableData(); 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) { public showModal(row, isReadonly) {
if (isReadonly) { if (isReadonly) {
@ -458,10 +490,16 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
public cellClick(row, column) { public cellClick(row, column) {
if (this.isReadonly === false) { if (this.isReadonly === false) {
if (column.label === '扣分') { if (column.label === '扣分') {
row.pointFlag = true row.pointFlag = true;
this.clickPointFlag = true this.clickPointFlag = true;
this.$nextTick(() => {
(this.$refs.score as any)[0].focus();
})
} else if (column.label === '评估记录') { } 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) { public pointInput(data, row, items) {
// 0 // 0
if (data.replace(/^0+(\d)/, "$1")) { if (data.replace(/^0+(\d)/, "$1")) {
@ -565,9 +608,6 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
} }
} }
} }
// //
public previewFile(url, file) { public previewFile(url, file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) { 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> </script>
<style lang="scss" scoped src="../../common.component.scss"></style> <style lang="scss" scoped src="../../common.component.scss"></style>

View File

@ -65,11 +65,11 @@
:label="item.name" :width="item.width" :key="item.key"> :label="item.name" :width="item.width" :key="item.key">
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" fixed="right" width="200" v-if="!isReadonly"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showSubmodal(scope.row,true)">查看</el-button> <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" v-if="!isReadonly" @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="deleteProData([scope.row.index - 1])">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -94,7 +94,7 @@
<el-dialog :close-on-click-modal="false" <el-dialog :close-on-click-modal="false"
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate" :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" <FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
@actionCallback="triCallback" :isReadonly="subIsReadonly" @change="changes" :actions="updateActions" @actionCallback="triCallback" :isReadonly="subIsReadonly" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center" :labelWidth="labelWidth"> :full-btn="true" btnPosition="center" :labelWidth="labelWidth">

View File

@ -376,7 +376,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
this.updateParams = {} as any; this.updateParams = {} as any;
this.setpsOptions = [] as any; this.setpsOptions = [] as any;
this.isReadonly = false; this.isReadonly = false;
//
this.clearFileListMethod()
this.getNumber() this.getNumber()
} }
} }
@ -414,6 +415,7 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public showUpdateModel(id) { public showUpdateModel(id) {
@ -422,6 +424,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
public handleClose() { public handleClose() {
this.showUpdate = false; this.showUpdate = false;
//
this.clearFileListMethod()
} }
@ -477,7 +481,9 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
public subCallback(data) { public subCallback(data) {
if (data.value === "cancel") { if (data.value === "cancel") {
this.showUpdate = false this.showUpdate = false;
//
this.clearFileListMethod()
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save") this.doSave(data.value !== "save")
} }
@ -544,7 +550,8 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
this.updateParams = {} as any this.updateParams = {} as any
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.getTableData(); this.getTableData();
//
this.clearFileListMethod()
if (goOn === true) { if (goOn === true) {
this.getNumber() 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> </script>
<style lang="scss" scoped src="../common.component.scss"></style> <style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -270,6 +270,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
} }
created() { created() {
this.buildUpdateForm()
} }
@ -284,7 +285,9 @@ export default class RiskCard extends BaseRecordComponent<any> {
analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null, 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, 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() { public handleClose() {
this.subShowUpdate = false; this.subShowUpdate = false;
//
this.clearFileListMethod();
} }
public toggleAll() { public toggleAll() {
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
} }
public selectAll() { public selectAll() {
if (!this.selectData.length) { if (!this.selectData.length) {
this.toggleAll() this.toggleAll()
@ -468,10 +475,20 @@ export default class RiskCard extends BaseRecordComponent<any> {
public triCallback(data) { public triCallback(data) {
if (data.value === "cancel") { if (data.value === "cancel") {
this.subShowUpdate = false this.subShowUpdate = false
//
this.clearFileListMethod();
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save") 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?) { public doSave(goOn?) {
// //
@ -492,7 +509,8 @@ export default class RiskCard extends BaseRecordComponent<any> {
this.subUpdateParams = {} as any this.subUpdateParams = {} as any
this.subShowUpdate = !!goOn; this.subShowUpdate = !!goOn;
this.getTableData(); this.getTableData();
//
this.clearFileListMethod()
if (goOn === true) { if (goOn === true) {
this.getNumber() this.getNumber()
} }

View File

@ -301,6 +301,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.subIsReadonly = false; this.subIsReadonly = false;
this.fileList = [] as any; this.fileList = [] as any;
//
this.clearFileListMethod()
this.getNumber() this.getNumber()
} }
} }
@ -340,6 +342,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
public handleClose() { public handleClose() {
this.subShowUpdate = false; this.subShowUpdate = false;
//
this.clearFileListMethod()
} }
@ -399,7 +403,9 @@ export default class SafeCard extends BaseRecordComponent<any> {
public triCallback(data) { public triCallback(data) {
if (data.value === "cancel") { if (data.value === "cancel") {
this.subShowUpdate = false this.subShowUpdate = false;
//
this.clearFileListMethod()
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save") this.doSave(data.value !== "save")
} }
@ -427,7 +433,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
this.subUpdateParams = {} as any this.subUpdateParams = {} as any
this.subShowUpdate = !!goOn; this.subShowUpdate = !!goOn;
this.getTableData(); this.getTableData();
//
this.clearFileListMethod()
if (goOn === true) { if (goOn === true) {
this.getNumber() this.getNumber()
} }
@ -512,7 +519,11 @@ export default class SafeCard extends BaseRecordComponent<any> {
} }
} }
// /**
* 下载附件
* @param url 下载url
* @param file 文件信息
*/
public downLoadFile(url, file) { public downLoadFile(url, file) {
let DownUrl = url; let DownUrl = url;
fetch(DownUrl) fetch(DownUrl)
@ -535,6 +546,15 @@ export default class SafeCard extends BaseRecordComponent<any> {
window.URL.revokeObjectURL(href); // blob window.URL.revokeObjectURL(href); // blob
}); });
} }
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.fileList = [];
const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any;
option.fileList = [];
}
} }
</script> </script>
<style lang="scss" scoped src="../common.component.scss"></style> <style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -52,7 +52,7 @@
<TableComponent :tableData="updateParams.members" :tableColumn="subTableColumn" <TableComponent :tableData="updateParams.members" :tableColumn="subTableColumn"
@actionCallback="subCallback($event)" :actions="isReadonly ? []:tableActions" @actionCallback="subCallback($event)" :actions="isReadonly ? []:tableActions"
actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;"> 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%"> row-key="checked" @selection-change="handleSubSelectionChange" style="width: 100%">
<el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40"> <el-table-column v-if="!isReadonly" type="selection" fixed label="全选" width="40">
</el-table-column> </el-table-column>
@ -93,7 +93,7 @@
:before-close="handleTableClose" destroy-on-close> :before-close="handleTableClose" destroy-on-close>
<TableComponent :tableData="currentDetailsTableData" :tableColumn="subTableColumn" :showFooter="false" <TableComponent :tableData="currentDetailsTableData" :tableColumn="subTableColumn" :showFooter="false"
style="margin-bottom: 20px;"> 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%"> border style="width: 100%">
<template v-for="item in subTableColumn"> <template v-for="item in subTableColumn">
<el-table-column :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name" <el-table-column :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"

View File

@ -278,6 +278,19 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
width: "100%", width: "100%",
showError: false, showError: false,
},] },]
this.subUpdateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.subUpdateParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
} }
created() { created() {
@ -343,7 +356,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
} as any; } as any;
this.fileList = [] as any; this.fileList = [] as any;
this.getFormNumber() this.getFormNumber()
//
this.clearFileListMethod()
} }
} }
// //
@ -385,7 +399,6 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
this.updateParams.resourceId = resourceId.join(",") this.updateParams.resourceId = resourceId.join(",")
this.updateParams.resourceName = resourceName.join(",") this.updateParams.resourceName = resourceName.join(",")
} }
// //
this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId]; this.updateParams.chargeUserName = this.$store.getters.user_map[this.updateParams.chargeUserId];
this.updateParams.approveUserName = this.$store.getters.user_map[this.updateParams.approveUserId]; this.updateParams.approveUserName = this.$store.getters.user_map[this.updateParams.approveUserId];
@ -398,7 +411,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
} as any } as any
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.getTableData(); this.getTableData();
this.fileList = []; //
this.clearFileListMethod()
if (goOn === true) { if (goOn === true) {
this.getFormNumber() this.getFormNumber()
} }
@ -411,6 +425,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
public handleClose() { public handleClose() {
this.showUpdate = false; this.showUpdate = false;
//
this.clearFileListMethod()
} }
@ -419,6 +435,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
} }
public selectAll() { public selectAll() {
if (!this.selectData.length) { if (!this.selectData.length) {
this.toggleAll() this.toggleAll()
@ -548,11 +565,13 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
public subCallback(data) { public subCallback(data) {
if (data.value === "add") { if (data.value === "add") {
this.buildSubForm()
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.buildSubForm()
this.subShowUpdate = true this.subShowUpdate = true
} else if (data.value === "cancel") { } else if (data.value === "cancel") {
this.showUpdate = false this.showUpdate = false;
//
this.clearFileListMethod()
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save") this.doSave(data.value !== "save")
} else if (data && data.value === 'delete') { } 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) { public downLoadFile(url, file) {
let DownUrl = url; let DownUrl = url;
fetch(DownUrl) fetch(DownUrl)
@ -663,6 +686,14 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
window.URL.revokeObjectURL(href); // blob window.URL.revokeObjectURL(href); // blob
}); });
} }
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.fileList = [];
const option = this.updateOptions.find(item => item.key === "resourceId") as any;
option.fileList = [];
}
} }
</script> </script>
<style lang="scss" scoped src="../common.component.scss"></style> <style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -61,7 +61,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
public subShowUpdate = false; public subShowUpdate = false;
public subUpdateActions = [] as any; public subUpdateActions = [] as any;
public formActions = [{ public formActions = [{
name: "查询", name: "查询",
value: "search", value: "search",
@ -105,7 +105,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
type: "treeSelect", type: "treeSelect",
datas: this.$store.state.deptTreeList, datas: this.$store.state.deptTreeList,
expandLevel: Infinity, expandLevel: Infinity,
width:"280px" width: "280px"
}, { }, {
name: "发布时间", name: "发布时间",
key: "publishTime", key: "publishTime",
@ -238,7 +238,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
}] }]
}, },
]; ];
this.updateActions = [{ this.subUpdateActions = [{
name: "取消", name: "取消",
value: "cancel" value: "cancel"
}, { }, {
@ -256,14 +256,14 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
created() { created() {
//
} }
public buildTable() { public buildTable() {
this.tableColumn.push({ name: '制度名称', key: "name", width: "200px" }); this.tableColumn.push({ name: '制度名称', key: "name", width: "200px" });
this.tableColumn.push({ name: '适用部门', key: "suitDeptName", 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: "publishDeptName", width: "100px", });
this.tableColumn.push({ name: '发布时间', key: "publishTime", width: "150px", }); this.tableColumn.push({ name: '发布时间', key: "publishTime", width: "150px", });
this.tableColumn.push({ this.tableColumn.push({
@ -274,7 +274,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
} }
}); });
this.tableColumn.push({ this.tableColumn.push({
name: '状态', key: "status",width:"80px", render: (data) => { name: '状态', key: "status", width: "80px", render: (data) => {
if (data.status === 1) { if (data.status === 1) {
return `<span class="color_1">${'在用'}</span>` return `<span class="color_1">${'在用'}</span>`
} else if (data.status === 0) { } 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) { if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url; this.currentUrl = file.url;
this.showFile = true; this.showFile = true;
} else{ } else {
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank") window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
} }
} }

View File

@ -245,7 +245,7 @@ export default class Programme extends BaseRecordComponent<any> {
}] }]
}, },
]; ];
this.updateActions = [{ this.subUpdateActions = [{
name: "取消", name: "取消",
value: "cancel" value: "cancel"
}, { }, {
@ -272,7 +272,7 @@ export default class Programme extends BaseRecordComponent<any> {
res.data.forEach((item) => { res.data.forEach((item) => {
let itemList = {} as any; let itemList = {} as any;
itemList.name = item; itemList.name = item;
itemList.value = item === '永久'?'1': item; itemList.value = item === '永久' ? '1' : item;
this.suitList.push(itemList) this.suitList.push(itemList)
}) })
}) })

View File

@ -383,15 +383,19 @@ export default class TrainRecords extends BaseRecordComponent<any> {
*/ */
public durationChange(data: any, item: any) { public durationChange(data: any, item: any) {
if (item && item.key === 'duration') { if (item && item.key === 'duration') {
this.updateParams.duration = null; this.$set(this.updateParams, item.key, null);
this.$set(this.updateParams, item.key, +data.toFixed(1)) setTimeout(() => {
this.$set(this.updateParams, item.key, +data.toFixed(1))
}, 0)
} }
} }
public scoreFormat(data: any, item: any) { public scoreFormat(data: any, item: any) {
if (item && item.key === 'score') { if (item && item.key === 'score') {
this.updateParams.score = null; 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.updateParams.members.splice(this.updateParams.members.findIndex(item => item.index === this.subUpdateParams.index), 1, this.subUpdateParams)
} }
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
const option = this.subUpdateOptions.find(item => item.key === "score") as any;
option.hide = true
this.subShowUpdate = !!goOn; this.subShowUpdate = !!goOn;
return return
} }