Explorar el Código

更新需求发布添加

wuhongyuq hace 5 años
padre
commit
6b758bfe71

+ 4 - 4
src/components/enterprise/enterprisexuqiu.vue

@@ -92,17 +92,17 @@ export default {
   overflow: hidden;
 }
 .main {
-  height: 1100px;
+  min-height: 1800px;
   overflow: hidden;
   margin: 10px 0;
 }
 .left {
-  height: 1100px;
+  min-height: 1800px;
   margin: 0 10px 0 0;
 }
 .leftDiao {
   background: #fff;
-  height: 730px;
+  height: 1430px;
   overflow: hidden;
 }
 .leftTop {
@@ -113,7 +113,7 @@ export default {
 }
 .right {
   width: 940px;
-  height: 1100px;
+  min-height: 1800px;
   background: #fff;
   overflow: hidden;
 }

+ 76 - 0
src/components/upload.vue

@@ -0,0 +1,76 @@
+<template>
+  <div id="upload">
+    <el-upload
+      v-if="url"
+      ref="upload"
+      :action="url"
+      list-type="picture-card"
+      :file-list="fileList"
+      :limit="limit"
+      :on-exceed="outLimit"
+      :on-preview="handlePictureCardPreview"
+      :before-remove="handleRemove"
+      :on-success="onSuccess"
+      accept=".jpg,.jpeg,.png,.bmp,.gif,.svg"
+    >
+      <template>
+        <i class="el-icon-plus"></i>
+      </template>
+    </el-upload>
+    <el-dialog :visible.sync="dialogVisible">
+      <img width="100%" :src="dialogImageUrl" alt="" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'upload',
+  props: {
+    url: { type: null },
+    limit: { type: Number },
+    data: { type: null },
+    type: { type: String },
+  },
+  components: {},
+  data: () => ({
+    dialogVisible: false,
+    dialogImageUrl: '',
+    fileList: [],
+  }),
+  created() {
+    if (this.data) {
+      this.defalutProcess(this.data);
+    }
+  },
+  watch: {
+    data: {
+      handler(val) {
+        this.defalutProcess(val);
+      },
+    },
+  },
+  computed: {},
+  methods: {
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url;
+      this.dialogVisible = true;
+    },
+    handleRemove(file) {
+      return true;
+    },
+    outLimit() {
+      this.$message.error('只允许上传1张图片');
+    },
+    onSuccess(response, file, fileList) {
+      //将文件整理好传回父组件
+      this.$emit('upload', { type: this.type, data: response });
+    },
+    defalutProcess(val) {
+      this.$set(this, `fileList`, [{ name: this.type, url: `${this.data}?${new Date().getTime()}` }]);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 42 - 16
src/layout/enterprise/contextfabu.vue

@@ -22,14 +22,14 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <!-- <el-col class="mingcheng" :span="24">
-                <el-form-item label="产品图片" v-model="form.url">
-                  <el-upload> </el-upload>
+              <el-col class="mingcheng" :span="24">
+                <el-form-item label="产品图片" prop="url">
+                  <upload :limit="1" :data="form.url" type="url" :url="'/files/links/upload'" @upload="uploadSuccess"></upload>
                 </el-form-item>
-              </el-col> -->
+              </el-col>
               <el-col class="mingcheng" :span="24">
                 <el-form-item label="应用领域" prop="1" v-if="form.totaltype === '1' ? form.totaltype === '2' : 'qiya'">
-                  <el-input v-model="form.field" placeholder="请选择名称"></el-input>
+                  <el-input v-model="form.field" placeholder="请输入应用领域"></el-input>
                 </el-form-item>
               </el-col>
               <el-col class="mingcheng" :span="24">
@@ -38,13 +38,31 @@
                 </el-form-item>
               </el-col>
 
+              <el-col class="mingcheng" :span="24">
+                <el-form-item label="市场前景">
+                  <el-input v-model="form.prospect" placeholder="请输入市场前景"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col class="mingcheng" :span="24">
+                <el-form-item label="电子合同">
+                  <el-input v-model="form.contract" placeholder="请输入电子合同"></el-input>
+                </el-form-item>
+              </el-col>
+
+              <el-col class="mingcheng" :span="24">
+                <el-form-item label="描述">
+                  <el-input v-model="form.description" placeholder="请输入描述"></el-input>
+                </el-form-item>
+              </el-col>
+
+              <el-col class="mingcheng" :span="24">
+                <el-form-item label="知识产权">
+                  <el-input v-model="form.property" placeholder="请输入知识产权"></el-input>
+                </el-form-item>
+              </el-col>
+
               <el-col class="mingcheng" :span="24">
                 <el-form-item label="产品参数" prop="2" v-if="form.totaltype === '1' ? form.totaltype === '2' : 'qiya'">
-                  <!-- <el-table :data="tableData" style="width: 100%">
-                    <el-table-column prop="arg_name" label="参数名称" width="180"> </el-table-column>
-                    <el-table-column prop="memo" label="参数内容" width="180"> </el-table-column>
-                  </el-table> -->
-                  <!-- <el-button type="primary">添加</el-button> -->
                   <template>
                     <div class="tableDate">
                       <div class="button" style="width:6%;float:right;">
@@ -56,11 +74,12 @@
                           <el-table-column type="selection" width="45" align="center"></el-table-column>
                           <el-table-column label="序号" type="index" width="60" align="center"></el-table-column>
 
-                          <el-table-column label="产品参数">
+                          <el-table-column label="产品名称">
                             <template slot-scope="scope">
-                              <el-input class="arg_name" v-model="scope.row.require_des"></el-input>
+                              <el-input type="input" class="remark" v-model="scope.row.arg_name"></el-input>
                             </template>
                           </el-table-column>
+
                           <el-table-column label="内容">
                             <template slot-scope="scope">
                               <el-input type="textarea" class="remark" v-model="scope.row.memo"></el-input>
@@ -85,7 +104,7 @@
               </el-col>
               <el-col class="mingcheng" :span="24">
                 <el-form-item label="单位">
-                  <el-input v-model="form.product_type_name" placeholder="请输入名称"></el-input>
+                  <el-input v-model="form.priceunit" placeholder="请输入单位"></el-input>
                 </el-form-item>
               </el-col>
 
@@ -127,6 +146,7 @@
 </template>
 
 <script>
+import upload from '@/components/upload.vue';
 export default {
   name: 'contextfabu',
   props: {
@@ -135,7 +155,9 @@ export default {
     columnList: null,
   },
 
-  components: {},
+  components: {
+    upload,
+  },
   data: () => ({
     tableData: [],
     selectlistRow: [],
@@ -153,8 +175,12 @@ export default {
   },
   computed: {},
   methods: {
-    selectChild(column_id) {
-      let res = this.columnList.filter(fil => fil.id === column_id);
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+    },
+
+    selectChild(product_type_id) {
+      let res = this.columnList.filter(fil => fil.id === product_type_id);
       if (res.length > 0) {
         console.log(res[0].name);
         this.$set(this.form, `product_type_name`, res[0].name);

+ 5 - 4
src/layout/enterprise/contextfabus.vue

@@ -26,12 +26,13 @@
             <el-col :span="24" class="fbListCenterR"> </el-col>
           </el-col>
           <el-col :span="24"> </el-col>
-          <el-col v-for="(item, index) in recruitData" :key="index" >
+          <el-col v-for="(item, index) in recruitData" :key="index">
             <el-col :span="21" class="title textOver">{{ item.name }}</el-col>
-            <el-col :span="3" class="date">
-              {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
-            </el-col>
           </el-col>
+          <!-- <el-col :span="3" class="date">
+              {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
+            </el-col> -->
+
           <!-- <el-table :data="recruitData" style="width: 100%" border>
             <el-table-column label="名称" align="center">
               <template slot-scope="scoped">

+ 2 - 0
src/store/index.js

@@ -19,6 +19,7 @@ import market from './market';
 import enterpriseproject from './enterpriseproject';
 import transaction from './transaction';
 import marketproduct from './marketproduct';
+import markettype from './markettype';
 
 Vue.use(Vuex);
 
@@ -43,6 +44,7 @@ export default new Vuex.Store({
     enterpriseproject,
     transaction,
     marketproduct,
+    markettype,
   },
   state: {},
   mutations: {},

+ 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 = {
+  columnInfo: `/api/market/protype`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.columnInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.columnInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.columnInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.columnInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.columnInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 11 - 1
src/views/enterprise/enterprisexuqiu.vue

@@ -18,6 +18,7 @@ import { createNamespacedHelpers, mapGetters } from 'vuex';
 const { mapActions: mapSite } = createNamespacedHelpers('site');
 const { mapActions: mapRecruit } = createNamespacedHelpers('market');
 const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
+const { mapActions: mapColumn } = createNamespacedHelpers('markettype');
 export default {
   name: 'adviserList',
   props: {},
@@ -35,6 +36,7 @@ export default {
   created() {
     this.search();
     this.searchSite();
+    this.searchColumn();
   },
   computed: {
     id() {
@@ -49,7 +51,8 @@ export default {
   methods: {
     ...mapSite(['showInfo']),
 
-    ...marketproduct({ columnList: 'query', columnInfo: 'fetch', marketcerate: 'create' }),
+    ...marketproduct({ list: 'query', columnInfo: 'fetch', marketcerate: 'create' }),
+    ...mapColumn({ queryList: 'query' }),
     async search() {
       this.loading = false;
       if (this.$route.query.id) {
@@ -58,6 +61,13 @@ export default {
       }
       this.loading = true;
     },
+
+    async searchColumn({ ...info } = {}) {
+      const res = await this.queryList({ ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnList`, res.data);
+      }
+    },
     // 查询站点信息
     async searchSite() {
       let res = await this.showInfo();