Browse Source

修改专利超市

guhongwei 3 years ago
parent
commit
1affa18dc5

+ 1 - 1
src/layout/patent/info-1.vue

@@ -49,7 +49,7 @@ export default {
   created() {},
   methods: {
     searchImg(data) {
-      if (data.img_url) {
+      if (data.img_url && data.img_url.length > 0) {
         var url = data.img_url.map((item) => item.url)[0];
         this.$set(this, `img_url`, url);
       } else {

+ 25 - 18
src/views/market/patentInfo/index.vue

@@ -10,8 +10,9 @@
         </van-col>
       </template>
     </admin-frame>
-    <van-dialog class="dialog" v-model="show" title="查询条件" :show-cancel-button="false" :show-confirm-button="false">
-      <search-1 :searchForm="searchForm" @toClose="toClose" @reseat="reseat" @onSubmit="onSubmit" @changeCreate="changeCreate"></search-1>
+    <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button>
+      <search-1 v-if="dialog.type == '1'" :searchForm="searchForm" @reseat="reseat" @onSubmit="onSubmit" @changeCreate="changeCreate"></search-1>
+      <info-1 v-else-if="dialog.type == '2'" :info="info"></info-1>
     </van-dialog>
     <van-calendar v-model="oneShow" @confirm="oneChange" :min-date="minDate" :max-date="maxDate" />
   </div>
@@ -20,6 +21,7 @@
 <script>
 import search1 from './parts/search-1.vue';
 import list1 from './parts/list-1.vue';
+import info1 from '@/layout/patent/info-1.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: patentinfo } = createNamespacedHelpers('patentinfo');
@@ -31,19 +33,23 @@ export default {
     adminFrame,
     list1,
     search1,
+    info1,
   },
   data: function () {
     return {
       list: [],
       limit: 5,
       total: 0,
-      // 查询条件
-      show: false,
-      searchForm: {},
       // 选择申请日
       oneShow: false,
       minDate: new Date(1900, 1, 1),
       maxDate: new Date(2050, 1, 1),
+      // 弹框
+      dialog: { show: false, title: '查询条件', type: '1' },
+      // 查询条件
+      searchForm: {},
+      // 详情
+      info: {},
     };
   },
   async created() {
@@ -60,15 +66,15 @@ export default {
     },
     // 详情
     detail(data) {
-      this.$router.push({ path: '/market/patentInfo/detail', query: { id: data.id } });
+      data.inventor = JSON.stringify(data.inventor.map((i) => i.name));
+      this.$set(this, `info`, data);
+      let dialog = { show: true, title: '详细信息', type: '2' };
+      this.$set(this, `dialog`, dialog);
     },
     // 查询
     toSearch() {
-      this.show = true;
-    },
-    // 取消查询
-    toClose() {
-      this.show = false;
+      let dialog = { show: true, title: '查询条件', type: '1' };
+      this.$set(this, `dialog`, dialog);
     },
     // 重置条件
     reseat() {
@@ -78,7 +84,8 @@ export default {
     // 提交查询
     onSubmit({ data }) {
       this.search(data);
-      this.show = false;
+      let dialog = { show: false, title: '查询条件', type: '1' };
+      this.$set(this, `dialog`, dialog);
     },
     changeCreate() {
       this.oneShow = true;
@@ -112,10 +119,10 @@ export default {
   padding: 10px 0;
   text-align: center;
 }
-// .dialog {
-//   /deep/.van-dialog__content {
-//     height: 300px;
-//     overflow-y: auto;
-//   }
-// }
+.dialog {
+  /deep/.van-dialog__content {
+    max-height: 350px;
+    overflow-y: auto;
+  }
+}
 </style>

+ 0 - 4
src/views/market/patentInfo/parts/search-1.vue

@@ -37,7 +37,6 @@
             </van-field>
             <van-field v-model="searchForm.on_obligee" name="on_obligee" label="当前权利人" placeholder="请输入当前权利人" />
             <div class="btn">
-              <van-button type="danger" size="small" @click="toClose">取消查询</van-button>
               <van-button type="info" size="small" @click="reseat">重置条件</van-button>
               <van-button type="primary" size="small" @click="onSubmit">提交查询</van-button>
             </div>
@@ -62,9 +61,6 @@ export default {
   },
   created() {},
   methods: {
-    toClose() {
-      this.$emit('toClose');
-    },
     reseat() {
       this.$emit('reseat');
     },