guhongwei 3 years ago
parent
commit
45f65cbe35

+ 10 - 0
src/router/index.js

@@ -464,6 +464,16 @@ const patent = [
     meta: { title: '专利交易-详细信息' },
     component: () => import('../views/patent/admin/patent/trans_info.vue'),
   },
+  {
+    path: '/patent/admin/patent/techol',
+    meta: { title: '专利需求' },
+    component: () => import('../views/patent/admin/techol/index.vue'),
+  },
+  {
+    path: '/patent/admin/techol/techol_info',
+    meta: { title: '专利需求-详细信息' },
+    component: () => import('../views/patent/admin/techol/techol_info.vue'),
+  },
 ];
 const web = [
   {

+ 3 - 0
src/store/index.js

@@ -56,6 +56,8 @@ import patentassess from '@common/src/store/patent/patentassess';
 import patentinfo from '@common/src/store/patent/patentinfo';
 // 已授权专利预警表
 import patentearly from '@common/src/store/patent/patentearly';
+// 专利需求
+import patenttechol from '@common/src/store/patent/patenttechol';
 
 // 专利交易
 import patenttrans from '@common/src/store/patent/patenttrans';
@@ -120,5 +122,6 @@ export default new Vuex.Store({
     patentearly,
     patenttrans,
     mission,
+    patenttechol,
   },
 });

+ 63 - 0
src/views/market/demand/index copy.vue

@@ -0,0 +1,63 @@
+<template>
+  <div id="index">
+    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list" @detail="detail"></list-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import list1 from './parts/list-1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    list1,
+  },
+  data: function () {
+    return {
+      list: [],
+      limit: 5,
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...patenttrans(['query']),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 详情
+    detail(data) {
+      this.$router.push({ path: '/market/demand/detail', query: { id: data.id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 16 - 20
src/views/market/demand/index.vue

@@ -1,48 +1,44 @@
 <template>
   <div id="index">
-    <admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
+    <admin-frame topType="2" :rightArrow="false" :leftArrow="false" :usePage="false" :useNav="false">
       <template v-slot:info>
-        <list-1 :list="list" @detail="detail"></list-1>
+        <form-1 :form="form" @onSubmit="onSubmit"></form-1>
       </template>
     </admin-frame>
   </div>
 </template>
 
 <script>
-import list1 from './parts/list-1.vue';
+import form1 from './parts/form-1.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
+const { mapActions: patenttechol } = createNamespacedHelpers('patenttechol');
+const moment = require('moment');
 export default {
   name: 'index',
   props: {},
   components: {
     adminFrame,
-    list1,
+    form1,
   },
   data: function () {
     return {
-      list: [],
-      limit: 5,
-      total: 0,
+      form: {},
     };
   },
-  async created() {
-    await this.search();
-  },
+  async created() {},
   methods: {
-    ...patenttrans(['query']),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
-      let res = await this.query({ skip, limit, ...info });
+    ...patenttechol(['create']),
+    async onSubmit(data) {
+      data.status = '0';
+      data.order_num = 'HC' + moment(new Date()).valueOf();
+      let res = await this.create(data);
       if (this.$checkRes(res)) {
-        this.$set(this, `list`, res.data);
-        this.$set(this, `total`, res.total);
+        this.$toast({ type: `success`, message: `操作成功` });
+      } else {
+        this.$toast({ type: `error`, message: `${res.errmsg}` });
       }
     },
-    // 详情
-    detail(data) {
-      this.$router.push({ path: '/market/demand/detail', query: { id: data.id } });
-    },
   },
   computed: {
     ...mapState(['user']),

+ 97 - 0
src/views/market/demand/parts/form-1.vue

@@ -0,0 +1,97 @@
+<template>
+  <div id="form-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col :span="24" class="one">
+          <van-form @submit="onSubmit" @reset="onReset">
+            <van-field
+              v-model="form.describe"
+              name="describe"
+              label="需求描述(用途)"
+              placeholder="需求描述(用途)"
+              type="textarea"
+              autosize
+              :rules="[{ required: true, message: '请填写需求描述(用途)' }]"
+            />
+            <van-field name="urgent" label="紧急程度" :rules="[{ required: true, message: '请选择紧急程度' }]">
+              <template #input>
+                <van-radio-group v-model="form.urgent" direction="horizontal">
+                  <van-radio name="特急">特急</van-radio>
+                  <van-radio name="一般">一般</van-radio>
+                  <van-radio name="长期">长期</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field v-model="form.contact" name="contact" label="联系人" placeholder="联系人" :rules="[{ required: true, message: '请填写联系人' }]" />
+            <van-field v-model="form.phone" name="phone" label="联系电话" placeholder="联系电话" :rules="[{ required: true, message: '请填写联系电话' }]" />
+            <van-field v-model="form.email" name="email" label="电子邮箱" placeholder="电子邮箱" :rules="[{ required: true, message: '请填写电子邮箱' }]" />
+            <van-field
+              v-model="form.requirement"
+              name="requirement"
+              label="合作条件及要求"
+              placeholder="合作条件及要求"
+              type="textarea"
+              autosize
+              :rules="[{ required: true, message: '请填写合作条件及要求' }]"
+            />
+            <div class="btn">
+              <van-button type="danger" size="small" native-type="reset">重置信息</van-button>
+              <van-button type="info" size="small" native-type="submit">提交信息</van-button>
+            </div>
+          </van-form>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'form-1',
+  props: {
+    form: { type: Object },
+  },
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {
+    onSubmit(values) {
+      this.$emit('onSubmit', values);
+      console.log();
+    },
+    onReset() {
+      console.log('1');
+    },
+  },
+  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 10px;
+      }
+    }
+  }
+}
+</style>

+ 1 - 0
src/views/patent/admin/adminBtn.vue

@@ -25,6 +25,7 @@
             <van-cell title="专利信息" @click="pathBtn('admin/patent', 'info')" is-link />
             <van-cell title="价值评估" @click="pathBtn('admin/patent', 'assessment')" is-link />
             <van-cell title="专利交易" @click="pathBtn('admin/patent', 'trans')" is-link />
+            <van-cell title="专利需求" @click="pathBtn('admin/patent', 'techol')" is-link />
           </van-col>
         </van-col>
       </van-col>

+ 68 - 0
src/views/patent/admin/techol/index.vue

@@ -0,0 +1,68 @@
+<template>
+  <div id="index">
+    <admin-frame @search="search" :limit="limit" :total="total" topType="3" @back="back" :useNav="false">
+      <template v-slot:info>
+        <list-1 :list="list" @detail="detail"></list-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import list1 from './parts/list-1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: patenttechol } = createNamespacedHelpers('patenttechol');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    list1,
+  },
+  data: function () {
+    return {
+      list: [],
+      limit: 5,
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...patenttechol(['query']),
+    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
+      if (searchName) info.order_num = searchName;
+      let res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    // 查看详情
+    detail(data) {
+      this.$router.push({ path: '/patent/admin/techol/techol_info', query: { id: data.id } });
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/patent/index' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 50 - 0
src/views/patent/admin/techol/parts/info-1.vue

@@ -0,0 +1,50 @@
+<template>
+  <div id="info-1">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col :span="24" class="one">
+          <van-form>
+            <van-field v-model="info.order_num" name="order_num" label="需求单号" readonly />
+            <van-field v-model="info.describe" name="describe" label="需求描述(用途)" type="textarea" autosize readonly />
+            <van-field v-model="info.urgent" name="urgent" label="紧急程度" placeholder="联系人" readonly />
+            <van-field v-model="info.contact" name="contact" label="联系人" placeholder="联系人" readonly />
+            <van-field v-model="info.phone" name="phone" label="联系电话" placeholder="联系电话" readonly />
+            <van-field v-model="info.email" name="email" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="info.requirement" name="requirement" label="合作条件及要求" type="textarea" autosize 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></style>

+ 91 - 0
src/views/patent/admin/techol/parts/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="one">
+          <van-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+            <van-col :span="24" class="name">
+              {{ item.order_num }}
+            </van-col>
+            <van-col :span="24" class="other">
+              <van-col :span="24" class="otherInfo">
+                联系人:<span>{{ item.contact || '暂无' }}</span>
+              </van-col>
+              <van-col :span="24" class="otherInfo">
+                联系电话:<span>{{ item.phone || '暂无' }}</span>
+              </van-col>
+            </van-col>
+            <van-col :span="24" class="btn">
+              <van-button type="info" size="small" @click="detail(item)">查看信息</van-button>
+            </van-col>
+          </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: {
+    detail(data) {
+      this.$emit('detail', 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 {
+  .one {
+    padding: 8px 8px 0 8px;
+    .list {
+      background-color: #fff;
+      padding: 8px;
+      margin: 0 0 8px 0;
+      border-radius: 5px;
+      .name {
+        font-size: 16px;
+        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;
+      }
+    }
+  }
+}
+</style>

+ 63 - 0
src/views/patent/admin/techol/techol_info.vue

@@ -0,0 +1,63 @@
+<template>
+  <div id="techol_info">
+    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
+      <template v-slot:info>
+        <info-1 :info="info"></info-1>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import info1 from './parts/info-1.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: patenttechol } = createNamespacedHelpers('patenttechol');
+export default {
+  name: 'techol_info',
+  props: {},
+  components: {
+    adminFrame,
+    info1,
+  },
+  data: function () {
+    return {
+      info: {},
+    };
+  },
+  async created() {
+    if (this.id) await this.search();
+  },
+  methods: {
+    ...patenttechol(['fetch']),
+    async search() {
+      let res = await this.fetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/patent/admin/patent/techol' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>