|
@@ -0,0 +1,178 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <top topType="2" @back="back"></top>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="info" :style="{ height: clientHeight + 'px' }">
|
|
|
+ <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-col :span="24" class="name">
|
|
|
+ {{ item.project }}
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="other">
|
|
|
+ <el-col :span="12" class="other_info textOver">
|
|
|
+ 联系人:<span>{{ item.contact || '暂无' }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="other_info textOver">
|
|
|
+ 联系电话:<span>{{ item.phone || '暂无' }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="other_info textOver">
|
|
|
+ 电子邮箱:<span>{{ item.email || '暂无' }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="other_info textOver">
|
|
|
+ 服务时间:<span>{{ item.server_time || '暂无' }}</span>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="staBtn">
|
|
|
+ <el-col :span="18" class="status">
|
|
|
+ 状态:<span>{{ item.status == '0' ? '预约' : '完成' }}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" class="btn">
|
|
|
+ <el-button type="primary" size="mini">查看详情</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="foot">
|
|
|
+ <page :limit="limit" :total="total" @search="search"></page>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import top from '@/layout/common/top.vue';
|
|
|
+import page from '@/layout/common/page.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: Order } = createNamespacedHelpers('Order');
|
|
|
+const { mapActions: Medium } = createNamespacedHelpers('Medium');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ top,
|
|
|
+ page,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ return {
|
|
|
+ clientHeight: '',
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ limit: '10',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ ...Order(['query']),
|
|
|
+ ...Medium(['fetch']),
|
|
|
+ async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
|
+ let openid = sessionStorage.getItem('openid');
|
|
|
+ if (openid) info.openid = openid;
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ for (const val of res.data) {
|
|
|
+ this.searchPro(val);
|
|
|
+ }
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取项目/设备名称
|
|
|
+ async searchPro(data) {
|
|
|
+ let res = await this.fetch(data.medium_id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let arr = res.data.project.find((i) => i.id == data.project);
|
|
|
+ if (arr) {
|
|
|
+ data.project = arr.name;
|
|
|
+ } else {
|
|
|
+ let arr = res.data.equipment.find((i) => i.id == data.project);
|
|
|
+ if (arr) {
|
|
|
+ data.project = arr.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ back() {
|
|
|
+ this.$router.push({ path: '/perCenter/index' });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ let clientHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 80;
|
|
|
+ this.$set(this, `clientHeight`, clientHeight);
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.main {
|
|
|
+ .top {
|
|
|
+ height: 40px;
|
|
|
+ overflow: hidden;
|
|
|
+ border-bottom: 1px solid #f1f1f1;
|
|
|
+ }
|
|
|
+ .info {
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+ background-color: #f9f9f9;
|
|
|
+ padding: 8px;
|
|
|
+ .list {
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 8px;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ border-radius: 10px;
|
|
|
+ .name {
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 0 0 5px 0;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .other {
|
|
|
+ .other_info {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ margin: 0 0 5px 0;
|
|
|
+ span {
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .staBtn {
|
|
|
+ .status {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ padding: 4px 0;
|
|
|
+ span {
|
|
|
+ color: #ff0000;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .foot {
|
|
|
+ height: 40px;
|
|
|
+ overflow: hidden;
|
|
|
+ border-top: 1px solid #f1f1f1;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|