123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651 |
- <template>
- <view class="main">
- <view class="one">
- <view class="one_1">
- 基本信息
- </view>
- <view class="one_2">
- <view class="label">
- <text class="title">批建时间:</text>
- <text class="content">{{info.build_time||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室名称:</text>
- <text class="content">{{info.name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">英文名称:</text>
- <text class="content">{{info.english_name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">所属学科:</text>
- <text class="content">{{info.subject||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">所属专业:</text>
- <text class="content">{{info.major||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室面积:</text>
- <text class="content">{{info.lab_acreage||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">依托单位名称:</text>
- <text class="content">{{info.unit_name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室地区:</text>
- <text class="content">{{info.zhRegion||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室地址:</text>
- <text class="content">{{info.lab_address||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室建设方案:</text>
- <text class="content" @tap.stop="toFile(info.plan)" v-if="info.plan&&info.plan.length>0">
- {{info.plan[0].name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室定位:</text>
- <text class="content">{{info.position||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室简介:</text>
- <text class="content">{{info.brief||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">实验室标志性照片:</text>
- <view class="image">
- <view v-for="(item, index) in info.basic_file" :key="index">
- <image class="images" :src="item.url" mode="widthFix"></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="one">
- <view class="one_1">
- 实验室主任信息
- </view>
- <view class="one_2">
- <view class="label">
- <text class="title">姓名:</text>
- <text class="content">{{directorInfo.name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">性别:</text>
- <text class="content">{{formatText(directorInfo.gender,genderList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">出生年月:</text>
- <text class="content">{{directorInfo.birth||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件类别:</text>
- <text class="content">{{formatText(directorInfo.cardtype,cardtypeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件号码:</text>
- <text class="content">{{directorInfo.num||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">学历:</text>
- <text class="content">{{formatText(directorInfo.education,educationList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">学位:</text>
- <text class="content">{{formatText(directorInfo.degree,degreeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">职称:</text>
- <text class="content">{{formatText(directorInfo.title,titleList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">研究领域:</text>
- <text class="content">{{directorInfo.field||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">工作单位:</text>
- <text class="content">{{directorInfo.unit||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">电子邮箱:</text>
- <text class="content">{{directorInfo.email||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">办公电话:</text>
- <text class="content">{{directorInfo.work_phone||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">手机号:</text>
- <text class="content">{{directorInfo.phone||'暂无'}}</text>
- </view>
- </view>
- </view>
- <view class="one" v-if="list.length>0">
- <view class="one_1">
- 研究方向
- </view>
- <view class="one_2">
- <view class="list" v-for="(item, index) in list" :key="index">
- <view class="name textOver">{{item.name||'暂无'}}</view>
- <view class="other">
- <view class="other_1 textOne">
- 方向带头人:{{getDict(item.person_id,'person_id')||'暂无'}}
- </view>
- <view class="other_1 textOver">
- 核心成员:{{getDict(item.persons,'persons')||'暂无'}}
- </view>
- <view class="other_1 textOne" @tap.stop="toFile(item.file)"
- v-if="item.file&&item.file.length>0">
- 附件:{{item.file[0].name||'暂无'}}
- </view>
- <view class="status textOne">
- 是否启用:{{getDict(item.is_show,'is_show')||'暂无'}}
- </view>
- </view>
- </view>
- <view class="total">
- <uni-pagination :current="page" :pageSize="3" :total="total" @change="toPage" />
- </view>
- </view>
- </view>
- <view class="one">
- <view class="one_1">
- 依托单位
- </view>
- <view class="one_2">
- <view class="label">
- <text class="title">名称:</text>
- <text class="content">{{unitInfo.name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">通讯地址:</text>
- <text class="content">{{unitInfo.address||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">联系人:</text>
- <text class="content">{{unitInfo.contacts||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">联系电话:</text>
- <text class="content">{{unitInfo.phone||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">单位类别:</text>
- <text class="content">{{formatText(unitInfo.type,unittypeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">是否为事业单位:</text>
- <text class="content">{{formatText(unitInfo.is_career,careerList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">隶属:</text>
- <text class="content">{{formatText(unitInfo.subjection,subjectionList)||'暂无'}}</text>
- </view>
- </view>
- </view>
- <view class="one">
- <view class="one_1">
- 科研助理(日常联系人)
- </view>
- <view class="one_2">
- <view class="label">
- <text class="title">姓名:</text>
- <text class="content">{{assistantInfo.name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件类别:</text>
- <text class="content">{{formatText(assistantInfo.cardtype,cardtypeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件号码:</text>
- <text class="content">{{assistantInfo.num||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">工作单位:</text>
- <text class="content">{{assistantInfo.unit||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">电子邮箱:</text>
- <text class="content">{{assistantInfo.email||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">办公电话:</text>
- <text class="content">{{assistantInfo.work_phone||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">手机号:</text>
- <text class="content">{{assistantInfo.phone||'暂无'}}</text>
- </view>
- </view>
- </view>
- <view class="one">
- <view class="one_1">
- 财务助理
- </view>
- <view class="one_2">
- <view class="label">
- <text class="title">是否同以上科研助理:</text>
- <text class="content">{{formatText(info.is_alike,alikeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">姓名:</text>
- <text class="content">{{financeInfo.name||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件类别:</text>
- <text class="content">{{formatText(financeInfo.cardtype,cardtypeList)||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">证件号码:</text>
- <text class="content">{{financeInfo.num||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">工作单位:</text>
- <text class="content">{{financeInfo.unit||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">电子邮箱:</text>
- <text class="content">{{financeInfo.email||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">办公电话:</text>
- <text class="content">{{financeInfo.work_phone||'暂无'}}</text>
- </view>
- <view class="label">
- <text class="title">手机号:</text>
- <text class="content">{{financeInfo.phone||'暂无'}}</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- id: '',
- user: {},
- info: {},
- // 实验室主任信息
- directorInfo: {},
- // 依托单位
- unitInfo: {},
- // 科研助理
- assistantInfo: {},
- // 财务助理
- financeInfo: {},
- list: [],
- total: 0,
- skip: 0,
- limit: 3,
- page: 1,
- // 字典表
- regionList: [],
- genderList: [],
- cardtypeList: [],
- educationList: [],
- degreeList: [],
- titleList: [],
- unittypeList: [],
- careerList: [],
- subjectionList: [],
- alikeList: [{
- dict_value: true,
- dict_label: '是'
- },
- {
- dict_value: false,
- dict_label: '否'
- },
- ],
- userList: [],
- showList: []
- }
- },
- onLoad: async function(e) {
- const that = this;
- that.$set(that, `id`, e && e.id || '');
- await that.searchOther();
- that.searchToken();
- await that.search();
- uni.hideLoading();
- },
- onPullDownRefresh: async function() {
- const that = this;
- await that.search();
- uni.stopPullDownRefresh();
- },
- methods: {
- searchToken() {
- const that = this;
- try {
- const res = uni.getStorageSync('token');
- if (res) {
- const user = that.$jwt(res);
- that.$set(that, `user`, user);
- } else {
- uni.navigateTo({
- url: `/pages/login/index`
- })
- }
- } catch (e) {
- uni.showToast({
- title: err.errmsg,
- icon: 'error',
- duration: 2000
- });
- }
- },
- async search() {
- const that = this;
- if (that.id) {
- const res = await that.$api(`/basic/${that.id}`, 'GET', {}, 'freeLabel')
- if (res.errcode == '0') {
- if (res.data.region) {
- for (let val of that.regionList) {
- const region = val.children.find(i => i.code == res.data.region)
- if (region) res.data.zhRegion = region.name
- }
- }
- that.$set(that, `info`, res.data)
- // 实验室主任信息
- const director = await that.$api(`/basicDirector`, 'GET', {
- lab_id: that.id
- }, 'freeLabel')
- if (director.errcode == '0' && director.total > 0) {
- that.$set(that, `directorInfo`, director.data[0]);
- }
- // 依托单位信息
- if (res.data.declare_unit) that.$set(that, `unitInfo`, res.data.declare_unit)
- // 科研助理
- if (res.data.assistant) that.$set(that, `assistantInfo`, res.data.assistant)
- // 财务助理
- if (res.data.finance) that.$set(that, `financeInfo`, res.data.finance)
- // 研究方向
- that.dirSearch();
- } else {
- uni.showToast({
- title: res.errmsg,
- });
- }
- }
- },
- // 研究方向
- async dirSearch() {
- const that = this;
- let info = {
- skip: that.skip,
- limit: that.limit,
- lab_id: that.id
- }
- const res = await that.$api(`/direction`, 'GET', {
- ...info
- }, 'freeLabel')
- if (res.errcode == '0') {
- that.$set(that, `list`, res.data)
- that.$set(that, `total`, res.total)
- } else {
- uni.showToast({
- title: res.errmsg,
- });
- }
- uni.hideLoading();
- },
- // 查询字典表
- getDict(e, model) {
- const that = this;
- if (!e) return '暂无'
- if (model == 'person_id') {
- let data = that.userList.find((i) => i._id == e);
- if (data) return data.name;
- else return '暂无';
- } else if (model == 'persons') {
- let list = [];
- if (e.length > 0) {
- for (const val of e) {
- let data = that.userList.find((i) => i._id == val);
- if (data) list.push(data.name);
- }
- return list.join(',');
- }
- } else if (model == 'is_show') {
- let data = that.showList.find((i) => i.dict_value == e);
- if (data) return data.dict_label;
- else return '暂无';
- }
- },
- // 整理数据
- formatText(item, model) {
- const that = this;
- if (item) {
- let data = model.find((i) => i.dict_value == item);
- if (data) return data.dict_label;
- else return '暂无';
- }
- },
- // 查看文件
- toFile(item) {
- const that = this;
- let serverUrl = that.$config.serverFile;
- let url = item[0].url
- // 判断前面是否有http
- const http = url.lastIndexOf("http");
- if (http == -1) url = serverUrl + url
- //获取最后一个.的位置
- const arr = url.lastIndexOf(".");
- //获取后缀
- const typeName = url.substr(arr + 1);
- //支持预览的文件类型
- //微信小程序
- let fileType = ['doc', 'xls', 'ppt', 'pdf', 'docx', 'xlsx', 'pptx'];
- uni.showLoading({
- title: '加载中',
- mask: true
- })
- //下载文件资源到本地
- uni.downloadFile({
- url: url,
- success: function(res) {
- uni.hideLoading();
- var filePath = res.tempFilePath;
- if (!fileType.includes(typeName)) {
- return false;
- }
- uni.showLoading({
- title: '正在打开',
- mask: true
- })
- // 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
- uni.openDocument({
- filePath: filePath,
- fileType: typeName, // 文件类型,指定文件类型打开文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx
- success: res => {
- uni.hideLoading();
- console.log('打开文档成功', res);
- },
- fail: openError => {
- uni.hideLoading();
- console.log('fail:' + JSON.stringify(openError));
- }
- });
- },
- fail: function(err) {
- uni.hideLoading();
- console.log('fail:' + JSON.stringify(err));
- }
- });
- },
- // 分页
- toPage(e) {
- const that = this;
- uni.showLoading({
- title: '加载中',
- mask: true
- })
- that.$set(that, `page`, e.current);
- const page = e.current - 1;
- const skip = page * that.limit;
- that.$set(that, `skip`, skip)
- that.dirSearch();
- },
- async searchOther() {
- const that = this;
- let res;
- uni.showLoading({
- title: '正在加载请稍后',
- mask: true
- })
- //地区
- res = await that.$api('/region', 'GET', {
- code: '220000',
- status: '0'
- }, 'freeLabel')
- if (res.errcode == '0') that.$set(that, `regionList`, res.data);
- //性别
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'sys_user_sex',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `genderList`, res.data);
- //证件类别
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'leading_cadre_cardtype',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `cardtypeList`, res.data);
- //学历
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'education',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `educationList`, res.data);
- //学位
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'degree',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `degreeList`, res.data);
- //职称
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'title',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `titleList`, res.data);
- //单位类别
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'declare_unit_type',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `unittypeList`, res.data);
- //事业单位
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'declare_unit_career',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `careerList`, res.data);
- //隶属
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'declare_unit_subjection',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `subjectionList`, res.data);
- //是否启用
- res = await that.$api('/dictData', 'GET', {
- dict_type: 'info_show',
- status: '0'
- }, 'jcyjdtglpt')
- if (res.errcode == '0') that.$set(that, `showList`, res.data);
- // 固定/流动人员 作者
- let personList = [];
- res = await that.$api('/fixedpersonnel', 'GET', {
- status: '0'
- }, 'freeLabel')
- if (res.errcode == '0') personList = res.data;
- res = await that.$api('/flowpersonnel', 'GET', {
- status: '0'
- }, 'freeLabel')
- if (res.errcode == '0') personList.push(...res.data);
- that.$set(that, `userList`, personList);
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .main {
- background-color: var(--f9Color);
- .one {
- padding: 2vw;
- .one_1 {
- padding: 2vw;
- font-size: var(--font16Size);
- font-weight: bold;
- margin: 0 0 2vw 0;
- border-bottom: 1px var(--fcColor) dashed;
- }
- .one_2 {
- background-color: var(--mainColor);
- padding: 2vw;
- margin: 0 0 2vw 0;
- border-radius: 5px;
- .label {
- margin: 0 0 1vw 0;
- .title {
- font-size: var(--font14Size);
- font-weight: bold;
- }
- .content {
- margin: 0 0 0 1vw;
- color: var(--f85Color);
- font-size: var(--font14Size);
- }
- .image {
- .images {
- width: 100%;
- margin: 0 0 1vw 0;
- }
- }
- }
- .list {
- background-color: var(--mainColor);
- border: 1px solid var(--f5Color);
- padding: 2vw;
- margin: 0 2vw 2vw 2vw;
- border-radius: 5px;
- .name {
- font-size: var(--font14Size);
- font-weight: bold;
- }
- .other {
- font-size: var(--font12Size);
- color: var(--f85Color);
- .other_1 {
- margin: 1vw 0 0 0;
- }
- }
- .status {
- padding: 1vw 0 0 0;
- font-size: var(--font12Size);
- color: var(--fF0Color);
- }
- }
- }
- }
- }
- </style>
|