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

新增功能

parent e2615541
<template>
<div style="display: flex;">
<el-dialog
:fullscreen='true'
append-to-body
:visible.sync="show"
width="100%"
>
<el-dialog :fullscreen='true' append-to-body :visible.sync="show" width="100%">
<div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 60px;" @click="showSize=b" ></div>
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 90px;" @click="showSize=m" ></div>
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 120px;" @click="showSize=s" ></div>
<div v-if="showType=='pdf'"
style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 60px;"
@click="showSize=b"></div>
<div v-if="showType=='pdf'"
style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 90px;"
@click="showSize=m"></div>
<div v-if="showType=='pdf'"
style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 120px;"
@click="showSize=s"></div>
<div :style="showSize" style='height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i"></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
......@@ -20,10 +21,10 @@
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
" border="0">
</div>
</el-dialog>
<div id='approvefileAdd' style="display: none;" >
<div id='approvefileAdd' style="display: none;">
<input @change='beginUpload' id='aqglfilesonadd' ref="upload" type="file" style="display: none;">
</div>
<div class="min_full" style="width: 200px;border-right: 0px;">
......@@ -46,10 +47,10 @@
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar" >
<el-row class="tool-bar">
<PrintButton :app='this'></PrintButton>
<EditButton ref="add" :app='this'></EditButton>
<!-- <ViewButton ref="view" :app='this'></ViewButton>
<!-- <ViewButton ref="view" :app='this'></ViewButton>
<CopyButton ref="copy" :app='this'></CopyButton>
<FieldButton :app='this'></FieldButton>
......@@ -59,10 +60,10 @@
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager v-loading='isupLoad' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem'
@getRow='getRow'>
<TablePager v-loading='isupLoad' @getData='getData' :ref="'TablePager'" :app='this' :query='query'
@selectItem='selectItem' @getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="附件操作" width="160" header-align="center" fixed="right" >
<el-table-column label="附件操作" width="160" header-align="center" fixed="right">
<template slot-scope="scope">
<div style="width: 100%;display: flex;">
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
......@@ -92,7 +93,9 @@
</template>
<script>
import {pdf} from 'common'
import {
pdf
} from 'common'
import {
doQuerytree
} from "@/api/outsourcingDirector/declare.js";
......@@ -111,55 +114,75 @@
doUpdate
} from "@/api/outsourcingDirector/declare.js";
import Edit from './lessEdit.vue'
import {tableMixin} from 'common'
import {
tableMixin
} from 'common'
// import MainIndex from './mainIndex.vue'
// import LessIndex from './lessIndex.vue'
export default {
mixins: [tableMixin],
name:'securityDocumentManagement',
components:{
name: 'securityDocumentManagement',
components: {
// MainIndex,
// LessIndex,
Edit,
pdf
},
data() {
return{
showSize:'transform:scale(0.36)',
s:'transform:scale(0.36)',
m:'transform:scale(0.6)',
b:'transform:scale(0.9)',
numPages:1,
show:false,
isupLoad:false,
return {
showSize: 'transform:scale(0.36)',
s: 'transform:scale(0.36)',
m: 'transform:scale(0.6)',
b: 'transform:scale(0.9)',
numPages: 1,
show: false,
isupLoad: false,
treeTitle: '目录',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
},
// 额外
// 额外
typeMap: [],
systemType: [],
baseUrl: 'aqgl/wxglzd',
/* 查询参数*/
queryParams: {
mlid:'',
title:'',
gsid:''
mlid: '',
title: '',
gsid: ''
},
treeQueryParams:{
treeQueryParams: {
},
/* 表格标题对应参数*/
tableTitle: [
{prop: 'title', label: '文档名称', width: '340'},
{prop: 'fileVersion', label: '版本', width: '60'},
{prop: 'createTime', label: '上传时间', fieldType: "ftDateTime"},
{prop: 'updUserName', label: '上传人', width: "80"},
{prop: 'fileSize', label: '大小', width: '70',
formatter:function(a,b,bytes){
if(!bytes){
tableTitle: [{
prop: 'title',
label: '文档名称',
width: '340'
},
{
prop: 'fileVersion',
label: '版本',
width: '60'
},
{
prop: 'createTime',
label: '上传时间',
fieldType: "ftDateTime"
},
{
prop: 'updUserName',
label: '上传人',
width: "80"
},
{
prop: 'fileSize',
label: '大小',
width: '70',
formatter: function(a, b, bytes) {
if (!bytes) {
return '未上传文件'
}
if (bytes === 0) return '0 B';
......@@ -173,7 +196,7 @@
]
}
},
methods:{
methods: {
getNumPages(url) {
var loadingTask = pdf.createLoadingTask(url)
loadingTask.promise.then(pdf => {
......@@ -184,139 +207,140 @@
})
},
/* 预览 */
preview(row){
preview(row) {
console.log(row)
this.showType=row.fileType
let canShow=['gif','jpg','jpeg','png','bmp','pdf'].indexOf(row.fileType)==-1
if(canShow){
this.showType = row.fileType
let canShow = ['gif', 'jpg', 'jpeg', 'png', 'bmp', 'pdf'].indexOf(row.fileType) == -1
if (canShow) {
this.$warning('该文件不支持预览,请直接下载')
return
}
autoAttachPreview({},'aqgl/wxglzd',row.fileId).then(res=>{
if(res.type=='application/json'){
autoAttachPreview({}, 'aqgl/wxglzd', row.fileId).then(res => {
if (res.type == 'application/json') {
this.$warning('您没有权限,请联系系统管理员!')
return
}
let blob = new Blob([res], {
type: 'application/'+row.fileType+';charset=UTF-8',
type: 'application/' + row.fileType + ';charset=UTF-8',
});
this.url=URL.createObjectURL(blob)
this.url = URL.createObjectURL(blob)
this.getNumPages(this.url)
this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
this.show = true
this.$nextTick(() => {
this.$refs.show.addEventListener('contextmenu', function(event) {
event.preventDefault();
}, false);
})
})
},
creatFile(){
creatFile() {
/* 清除老节点 */
$('#approvefileAdd').find('input').remove()
let lineEl = document.createElement('input');
let $lineEl=$(lineEl)
$lineEl.attr('type','file')
$lineEl.attr('ref','upload')
$lineEl.attr('id','aqglfilesonadd')
let $lineEl = $(lineEl)
$lineEl.attr('type', 'file')
$lineEl.attr('ref', 'upload')
$lineEl.attr('id', 'aqglfilesonadd')
$lineEl.hide()
$lineEl.change(()=>{
$lineEl.change(() => {
this.beginUpload()
})
// $lineEl
$('#approvefileAdd').append($lineEl)
},
beginUpload(){
this.isupLoad=true
let uploadDom=document.getElementById('aqglfilesonadd')
beginUpload() {
this.isupLoad = true
let uploadDom = document.getElementById('aqglfilesonadd')
var filec = uploadDom.files[0];
var name = filec.name
var type = filec.type
let updateId=$(uploadDom).attr('inputId')
updateId&&$(uploadDom).attr('inputId',null)
let updateId = $(uploadDom).attr('inputId')
updateId && $(uploadDom).attr('inputId', null)
if (filec) {
let formData = new FormData();
formData.append('file', filec)
formData.append('type', type)
formData.append('folder', '')
formData.append('name', name)
if(updateId){
if (updateId) {
formData.append('id', updateId)
this.creatFile()
uploadUpdate(formData,'aqgl/wxglzd').then(res => {
uploadUpdate(formData, 'aqgl/wxglzd').then(res => {
if (res.success) {
this.$success('更新成功')
this.isupLoad=false
this.isupLoad = false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
}).catch(e => {
console.error(e)
this.isupLoad=false
this.isupLoad = false
})
return
}
formData.append('groupid', this.queryParams.gsid)
this.creatFile()
uploadAttachDownload(formData,'aqgl/wxglzd').then(res => {
uploadAttachDownload(formData, 'aqgl/wxglzd').then(res => {
if (res.success) {
this.$success('添加成功')
this.isupLoad=false
this.isupLoad = false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
}).catch(e => {
console.error(e)
this.isupLoad=false
this.isupLoad = false
})
}
},
upload(){
let $upload=$('#aqglfilesonadd')
arguments[0]=='update'&&$upload.attr('inputId',arguments[1].fileId)&&$upload.click()
if(arguments[0]=='update'){
upload() {
let $upload = $('#aqglfilesonadd')
arguments[0] == 'update' && $upload.attr('inputId', arguments[1].fileId) && $upload.click()
if (arguments[0] == 'update') {
return
}
else if (this.queryParams.gsid ){
} else if (this.queryParams.gsid) {
$upload.click()
/* 上传*/
}else{
} else {
this.$warning('请选中公司操作操作');
}
},
down(data,type,title) {
down(data, type, title) {
let a = document.createElement('a');
a.download = title;
a.style.display = 'none';
let blob = new Blob([data], {
type: 'application/'+type+';charset=UTF-8',
type: 'application/' + type + ';charset=UTF-8',
});
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
downLoad(row){
let title=row.fileName
autoAttachDownload({},'aqgl/wxglzd',row.fileId).then(res=>{
if(res.type=='application/json'){
downLoad(row) {
let title = row.fileName
autoAttachDownload({}, 'aqgl/wxglzd', row.fileId).then(res => {
if (res.type == 'application/json') {
this.$warning('您没有【下载】权限,请联系系统管理员!')
return
}
this.down(res,row.type,title)
this.down(res, row.type, title)
})
},
selectedTree(val){
if(val.type=='ML'){
this.queryParams.gsid=val.gsid
this.queryParams.mlid=val.id
}else{
this.queryParams.gsid=val.id
this.queryParams.mlid=''
selectedTree(val) {
if (val.type == 'ML') {
this.queryParams.gsid = val.gsid
this.queryParams.mlid = val.id
} else {
this.queryParams.gsid = val.id
this.queryParams.mlid = ''
}
this.$refs['TablePager'].pageQuery()
},
/* 基础查询*/
query: doQuery,
apiDelete:doDelete,
apiUpdate:doUpdate,
apiDelete: doDelete,
apiUpdate: doUpdate,
apiTreeQuery: doQuerytree,
}
......
<template>
<!-- <div class="min_full" style="height: 140vh;"> -->
<!-- <div class="min_full" style="height: 140vh;"> -->
<div class="min_full" >
<Zdzrr :app='this' v-if="showDialog&&DialogName=='指定检查人'" ></Zdzrr>
<yhContent :app='this' v-if="showDialog&&DialogName=='关联隐患'" ></yhContent>
<div class="min_full">
<Zdzrr :app='this' v-if="showDialog&&DialogName=='指定检查人'"></Zdzrr>
<yhContent :app='this' v-if="showDialog&&DialogName=='关联隐患'"></yhContent>
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
......@@ -11,13 +11,14 @@
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">状态:</span>
<RelSelect style="width: 100%;" src='aqgl/fxyk/fxpc/init/zt' clearable :match="{value:'id',label:'name'}" v-model='queryParams.zt' ></RelSelect>
<RelSelect style="width: 100%;" src='aqgl/fxyk/fxpc/init/zt' clearable :match="{value:'id',label:'name'}"
v-model='queryParams.zt'></RelSelect>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">检查人员:</span>
<el-input v-model="queryParams.jcr" ></el-input>
<el-input v-model="queryParams.jcr"></el-input>
</div>
</el-col>
......@@ -30,7 +31,7 @@
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">结束日期:</span>
<el-date-picker value-format="timestamp" v-model="queryParams.jsrq" ></el-date-picker>
<el-date-picker value-format="timestamp" v-model="queryParams.jsrq"></el-date-picker>
</div>
</el-col>
......@@ -39,19 +40,22 @@
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">公司:</span>
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='queryParams.gsid' ></RelSelect>
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.gsid'></RelSelect>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">班组:</span>
<RelSelect linkage :linkParams="{pid:queryParams.gsid}" style="width: 100%;" src='jcsj/common/bm/queryBz' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='queryParams.bmid' ></RelSelect>
<RelSelect linkage :linkParams="{pid:queryParams.gsid}" style="width: 100%;" src='jcsj/common/bm/queryBz'
filterable clearable :match="{value:'id',label:'bmmc'}" v-model='queryParams.bmid'></RelSelect>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">任务类型:</span>
<RelSelect style="width: 100%;" src='aqgl/fxyk/fxpc/init/rwlx' clearable :match="{value:'id',label:'name'}" v-model='queryParams.rwlx' ></RelSelect>
<RelSelect style="width: 100%;" src='aqgl/fxyk/fxpc/init/rwlx' clearable :match="{value:'id',label:'name'}"
v-model='queryParams.rwlx'></RelSelect>
</div>
</el-col>
</el-row>
......@@ -67,6 +71,7 @@
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<el-button size='mini' @click="zdzrr" type="primary">指定责任人</el-button>
<el-button size='mini' @click="wc" type="primary">完成</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
......@@ -77,16 +82,17 @@
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="关联隐患" width="90" header-align="center" >
<template slot-scope="scope" >
<span @click="watchglyh(scope.row)" style="color: cornflowerblue;cursor: pointer;line-height: 30px;text-align: center;width: 70px;display: inline-block;">查看</span>
<el-table-column label="关联隐患" width="90" header-align="center">
<template slot-scope="scope">
<span @click="watchglyh(scope.row)"
style="color: cornflowerblue;cursor: pointer;line-height: 30px;text-align: center;width: 70px;display: inline-block;">查看</span>
</template>
</el-table-column>
</template>
</TablePager>
</div>
</div>
<!-- <div class="min_full" style="height: 60%;padding: 10px;">
<!-- <div class="min_full" style="height: 60%;padding: 10px;">
<el-tabs v-model="activeName" >
<el-tab-pane label="检查标准" name="first" >
<Details ref="Details" />
......@@ -104,7 +110,7 @@
</template>
<script>
import Zdzrr from './zdzrr'
import Zdzrr from './zdzrr'
/* 引入需要的接口*/
/* 引入需要的接口*/
import {
......@@ -138,15 +144,17 @@ import Zdzrr from './zdzrr'
}
]
)
this.$refs['TablePager'].pageQuery({setFirstCurrent:true})
this.$refs['TablePager'].pageQuery({
setFirstCurrent: true
})
console.log(this)
},
data() {
return {
DialogTitle:'指定检查人',
DialogTitle: '指定检查人',
/*需要的额外参数 */
showDialog:false,
doQueryScgw:[],
showDialog: false,
doQueryScgw: [],
activeName: 'first',
/*需要的额外参数 */
showDialog: false,
......@@ -156,13 +164,13 @@ import Zdzrr from './zdzrr'
baseUrl: '/aqgl/fxyk/fxpc',
/* 查询参数*/
queryParams: {
rwlx:'',
queryType:'fxpc',
gsid:'',
bmid:'',
jcr:'',
zt:'',
ksrq: new Date().getTime()-1000*60*60*24*30,
rwlx: '',
queryType: 'fxpc',
gsid: '',
bmid: '',
jcr: '',
zt: '',
ksrq: new Date().getTime() - 1000 * 60 * 60 * 24 * 30,
jsrq: new Date().getTime()
},
/* 表格标题对应参数*/
......@@ -170,38 +178,121 @@ import Zdzrr from './zdzrr'
// {label: "ID", prop: "id", fieldType: "ftString",width:192},
// {label: "单据来源", prop: "djly", fieldType: "ftString",width:60},
// {label: "风险排查标准编码", prop: "fxbzid", fieldType: "ftString",width:192},
{label: "状态", prop: "ztName", fieldType: "ftString",width:50},
{label: "任务类型", prop: "rwlxName", fieldType: "ftString",width:100},
{label: "下达日期", prop: "xdrq", fieldType: "ftDate"},
{
label: "状态",
prop: "ztName",
fieldType: "ftString",
width: 50
},
{
label: "任务类型",
prop: "rwlxName",
fieldType: "ftString",
width: 100
},
{
label: "下达日期",
prop: "xdrq",
fieldType: "ftDate"
},
// {label: "截止日期", prop: "jzrq", fieldType: "ftDateTime"},
{label: "检查时间", prop: "sjjcsj", fieldType: "ftDateTime"},
{label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
{label: "检查岗位", prop: "gwName", fieldType: "ftString",width:192},
{label: "检查内容", prop: "nr", fieldType: "ftString",width:300},
{label: "检查部位", prop: "jcyd", fieldType: "ftString",width:300},
{label: "检查人", prop: "jcrName", fieldType: "ftString",width:192},
{label: "地点", prop: "fxpcdd", fieldType: "ftString",width:192},
{label: "风险点", prop: "fxd", fieldType: "ftString",width:192},
{label: "公司", prop: "gsName", fieldType: "ftString",width:192},
{label: "班组", prop: "bzName", fieldType: "ftString",width:192},
{
label: "检查时间",
prop: "sjjcsj",
fieldType: "ftDateTime"
},
{
label: "创建时间",
prop: "cjsj",
fieldType: "ftDateTime"
},
{
label: "检查岗位",
prop: "gwName",
fieldType: "ftString",
width: 192
},
{
label: "检查内容",
prop: "nr",
fieldType: "ftString",
width: 300
},
{
label: "检查部位",
prop: "jcyd",
fieldType: "ftString",
width: 300
},
{
label: "检查人",
prop: "jcrName",
fieldType: "ftString",
width: 192
},
{
label: "地点",
prop: "fxpcdd",
fieldType: "ftString",
width: 192
},
{
label: "风险点",
prop: "fxd",
fieldType: "ftString",
width: 192
},
{
label: "公司",
prop: "gsName",
fieldType: "ftString",
width: 192
},
{
label: "班组",
prop: "bzName",
fieldType: "ftString",
width: 192
},
],
timer:false,
timer: false,
}
},
methods: {
watchglyh(row){
this.watchglyh.fxpcid=row.id
wc() {
if (this.singleItem && this.singleItem.id) {
this.$confirm('是否继续该操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('/aqgl/fxyk/fxpc/complete', {
id: this.singleItem.id,
bmId: this.singleItem.bmid
}).then(res => {
if (res.success) {
this.$refs['TablePager'].pageQuery()
}
})
})
} else {
this.$warning('请选中一条数据')
}
},
watchglyh(row) {
this.watchglyh.fxpcid = row.id
this.showDialog = true
this.DialogTitle='关联隐患'
this.DialogName='关联隐患'
this.DialogTitle = '关联隐患'
this.DialogName = '关联隐患'
},
zdzrr(){
zdzrr() {
if (this.app.selectOne || this.app.clickOne) {
this.showDialog = true
this.DialogTitle='指定检查人'
this.DialogName='指定检查人'
this.DialogTitle = '指定检查人'
this.DialogName = '指定检查人'
} else {
this.$warning('请选中一行操作');
}
......
......@@ -42,6 +42,13 @@
<RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='queryParams.gsid' ></RelSelect>
</div>
</el-col>
<!-- <el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">部门:</span>
<RelSelect linkage :linkParams="{pid:queryParams.gsid}" style="width: 100%;" src='jcsj/common/bm/queryBz' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='queryParams.bmid' ></RelSelect>
</div>
</el-col> -->
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">班组:</span>
......
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