|
@@ -16,15 +16,27 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-col>
|
|
|
- <el-col :span="24" v-else-if="display == 'apply'">
|
|
|
- <el-tabs v-model="applyActive" type="card">
|
|
|
- <el-tab-pane label="技术成果" name="first">
|
|
|
- <applyAchieve :dock_id="dock_id" @toRest="toRest"></applyAchieve>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="科技需求" name="second">
|
|
|
- <applyTechol :dock_id="dock_id" @toRest="toRest"></applyTechol>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <el-col :span="24" class="two" v-else-if="display == 'apply'">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
+ <el-form-item label="用户名称" prop="name">
|
|
|
+ <el-input v-model="form.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系电话" prop="phone">
|
|
|
+ <el-input v-model="form.phone"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="create_time">
|
|
|
+ <el-date-picker v-model="form.create_time" placeholder="请选择" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"> </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="参展项目" prop="productList">
|
|
|
+ <el-select v-model="form.productList" value-key="id" clearable filterable multiple collapse-tags placeholder="请选择选择产品">
|
|
|
+ <el-option v-for="(item, index) in goodsList" :key="index" :label="`${item.name}(${getType(item.type)})`" :value="item"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-button type="danger" size="mini" @click="resetBtn">取消申请</el-button>
|
|
|
+ <el-button type="success" size="mini" @click="onSubmit('form')">提交申请</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -35,36 +47,75 @@
|
|
|
<script>
|
|
|
import next from '../dock/next.vue';
|
|
|
import past from '../dock/past.vue';
|
|
|
-import applyAchieve from '../dock/applyAchieve.vue';
|
|
|
-import applyTechol from '../dock/applyTechol.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: product } = createNamespacedHelpers('product');
|
|
|
+const { mapActions: dockUser } = createNamespacedHelpers('dockUser');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
|
name: 'dockInfo',
|
|
|
props: {},
|
|
|
- components: { next, past, applyAchieve, applyTechol },
|
|
|
+ components: { next, past },
|
|
|
data: function() {
|
|
|
return {
|
|
|
+ active: 'first',
|
|
|
// 显示
|
|
|
display: 'list',
|
|
|
- // 列表
|
|
|
- active: 'first',
|
|
|
- // 申请展会(技术成果,科技需求)
|
|
|
- applyActive: 'first',
|
|
|
- dock_id: '',
|
|
|
+ form: {
|
|
|
+ productList: [],
|
|
|
+ },
|
|
|
+ rules: {},
|
|
|
+ // 企业成果
|
|
|
+ goodsList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ if (this.user) this.search();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ ...product(['query']),
|
|
|
+ ...dockUser(['create']),
|
|
|
+ async search() {
|
|
|
+ let data = { name: this.user.name, phone: this.user.phone, user_id: this.user.id };
|
|
|
+ this.$set(this, `form`, data);
|
|
|
+ let res = await this.query({ user_id: this.user.id, status: 2 });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `goodsList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 申请展会
|
|
|
toApply(data) {
|
|
|
- this.$set(this, `dock_id`, data.id);
|
|
|
+ this.$set(this.form, `dock_id`, data.id);
|
|
|
this.display = 'apply';
|
|
|
},
|
|
|
+ // 提交申请
|
|
|
+ onSubmit(formName) {
|
|
|
+ this.$refs[formName].validate(async valid => {
|
|
|
+ if (valid) {
|
|
|
+ let data = this.form;
|
|
|
+ let res = await this.create(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({
|
|
|
+ message: '申请参展成功!',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.resetBtn();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 整理类型
|
|
|
+ getType(type) {
|
|
|
+ if (type == '0') return '科技需求';
|
|
|
+ else if (type == '1') return '技术成果';
|
|
|
+ else if (type == '2') return '商务服务';
|
|
|
+ },
|
|
|
// 取消申请
|
|
|
- toRest() {
|
|
|
+ resetBtn() {
|
|
|
this.display = 'list';
|
|
|
},
|
|
|
},
|
|
@@ -88,5 +139,16 @@ export default {
|
|
|
color: #22529a;
|
|
|
margin: 0 0 10px 0;
|
|
|
}
|
|
|
+ .two {
|
|
|
+ .el-date-editor {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .el-select {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|