guhongwei 3 年 前
コミット
3cdeda5158

+ 57 - 0
src/layout/scientific/award/info-1.vue

@@ -0,0 +1,57 @@
+<template>
+  <div id="info-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="one">
+          <van-form label-width="4em">
+            <van-field v-model="info.name" name="name" label="成果名称" readonly />
+            <van-field v-model="info.resulnumber" name="resulnumber" label="成果编号" readonly />
+            <van-field v-model="info.type" name="type" label="类别" readonly />
+            <van-field v-model="info.level" name="level" label="获奖等级" readonly />
+            <van-field v-model="info.directionName" name="directionName" label="研究方向" readonly />
+            <van-field v-model="info.person" name="person" label="获奖人" readonly />
+          </van-form>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'info-1',
+  props: {
+    info: { type: Object },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    .van-divider {
+      margin: 10px 0;
+    }
+  }
+}
+</style>

+ 91 - 0
src/layout/scientific/award/list-1.vue

@@ -0,0 +1,91 @@
+<template>
+  <div id="list-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
+          <van-col span="24" class="title textOver">
+            {{ item.name }}
+          </van-col>
+          <van-col span="24" class="other">
+            <van-col span="24" class="otherInfo">
+              成果编号:<span>{{ item.resulnumber || '暂无' }}</span>
+            </van-col>
+            <van-col span="24" class="otherInfo">
+              获奖等级:<span>{{ item.level || '暂无' }}</span>
+            </van-col>
+          </van-col>
+          <van-col span="24" class="btn">
+            <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
+          </van-col>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list-1',
+  props: {
+    list: { type: Array },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    // 查看详情
+    toView(data) {
+      this.$emit('toView', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    background-color: #fff;
+    margin: 0 0 8px 0;
+    padding: 8px;
+    border-radius: 5px;
+    .title {
+      font-size: 16px;
+      font-weight: bold;
+      margin: 0 0 5px 0;
+    }
+    .other {
+      margin: 0 0 5px 0;
+      .otherInfo {
+        font-size: 14px;
+        color: #666;
+        margin: 0 0 5px 0;
+        span {
+          color: #000;
+        }
+      }
+    }
+    .btn {
+      text-align: center;
+      .van-button {
+        margin: 0 5px;
+      }
+    }
+  }
+}
+</style>

+ 70 - 0
src/layout/scientific/award/search-1.vue

@@ -0,0 +1,70 @@
+<template>
+  <div id="search-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="one">
+          <van-form label-width="4em">
+            <van-field v-model="form.type" name="type" label="类别" placeholder="请输入类别" />
+            <van-field v-model="form.resulnumber" name="resulnumber" label="成果编号" placeholder="请输入成果编号" />
+            <van-field v-model="form.unit" name="unit" label="成果名称" placeholder="请输入成果名称" />
+            <van-field v-model="form.level" name="level" label="获奖等级" placeholder="请输入获奖等级" />
+            <van-field v-model="form.directionName" name="directionName" label="研究方向" placeholder="请输入研究方向" />
+            <div class="btn">
+              <van-button type="info" size="small" @click="reseat">重置条件</van-button>
+              <van-button type="primary" size="small" @click="onSubmit">提交查询</van-button>
+            </div>
+          </van-form>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const moment = require('moment');
+export default {
+  name: 'search-1',
+  props: { form: { type: Object } },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    reseat() {
+      this.$emit('reseat');
+    },
+    onSubmit() {
+      this.$emit('onSubmit', { data: this.form });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    .btn {
+      text-align: center;
+      margin: 10px 0;
+      .van-button {
+        margin: 0 5px;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/router/index.js

@@ -52,7 +52,7 @@ const scientific = [
   },
   {
     path: '/scientific/award/index',
-    meta: { title: '获奖信息展示' },
+    meta: { title: '实验室建设期内获奖明细' },
     component: () => import('../views/scientific/award/index.vue'),
   },
   {

+ 140 - 8
src/views/scientific/award/index.vue

@@ -1,22 +1,147 @@
 <template>
   <div id="index">
-    <van-row>
-      <van-col span="24" class="main"> test </van-col>
-    </van-row>
+    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @back="back" @add="toAdd" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list" @toView="toView"></list-1>
+      </template>
+    </admin-frame>
+    <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
+      <info-1 :info="info" v-if="dialog.type == '1'"></info-1>
+      <search-1 :form="searhForm" v-else-if="dialog.type == '2'" @reseat="reseat" @onSubmit="onSubmit"></search-1>
+    </van-dialog>
   </div>
 </template>
 
 <script>
+import list1 from '@/layout/scientific/award/list-1.vue';
+import info1 from '@/layout/scientific/award/info-1.vue';
+import search1 from '@/layout/scientific/award/search-1.vue';
+import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: {
+    adminFrame,
+    list1,
+    info1,
+    search1,
+  },
   data: function () {
-    return {};
+    return {
+      list: [
+        {
+          createBy: '1',
+          createTime: '2021-10-11 23:11:01',
+          delFlag: '0',
+          direction: 'direction001',
+          directionName: '开创视觉光刺激治疗癫痫研究',
+          id: '45b54288eb0c40abbf6b123735da1445',
+          level: '1',
+          name: '这里是成果名称',
+          params: {},
+          person: [
+            {
+              createBy: '1',
+              createTime: '2021-10-11 23:53:48',
+              delFlag: '0',
+              id: '66da7d92145748f0a8a7b04b8cad4180',
+              level: '1',
+              params: {},
+              patentId: '45b54288eb0c40abbf6b123735da1445',
+              remark: null,
+              searchValue: null,
+              updateBy: null,
+              updateTime: null,
+              userId: 'person003',
+              userName: '付学奇',
+            },
+            {
+              createBy: '1',
+              createTime: '2021-10-11 23:53:48',
+              delFlag: '0',
+              id: '848422552bdc4bcda6e24897c1311362',
+              level: '2',
+              params: {},
+              patentId: '45b54288eb0c40abbf6b123735da1445',
+              remark: null,
+              searchValue: null,
+              updateBy: null,
+              updateTime: null,
+              userId: 'person001',
+              userName: '王江涛',
+            },
+            {
+              createBy: '1',
+              createTime: '2021-10-11 23:53:48',
+              delFlag: '0',
+              id: '109e43caf78d4fe3ae977c2467926548',
+              level: '3',
+              params: {},
+              patentId: '45b54288eb0c40abbf6b123735da1445',
+              remark: null,
+              searchValue: null,
+              updateBy: null,
+              updateTime: null,
+              userId: 'person002',
+              userName: '刘光耀',
+            },
+          ],
+          personlevel: null,
+          remark: null,
+          resulnumber: '这里是成果编号',
+          searchValue: null,
+          type: '2',
+          updateBy: null,
+          updateTime: '2021-10-11 23:53:48',
+          userId: null,
+          userName: null,
+        },
+      ],
+      total: 0,
+      limit: 5,
+      // 查询
+      searhForm: {},
+      // 弹框
+      dialog: { show: false, title: '详细信息', type: '1' },
+      // 详细信息
+      info: {},
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
+      if (searchName) info.name = searchName;
+      console.log(this.searhForm);
+    },
+    // 查看信息
+    async toView(data) {
+      data.person = JSON.stringify(data.person.map((i) => i.userName));
+      this.$set(this, `info`, data);
+      this.dialog = { show: true, title: '详细信息', type: '1' };
+    },
+    // 添加查询条件
+    toAdd() {
+      this.dialog = { show: true, title: '查询条件', type: '2' };
+    },
+    // 重置条件
+    reseat() {
+      this.searhForm = {};
+      this.dialog = { show: false, title: '查询条件', type: '2' };
+      this.search();
+    },
+    // 提交查询
+    onSubmit({ data }) {
+      this.search(data);
+      this.dialog = { show: false, title: '查询条件', type: '2' };
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/scientific/index' });
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
   },
@@ -33,4 +158,11 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.dialog {
+  /deep/.van-dialog__content {
+    max-height: 350px;
+    overflow-y: auto;
+  }
+}
+</style>