wxy 4 år sedan
förälder
incheckning
f3c83b6967

+ 3 - 3
src/router/index.js

@@ -107,10 +107,10 @@ const routes = [
     component: () => import('../views/userCenter/dock/index.vue'),
   },
   {
-    path: '/userCenter/dock/apply',
-    name: 'apply',
+    path: '/userCenter/dock/detail',
+    name: 'detail',
     meta: { title: '申请', isleftarrow: true },
-    component: () => import('../views/userCenter/dock/apply.vue'),
+    component: () => import('../views/userCenter/dock/detail.vue'),
   },
   // 用户-基本信息
   {

+ 2 - 0
src/store/index.js

@@ -3,6 +3,7 @@ import Vuex from 'vuex';
 //直播大厅
 import dock from './live/dock';
 import chat from './live/chat';
+import apply from './live/apply';
 // 科技超市
 import product from './market/product';
 import exportuser from './market/exportuser';
@@ -47,5 +48,6 @@ export default new Vuex.Store({
     productpact,
     //修改密码
     password,
+    apply,
   },
 });

+ 39 - 0
src/store/live/apply.js

@@ -0,0 +1,39 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  applyInfo: `/api/live/dock/apply`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
+    const res = await this.$axios.$get(api.applyInfo, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.applyInfo}/${id}`, { ...info });
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.applyInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { dock_id, id, ...data }) {
+    const res = await this.$axios.$post(`${api.applyInfo}/${dock_id}/check/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.applyInfo}/${payload}`);
+    return res;
+  },
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 0 - 305
src/views/userCenter/dock/apply.vue

@@ -1,305 +0,0 @@
-<template>
-  <div id="detail">
-    <el-row>
-      <el-col :span="24" class="style">
-        <el-col :span="24" class="top">
-          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
-        </el-col>
-        <el-col :span="24" class="main">
-          <el-tabs v-model="activeName" type="card">
-            <el-tab-pane label="需求申请" name="first">
-              <el-form :model="demandForm" :rules="demandFormrules" ref="ruleForm" label-width="90px" class="demo-ruleForm">
-                <el-form-item label="产品类型" prop="totaltype">
-                  <el-select v-model="demandForm.totaltype" placeholder="请选择产品类型">
-                    <el-option label="技术" value="0"></el-option>
-                    <el-option label="产品" value="1" disabled></el-option>
-                    <el-option label="服务" value="2" disabled></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="名称" prop="name">
-                  <el-input v-model="demandForm.name" placeholder="请输入名称"></el-input>
-                </el-form-item>
-                <el-form-item label="类型">
-                  <el-select v-model="demandForm.product_type_id" filterable @change="selectChild">
-                    <el-option v-for="(item, index) in columnList" :key="index" :value="item.id" :label="item.name"></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="产品简介">
-                  <el-input type="textarea" v-model="demandForm.introduction" placeholder="请输入产品简介"></el-input>
-                </el-form-item>
-                <el-form-item label="研发阶段">
-                  <el-select v-model="demandForm.phase" placeholder="请选择研发阶段">
-                    <el-option label="阶段成果" value="0"></el-option>
-                    <el-option label="最终成果" value="1"></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-row>
-                  <el-col :span="12">
-                    <el-form-item label="产品单价">
-                      <el-input v-model="demandForm.price" placeholder="请输入产品单价"></el-input>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :span="12">
-                    <el-form-item label="产品单位">
-                      <el-select v-model="demandForm.priceunit" placeholder="请选择产品单位">
-                        <el-option label="公斤" value="0"></el-option>
-                        <el-option label="套" value="1"></el-option>
-                        <el-option label="件" value="2"></el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
-                <el-form-item label="产品图片" prop="image">
-                  <upload
-                    :limit="1"
-                    :data="demandForm.image"
-                    :uploadBtn="true"
-                    type="image"
-                    :url="`/files/image/upload`"
-                    @upload="uploadSuccess"
-                    @delete="uploadDelete"
-                  ></upload>
-                </el-form-item>
-                <span>
-                  <el-form-item label="所属领域">
-                    <el-select v-model="demandForm.field" placeholder="请选择所属领域">
-                      <el-option label="先进制造" value="0"></el-option>
-                      <el-option label="新材料" value="1"></el-option>
-                      <el-option label="光电子" value="2"></el-option>
-                      <el-option label="信息技术" value="3"></el-option>
-                      <el-option label="文化和科技融合" value="4"></el-option>
-                    </el-select>
-                  </el-form-item>
-                </span>
-                <el-form-item label="服务范围">
-                  <el-input type="textarea" v-model="demandForm.scope" placeholder="请输入服务范围"></el-input>
-                </el-form-item>
-                <el-form-item label="合作方式">
-                  <el-select v-model="demandForm.coopermode" placeholder="请选择合作方式">
-                    <el-option label="技术转让" value="0"></el-option>
-                    <el-option label="技术服务" value="1"></el-option>
-                    <el-option label="技术许可" value="2"></el-option>
-                    <el-option label="技术融资" value="3"></el-option>
-                    <el-option label="其他" value="4"></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="交易方式">
-                  <el-select v-model="demandForm.business" placeholder="请选择交易方式">
-                    <el-option label="公用" value="0"></el-option>
-                    <el-option label="竞价" value="1"></el-option>
-                    <el-option label="转让" value="2"></el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item label="投入预算">
-                  <el-input v-model="demandForm.budget" placeholder="请输入投入预算"></el-input>
-                </el-form-item>
-                <el-form-item label="需求截止日期">
-                  <el-date-picker v-model="demandForm.end_date" type="date" placeholder="请选择需求截止日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
-                  </el-date-picker>
-                </el-form-item>
-                <el-form-item>
-                  <span slot="label">
-                    <el-popover
-                      placement="top-start"
-                      width="200"
-                      trigger="hover"
-                      content="(阐述在生产经营、项目建设、科研活动、产业化方向中遇到的技术难题或瓶颈问题及需达到的技术指标)"
-                    >
-                      <span slot="reference" style="color:#409eff">难题或瓶颈问题</span>
-                    </el-popover>
-                  </span>
-                  <el-input type="textarea" v-model="demandForm.difficult_problem" placeholder="请输入难题或瓶颈问题"></el-input>
-                </el-form-item>
-                <el-form-item>
-                  <span slot="label">
-                    <el-popover
-                      placement="top-start"
-                      width="200"
-                      trigger="hover"
-                      content="(企业承接成果、技术所具备的技术人员、设备、资金等基础条件及其他配套条件)"
-                    >
-                      <span slot="reference" style="color:#409eff">企业解决技术需求已具备的条件</span>
-                    </el-popover>
-                  </span>
-                  <el-input type="textarea" v-model="demandForm.demand" placeholder="请输入企业解决需求"></el-input>
-                </el-form-item>
-                <el-form-item label="联系人" prop="contact_user">
-                  <el-input v-model="demandForm.contact_user" placeholder="请输入联系人"></el-input>
-                </el-form-item>
-                <el-form-item label="联系电话" prop="contact_tel">
-                  <el-input v-model.number="demandForm.contact_tel" placeholder="请输入联系电话" maxlength="11"></el-input>
-                </el-form-item>
-                <el-form-item>
-                  <el-button @click="resetForm('ruleForm')">取消</el-button>
-                  <el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
-                </el-form-item>
-              </el-form>
-            </el-tab-pane>
-            <el-tab-pane label="产品申请" name="second">
-              <el-form :model="productForm" :rules="productFormrules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-                <el-form-item label="选择产品">
-                  <el-select v-model="productForm.goodsList" value-key="id" multiple placeholder="请选择选择产品">
-                    <el-option v-for="(item, index) in goodsLists" :key="index" :label="item.name" :value="item"> </el-option>
-                  </el-select>
-                </el-form-item>
-                <el-form-item>
-                  <el-button type="primary" @click="submitproductForm('ruleForm')">确定</el-button>
-                  <el-button @click="resetForm('ruleForm')">取消</el-button>
-                </el-form-item>
-              </el-form>
-            </el-tab-pane>
-          </el-tabs>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import upload from '@/components/upload.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-import _ from 'lodash';
-const { mapActions: product } = createNamespacedHelpers('marketproduct');
-const { mapActions: maarkettype } = createNamespacedHelpers('maarkettype');
-const { mapActions: apply } = createNamespacedHelpers('apply');
-import NavBar from '@/layout/common/topInfo.vue';
-export default {
-  name: 'detail',
-  props: {},
-  components: {
-    NavBar,
-    upload,
-  },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    // 标签
-    activeName: 'first',
-    // 需求
-    demandForm: {
-      totaltype: '0',
-    },
-    columnList: [], //类型
-    demandFormrules: {
-      name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-      totaltype: [{ required: true, message: '请输入名称', trigger: 'change' }],
-      contact_user: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
-      contact_tel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
-    },
-    // 技术
-    productForm: {},
-    productFormrules: {},
-    // 产品类别
-    goodsLists: [],
-  }),
-  created() {
-    this.maarkettype();
-  },
-  computed: {
-    ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
-    },
-  },
-  methods: {
-    ...apply({ applyupdate: 'update', applyCreate: 'create' }),
-    ...maarkettype({ markettypeList: 'query' }),
-    ...product({ mapProductQuery: 'query', mapProductFetch: 'fetch' }),
-    // 需求提交
-    async submitForm() {
-      let data = {};
-      data.user_id = this.user.uid;
-      data.user_name = this.user.name;
-      data.contact_tel = this.user.phone;
-      data.role = this.user.role;
-      let goods = [];
-      goods.push(this.demandForm);
-      data.goodsList = goods;
-      const res = await this.applyCreate({ id: this.id, ...data });
-      if (res.errcode === 0) {
-        this.$notify({
-          message: '申请参加对接会成功',
-          type: 'success',
-        });
-        this.$router.push('/userCenter/dock/index');
-      }
-    },
-    // 产品提交
-    async submitproductForm() {
-      let data = this.productForm;
-      data.user_id = this.user.uid;
-      data.user_name = this.user.name;
-      data.contact_tel = this.user.phone;
-      data.role = this.user.role;
-      const res = await this.applyCreate({ id: this.id, ...data });
-      if (res.errcode === 0) {
-        this.$notify({
-          message: '申请参加对接会成功',
-          type: 'success',
-        });
-        this.$router.push('/userCenter/dock/index');
-      }
-    },
-    // 查询类型
-    async maarkettype({ category = 54, ...info } = {}) {
-      const res = await this.markettypeList({ category, ...info });
-      if (this.$checkRes(res)) {
-        this.$set(this, `columnList`, res.data);
-      }
-      const arr = await this.mapProductQuery({ userid: this.user.uid });
-      if (this.$checkRes(arr)) {
-        this.$set(this, `goodsLists`, arr.data);
-      }
-    },
-    // 类型选择
-    selectChild(product_type_id) {
-      let res = this.columnList.filter(fil => fil.id === product_type_id);
-      if (res.length > 0) {
-        this.$set(this.demandForm, `product_type_name`, res[0].name);
-      }
-      this.$forceUpdate();
-    },
-    // 图片
-    uploadSuccess({ type, data }) {
-      let arr = _.get(this.demandForm, type);
-      if (_.isArray(arr)) {
-        let datas = { name: data.name, url: data.uri };
-        this.demandForm[type].push({ name: data.name, url: data.uri });
-      } else {
-        let newArr = [{ name: data.name, url: data.uri }];
-        this.$set(this.demandForm, `${type}`, newArr);
-      }
-    },
-    // 删除图片
-    uploadDelete(index) {
-      this.demandForm.image.splice(index, 1);
-    },
-  },
-  mounted() {
-    this.title = this.$route.meta.title;
-    this.isleftarrow = this.$route.meta.isleftarrow;
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.style {
-  width: 100%;
-  min-height: 667px;
-  position: relative;
-  background-color: #f9fafc;
-}
-.top {
-  height: 46px;
-  overflow: hidden;
-  position: relative;
-  z-index: 999;
-}
-.main {
-  min-height: 570px;
-}
-</style>

+ 263 - 0
src/views/userCenter/dock/detail.vue

@@ -0,0 +1,263 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <van-tabs v-model="active" @click="clickbtn">
+            <van-tab title="技术需求">
+              <producInfo
+                :type="type"
+                :form="form"
+                @onSubmit="onSubmit"
+                :fieldList="fieldList"
+                :achievestatusList="achievestatusList"
+                :cooperationList="cooperationList"
+              ></producInfo>
+            </van-tab>
+            <van-tab title="产品供求">
+              <!-- <van-form> -->
+              <!-- <van-field
+                  readonly
+                  clickable
+                  name="picker"
+                  :value="productForm.goodsList"
+                  label="合作方式"
+                  placeholder="选择产品"
+                  @click="showPicker = true"
+                  class="van1"
+                />
+                <van-popup v-model="showPicker" position="bottom">
+                  <van-picker show-toolbar :columns="goodsList" @confirm="onConfirm" @cancel="showPicker = false" />
+                </van-popup> -->
+              <!-- </van-form> -->
+              <el-form :model="productForm" label-width="100px">
+                <el-form-item label="选择产品">
+                  <el-select v-model="productForm.goodsList" value-key="id" multiple placeholder="请选择选择产品">
+                    <el-option v-for="(item, index) in goodsLists" :key="index" :label="item.name" :value="item"> </el-option>
+                  </el-select>
+                </el-form-item>
+                <el-form-item>
+                  <el-button @click="btn1('ruleForm')">取消</el-button>
+                  <el-button type="primary" @click="btn2('ruleForm')">确定</el-button>
+                </el-form-item>
+              </el-form>
+            </van-tab>
+          </van-tabs>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import producInfo from './parts/producInfo.vue';
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: markettype } = createNamespacedHelpers('markettype');
+const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
+const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
+const { mapActions: product } = createNamespacedHelpers('product');
+const { mapActions: apply } = createNamespacedHelpers('apply');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    NavBar,
+    producInfo,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      active: 0,
+      type: '0',
+      form: {},
+      // 字典表
+      fieldList: [],
+      achievestatusList: [],
+      cooperationList: [],
+      value: '',
+      //成果列表
+      goodsLists: [],
+      showPicker: false,
+      productForm: {},
+    };
+  },
+  async created() {
+    await this.searchtype();
+    await this.searchinfo();
+    if (this.id) {
+      await this.searchproductinfo();
+    }
+  },
+  methods: {
+    ...markettype({ markettypeList: 'query' }),
+    ...marketuser({ marketuserfetch: 'fetch' }),
+    ...exportuser({ exportuserfetch: 'fetch' }),
+    ...apply({ applyupdate: 'update', applyCreate: 'create' }),
+    ...product({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update', marketquery: 'query' }),
+    // 查询企业详情
+    async searchinfo() {
+      let user = this.user;
+      if (user.role == '4' || user.role == '5') {
+        let res = await this.marketuserfetch(user.userid);
+        if (res.errcode === 0) {
+          let message = {
+            company: res.data.name,
+            phone: res.data.phone,
+            email: res.data.email,
+            companytype: res.data.companytype,
+            companydate: res.data.companydate,
+            companycapital: res.data.companycapital,
+          };
+          this.$set(this, `form`, message);
+        }
+      } else {
+        let res = await this.exportuserfetch(user.userid);
+        if (res.errcode === 0) {
+          let message = {
+            company: res.data.name,
+            phone: res.data.phone,
+            email: res.data.email,
+            qqwx: res.data.qqwx,
+          };
+          this.$set(this, `form`, message);
+        }
+      }
+    },
+    // 查询产品详情
+    async searchproductinfo() {
+      let res = await this.productFetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    // 查询字典表
+    async searchtype() {
+      // 所属领域;
+      let res = await this.markettypeList({ category: '01' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `fieldList`, res.data);
+      }
+      // 成果状态;
+      res = await this.markettypeList({ category: '02' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `achievestatusList`, res.data);
+      }
+      // 合作方式;
+      res = await this.markettypeList({ category: '03' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `cooperationList`, res.data);
+      }
+      res = await this.marketquery({ userid: this.user.uid, status: 1 });
+      // console.log(res);
+      if (this.$checkRes(res)) {
+        let field = res.data.map(item => item.name);
+        this.$set(this, `goodsList`, field);
+      }
+    },
+    // 选择类型
+    clickbtn(name) {
+      // console.log(name);
+      this.$set(this, `type`, String(name));
+    },
+    // 提交
+    async onSubmit({ data }) {
+      data.type = this.type;
+      data.userid = this.user.uid;
+      let res = await this.productCreate(data);
+      if (this.$checkRes(res)) {
+        this.$notify({
+          message: '保存草稿成功',
+          type: 'success',
+        });
+        this.$router.push({ path: '/userCenter/myProduct/index' });
+      }
+    },
+    // 监听显示类型
+    changetype() {
+      let type = this.producttype;
+      this.$set(this, `active`, Number(type));
+      this.$set(this, `type`, type);
+    },
+    onConfirm(value) {
+      this.$set(this.productForm, `goodsLists`, value);
+      this.showPicker = false;
+    },
+    btn1() {
+      this.productForm = {};
+    },
+    // 提交
+    async btn2() {
+      let data = this.productForm;
+      data.user_id = this.user.uid;
+      data.user_name = this.user.name;
+      data.contact_tel = this.user.phone;
+      data.role = this.user.role;
+      console.log(data);
+      const res = await this.applyCreate({ id: this.id, ...data });
+      if (res.errcode === 0) {
+        this.$notify({
+          message: '申请参加对接会成功',
+          type: 'success',
+        });
+        this.btn1();
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    producttype() {
+      return this.$route.query.type;
+    },
+  },
+  watch: {
+    producttype: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.changetype();
+      },
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+/deep/.van1 {
+  padding-top: 20px;
+}
+/deep/.el-form-item {
+  margin-top: 15px;
+}
+</style>

+ 1 - 1
src/views/userCenter/dock/index.vue

@@ -70,7 +70,7 @@ export default {
     // 申请
     detailBtn(data) {
       if (data.status == '0') {
-        this.$router.push({ path: '/userCenter/matter/apply', query: { id: data.id } });
+        this.$router.push({ path: '/userCenter/dock/detail/', query: { id: data.id } });
       } else {
         console.log(data);
       }

+ 0 - 3
src/views/userCenter/dock/parts/docklist.vue

@@ -16,9 +16,6 @@
             <span class="textOver">状态:{{ item.status == '0' ? '准备中' : item.status == '1' ? '开始' : '结束' }}</span>
           </p>
           <el-col :span="24" class="btn">
-            <!-- <el-button type="primary" size="mini" @click="detailBtn(item)">{{
-              item.status == '0' || item.status == '1' ? '编辑/状态审核' : '查看成果'
-            }}</el-button> -->
             <el-button v-if="item.status === '0'" type="primary" size="mini" @click="detailBtn(item)">申请</el-button>
           </el-col>
         </el-col>

+ 350 - 0
src/views/userCenter/dock/parts/producInfo.vue

@@ -0,0 +1,350 @@
+<template>
+  <div id="producInfo">
+    <el-row>
+      <el-col :span="24">
+        <span v-if="type == '0'">
+          <van-form>
+            <van-field v-model="form.company" name="企业名称" label="企业名称" placeholder="企业名称" readonly />
+            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" />
+            <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" />
+            <van-field v-model="form.name" name="需求名称" label="需求名称" placeholder="需求名称" />
+            <van-field name="radio" label="紧急程度">
+              <template #input>
+                <van-radio-group v-model="form.degreeurgency" 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 readonly clickable name="picker" :value="form.field" label="所属领域" placeholder="点击选择" @click="fieldpic = true" />
+            <van-popup v-model="fieldpic" position="bottom">
+              <van-picker show-toolbar :columns="field" @confirm="fieldSubmit" @cancel="fieldpic = false" />
+            </van-popup>
+            <van-field readonly clickable name="picker" :value="form.cooperation" label="合作方式" placeholder="点击选择" @click="cooperationpic = true" />
+            <van-popup v-model="cooperationpic" position="bottom">
+              <van-picker show-toolbar :columns="cooperation" @confirm="cooperationSubmit" @cancel="cooperationpic = false" />
+            </van-popup>
+            <van-field v-model="form.budget" name="投资预算" label="投资预算" placeholder="投资预算" />
+            <van-field v-model="form.requirementdesc" rows="1" autosize label="技术说明" type="textarea" placeholder="技术说明" />
+            <van-field v-model="form.expect" rows="1" autosize label="预期目标" type="textarea" placeholder="预期目标" />
+            <van-field v-model="form.present" rows="1" autosize label="合作要求" type="textarea" placeholder="合作要求" />
+            <van-field name="expertimage" label="产品图片(6)">
+              <template #input
+                ><upload
+                  :limit="6"
+                  :data="form.image"
+                  type="image"
+                  :url="`/files/imgpath/upload`"
+                  @upload="uploadSuccess"
+                  :uploadBtn="true"
+                  @delete="uploadDelete"
+                ></upload>
+              </template>
+            </van-field>
+            <div style="margin: 16px;">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+        <span v-else-if="type == '1'">
+          <van-form>
+            <van-field v-model="form.company" name="企业名称" label="企业名称" placeholder="企业名称" readonly />
+            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" />
+            <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" />
+            <van-field v-model="form.name" name="成果名称" label="成果名称" placeholder="成果名称" />
+            <van-field readonly clickable name="picker" :value="form.field" label="所属领域" placeholder="点击选择" @click="fieldpic = true" />
+            <van-popup v-model="fieldpic" position="bottom">
+              <van-picker show-toolbar :columns="field" @confirm="fieldSubmit" @cancel="fieldpic = false" />
+            </van-popup>
+            <van-field readonly clickable name="picker" :value="form.cooperation" label="合作方式" placeholder="点击选择" @click="cooperationpic = true" />
+            <van-popup v-model="cooperationpic" position="bottom">
+              <van-picker show-toolbar :columns="cooperation" @confirm="cooperationSubmit" @cancel="cooperationpic = false" />
+            </van-popup>
+            <van-field readonly clickable name="picker" :value="form.achievestatus" label="成果状态" placeholder="点击选择" @click="achievestatuspic = true" />
+            <van-popup v-model="achievestatuspic" position="bottom">
+              <van-picker show-toolbar :columns="achievestatus" @confirm="achievestatusOnsubmit" @cancel="achievestatuspic = false" />
+            </van-popup>
+            <van-field v-model="form.achieveown" name="成果权属" label="成果权属" placeholder="成果权属" />
+            <van-field name="radio" label="成果来源">
+              <template #input>
+                <van-radio-group v-model="form.achievesource" direction="horizontal">
+                  <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-field v-model="form.intentionprice" name="意向价格" label="意向价格" placeholder="意向价格" />
+            <van-field name="patent" label="专利信息">
+              <template #input>
+                <el-button type="primary" size="mini" @click="addPatent">添加</el-button>
+                <el-button type="primary" size="mini" @click="viewPatent">查看</el-button>
+              </template>
+            </van-field>
+            <van-field v-model="form.achievebrief" rows="1" autosize label="成果简介" type="textarea" placeholder="成果简介" />
+            <van-field v-model="form.features" rows="1" autosize label="技术特点" type="textarea" placeholder="技术特点" />
+            <van-field v-model="form.team" rows="1" autosize label="技术团队" type="textarea" placeholder="技术团队" />
+            <van-field v-model="form.expectations" rows="1" autosize label="商业预期" type="textarea" placeholder="商业预期" />
+            <van-field v-model="form.condition" rows="1" autosize label="合作要求" type="textarea" placeholder="合作要求" />
+            <van-field name="expertimage" label="产品图片(6)">
+              <template #input
+                ><upload
+                  :limit="6"
+                  :data="form.image"
+                  type="image"
+                  :url="`/files/imgpath/upload`"
+                  @upload="uploadSuccess"
+                  :uploadBtn="true"
+                  @delete="uploadDelete"
+                ></upload>
+              </template>
+            </van-field>
+            <div style="margin: 16px;">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+        <span v-else-if="type == '2'">
+          <van-form>
+            <van-field v-model="form.company" name="企业名称" label="企业名称" placeholder="企业名称" readonly />
+            <van-field v-model="form.phone" name="联系电话" label="联系电话" placeholder="联系电话" readonly />
+            <van-field v-model="form.email" name="电子邮箱" label="电子邮箱" placeholder="电子邮箱" readonly />
+            <van-field v-model="form.contacts" name="联系人" label="联系人" placeholder="联系人" />
+            <van-field v-model="form.qqwx" name="QQ/微信" label="QQ/微信" placeholder="QQ/微信" />
+            <van-field v-model="form.name" name="信息名称" label="信息名称" placeholder="信息名称" />
+            <van-field name="radio" label="信息属性">
+              <template #input>
+                <van-radio-group v-model="form.messattribute" direction="horizontal">
+                  <van-radio name="提供方">提供方</van-radio>
+                  <van-radio name="需求方">需求方</van-radio>
+                </van-radio-group>
+              </template>
+            </van-field>
+            <van-field name="radio" label="需求程度">
+              <template #input>
+                <van-radio-group v-model="form.demand" 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.informationdesc" rows="1" autosize label="信息描述" type="textarea" placeholder="信息描述" />
+            <van-field v-model="form.coreelements" rows="1" autosize label="核心要素" type="textarea" placeholder="核心要素" />
+            <van-field v-model="form.priceinfo" rows="1" autosize label="价格信息" type="textarea" placeholder="价格信息" />
+            <van-field v-model="form.businessexpect" rows="1" autosize label="商业预期" type="textarea" placeholder="商业预期" />
+            <div style="margin: 16px;">
+              <van-button round block type="info" @click="onSubmit">
+                提交
+              </van-button>
+            </div>
+          </van-form>
+        </span>
+      </el-col>
+    </el-row>
+    <van-dialog v-model="show" title="添加专利信息" :showConfirmButton="false" :closeOnClickOverlay="true">
+      <van-form>
+        <van-field v-model="patentform.patentinfo" name="名称" label="名称" placeholder="名称" />
+        <van-field name="radio" label="专利状态">
+          <template #input>
+            <van-radio-group v-model="patentform.patentstatus" direction="horizontal">
+              <van-radio name="已申请">已申请</van-radio>
+              <van-radio name="已授权">已授权</van-radio>
+            </van-radio-group>
+          </template>
+        </van-field>
+        <div style="margin: 16px;">
+          <van-button round block type="info" @click="patentSubmit">
+            提交
+          </van-button>
+        </div>
+      </van-form>
+    </van-dialog>
+    <van-dialog v-model="patentshow" title="查看专利信息" :showConfirmButton="false" :closeOnClickOverlay="true">
+      <div class="patentList" v-for="(item, index) in patentList" :key="index">
+        <p class="textOver">{{ item.patentinfo }}</p>
+        <p>专利状态:{{ item.patentstatus }}</p>
+        <p>
+          <el-button type="primary" size="mini" @click="delPatent(index, item)">刪除</el-button>
+        </p>
+      </div>
+    </van-dialog>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/upload.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'producInfo',
+  props: {
+    type: { type: String, default: '0' },
+    form: { type: Object },
+    fieldList: { type: Array },
+    cooperationList: { type: Array },
+    achievestatusList: { type: Array },
+  },
+  components: {
+    upload,
+  },
+  data: function() {
+    return {
+      field: [],
+      fieldpic: false,
+      cooperation: [],
+      cooperationpic: false,
+      achievestatus: [],
+      achievestatuspic: false,
+      // 专利信息
+      show: false,
+      patentform: {},
+      patentshow: false,
+      patentList: [],
+    };
+  },
+  created() {},
+  methods: {
+    // 重组数组
+    seachfield() {
+      let field = this.fieldList.map(item => item.name);
+      this.$set(this, `field`, field);
+    },
+    // 所屬領域
+    fieldSubmit(value) {
+      this.$set(this.form, `field`, value);
+      this.fieldpic = false;
+    },
+    // 重组数组
+    searchcooperation() {
+      let cooperation = this.cooperationList.map(item => item.name);
+      this.$set(this, `cooperation`, cooperation);
+    },
+    // 合作方式
+    cooperationSubmit(value) {
+      this.$set(this.form, `cooperation`, value);
+      this.cooperationpic = false;
+    },
+    // 重组数组
+    searchachievestatus() {
+      let achievestatus = this.achievestatusList.map(item => item.name);
+      this.$set(this, `achievestatus`, achievestatus);
+    },
+    // 成果状态
+    achievestatusOnsubmit(value) {
+      this.$set(this.form, `achievestatus`, value);
+      this.achievestatuspic = false;
+    },
+    // 图片上传
+    uploadSuccess({ type, data }) {
+      let arr = _.get(this.form, type);
+      if (_.isArray(arr)) {
+        let datas = { name: data.name, url: data.uri };
+        this.form[type].push({ name: data.name, url: data.uri });
+      } else {
+        let newArr = [{ name: data.name, url: data.uri }];
+        this.$set(this.form, `${type}`, newArr);
+      }
+    },
+    // 删除图片
+    uploadDelete(index) {
+      this.form.image.splice(index, 1);
+    },
+    // 添加专利信息
+    addPatent() {
+      this.show = true;
+    },
+    // 提交专利信息
+    patentSubmit() {
+      this.patentList.push(this.patentform);
+      this.show = false;
+    },
+    // 查看专利信息
+    viewPatent() {
+      this.patentshow = true;
+    },
+    // 删除专利信息
+    delPatent(index, val) {
+      this.patentList.splice(index, 1);
+      this.$notify({
+        message: '删除成功',
+        type: 'success',
+      });
+      this.patentshow = false;
+    },
+    onSubmit() {
+      this.form.patent = this.patentList;
+      this.$emit('onSubmit', { data: this.form });
+    },
+    // 查询专利信息
+    searchpatent() {
+      let data = this.form;
+      if (data.patent) {
+        console.log(data.patent);
+        this.$set(this, `patentList`, data.patent);
+      }
+    },
+  },
+  watch: {
+    fieldList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.seachfield();
+      },
+    },
+    cooperationList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.searchcooperation();
+      },
+    },
+    achievestatusList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.searchachievestatus();
+      },
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.patentList {
+  padding: 0 10px;
+  border-bottom: 1px dashed #ccc;
+  p {
+    font-size: 16px;
+    color: #666;
+    padding: 0 0 5px 0;
+  }
+  p:nth-child(1) {
+    font-size: 18px;
+    color: #000;
+    font-weight: bold;
+  }
+  p:nth-child(3) {
+    text-align: center;
+  }
+}
+</style>

+ 211 - 0
src/views/userCenter/matter/detail.vue

@@ -0,0 +1,211 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <van-tabs v-model="active" @click="clickbtn">
+            <van-tab title="科技需求">
+              <producInfo
+                :type="type"
+                :form="form"
+                @onSubmit="onSubmit"
+                :fieldList="fieldList"
+                :achievestatusList="achievestatusList"
+                :cooperationList="cooperationList"
+              ></producInfo>
+            </van-tab>
+            <van-tab title="技术成果">
+              <producInfo
+                :type="type"
+                :form="form"
+                @onSubmit="onSubmit"
+                :fieldList="fieldList"
+                :achievestatusList="achievestatusList"
+                :cooperationList="cooperationList"
+              ></producInfo>
+            </van-tab>
+            <van-tab title="商务服务">
+              <producInfo
+                :type="type"
+                :form="form"
+                @onSubmit="onSubmit"
+                :fieldList="fieldList"
+                :achievestatusList="achievestatusList"
+                :cooperationList="cooperationList"
+              ></producInfo>
+            </van-tab>
+          </van-tabs>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import producInfo from './parts/producInfo.vue';
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: markettype } = createNamespacedHelpers('markettype');
+const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
+const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
+const { mapActions: product } = createNamespacedHelpers('product');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    NavBar,
+    producInfo,
+  },
+  data: function() {
+    return {
+      // 头部标题
+      title: '',
+      // meta为true
+      isleftarrow: '',
+      // 返回
+      navShow: true,
+      active: 0,
+      type: '0',
+      form: {},
+      // 字典表
+      fieldList: [],
+      achievestatusList: [],
+      cooperationList: [],
+    };
+  },
+  async created() {
+    await this.searchtype();
+    await this.searchinfo();
+    if (this.id) {
+      await this.searchproductinfo();
+    }
+  },
+  methods: {
+    ...markettype({ markettypeList: 'query' }),
+    ...marketuser({ marketuserfetch: 'fetch' }),
+    ...exportuser({ exportuserfetch: 'fetch' }),
+    ...product({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update' }),
+    // 查询企业详情
+    async searchinfo() {
+      let user = this.user;
+      if (user.role == '4' || user.role == '5') {
+        let res = await this.marketuserfetch(user.userid);
+        if (res.errcode === 0) {
+          let message = {
+            company: res.data.name,
+            phone: res.data.phone,
+            email: res.data.email,
+            companytype: res.data.companytype,
+            companydate: res.data.companydate,
+            companycapital: res.data.companycapital,
+          };
+          this.$set(this, `form`, message);
+        }
+      } else {
+        let res = await this.exportuserfetch(user.userid);
+        if (res.errcode === 0) {
+          let message = {
+            company: res.data.name,
+            phone: res.data.phone,
+            email: res.data.email,
+            qqwx: res.data.qqwx,
+          };
+          this.$set(this, `form`, message);
+        }
+      }
+    },
+    // 查询产品详情
+    async searchproductinfo() {
+      let res = await this.productFetch(this.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
+    // 查询字典表
+    async searchtype() {
+      // 所属领域;
+      let res = await this.markettypeList({ category: '01' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `fieldList`, res.data);
+      }
+      // 成果状态;
+      res = await this.markettypeList({ category: '02' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `achievestatusList`, res.data);
+      }
+      // 合作方式;
+      res = await this.markettypeList({ category: '03' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `cooperationList`, res.data);
+      }
+    },
+    // 选择类型
+    clickbtn(name) {
+      this.$set(this, `type`, String(name));
+    },
+    // 提交
+    async onSubmit({ data }) {
+      data.type = this.type;
+      data.userid = this.user.uid;
+      let res = await this.productCreate(data);
+      if (this.$checkRes(res)) {
+        this.$notify({
+          message: '保存草稿成功',
+          type: 'success',
+        });
+        this.$router.push({ path: '/userCenter/myProduct/index' });
+      }
+    },
+    // 监听显示类型
+    changetype() {
+      let type = this.producttype;
+      this.$set(this, `active`, Number(type));
+      this.$set(this, `type`, type);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    producttype() {
+      return this.$route.query.type;
+    },
+  },
+  watch: {
+    producttype: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.changetype();
+      },
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 0 - 79
src/views/userCenter/matter/detailinfo.vue

@@ -1,79 +0,0 @@
-<template>
-  <div id="">
-    <el-row>
-      <el-col :span="24" class="style">
-        <el-col :span="24" class="top">
-          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
-        </el-col>
-        <el-col :span="24" class="main">
-          <detailinfo :detailInfo="detailInfo"></detailinfo>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import NavBar from '@/layout/common/topInfo.vue';
-import detailinfo from '@/layout/matter/detailinfo.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: transaction } = createNamespacedHelpers('transaction');
-export default {
-  name: 'prodDetail',
-  props: {},
-  components: {
-    NavBar,
-    detailinfo, //详情
-  },
-  data: () => ({
-    // 头部标题
-    title: '',
-    // meta为true
-    isleftarrow: '',
-    // 返回
-    navShow: true,
-    // 产品名称
-    detailInfo: {},
-  }),
-  created() {
-    this.search();
-  },
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-  },
-  methods: {
-    ...transaction({ transactionList: 'query', transactiondtetle: 'delete', shenheupdate: 'update', fetch: 'fetch' }),
-
-    async search() {
-      let res = await this.fetch(this.id);
-      if (this.$checkRes(res)) {
-        this.$set(this, `detailInfo`, res.data);
-      }
-    },
-  },
-  mounted() {
-    this.title = this.$route.meta.title;
-    this.isleftarrow = this.$route.meta.isleftarrow;
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.style {
-  width: 100%;
-  min-height: 667px;
-  position: relative;
-  background-color: #f9fafc;
-}
-.top {
-  height: 46px;
-  overflow: hidden;
-  position: relative;
-  z-index: 999;
-}
-.main {
-  min-height: 570px;
-}
-</style>

+ 0 - 1
src/views/userCenter/myProduct/parts/producInfo.vue

@@ -89,7 +89,6 @@
                 <el-button type="primary" size="mini" @click="viewPatent">查看</el-button>
               </template>
             </van-field>
-            <!-- <van-field v-model="form.roadshow" name="项目路演" label="项目路演" placeholder="项目路演" /> -->
             <van-field v-model="form.achievebrief" rows="1" autosize label="成果简介" type="textarea" placeholder="成果简介" />
             <van-field v-model="form.features" rows="1" autosize label="技术特点" type="textarea" placeholder="技术特点" />
             <van-field v-model="form.team" rows="1" autosize label="技术团队" type="textarea" placeholder="技术团队" />