Commit 73357590 authored by 李苏's avatar 李苏 💬

隐患管理部分接口

parent b1c3aa84
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任部门" ref="bmid" prop="bmid"> <el-form-item label="责任部门" ref="bmid" prop="bmid">
<el-input :readonly="readonly" v-model="form.bmid" ></el-input> <RelSelect :readonly="readonly" style="width: 100%;" src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任部门" ref="bmid" prop="bmid"> <el-form-item label="责任部门" ref="bmid" prop="bmid">
<el-input :readonly="readonly" v-model="form.bmid" ></el-input> <RelSelect :readonly="readonly" style="width: 100%;" src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12"> <!-- <el-col :span="12">
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任部门" ref="bmid" prop="bmid"> <el-form-item label="责任部门" ref="bmid" prop="bmid">
<el-input :readonly="readonly" v-model="form.bmid" ></el-input> <RelSelect :readonly="readonly" style="width: 100%;" src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任部门" ref="bmid" prop="bmid"> <el-form-item label="责任部门" ref="bmid" prop="bmid">
<el-input :readonly="readonly" v-model="form.bmid" ></el-input> <RelSelect :readonly="readonly" style="width: 100%;" src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任部门" ref="bmid" prop="bmid"> <el-form-item label="责任部门" ref="bmid" prop="bmid">
<el-input :readonly="readonly" v-model="form.bmid" ></el-input> <RelSelect :readonly="readonly" style="width: 100%;" src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
......
<template> <template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写--> <!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="角色编码" ref="roleid" prop="roleid"> <el-form-item label="风险类型" ref="fxlx" prop="fxlx">
<el-input :readonly="readonly" v-toUpperCase v-model="form.roleid"></el-input> <RelSelect src='/aqgl/fxyk/shlx/query' clearable :match="{value:'id',label:'name'}" v-model='form.fxlx' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.fxlx" ></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="角色名称" ref="rolename" prop="rolename"> <el-form-item label="风险性质" ref="fxxz" prop="fxxz">
<el-input :readonly="readonly" v-model="form.rolename"></el-input> <RelSelect src='/aqgl/fxyk/fxsj/init/shxz' clearable :match="{value:'id',label:'name'}" v-model='form.fxxz' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.fxxz" ></el-input> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="死亡人数" ref="swrs" prop="swrs">
<el-input type="number" :readonly="readonly" v-model="form.swrs" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="重伤人数" ref="zsrs" prop="zsrs">
<el-input type="number" :readonly="readonly" v-model="form.zsrs" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="轻伤人数" ref="qsrs" prop="qsrs">
<el-input type="number" :readonly="readonly" v-model="form.qsrs" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="直接经济损失" ref="zjjjss" prop="zjjjss">
<el-input type="number" :readonly="readonly" v-model="form.zjjjss" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="损失工作日" ref="gzrss" prop="gzrss">
<el-input type="number" :readonly="readonly" v-model="form.gzrss" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" ref="bmid" prop="bmid">
<RelSelect src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.bmid" ></el-input> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="车间" ref="cjid" prop="cjid">
<RelSelect src='/kzzx/cj/query' filterable clearable :match="{value:'id',label:'cjmc'}" v-model='form.cjid' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.cjid" ></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="登记人" ref="djrid" prop="djrid">
<RelSelect src='/kzzx/user/query' filterable clearable :match="{value:'userid',label:'username'}" v-model='form.djrid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事故日期" ref="sgrq" prop="sgrq">
<el-date-picker style="width: 100%;" :readonly="readonly" v-model="form.sgrq" ></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注"> <el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.bz"></el-input> <el-input type='textarea' :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- 按钮重写, -->
<!-- <div slot="reFooter">
<span slot="footer">
重写按钮写在这里,根据需要重写 slot(reFooter,foorer) 节点样式 重写方法需要在此页重新定义
</span>
</div> -->
</RelDialog> </RelDialog>
</template> </template>
<script> <script>
...@@ -36,9 +85,10 @@ ...@@ -36,9 +85,10 @@
mixins: [editMixin], mixins: [editMixin],
/* 存放index页面传递的额外参数*/ /* 存放index页面传递的额外参数*/
mounted() { mounted() {
}, },
/* 组件名称*/ /* 组件名称*/
name: 'roleManagementEdit', name: "aqglFxsjEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/ /* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() { data() {
...@@ -47,11 +97,50 @@ ...@@ -47,11 +97,50 @@
/* 额外初始化,根据需求*/ /* 额外初始化,根据需求*/
systemType: [], systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: { form: {
roleid: '', //ID
rolename: '', id:'',
bz: "", //风险类型
fxlx:'',
//风险性质
fxxz:'',
//死亡人数
swrs:'',
//重伤人数
zsrs:'',
//轻伤人数
qsrs:'',
//直接经济损失
zjjjss:'',
//损失工作日
gzrss:'',
//部门编码
bmid:'',
//车间编码
cjid:'',
//登记人编码
djrid:'',
//备注
bz:'',
//维护人编码
whrid:'',
//维护人
whr:'',
//维护时间
whsj:new Date().getTime(),
//创建人编码
cjrid:'',
//创建人
cjr:'',
//创建时间
cjsj:new Date().getTime(),
//事故日期
sgrq:new Date().getTime(),
//系统版本
sysversion:'',
}, },
/* form提交时的规则,具体规则参考官网*/ /* form提交时的规则,具体规则参考官网*/
rules: { rules: {
......
...@@ -9,42 +9,34 @@ ...@@ -9,42 +9,34 @@
<el-col :span="6" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">开始日期:</span> <span class="search-span">开始日期:</span>
<el-date-picker></el-date-picker> <el-date-picker v-model="queryParams.sgksrq"></el-date-picker>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">结束日期:</span> <span class="search-span">结束日期:</span>
<el-date-picker ></el-date-picker> <el-date-picker v-model="queryParams.sgjsrq" ></el-date-picker>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar"> <el-row class="tool-bar">
<PrintButton :app='app'></PrintButton> <!-- <PrintButton :app='app'></PrintButton> -->
<ViewButton ref="view" :app='app'></ViewButton> <ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton> <AttachFileButton :app='app'></AttachFileButton>
<!-- <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<FieldButton :app='app'></FieldButton> <FieldButton :app='app'></FieldButton> -->
<ExcelButton :app='app'></ExcelButton> <!-- <ExcelButton :app='app'></ExcelButton> -->
<!-- 额外按钮--> <!-- 额外按钮-->
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'> @getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="启用/停用" width="90" header-align="center" >
<template slot-scope="scope">
<el-switch @click.native="setEnable(scope.row.id)" :value='tybz(scope)' style="width: 80px;justify-content: center;"
active-color="#13ce66" inactive-color="#eee">
</el-switch>
</template>
</el-table-column>
</template>
</TablePager> </TablePager>
</div> </div>
</div> </div>
...@@ -53,13 +45,13 @@ ...@@ -53,13 +45,13 @@
<script> <script>
/* 引入需要的接口*/ /* 引入需要的接口*/
import { import {
QueryKzzxRole, doQuery,
QueryApptype, doAdd,
AddKzzxRole, doUpdate,
DeleteKzzxRole, doDelete,
UpdateKzzxRole, doInitShlx,
QtKzzxRole doInitShxz
} from "common/src/api/system/dmgSystem.js"; } from '@/api/riskPrecontrol/maintenanceRisk';
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
...@@ -68,7 +60,7 @@ ...@@ -68,7 +60,7 @@
} from 'common' } from 'common'
export default { export default {
mixins: [tableMixin], mixins: [tableMixin],
name: 'appVersion', name: 'maintenanceRisk',
/* 初始额外赋值*/ /* 初始额外赋值*/
async mounted() { async mounted() {
...@@ -82,130 +74,56 @@ ...@@ -82,130 +74,56 @@
DialogName: '', DialogName: '',
type: '', type: '',
DialogTitle: '', DialogTitle: '',
powerList: [{
name: '分配'
}, {
name: '复制'
}, {
name: '查看'
}],
/* 基础url*/ /* 基础url*/
baseUrl: 'kzzx/role', baseUrl: '/aqgl/fxsj',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
role: '', sgksrq: new Date().getTime(),
all: false sgjsrq: new Date().getTime()
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [{ tableTitle: [
prop: 'roleid', {label: "风险类型", prop: "fxlx", fieldType: "ftString",width:192,transform:{
label: '事故日期', url:'/aqgl/fxyk/shlx/query',label:'name',value:'id'
width: '120' }},
}, {label: "风险性质", prop: "fxxz", fieldType: "ftString",width:240,transform:{
{ url:'/aqgl/fxyk/fxsj/init/shxz',label:'name',value:'id'
prop: 'rolename', }},
label: '事故时间', {label: "死亡人数", prop: "swrs", fieldType: "int"},
width: '160' {label: "重伤人数", prop: "zsrs", fieldType: "int"},
}, {label: "轻伤人数", prop: "qsrs", fieldType: "int"},
{ {label: "直接经济损失", prop: "zjjjss", fieldType: "float"},
prop: 'rolename', {label: "损失工作日", prop: "gzrss", fieldType: "float"},
label: '类型', {label: "部门", prop: "bmid", fieldType: "ftString",width:192,transform:{
width: '160' url:'/kzzx/bm/query',label:'bmmc',value:'id'
}, }},
{ {label: "车间编码", prop: "cjid", fieldType: "ftString",width:192},
prop: 'rolename', {label: "登记人", prop: "djrid", fieldType: "ftString",width:192,transform:{
label: '性质', url:'/kzzx/user/query',label:'username',value:'userid'
width: '160' }},
}, {label: "备注", prop: "bz", fieldType: "ftString",width:300},
{ {label: "维护人", prop: "whr", fieldType: "ftString"},
prop: 'rolename', {label: "维护时间", prop: "whsj", fieldType: "ftDateTime"},
label: '死亡人数', {label: "创建人", prop: "cjr", fieldType: "ftString"},
width: '160' {label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
},
{
prop: 'rolename',
label: '重伤人数',
width: '160'
},
{
prop: 'rolename',
label: '轻伤人数',
width: '160'
},
{
prop: 'tybz',
label: '直接经济损失(万元)',
width: '120',
...this.$common('tybz')
},
{
prop: 'tyrq',
label: '损失工作日',
width: '120',
...this.$common('ftDate')
},
{
prop: 'whr',
label: '所属分厂',
width: '100'
},
{
prop: 'whsj',
label: '所属车间',
...this.$common('ftDateTime')
},
{
prop: 'bz',
label: '录入人工号',
},
{
prop: 'bz',
label: '录入人',
}
] ]
} }
}, },
methods: { methods: {
tybz(a) {
let nTy = false
nTy = (a.row.tybz == 'N' ? true : false)
return nTy
},
/* 基础查询*/
query: QueryKzzxRole, query: doQuery,
/* 基础增*/ /* 基础增*/
apiAdd: AddKzzxRole, apiAdd: doAdd,
/* 基础更新*/ /* 基础更新*/
apiUpdate: UpdateKzzxRole, apiUpdate: doUpdate,
/* 删除操作*/ /* 删除操作*/
apiDelete: DeleteKzzxRole, apiDelete: doDelete,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
}, },
/* 启用停用*/
setEnable(id) {
this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: id
}
QtKzzxRole(params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.$refs['TablePager'].reLoad()
} else {
this.$error(res.message || '操作失败')
}
})
})
}
}, },
......
<template> <template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写--> <!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="角色编码" ref="roleid" prop="roleid"> <el-form-item label="风险类型" ref="fxlx" prop="fxlx">
<el-input :readonly="readonly" v-toUpperCase v-model="form.roleid"></el-input> <RelSelect src='/aqgl/fxyk/shlx/query' clearable :match="{value:'id',label:'name'}" v-model='form.fxlx' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.fxlx" ></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="角色名称" ref="rolename" prop="rolename"> <el-form-item label="风险性质" ref="fxxz" prop="fxxz">
<el-input :readonly="readonly" v-model="form.rolename"></el-input> <RelSelect src='/aqgl/fxyk/fxsj/init/shxz' clearable :match="{value:'id',label:'name'}" v-model='form.fxxz' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.fxxz" ></el-input> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="死亡人数" ref="swrs" prop="swrs">
<el-input type="number" :readonly="readonly" v-model="form.swrs" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="重伤人数" ref="zsrs" prop="zsrs">
<el-input type="number" :readonly="readonly" v-model="form.zsrs" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="轻伤人数" ref="qsrs" prop="qsrs">
<el-input type="number" :readonly="readonly" v-model="form.qsrs" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="直接经济损失" ref="zjjjss" prop="zjjjss">
<el-input type="number" :readonly="readonly" v-model="form.zjjjss" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="损失工作日" ref="gzrss" prop="gzrss">
<el-input type="number" :readonly="readonly" v-model="form.gzrss" ></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" ref="bmid" prop="bmid">
<RelSelect src='/kzzx/bm/query' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.bmid" ></el-input> -->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="车间" ref="cjid" prop="cjid">
<RelSelect src='/kzzx/cj/query' filterable clearable :match="{value:'id',label:'cjmc'}" v-model='form.cjid' ></RelSelect>
<!-- <el-input :readonly="readonly" v-model="form.cjid" ></el-input> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item label="登记人" ref="djrid" prop="djrid">
<RelSelect src='/kzzx/user/query' filterable clearable :match="{value:'userid',label:'username'}" v-model='form.djrid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="事故日期" ref="sgrq" prop="sgrq">
<el-date-picker style="width: 100%;" :readonly="readonly" v-model="form.sgrq" ></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注"> <el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.bz"></el-input> <el-input type='textarea' :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- 按钮重写, -->
<!-- <div slot="reFooter">
<span slot="footer">
重写按钮写在这里,根据需要重写 slot(reFooter,foorer) 节点样式 重写方法需要在此页重新定义
</span>
</div> -->
</RelDialog> </RelDialog>
</template> </template>
<script> <script>
...@@ -36,9 +85,10 @@ ...@@ -36,9 +85,10 @@
mixins: [editMixin], mixins: [editMixin],
/* 存放index页面传递的额外参数*/ /* 存放index页面传递的额外参数*/
mounted() { mounted() {
}, },
/* 组件名称*/ /* 组件名称*/
name: 'roleManagementEdit', name: "aqglFxsjEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/ /* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() { data() {
...@@ -47,11 +97,50 @@ ...@@ -47,11 +97,50 @@
/* 额外初始化,根据需求*/ /* 额外初始化,根据需求*/
systemType: [], systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: { form: {
roleid: '', //ID
rolename: '', id:'',
bz: "", //风险类型
fxlx:'',
//风险性质
fxxz:'',
//死亡人数
swrs:'',
//重伤人数
zsrs:'',
//轻伤人数
qsrs:'',
//直接经济损失
zjjjss:'',
//损失工作日
gzrss:'',
//部门编码
bmid:'',
//车间编码
cjid:'',
//登记人编码
djrid:'',
//备注
bz:'',
//维护人编码
whrid:'',
//维护人
whr:'',
//维护时间
whsj:new Date().getTime(),
//创建人编码
cjrid:'',
//创建人
cjr:'',
//创建时间
cjsj:new Date().getTime(),
//事故日期
sgrq:new Date().getTime(),
//系统版本
sysversion:'',
}, },
/* form提交时的规则,具体规则参考官网*/ /* form提交时的规则,具体规则参考官网*/
rules: { rules: {
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
<el-col :span="6" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">开始日期:</span> <span class="search-span">开始日期:</span>
<el-date-picker></el-date-picker> <el-date-picker v-model="queryParams.sgksrq"></el-date-picker>
</div> </div>
</el-col> </el-col>
<el-col :span="6" class="search-col"> <el-col :span="6" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">结束日期:</span> <span class="search-span">结束日期:</span>
<el-date-picker ></el-date-picker> <el-date-picker v-model="queryParams.sgjsrq" ></el-date-picker>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<AddButton ref="add" :app='app'></AddButton> <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app'></AttachFileButton>
<FieldButton :app='app'></FieldButton> <FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton> <ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮--> <!-- 额外按钮-->
...@@ -36,15 +36,6 @@ ...@@ -36,15 +36,6 @@
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'> @getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="启用/停用" width="90" header-align="center" >
<template slot-scope="scope">
<el-switch @click.native="setEnable(scope.row.id)" :value='tybz(scope)' style="width: 80px;justify-content: center;"
active-color="#13ce66" inactive-color="#eee">
</el-switch>
</template>
</el-table-column>
</template>
</TablePager> </TablePager>
</div> </div>
</div> </div>
...@@ -53,13 +44,13 @@ ...@@ -53,13 +44,13 @@
<script> <script>
/* 引入需要的接口*/ /* 引入需要的接口*/
import { import {
QueryKzzxRole, doQuery,
QueryApptype, doAdd,
AddKzzxRole, doUpdate,
DeleteKzzxRole, doDelete,
UpdateKzzxRole, doInitShlx,
QtKzzxRole doInitShxz
} from "common/src/api/system/dmgSystem.js"; } from '@/api/riskPrecontrol/maintenanceRisk';
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
...@@ -68,7 +59,7 @@ ...@@ -68,7 +59,7 @@
} from 'common' } from 'common'
export default { export default {
mixins: [tableMixin], mixins: [tableMixin],
name: 'appVersion', name: 'maintenanceRisk',
/* 初始额外赋值*/ /* 初始额外赋值*/
async mounted() { async mounted() {
...@@ -82,130 +73,56 @@ ...@@ -82,130 +73,56 @@
DialogName: '', DialogName: '',
type: '', type: '',
DialogTitle: '', DialogTitle: '',
powerList: [{
name: '分配'
}, {
name: '复制'
}, {
name: '查看'
}],
/* 基础url*/ /* 基础url*/
baseUrl: 'kzzx/role', baseUrl: '/aqgl/fxsj',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
role: '', sgksrq: new Date().getTime(),
all: false sgjsrq: new Date().getTime()
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [{ tableTitle: [
prop: 'roleid', {label: "风险类型", prop: "fxlx", fieldType: "ftString",width:192,transform:{
label: '事故日期', url:'/aqgl/fxyk/shlx/query',label:'name',value:'id'
width: '120' }},
}, {label: "风险性质", prop: "fxxz", fieldType: "ftString",width:240,transform:{
{ url:'/aqgl/fxyk/fxsj/init/shxz',label:'name',value:'id'
prop: 'rolename', }},
label: '事故时间', {label: "死亡人数", prop: "swrs", fieldType: "int"},
width: '160' {label: "重伤人数", prop: "zsrs", fieldType: "int"},
}, {label: "轻伤人数", prop: "qsrs", fieldType: "int"},
{ {label: "直接经济损失", prop: "zjjjss", fieldType: "float"},
prop: 'rolename', {label: "损失工作日", prop: "gzrss", fieldType: "float"},
label: '类型', {label: "部门", prop: "bmid", fieldType: "ftString",width:192,transform:{
width: '160' url:'/kzzx/bm/query',label:'bmmc',value:'id'
}, }},
{ {label: "车间编码", prop: "cjid", fieldType: "ftString",width:192},
prop: 'rolename', {label: "登记人", prop: "djrid", fieldType: "ftString",width:192,transform:{
label: '性质', url:'/kzzx/user/query',label:'username',value:'userid'
width: '160' }},
}, {label: "备注", prop: "bz", fieldType: "ftString",width:300},
{ {label: "维护人", prop: "whr", fieldType: "ftString"},
prop: 'rolename', {label: "维护时间", prop: "whsj", fieldType: "ftDateTime"},
label: '死亡人数', {label: "创建人", prop: "cjr", fieldType: "ftString"},
width: '160' {label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
},
{
prop: 'rolename',
label: '重伤人数',
width: '160'
},
{
prop: 'rolename',
label: '轻伤人数',
width: '160'
},
{
prop: 'tybz',
label: '直接经济损失(万元)',
width: '120',
...this.$common('tybz')
},
{
prop: 'tyrq',
label: '损失工作日',
width: '120',
...this.$common('ftDate')
},
{
prop: 'whr',
label: '所属分厂',
width: '100'
},
{
prop: 'whsj',
label: '所属车间',
...this.$common('ftDateTime')
},
{
prop: 'bz',
label: '录入人工号',
},
{
prop: 'bz',
label: '录入人',
}
] ]
} }
}, },
methods: { methods: {
tybz(a) {
let nTy = false
nTy = (a.row.tybz == 'N' ? true : false)
return nTy
},
/* 基础查询*/
query: QueryKzzxRole, query: doQuery,
/* 基础增*/ /* 基础增*/
apiAdd: AddKzzxRole, apiAdd: doAdd,
/* 基础更新*/ /* 基础更新*/
apiUpdate: UpdateKzzxRole, apiUpdate: doUpdate,
/* 删除操作*/ /* 删除操作*/
apiDelete: DeleteKzzxRole, apiDelete: doDelete,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
}, },
/* 启用停用*/
setEnable(id) {
this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: id
}
QtKzzxRole(params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.$refs['TablePager'].reLoad()
} else {
this.$error(res.message || '操作失败')
}
})
})
}
}, },
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
/* 初始额外赋值*/ /* 初始额外赋值*/
async mounted() { async mounted() {
this.$refs['TablePager'].pageQuery() this.$refs['TablePager'].pageQuery({setFirstCurrent:true})
}, },
data() { data() {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment