guhongwei 3 år sedan
förälder
incheckning
5576b490bd

+ 3 - 3
src/layout/patentInfo/trans-1.vue

@@ -31,9 +31,9 @@
               v-model="form.budget"
               name="budget"
               type="digit"
-              label="投资预算(万元)"
-              placeholder="请输入投资预算"
-              :rules="[{ required: true, message: '请输入投资预算' }]"
+              label="意向价格(万元)"
+              placeholder="请输入意向价格"
+              :rules="[{ required: true, message: '请输入意向价格' }]"
             />
             <van-field name="type" label="交易类型" :rules="[{ required: true, message: '交易类型' }]">
               <template #input>

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

@@ -10,7 +10,7 @@
             <van-field v-model="info.contact" name="contact" label="联系人" readonly />
             <van-field v-model="info.phone" name="phone" label="联系电话" readonly />
             <van-field v-model="info.email" name="email" label="电子邮箱" readonly />
-            <van-field v-model="info.budget" name="budget" type="digit" label="投资预算(万元)" readonly />
+            <van-field v-model="info.budget" name="budget" type="digit" label="意向价格(万元)" readonly />
             <van-field v-model="info.type" name="type" label="交易类型" readonly />
             <van-col span="24" class="typeThr" v-if="info.type == '免费许可'">
               <van-col span="24" class="title"> 免费许可承诺书 </van-col>

+ 1 - 1
src/views/account/index.vue

@@ -18,7 +18,7 @@
           <van-cell title="代理机构" @click="to('agentmech')" is-link v-if="userInfo.role == '1'" />
           <van-cell title="咨询师" @click="to('answertea')" is-link v-if="userInfo.role == '1'" />
           <van-cell title="专利运营" @click="toPatent('patent')" is-link />
-          <van-cell title="修改密码" @click="to('password')" is-link v-if="userInfo.role == '3'" />
+          <van-cell title="修改密码" @click="to('password')" is-link v-if="userInfo.role == '1' || userInfo.role == '2' || userInfo.role == '3'" />
           <van-cell title="退出登录" @click="logout" is-link />
         </van-col>
       </template>

+ 27 - 10
src/views/account/password/index.vue

@@ -24,6 +24,7 @@
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: personal } = createNamespacedHelpers('personal');
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
 export default {
   name: 'login',
   props: {},
@@ -38,18 +39,34 @@ export default {
   async created() {},
   methods: {
     ...personal(['updatePassword']),
+    ...adminLogin(['updatePwd']),
     async onSubmit(values) {
-      let data = { id: this.user.id, password: values.password };
-      let res = await this.updatePassword(data);
-      if (this.$checkRes(res)) {
-        let token = localStorage.removeItem('token');
-        let openid = sessionStorage.removeItem('openid');
-        if (token == undefined && openid == undefined) {
-          this.$toast({ type: 'fail', message: '退出登录成功' });
-          this.$router.push({ path: '/login', query: { path: '/account/index', type: '1' } });
+      if (this.user.role == '1' || this.user.role == '2') {
+        let data = { id: this.user.id, passwd: values.password };
+        let res = await this.updatePwd(data);
+        if (this.$checkRes(res)) {
+          let token = localStorage.removeItem('token');
+          let openid = sessionStorage.removeItem('openid');
+          if (token == undefined && openid == undefined) {
+            this.$toast({ type: 'fail', message: '退出登录成功' });
+            this.$router.push({ path: '/login', query: { path: '/account/index', type: '1' } });
+          }
+        } else {
+          this.$toast({ type: `fail`, message: `${res.errmsg}` });
+        }
+      } else if (this.user.role == '3') {
+        let data = { id: this.user.id, password: values.password };
+        let res = await this.updatePassword(data);
+        if (this.$checkRes(res)) {
+          let token = localStorage.removeItem('token');
+          let openid = sessionStorage.removeItem('openid');
+          if (token == undefined && openid == undefined) {
+            this.$toast({ type: 'fail', message: '退出登录成功' });
+            this.$router.push({ path: '/login', query: { path: '/account/index', type: '1' } });
+          }
+        } else {
+          this.$toast({ type: `fail`, message: `${res.errmsg}` });
         }
-      } else {
-        this.$toast({ type: `fail`, message: `${res.errmsg}` });
       }
     },
     back() {

+ 9 - 44
src/views/index.vue

@@ -3,7 +3,7 @@
     <admin-frame :useTop="false" :usePage="false" :useNav="false">
       <template v-slot:info>
         <van-button v-for="(i, index) in menu" :key="`menu-${index}`" @click="$router.push(i.router)">{{ i.label }}</van-button>
-        <!-- <van-button @click="toAdd()">添加用户</van-button> -->
+        <van-button @click="toAdd()">批量添加专利交易信息</van-button>
       </template>
     </admin-frame>
   </div>
@@ -13,7 +13,7 @@
 const { textname } = require('@frame/src/layout/test');
 import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: personal } = createNamespacedHelpers('personal');
+const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
 const moment = require('moment');
 export default {
   name: 'index',
@@ -81,54 +81,19 @@ export default {
       textname: textname,
     };
   },
-  async created() {
-    const limitMonth = 3;
-    // const { create_date } = i;
-    // 取专利日期
-    const month = moment('2021-11-30').format('MM-DD');
-    console.log(month);
-    // // 取得当前年份
-    const nowYear = '2020';
-    console.log(nowYear);
-    // // 当前年份+一年
-    const afterYear = moment(nowYear).add(1, 'year').format('YYYY');
-    // // 开始时间(先组合日期,减去三个月)
-    const nowDate = afterYear + '-' + month;
-    const start = moment(nowDate).subtract(limitMonth, 'months').format('YYYY-MM-DD');
-    console.log(start);
-    // 结束时间
-    const end = afterYear + '-' + month;
-    console.log(end);
-    const r = moment().isBetween(start, end, null, '[]');
-    console.log(r);
-  },
+  async created() {},
   methods: {
-    ...personal(['create', 'query']),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    ...patenttrans(['create', 'query']),
+
+    // 添加用户
+    async toAdd() {
       for (const val of this.textname) {
-        let res = await this.query({ phone: val });
+        let res = await this.create(val);
         if (this.$checkRes(res)) {
-          if (res.total > 0) {
-            console.log('1');
-          } else {
-            let data = {
-              name: val,
-              phone: val,
-              password: '111111',
-              type: '4',
-              code: 'JLKJQYCGD',
-              status: '1',
-            };
-            let p1 = await this.create(data);
-            console.log(p1);
-          }
+          console.log(res);
         }
       }
     },
-    // 添加用户
-    toAdd() {
-      this.search();
-    },
   },
   computed: {
     ...mapState(['user']),

+ 1 - 1
src/views/market/demand/parts/info-1.vue

@@ -9,7 +9,7 @@
             <van-field v-model="info.contact" name="contact" label="联系人" readonly />
             <van-field v-model="info.phone" name="phone" label="联系电话" readonly />
             <van-field v-model="info.email" name="email" label="电子邮箱" readonly />
-            <van-field v-model="info.budget" name="budget" type="digit" label="投资预算" readonly />
+            <van-field v-model="info.budget" name="budget" type="digit" label="意向价格" readonly />
             <van-field v-model="info.type" name="type" label="交易类型" readonly />
             <van-field name="is_report" label="评估报告">
               <template #input>

+ 1 - 1
src/views/market/demand/parts/list-1.vue

@@ -14,7 +14,7 @@
               交易类型:<span>{{ item.type || '暂无' }}</span>
             </van-col>
             <van-col span="12" class="otherInfo">
-              投资预算:<span>{{ item.budget || '暂无' }}万元</span>
+              意向价格:<span>{{ item.budget || '暂无' }}万元</span>
             </van-col>
           </van-col>
         </van-col>

+ 4 - 5
src/views/patent/admin/message/parts/form-1.vue

@@ -42,9 +42,9 @@
     <van-dialog class="dialog" v-model="dialog.show" :title="dialog.title" :show-confirm-button="false" show-cancel-button cancel-button-text="返回">
       <van-col span="24" class="one" v-if="dialog.type == '1'">
         <van-col span="24" class="one_1">
-          <van-search v-model="searchName" show-action placeholder="请输入联系电话" @search="searchUser">
+          <van-search v-model="name" show-action placeholder="请输入姓名">
             <template #action>
-              <div @click="searchUser">搜索</div>
+              <div @click="searchUser()">搜索</div>
             </template>
           </van-search>
         </van-col>
@@ -83,7 +83,7 @@ export default {
     return {
       dialog: { show: false, titla: '查询用户', type: '1' },
       // 查询
-      searchName: '',
+      name: '',
       list: [],
       limit: 3,
       total: 0,
@@ -113,8 +113,7 @@ export default {
     },
     // 查询用户
     async searchUser({ skip = 0, limit = this.limit, ...info } = {}) {
-      if (this.searchName) info.phone = this.searchName;
-      let res = await this.personalQuery({ skip, limit, ...info });
+      let res = await this.personalQuery({ skip, limit, name: this.name, ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);

+ 1 - 1
src/views/patent/market/parts/detail-2.vue

@@ -9,7 +9,7 @@
             <van-field v-model="form.contact" name="contact" label="联系人" readonly />
             <van-field v-model="form.phone" name="phone" label="联系电话" readonly />
             <van-field v-model="form.email" name="email" label="电子邮箱" readonly />
-            <van-field v-model="form.budget" name="budget" type="digit" label="投资预算" readonly />
+            <van-field v-model="form.budget" name="budget" type="digit" label="意向价格" readonly />
             <van-field v-model="form.type" name="type" label="交易类型" readonly />
             <van-field name="is_report" label="评估报告">
               <template #input>

+ 1 - 1
src/views/patent/market/parts/list-3.vue

@@ -14,7 +14,7 @@
               交易类型:<span>{{ item.type || '暂无' }}</span>
             </van-col>
             <van-col span="12" class="otherInfo">
-              投资预算:<span>{{ item.budget || '暂无' }}万元</span>
+              意向价格:<span>{{ item.budget || '暂无' }}万元</span>
             </van-col>
           </van-col>
         </van-col>

+ 2 - 2
src/views/patent/user/userBtn.vue

@@ -15,8 +15,8 @@
                 <template #icon><i class="iconfont icon-xiaoxi"></i></template>
               </van-goods-action-icon>
             </van-col>
-            <van-col span="8" class="one_1action" @click.native="pathBtn('user/message', 'notice')">
-              <van-goods-action-icon text="通知" badge="">
+            <van-col span="8" class="one_1action onlyColor" @click.native="pathBtn('user/message', 'notice')">
+              <van-goods-action-icon text="通知" :badge="numData.message ? numData.message.notice : ''">
                 <template #icon><i class="iconfont icon-tongzhi"></i></template>
               </van-goods-action-icon>
             </van-col>