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

修改功能字段

parent 7fe173ff
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<el-col :span="12" class="search-col"> <el-col :span="12" class="search-col">
<div class="search-item"> <div class="search-item">
<span class="search-span">名称:</span> <span class="search-span">名称:</span>
<el-input v-model="queryParams.info"></el-input> <el-input v-model="queryParams.name"></el-input>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
baseUrl: '/aqgl/rcgl/ufcgzylx', baseUrl: '/aqgl/rcgl/ufcgzylx',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
info: '' name: ''
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [
......
import request from 'common/src/utils/request' import request from 'common/src/utils/request'
/* query */ /*query */
export function doQuery(query) { export function doQuery(query) {
return request({ return request({
url: '/aqgl/zywsgl/ugrzyjkda/query', url: '/aqgl/zywsgl/ugrzyjkda/query',
...@@ -8,7 +8,7 @@ export function doQuery(query) { ...@@ -8,7 +8,7 @@ export function doQuery(query) {
data: query||{} data: query||{}
}) })
} }
/* 更新 */ /*更新 */
export function doUpdate(query) { export function doUpdate(query) {
return request({ return request({
url: '/aqgl/zywsgl/ugrzyjkda/update', url: '/aqgl/zywsgl/ugrzyjkda/update',
...@@ -31,11 +31,23 @@ export function doDelete(query) { ...@@ -31,11 +31,23 @@ export function doDelete(query) {
}) })
} }
export function doInitSyfw(query) {
return request({
url: '/aqgl/zywsgl/ugrzyjkda/init/syfw',
method: 'post',
data: query||{}
})
}
export function doQuerytree(query) {
export function initZt(query) {
return request({ return request({
url: '/aqgl/zywsgl/ugrzyjkda/query/tree', url: '/aqgl/zywsgl/ugrzyjkda/init/zt',
method: 'post', method: 'post',
data: query||{} data: query||{}
}) })
} }
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="100px" :rules="rules">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="职工" ref="userid" prop="userid">
<!-- <el-input :readonly="readonly" v-model="form.userid" ></el-input> -->
<personSelector :label="form.username||form.userid||'暂无'" @selected='userSelected' ></personSelector>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="所属公司" ref="gsid" prop="gsid">
<RelSelect style="width: 100%;" :readonly="readonly" src='jcsj/common/bm/queryGs' filterable clearable :match="{value:'id',label:'bmmc'}" v-model='form.gsid' ></RelSelect>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="健康档案内容" ref="jkdanr" prop="jkdanr" >
<el-input type="textarea" v-model='form.jkdanr' rows="5" >
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
name: "aqgl/rcglYgczxxEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
bmList: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
gsid:'',
userName:'',
//ID
id:'',
//用户编码
userid:'',
jkdanr:''
},
/* form提交时的规则,具体规则参考官网*/
rules: {
gsid: [{required: true,trigger: 'blur'}, ],
userid: [{required: true,trigger: 'blur'}, ],
}
}
},
methods: {
userSelected(row){
this.form.userid=row.id
}
}
}
</script>
<style scoped lang="scss">
</style>
<template> <template>
<div style="display: flex;"> <div class="min_full">
<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 :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>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div>
</el-dialog>
<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;">
<TreeBase :dgtype='3' :app='this' @selected='selectedTree'></TreeBase>
</div>
<div class="min_full" style="overflow: auto;width: calc(100% - 200px)">
<div class="min_full" style="calc(60vh - 42px)">
<!-- 查询条件--> <!-- 查询条件-->
<div class="search" v-condition> <div class="search" v-condition>
<SearchButton :app='app'></SearchButton> <SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1"> <el-row :gutter="30" class="search-row-1">
<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-input v-model="queryParams.title"></el-input> <RelSelect style="width: 100%;" src='jcsj/common/bm/queryGs' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.gsid'></RelSelect>
</div> </div>
</el-col> </el-col>
<!-- <el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">证书编号:</span>
<el-input v-model="queryParams.code"></el-input>
</div>
</el-col> -->
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">职工工号:</span>
<el-input v-model="queryParams.user"></el-input>
</div>
</el-col>
<!-- <el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">证书状态:</span>
<RelSelect src='aqgl/zywsgl/ugrzyjkda/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>
<RelSelect src='aqgl/zywsgl/ugrzyjkda/init/syfw' clearable :match="{value:'id',label:'name'}"
v-model='queryParams.syfw'></RelSelect>
</div>
</el-col> -->
</el-row> </el-row>
</div> </div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar" > <el-row class="tool-bar">
<PrintButton :app='this'></PrintButton> <PrintButton :app='app'></PrintButton>
<EditButton ref="add" :app='this'></EditButton> <ViewButton ref="view" :app='app'></ViewButton>
<!-- <ViewButton ref="view" :app='this'></ViewButton> <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app'></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<!-- 表头设置 -->
<CopyButton ref="copy" :app='this'></CopyButton> <!-- 权限-->
<FieldButton :app='this'></FieldButton>
<ExcelButton :app='this'></ExcelButton> -->
<!-- <AttachFileButton :app='this' ></AttachFileButton> -->
<el-button @click="upload" size='mini' type="primary">新增</el-button>
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager v-loading='isupLoad' @getData='getData' :ref="'TablePager'" :app='this' :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="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%;"
@click.native.prevent="preview(scope.row)" type="text" size="small">
<i class="el-icon-view"></i>预览
</el-button>
<el-button v-show="powerObj['91']" style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="downLoad(scope.row)" type="text" size="small">
<i class="el-icon-download"></i>下载
</el-button>
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="upload('update',scope.row)" type="text" size="small">
<i class="el-icon-upload2"></i>更新
</el-button>
</div>
</template>
</el-table-column>
</template>
</TablePager> </TablePager>
</div> </div>
</div> </div>
<!-- <MainIndex :vMain='this' ref="mainIndex" ></MainIndex>
<LessIndex :vMain='this' ref="lessIndex" ></LessIndex> -->
</div>
</div>
</template> </template>
<script> <script>
import {pdf} from 'common' /* 引入需要的接口*/
import {
doQuerytree
} from "@/api/daily/nros.js";
import {
autoAttachPreview,
autoAttach,
autoAttachDownload,
deleteAttachDownload,
uploadAttachDownload,
aqglUploadUpdate,
uploadUpdate
} from "common/src/api/system/dmgSystem.js";
import { import {
doQuery, doQuery,
doAdd,
doUpdate,
doDelete, doDelete,
doUpdate doInitSyfw
} from "./api.js"; } from './api.js';
import Edit from './lessEdit.vue' /* edit页面*/
import {tableMixin} from 'common' import Edit from './edit'
// import MainIndex from './mainIndex.vue' import {
// import LessIndex from './lessIndex.vue' tableMixin
} from 'common'
export default { export default {
mixins: [tableMixin], mixins: [tableMixin],
name:'securityDocumentManagement', name: 'appVersion',
components:{
pdf, /* 初始额外赋值*/
// MainIndex, async mounted() {
// LessIndex, this.$refs['TablePager'].pageQuery()
Edit
}, },
data() { data() {
return{ return {
showSize:'transform:scale(0.36)',
s:'transform:scale(0.36)', /*需要的额外参数 */
m:'transform:scale(0.6)', showDialog: false,
b:'transform:scale(0.9)', DialogName: '',
numPages:1, type: '',
show:false, DialogTitle: '',
isupLoad:false, /* 基础url*/
treeTitle: '目录', baseUrl: '/aqgl/zywsgl/ugrzyjkda',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
},
// 额外
typeMap: [],
systemType: [],
baseUrl: 'aqgl/zywsgl/ugrzyjkda',
/* 查询参数*/ /* 查询参数*/
queryParams: { queryParams: {
mlid:'', gsid: '',
title:'', // code: '',
gsid:'' user: '',
}, // syfw: '',
treeQueryParams:{ // zt: ''
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [{
{prop: 'title', label: '文档名称', width: '340'}, label: "公司",
{prop: 'fileVersion', label: '版本', width: '60'}, prop: "gsName",
{prop: 'createTime', label: '上传时间', fieldType: "ftDateTime"}, fieldType: "ftString",
{prop: 'updUserName', label: '上传人', width: "80"}, width: 100
{prop: 'fileSize', label: '大小', width: '70',
formatter:function(a,b,bytes){
if(!bytes){
return '未上传文件'
}
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
}
]
}
}, },
methods:{ // {label: "状态", prop: "ztName", fieldType: "ftString",width:60},
getNumPages(url) { {
var loadingTask = pdf.createLoadingTask(url) label: "职工工号",
loadingTask.promise.then(pdf => { prop: "usercode",
this.url = loadingTask fieldType: "ftString",
this.numPages = pdf.numPages width: 140
}).catch((err) => {
console.error('pdf加载失败')
})
}, },
/* 预览 */ {
preview(row){ label: "职工姓名",
console.log(row) prop: "username",
this.showType=row.fileType fieldType: "ftString",
let canShow=['gif','jpg','jpeg','png','bmp','pdf'].indexOf(row.fileType)==-1 width: 160
if(canShow){
this.$warning('该文件不支持预览,请直接下载')
return
}
autoAttachPreview({},'aqgl/zywsgl/ugrzyjkda',row.fileId).then(res=>{
if(res.type=='application/json'){
this.$warning('您没有权限,请联系系统管理员!')
return
}
let blob = new Blob([res], {
type: 'application/'+row.fileType+';charset=UTF-8',
});
this.url=URL.createObjectURL(blob)
this.getNumPages(this.url)
this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
})
}, },
creatFile(){ // {label: "证书编号", prop: "code", fieldType: "ftString",width:160},
/* 清除老节点 */ // {label: "证书名称", prop: "name", fieldType: "ftString",width:180},
$('#approvefileAdd').find('input').remove() // {label: "作业类别", prop: "zsflName", fieldType: "ftString", width: 100},
let lineEl = document.createElement('input'); // {label: "发证日期", prop: "fzrq", fieldType: "ftDateTime"},
let $lineEl=$(lineEl) // {label: "有效期", prop: "yxq", fieldType: "float"},
$lineEl.attr('type','file') // {label: "截止日期", prop: "jzrq", fieldType: "ftDateTime"},
$lineEl.attr('ref','upload') // {label: "复审日期1", prop: "fsrq1", fieldType: "ftDateTime"},
$lineEl.attr('id','aqglfilesonadd') // {label: "复审日期2", prop: "fsrq2", fieldType: "ftDateTime"},
$lineEl.hide() // {label: "实际复审日期1", prop: "sjfsrq1", fieldType: "ftDateTime"},
$lineEl.change(()=>{ // {label: "实际复审日期2", prop: "sjfsrq2", fieldType: "ftDateTime"},
this.beginUpload() {
}) label: "健康档案内容",
// $lineEl prop: "jkdanr",
$('#approvefileAdd').append($lineEl) fieldType: "ftString",
width: 300
}, },
beginUpload(){ // {label: "适用范围", prop: "syfw", fieldType: "ftString",width:60},
this.isupLoad=true // {label: "适用范围", prop: "syfwName", fieldType: "ftString",width:160},
let uploadDom=document.getElementById('aqglfilesonadd') // {label: "备注", prop: "bz", fieldType: "ftString",width:300},
var filec = uploadDom.files[0]; {
var name = filec.name label: "维护人",
var type = filec.type prop: "whr",
let updateId=$(uploadDom).attr('inputId') fieldType: "ftString"
updateId&&$(uploadDom).attr('inputId',null) },
if (filec) { {
let formData = new FormData(); label: "维护时间",
formData.append('file', filec) prop: "whsj",
formData.append('type', type) fieldType: "ftDateTime"
formData.append('folder', '') },
formData.append('name', name) {
if(updateId){ label: "创建人",
formData.append('id', updateId) prop: "cjr",
this.creatFile() fieldType: "ftString",
uploadUpdate(formData,'aqgl/zywsgl/ugrzyjkda').then(res => { show: false
if (res.success) { },
this.$success('更新成功') {
this.isupLoad=false label: "创建时间",
this.$refs['TablePager'].reLoad() prop: "cjsj",
} fieldType: "ftDateTime",
}).catch(e=>{ show: false
console.error(e)
this.isupLoad=false
})
return
}
formData.append('groupid', this.queryParams.gsid)
this.creatFile()
uploadAttachDownload(formData,'aqgl/zywsgl/ugrzyjkda').then(res => {
if (res.success) {
this.$success('添加成功')
this.isupLoad=false
this.$refs['TablePager'].reLoad()
} }
}).catch(e=>{
console.error(e)
this.isupLoad=false
})
]
} }
}, },
upload(){ methods: {
/* 清除老节点*/ query: doQuery,
let $upload=$('#aqglfilesonadd') /* 基础增*/
console.log($upload) apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
/* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
arguments[0]=='update'&&$upload.attr('inputId',arguments[1].fileId)&&$upload.click()
if(arguments[0]=='update'){
return
}
else if (this.queryParams.gsid ){
$upload.click()
/* 上传*/
}else{
this.$warning('请选中公司操作操作');
}
},
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',
});
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
downLoad(row){
let title=row.fileName
autoAttachDownload({},'aqgl/zywsgl/ugrzyjkda',row.fileId).then(res=>{
if(res.type=='application/json'){
this.$warning('您没有【下载】权限,请联系系统管理员!')
return
}
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=''
}
this.$refs['TablePager'].pageQuery()
}, },
/* 基础查询*/ components: {
query: doQuery, Edit,
apiDelete:doDelete,
apiUpdate:doUpdate,
apiTreeQuery: doQuerytree,
} }
} }
</script> </script>
<style> <style scoped>
</style> </style>
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="标题" ref="title" prop="title">
<el-input :readonly="readonly" v-model="form.title"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
// this.form.mlid=this.app.queryParams.mlid
this.form.gsid=this.app.queryParams.gsid
},
/* 组件名称*/
name: 'appVersionEdit',
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
mlid:'',
gsid:'',
title: '',
sytk: '',
bz: "",
fbrq:new Date().getTime(),
ssrq:new Date().getTime(),
mlid:''
},
/* form提交时的规则,具体规则参考官网*/
rules: {
gsid: [{
required: true,
}, ],
}
}
},
methods: {
/* 重写方法,this.app来调用index页面定义的api*/
}
}
</script>
<style scoped lang="scss">
</style>
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