guhongwei 3 роки тому
батько
коміт
c8fbdf3c1e

+ 2 - 0
src/layout/patentInfo/trans-1.vue

@@ -37,6 +37,7 @@
             </van-field>
             </van-field>
             <van-field v-model="form.budget_min" name="budget_min" type="digit" label="最小价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
             <van-field v-model="form.budget_min" name="budget_min" type="digit" label="最小价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
             <van-field v-model="form.budget_max" name="budget_max" type="digit" label="最大价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
             <van-field v-model="form.budget_max" name="budget_max" type="digit" label="最大价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
+
             <van-field name="type" label="交易类型" :rules="[{ required: true, message: '交易类型' }]">
             <van-field name="type" label="交易类型" :rules="[{ required: true, message: '交易类型' }]">
               <template #input>
               <template #input>
                 <van-radio-group v-model="form.type" direction="horizontal">
                 <van-radio-group v-model="form.type" direction="horizontal">
@@ -89,6 +90,7 @@
             <van-field v-model="form.requirementdesc" name="requirementdesc" label="技术说明" placeholder="请输入技术说明" type="textarea" autosize />
             <van-field v-model="form.requirementdesc" name="requirementdesc" label="技术说明" placeholder="请输入技术说明" type="textarea" autosize />
             <van-field v-model="form.expect" name="expect" label="商业预期" placeholder="请输入商业预期" type="textarea" autosize />
             <van-field v-model="form.expect" name="expect" label="商业预期" placeholder="请输入商业预期" type="textarea" autosize />
             <van-field v-model="form.condition" name="condition" label="合作条件及要求" placeholder="请输入合作条件及要求" type="textarea" autosize />
             <van-field v-model="form.condition" name="condition" label="合作条件及要求" placeholder="请输入合作条件及要求" type="textarea" autosize />
+
             <van-col span="24" class="btn">
             <van-col span="24" class="btn">
               <van-button type="info" size="small" native-type="submit">提交交易</van-button>
               <van-button type="info" size="small" native-type="submit">提交交易</van-button>
             </van-col>
             </van-col>

+ 7 - 1
src/layout/trans/list-1.vue

@@ -19,7 +19,9 @@
           </van-col>
           </van-col>
           <van-col span="24" class="btn">
           <van-col span="24" class="btn">
             <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
             <van-button type="info" size="small" @click="toView(item)">详细信息</van-button>
-            <template v-if="user.role == '1'"> </template>
+            <template v-if="user.role == '1'">
+              <van-button type="danger" size="small" @click="toDel(item)">刪除信息</van-button>
+            </template>
             <template v-else-if="user.role == '2'">
             <template v-else-if="user.role == '2'">
               <van-button type="info" size="small" @click="toExamine(item)" v-if="item.status == '0'">交易审核</van-button>
               <van-button type="info" size="small" @click="toExamine(item)" v-if="item.status == '0'">交易审核</van-button>
               <van-button type="info" size="small" @click="toContact(item)" v-if="item.status == '2'">合同审核</van-button>
               <van-button type="info" size="small" @click="toContact(item)" v-if="item.status == '2'">合同审核</van-button>
@@ -93,6 +95,10 @@ export default {
     toCheck(data) {
     toCheck(data) {
       this.$emit('toCheck', data);
       this.$emit('toCheck', data);
     },
     },
+    // 刪除信息
+    toDel(data) {
+      this.$emit('toDel', data);
+    },
     // 整理状态
     // 整理状态
     getStu(data) {
     getStu(data) {
       if (data == '0') return '待审中';
       if (data == '0') return '待审中';

+ 228 - 0
src/layout/trans/trans-create.vue

@@ -0,0 +1,228 @@
+<template>
+  <div id="trans-create">
+    <van-row>
+      <van-col span="24" class="main">
+        <van-col span="24" class="one">
+          <van-form @submit="onSubmit" label-width="5em">
+            <van-field v-model="form.create_number" name="create_number" label="专利号" placeholder="请输入专利号" />
+            <van-field v-model="form.patent_name" name="patent_name" label="专利名称" placeholder="请输入专利名称" />
+            <van-field v-model="form.on_obligee" name="on_obligee" label="当前权利人" placeholder="请输入当前权利人" />
+            <van-field v-model="form.on_afterobligee" name="on_afterobligee" label="变更后专利权人" placeholder="请输入变更后专利权人" />
+            <van-field v-model="form.contact" name="contact" label="联系人" placeholder="请输入联系人" />
+            <van-field v-model="form.phone" name="phone" label="联系电话" placeholder="请输入联系电话" />
+            <van-field v-model="form.email" name="email" label="电子邮箱" placeholder="请输入电子邮箱" />
+            <van-field name="budgetType" label="价格类型">
+              <template #input>
+                <van-radio-group v-model="form.budget_type" direction="horizontal">
+                  <van-radio name="1">面议</van-radio>
+                  <van-radio name="2">金额区间(万元)</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field v-model="form.budget_min" name="budget_min" type="digit" label="最小价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
+            <van-field v-model="form.budget_max" name="budget_max" type="digit" label="最大价格" placeholder="请输入价格" v-if="form.budget_type == '2'" />
+            <van-field name="type" label="交易类型">
+              <template #input>
+                <van-radio-group v-model="form.type" direction="horizontal">
+                  <van-radio name="转让">转让</van-radio>
+                  <van-radio name="许可">许可</van-radio>
+                  <van-radio name="免费许可">免费许可</van-radio>
+                  <van-radio name="招商">招商</van-radio>
+                  <van-radio name="质押">质押</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-col span="24" class="typeThr" v-if="form.type == '免费许可'">
+              <van-col span="24" class="title"> 免费许可承诺书 </van-col>
+              <van-col span="24" class="info">
+                公开声明:【{{ form.patent_name }}】专利权人许可本专利在【
+                <span @click.prevent="typeSelect('province')">{{ form.promise_file.province }}</span>
+                】【
+                <span @click.prevent="typeSelect('city')">{{ form.promise_file.city }}</span>
+                】范围内免费使用,期限至【
+                <span @click.prevent="typeSelect('end_date')">{{ form.promise_file.end_date }}</span>
+                】止,被许可人需与许可人签订许可合同后方可使用。
+              </van-col>
+              <van-popup v-model="oneShow" position="bottom">
+                <van-picker show-toolbar :columns="provinceList" @confirm="oneFirm" @cancel="oneShow = false" />
+              </van-popup>
+              <van-popup v-model="twoShow" position="bottom">
+                <van-picker show-toolbar :columns="cityList" @confirm="twoFirm" @cancel="twoShow = false" />
+              </van-popup>
+              <van-calendar v-model="thrShow" @confirm="thrFirm" :min-date="minDate" :max-date="maxDate" />
+            </van-col>
+            <van-field name="is_report" label="评估报告">
+              <template #input>
+                <van-radio-group v-model="form.is_report" direction="horizontal">
+                  <van-radio :name="true">有</van-radio>
+                  <van-radio :name="false">无</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field name="report" label="报告文件">
+              <template #input>
+                <van-uploader
+                  :fileList="form.report"
+                  :max-count="1"
+                  :after-read="(file) => toUpload(file, 'report')"
+                  @delete="(file) => toDelete(file, 'report')"
+                />
+              </template>
+            </van-field>
+            <van-field v-model="form.abstract" name="abstract" label="摘要" placeholder="请输入摘要" type="textarea" autosize rows="1" />
+            <van-field v-model="form.requirementdesc" name="requirementdesc" label="技术说明" placeholder="请输入技术说明" type="textarea" autosize rows="1" />
+            <van-field v-model="form.expect" name="expect" label="商业预期" placeholder="请输入商业预期" type="textarea" autosize rows="1" />
+            <van-field v-model="form.condition" name="condition" label="合作条件及要求" placeholder="请输入合作条件及要求" type="textarea" autosize rows="1" />
+            <van-field
+              :value="form.transfer_date"
+              name="transfer_date"
+              label="专利权转移日期"
+              placeholder="点击选择"
+              @click="selectDate('transfer_date')"
+              :rules="[{ required: false, message: '专利权转移日期' }]"
+            />
+            <!-- 选择日期公用弹框 -->
+            <van-calendar v-model="calendarShow" @confirm="calendarCon" :min-date="minDate" :max-date="maxDate" />
+            <van-field name="status" label="交易状态">
+              <template #input>
+                <van-radio-group v-model="form.status" direction="horizontal">
+                  <van-radio name="1">转让信息</van-radio>
+                  <van-radio name="2">交易公告</van-radio>
+                  <van-radio name="5">已成交专利</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-col span="24" class="btn">
+              <van-button type="info" size="small" native-type="submit">提交交易</van-button>
+            </van-col>
+          </van-form>
+        </van-col>
+      </van-col>
+    </van-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: upload } = createNamespacedHelpers('upload');
+const moment = require('moment');
+export default {
+  name: 'trans-create',
+  props: {
+    form: { type: Object },
+  },
+  components: {},
+  data: function () {
+    return {
+      type: '',
+      // 省份
+      oneShow: false,
+      provinceList: ['吉林省'],
+      // 城市
+      twoShow: false,
+      cityList: ['长春市', '吉林市', '四平市', '辽源市', '通化市', '白山市', '白城市', '延边州', '松原市', '长白山管委会'],
+      // 截止日期
+      thrShow: false,
+      minDate: new Date(1900, 1, 1),
+      maxDate: new Date(2050, 1, 1),
+      // 专利转移日期
+      calendarShow: false,
+      calendar_type: '',
+    };
+  },
+  created() {},
+  methods: {
+    ...upload(['upload']),
+    onSubmit(value) {
+      if (value) this.$emit('onSubmit', { data: this.form });
+    },
+    // 承诺书信息
+    typeSelect(type) {
+      this.$set(this, `type`, type);
+      if (type == 'province') this.oneShow = true;
+      else if (type == 'city') this.twoShow = true;
+      else if (type == 'end_date') this.thrShow = true;
+    },
+    // 确认选择省份
+    oneFirm(value) {
+      this.$set(this.form.promise_file, `${this.type}`, value);
+      this.oneShow = false;
+    },
+    // 确认选择城市
+    twoFirm(value) {
+      this.$set(this.form.promise_file, `${this.type}`, value);
+      this.twoShow = false;
+    },
+    // 确认选择日历
+    thrFirm(value) {
+      this.$set(this.form.promise_file, `${this.type}`, moment(value).format('YYYY-MM-DD'));
+      this.thrShow = false;
+    },
+    // 打开选择日期弹框
+    selectDate(type) {
+      this.$set(this, `calendar_type`, type);
+      this.calendarShow = true;
+    },
+    // 选中日期
+    calendarCon(date) {
+      this.$set(this.form, this.calendar_type, moment(date).format('YYYY-MM-DD'));
+      this.calendarShow = false;
+    },
+    async toUpload({ file }, model) {
+      // 上传,赋值
+      const res = await this.upload({ file, dir: 'file' });
+      if (this.$checkRes(res)) {
+        this.$set(this.form, model, [{ name: res.name, url: res.uri }]);
+      }
+    },
+    toDelete(file, model) {
+      const index = this.form[model].findIndex((f) => _.isEqual(f, file));
+      this.form[model].splice(index, 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;
+    }
+    .typeThr {
+      padding: 10px;
+      background-color: #fff;
+      .title {
+        text-align: center;
+        font-weight: bold;
+        margin: 0 0 15px 0;
+      }
+      .info {
+        padding: 0 0 15px 0;
+        line-height: 25px;
+        border-bottom: 1px solid #ebedf0;
+        span {
+          color: #409eff;
+        }
+        span:hover {
+          cursor: pointer;
+        }
+      }
+    }
+  }
+}
+</style>

+ 5 - 0
src/router/index.js

@@ -421,6 +421,11 @@ const patent = [
     meta: { title: '专利交易-信息导入' },
     meta: { title: '专利交易-信息导入' },
     component: () => import('../views/patent/admin/patent/trans_import.vue'),
     component: () => import('../views/patent/admin/patent/trans_import.vue'),
   },
   },
+  {
+    path: '/patent/admin/patent/trans_create',
+    meta: { title: '专利交易-信息维护' },
+    component: () => import('../views/patent/admin/patent/trans_create.vue'),
+  },
   {
   {
     path: '/patent/admin/patent/safeg',
     path: '/patent/admin/patent/safeg',
     meta: { title: '专利维权' },
     meta: { title: '专利维权' },

+ 17 - 5
src/views/patent/admin/patent/trans.vue

@@ -1,12 +1,12 @@
 <template>
 <template>
   <div id="trans">
   <div id="trans">
-    <admin-frame @search="search" :limit="limit" :total="total" topType="2" :rightArrow="false" @back="back" :useNav="false">
+    <admin-frame @search="search" :limit="limit" :total="total" topType="2" @add="toAdd" @back="back" :useNav="false">
       <template v-slot:info>
       <template v-slot:info>
         <van-col span="24" class="one">
         <van-col span="24" class="one">
           <van-button type="info" size="small" @click="toImport()">导入交易信息</van-button>
           <van-button type="info" size="small" @click="toImport()">导入交易信息</van-button>
         </van-col>
         </van-col>
         <span span="24" class="two">
         <span span="24" class="two">
-          <list-2 :list="list" @toView="toView"></list-2>
+          <list-1 :list="list" @toView="toView" @toDel="toDel"></list-1>
         </span>
         </span>
       </template>
       </template>
     </admin-frame>
     </admin-frame>
@@ -17,7 +17,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import list2 from '@/layout/trans/list-2.vue';
+import list1 from '@/layout/trans/list-1.vue';
 import info1 from '@/layout/trans/info-1.vue';
 import info1 from '@/layout/trans/info-1.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 import { mapState, createNamespacedHelpers } from 'vuex';
@@ -27,7 +27,7 @@ export default {
   props: {},
   props: {},
   components: {
   components: {
     adminFrame,
     adminFrame,
-    list2,
+    list1,
     info1,
     info1,
   },
   },
   data: function () {
   data: function () {
@@ -45,7 +45,7 @@ export default {
     await this.search();
     await this.search();
   },
   },
   methods: {
   methods: {
-    ...patenttrans(['query']),
+    ...patenttrans(['query', 'delete']),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info });
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
@@ -59,10 +59,22 @@ export default {
       let dialog = { show: true, title: '详细信息', type: '1' };
       let dialog = { show: true, title: '详细信息', type: '1' };
       this.$set(this, `dialog`, dialog);
       this.$set(this, `dialog`, dialog);
     },
     },
+    // 删除信息
+    async toDel(data) {
+      let res = await this.delete(data.id);
+      if (this.$checkRes(res)) {
+        this.$toast({ type: `success`, message: `操作完成` });
+        this.search();
+      }
+    },
     // 导入专利
     // 导入专利
     toImport() {
     toImport() {
       this.$router.push({ path: '/patent/admin/patent/trans_import' });
       this.$router.push({ path: '/patent/admin/patent/trans_import' });
     },
     },
+    // 添加
+    toAdd() {
+      this.$router.push({ path: '/patent/admin/patent/trans_create' });
+    },
     // 返回
     // 返回
     back() {
     back() {
       this.$router.push({ path: '/patent/index' });
       this.$router.push({ path: '/patent/index' });

+ 65 - 0
src/views/patent/admin/patent/trans_create.vue

@@ -0,0 +1,65 @@
+<template>
+  <div id="index">
+    <admin-frame topType="2" @back="back" :usePage="false" :rightArrow="false" :useNav="false">
+      <template v-slot:info>
+        <trans-create :form="form" @onSubmit="onSubmit"></trans-create>
+      </template>
+    </admin-frame>
+  </div>
+</template>
+
+<script>
+import transCreate from '@/layout/trans/trans-create.vue';
+import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
+const { mapActions: upload } = createNamespacedHelpers('upload');
+const moment = require('moment');
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    adminFrame,
+    transCreate,
+  },
+  data: function () {
+    return {
+      form: {
+        promise_file: { province: '吉林省', city: '长春市', end_date: moment(new Date()).format('YYYY-MM-DD') },
+      },
+    };
+  },
+  created() {},
+  methods: {
+    ...upload(['upload']),
+    ...patenttrans(['fetch', 'create', 'update']),
+    // 提交
+    async onSubmit({ data }) {
+      let res = await this.create(data);
+      if (this.$checkRes(res)) {
+        this.$toast({ type: `success`, message: `操作完成` });
+        this.back();
+      }
+    },
+    // 返回
+    back() {
+      this.$router.push({ path: '/patent/admin/patent/trans' });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>