rjy 4 years ago
parent
commit
f9b133632e
5 changed files with 179 additions and 37 deletions
  1. 59 0
      src/store/collectproduct.js
  2. 6 1
      src/store/index.js
  3. 38 0
      src/store/markettype.js
  4. 62 29
      src/views/index.vue
  5. 14 7
      vue.config.js

+ 59 - 0
src/store/collectproduct.js

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

+ 6 - 1
src/store/index.js

@@ -1,5 +1,7 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
+import markettype from './markettype';
+import collectproduct from './collectproduct';
 
 Vue.use(Vuex);
 
@@ -7,5 +9,8 @@ export default new Vuex.Store({
   state: {},
   mutations: {},
   actions: {},
-  modules: {},
+  modules: {
+    collectproduct,
+    markettype,
+  },
 });

+ 38 - 0
src/store/markettype.js

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

+ 62 - 29
src/views/index.vue

@@ -3,28 +3,38 @@
     <el-col :span="24">
       <div class="center">
         <el-col :span="24" class="ys">
-          <el-input v-model="input" placeholder="请输入查询产品" class="wid"></el-input>
+          <el-input v-model="company" placeholder="请输入查询产品" class="wid"></el-input>
           <el-button type="primary" @click="clic">查询产品</el-button>
         </el-col>
         <el-table @query="clic" :data="list" :default-sort="{ prop: 'company', order: 'descending' }" border>
           <el-table-column prop="company" label="企业名称" sortable></el-table-column>
           <el-table-column prop="name" label="标题" sortable></el-table-column>
-          <el-table-column prop="type" label="产品类型" sortable></el-table-column>
+          <el-table-column prop="type" label="产品类型" sortable>
+            <template slot-scope="{ row: { type } }">
+              <span v-if="+type === 0">技术</span>
+              <span v-else-if="+type === 1">产品</span>
+              <span v-else>商务</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="field" label="所属领域" sortable></el-table-column>
           <el-table-column prop="cooperation" label="合作方式" sortable></el-table-column>
           <el-table-column prop="contacts" label="联系人" sortable></el-table-column>
           <el-table-column prop="phone" label="联系电话" sortable></el-table-column>
-          <el-table-column prop="status" label="状态" sortable></el-table-column>
-          <el-table-column prop="cz" label="操作" class="page">
-            <el-col :span="24" @delete="delDelete">
-              <el-button type="text" icon="el-icon-delete"></el-button>
-            </el-col>
+          <el-table-column prop="status" label="状态" sortable>
+            <template slot-scope="{ row: { status } }">
+              <span v-if="+status === 0">审核拒绝</span>
+              <span v-else-if="+status === 1">审核成功</span>
+              <span v-else>待审核</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" class="page">
+            <el-button type="text" icon="el-icon-delete" @delete="delDelete"></el-button>
           </el-table-column>
         </el-table>
         <el-pagination background layout="prev, pager, next" :total="100"> </el-pagination>
         <el-tabs class="tab" v-model="activeName" type="card" @tab-click="handleClick">
           <el-tab-pane label="技术需求" name="first">
-            <el-col :span="24">
+            <el-col :span="24" class="pad">
               <el-col :span="24" class="con">
                 <h2>企业信息</h2>
               </el-col>
@@ -135,20 +145,20 @@
                   <el-input v-model="form.zjzyfrs" placeholder="请输入专&兼职研发人数"></el-input>
                 </el-col>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="dir">
                 <span>企业简介:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.companybrief" placeholder="请输入企业简介"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.companybrief" placeholder="请输入企业简介"></el-input>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="dir">
                 <span>主要产品:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.mainproduct" placeholder="请输入主要产品"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.mainproduct" placeholder="请输入主要产品"></el-input>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="cc">
                 <span>企业资质&荣誉:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.qualifications" placeholder="请输入主要产品"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.qualifications" placeholder="请输入主要产品"></el-input>
               </el-col>
             </el-col>
-            <el-col :span="24">
+            <el-col :span="24" class="pad">
               <el-col :span="24" class="ccn">
                 <h2>技术需求</h2>
               </el-col>
@@ -198,19 +208,21 @@
               </el-col>
               <el-col :span="24">
                 <span>技术难题&需求说明:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.requirementdesc" placeholder="请输入技术难题&需求说明"></el-input>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="dir">
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.requirementdesc" placeholder="请输入技术难题&需求说明"></el-input>
+              </el-col>
+              <el-col :span="24" class="dir">
                 <span>预期技术目标描述:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.expect" placeholder="请输入预期技术目标描述"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.expect" placeholder="请输入预期技术目标描述"></el-input>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="dir">
                 <span>需求现状及应对措施:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.present" placeholder="请输入需求现状及应对措施"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.present" placeholder="请输入需求现状及应对措施"></el-input>
               </el-col>
-              <el-col :span="24">
+              <el-col :span="24" class="cc">
                 <span>合作条件及要求:</span>
-                <el-input type="textarea" maxlength="300" v-model="form.condition" placeholder="请输入合作条件及要求"></el-input>
+                <el-input type="textarea" maxlength="300" show-word-limit v-model="form.condition" placeholder="请输入合作条件及要求"></el-input>
               </el-col>
             </el-col>
           </el-tab-pane>
@@ -238,17 +250,28 @@ export default {
   components: {},
   data: function() {
     return {
-      input: '',
+      types: '',
+      sta: '',
+      type: '',
+      company: '',
       form: {},
       total: '',
       activeName: 'first',
-      list: [],
+      list: [
+        // {
+        //   company: '1',
+        // },
+        // {
+        //   company: '2',
+        // },
+      ],
       fieldList: [],
       cooperationList: [],
+      achievestatusList: [],
     };
   },
   created() {
-    this.clic();
+    this.searchtype();
   },
   methods: {
     ...markettype({ markettypeList: 'query' }),
@@ -290,7 +313,7 @@ export default {
     },
     //提交
     async technologyBtn() {
-      let data = this.technologyForm;
+      let data = this.form;
       if (data.company != null) {
         data.noticeid = this.noticeid;
         data.type = '0';
@@ -301,7 +324,7 @@ export default {
             message: '信息添加成功',
             type: 'success',
           });
-          this.technologyForm = {};
+          this.form = {};
         }
       } else {
         this.$message({
@@ -358,9 +381,19 @@ export default {
 }
 .di {
   border-bottom: 1px dashed #ccc;
-  margin: 0 0 5px 0;
+  margin: 0 0 10px 0;
 }
 .sr {
-  margin-bottom: 5px;
+  margin-bottom: 10px;
+}
+.dir {
+  border-bottom: 1px dashed #ccc;
+  padding: 10px 0;
+}
+.cc {
+  margin-bottom: 10px;
+}
+.pad {
+  padding: 0 5px 0 5px;
 }
 </style>

+ 14 - 7
vue.config.js

@@ -17,15 +17,22 @@ module.exports = {
     port: '8001',
     //api地址前缀
     proxy: {
-      '/api': {
+      '/weixin': {
         target: 'http://smart.cc-lotus.info',
+        changeOrigin: true,
+        ws: true,
+      },
+      '/files': {
+        target: 'http://free.liaoningdoupo.com',
+      },
+      '/api': {
+        target: 'http://free.liaoningdoupo.com',
+        changeOrigin: true,
+        ws: true,
+      },
+      '/ws': {
+        target: 'http://free.liaoningdoupo.com',
         ws: true,
-        onProxyReq(proxyReq, req, res) {
-          proxyReq.setHeader('x-tenant', '99991');
-        },
-        '/files': {
-          target: 'http://free.liaoningdoupo.com',
-        },
       },
     },
   },