|
@@ -0,0 +1,146 @@
|
|
|
+<template>
|
|
|
+ <div id="two">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
+ <template v-for="(i, index) in question">
|
|
|
+ <el-col :span="24" :key="`two${index}`">
|
|
|
+ <el-form-item v-if="i.type === 'radio'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`">
|
|
|
+ <el-radio-group v-model="form[i.model]">
|
|
|
+ <el-radio v-for="(item, index) in getList(i.list)" :key="index" :label="item"></el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="i.type === 'text'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`">
|
|
|
+ <el-input v-model="form[i.model]"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="i.type === 'textarea'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`">
|
|
|
+ <el-input v-model="form[i.model]" type="textarea" :autosize="{ minRows: 4, maxRows: 6 }" maxlength="1000" show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="i.type === 'datePicker'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`">
|
|
|
+ <el-date-picker v-model="form[i.model]" placeholder="请选择" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" style="width:100%">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="i.type === 'frdb'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`" label-width="140px">
|
|
|
+ <el-col :span="12" v-for="(tag, index) in i.children" :key="index" class="frdb">
|
|
|
+ <el-form-item :label="tag.label">
|
|
|
+ <el-input v-model="form[tag.model]" style="width:100%;margin:0 0 10px 0;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="i.type === 'zycp'" :prop="`${index}`" :key="`two${index}`" :label="`${i.label}`">
|
|
|
+ <el-col :span="24" style="text-align:right;margin:0 0 10px 0;">
|
|
|
+ <el-button type="primary" size="small" @click="toZycp()">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-table :data="form.comDemand_zycp" border style="width: 100%">
|
|
|
+ <el-table-column prop="name" label="主要产品名称" align="center" show-overflow-tooltip> </el-table-column>
|
|
|
+ <el-table-column prop="mix" label="占企业销售收入总额比例" align="center" show-overflow-tooltip> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="danger" @click="toDel(scope.$index, scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </template>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog :title="dialog.title" :visible.sync="dialog.show" :width="dialog.width" :before-close="toClose">
|
|
|
+ <el-form ref="form" :model="marketForm" label-width="80px">
|
|
|
+ <el-form-item label="产品名称">
|
|
|
+ <el-input v-model="marketForm.name" placeholder="请输入产品名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="总额占比">
|
|
|
+ <el-input v-model="marketForm.mix" placeholder="请输入总额占比"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="text-align:center">
|
|
|
+ <el-button type="primary" @click="marketSubmit">提交保存</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { two } from '../fields.js';
|
|
|
+import * as select from '../select.js';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+export default {
|
|
|
+ name: 'two',
|
|
|
+ props: {
|
|
|
+ form: { type: Object },
|
|
|
+ rules: { type: Object },
|
|
|
+ },
|
|
|
+ model: {
|
|
|
+ prop: 'form',
|
|
|
+ event: 'change',
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ question: two,
|
|
|
+ marketForm: {},
|
|
|
+ // 弹框
|
|
|
+ dialog: { titla: '产品管理', show: false, width: '50%' },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ // 获取列表
|
|
|
+ getList(type) {
|
|
|
+ return select[type];
|
|
|
+ },
|
|
|
+ toZycp() {
|
|
|
+ this.dialog = { titla: '产品管理', show: true, width: '30%' };
|
|
|
+ },
|
|
|
+ // 提交保存
|
|
|
+ marketSubmit() {
|
|
|
+ let data = this.marketForm;
|
|
|
+ this.form.comDemand_zycp.push(data);
|
|
|
+ this.toClose();
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ toDel(index, data) {
|
|
|
+ this.form.comDemand_zycp.splice(index, 1);
|
|
|
+ },
|
|
|
+ // 关闭
|
|
|
+ toClose() {
|
|
|
+ this.marketForm = {};
|
|
|
+ this.dialog = { titla: '产品管理', show: false, width: '30%' };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.sbzc {
|
|
|
+ /deep/.el-input {
|
|
|
+ float: left;
|
|
|
+ width: 20%;
|
|
|
+ margin: 0 10px 0 0px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.rzbq {
|
|
|
+ /deep/.el-input {
|
|
|
+ float: left;
|
|
|
+ width: 10%;
|
|
|
+ margin: 0 10px 0 0px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|