Преглед на файлове

Merge branch 'master' of http://git.cc-lotus.info/financial_platform/admin-cms

guhongwei преди 5 години
родител
ревизия
b6843da1cb
променени са 4 файла, в които са добавени 191 реда и са изтрити 19 реда
  1. 131 12
      src/layout/institution/detailInfo.vue
  2. 1 1
      src/layout/institution/newsInfo.vue
  3. 5 4
      src/views/institution/detail.vue
  4. 54 2
      src/views/institution/index.vue

+ 131 - 12
src/layout/institution/detailInfo.vue

@@ -16,9 +16,12 @@
               <el-option label="既能发布债权产品又能发布股权产品" value="2"></el-option>
             </el-select>
           </el-form-item>
-          <!-- <el-form-item label="融资轮次">
-            <el-input v-model="ruleForm.round" placeholder="请输入融资轮次"></el-input>
-          </el-form-item> -->
+          <el-form-item label="融资轮次">
+            <el-select v-model="ruleForm.round" multiple placeholder="请选择">
+              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+            </el-select>
+          </el-form-item>
+
           <el-form-item label="组织形式">
             <el-input v-model="ruleForm.form" placeholder="请输入组织形式"></el-input>
           </el-form-item>
@@ -36,12 +39,23 @@
           <el-form-item label="创立时间">
             <el-input v-model="ruleForm.establish_time" placeholder="请输入创立时间"></el-input>
           </el-form-item>
-          <!-- <el-form-item label="所属行业">
-            <el-select v-model="ruleForm.profession" placeholder="请选择所属行业">
-              <el-option label="行业1" value="0"></el-option>
-              <el-option label="行业2" value="1"></el-option>
+          <el-form-item label="所属行业">
+            <!-- <el-cascader v-model="ruleForm.profession" :options="optionss" @change="handleChange"></el-cascader> -->
+            <el-select
+              v-for="(arrItem, key) in selectList"
+              :key="key"
+              v-model="selectArr[key]"
+              filterable
+              placeholder="请选择"
+              value-key="value"
+              @change="selected"
+              @focus="position = key"
+              style="margin:10px"
+            >
+              <el-option v-for="item in arrItem" :key="item.value" :label="item.label" :value="item"> </el-option>
             </el-select>
-          </el-form-item> -->
+          </el-form-item>
+
           <el-form-item label="组织机构号码">
             <el-input v-model="ruleForm.code" placeholder="请输入组织机构号码"></el-input>
           </el-form-item>
@@ -55,10 +69,12 @@
             <el-input v-model="ruleForm.registered_capital" placeholder="请输入注册资本"></el-input>
           </el-form-item>
           <el-form-item label="实缴资金">
-            <el-input v-model="ruleForm.contributed_capital" placeholder="请输入	实缴资金"></el-input>
+            <el-input v-model="ruleForm.contributed_capital" placeholder="请输入实缴资金"></el-input>
           </el-form-item>
           <el-form-item label="机构简介">
-            <wang-editor v-model="ruleForm.introduction" placeholder="请输入机构简介"></wang-editor>
+            <span v-if="toDisplay()">
+              <wang-editor :required="isNew" v-model="ruleForm.introduction" placeholder="请输入机构简介"></wang-editor>
+            </span>
           </el-form-item>
           <el-form-item>
             <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
@@ -83,20 +99,123 @@ export default {
     upload, //图片
   },
   data: () => ({
+    position: null,
+    selectArr: [],
+    selectList: [
+      [
+        {
+          value: '第1级-选项1',
+          label: '第1级-选项1',
+        },
+        {
+          value: '第1级-选项2',
+          label: '第1级-选项2',
+        },
+        {
+          value: '第1级-选项3',
+          label: '第1级-选项3',
+        },
+        {
+          value: '第1级-选项4',
+          label: '第1级-选项4',
+        },
+        {
+          value: '第1级-选项5',
+          label: '第1级-选项5',
+        },
+      ],
+    ],
+
     rules: {
       name: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
       logo: [{ required: true, message: '请上传机构logo', trigger: 'blur' }],
     },
+
+    props: { multiple: true },
+
+    value: [],
+    value: [],
+
+    options: [
+      {
+        value: '选项1',
+        label: '黄金糕',
+      },
+      {
+        value: '选项2',
+        label: '双皮奶',
+      },
+      {
+        value: '选项3',
+        label: '蚵仔煎',
+      },
+      {
+        value: '选项4',
+        label: '龙须面',
+      },
+      {
+        value: '选项5',
+        label: '北京烤鸭',
+      },
+    ],
+    value1: [],
+    value2: [],
   }),
   created() {},
-  computed: {},
+  computed: {
+    isNew() {
+      return this.$route.query.id === undefined ? true : false;
+    },
+  },
+  watch: {
+    isNew: {
+      handler(val) {},
+      immediate: true,
+    },
+  },
   methods: {
-    submitForm() {
+    addSelectList(index) {
+      return [
+        {
+          value: '选项1',
+          label: '选项2',
+        },
+        {
+          value: '选项2',
+          label: '选项2',
+        },
+        {
+          value: '选项3',
+          label: '选项3',
+        },
+      ];
+    },
+    selected(item) {
+      console.log(this.selectArr);
+      if (this.position >= 2 || this.position < 0) {
+      } else {
+        // console.log(item);  // item为当前选中项的对象
+        var nextSelect = this.addSelectList(this.position); //模拟获取下一级选项
+        this.selectList.splice(this.position + 1, this.selectList.length, nextSelect);
+        this.selectArr.splice(this.position + 1, this.selectArr.length);
+      }
+    },
+    toDisplay() {
+      if (this.isNew) return true;
+      else {
+        return !this.loading;
+      }
+    },
+    handleChange(value) {
+      console.log(value);
+    },
+    submitForm(ruleForm) {
       this.$emit('submitForm', { data: this.ruleForm });
     },
     resetForm() {
       this.$emit('resetForm');
     },
+
     uploadSuccess({ type, data }) {
       if (type !== 'logo') {
         let arr = _.get(this.ruleForm, type);

+ 1 - 1
src/layout/institution/newsInfo.vue

@@ -8,7 +8,7 @@
           <el-table-column label="机构类型" align="center">
             <template slot-scope="scope">
               <span style="margin-left: 10px">{{
-                scope.row.type === '0' ? '发布债权产品' : scope.row.type === '1' ? '发布股权产品' : '发布债权产品和股权产品'
+                scope.row.type === '0' ? '发布债权产品' : scope.row.type === '1' ? '发布股权产品' : scope.row.type === '2' ? '发布债权产品和股权产品' : ''
               }}</span>
             </template>
           </el-table-column>

+ 5 - 4
src/views/institution/detail.vue

@@ -46,16 +46,17 @@ export default {
     },
   },
   methods: {
-    ...mapActions(['query', 'delete', 'fetch']),
+    ...mapActions(['query', 'delete', 'fetch', 'update']),
     async search() {
       const res = await this.fetch(this.id);
       console.log(res.data);
       this.$set(this, `ruleForm`, res.data);
     },
     // 提交
-    submitForm(form) {
-      console.log(form);
-      this.resetForm();
+    submitForm(ruleForm) {
+      console.log(ruleForm);
+      let res = this.update(this.ruleForm);
+      // this.$router.push({ path: '/financial/index' });
     },
     // 取消
     resetForm() {

+ 54 - 2
src/views/institution/index.vue

@@ -37,23 +37,75 @@ export default {
     total: 1,
   }),
   created() {
-    this.search();
+    // this.search();
+    // this.searchstatus1();
+    // this.searchelse();
   },
   computed: {
     status() {
       return this.$route.params.status;
     },
   },
+  watch: {
+    // status(news) {
+    //   if (news == 1) {
+    //     this.search();
+    //   }
+    // },
+    status: {
+      handler(oval) {
+        console.log(oval);
+        this.debtTable = [];
+        console.log(this.debtTable);
 
+        if (oval == 0) {
+          console.log('if');
+          this.search();
+        } else if (oval == 1) {
+          console.log('elseif');
+          this.searchstatus1();
+        } else {
+          console.log('else');
+          this.searchelse();
+        }
+      },
+      //立刻
+      immediate: true,
+      deep: true,
+    },
+  },
   methods: {
     // 修改
     ...mapActions(['query', 'delete']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      console.log(status);
+
+      const res = await this.query({ skip, limit, ...info });
+      console.log(res.data);
+      var weishenhe = res.data.filter(item => item.type === '0');
+
+      this.$set(this, `debtTable`, weishenhe);
+    },
+    async searchstatus1({ skip = 0, limit = 10, ...info } = {}) {
+      console.log(status);
+
       const res = await this.query({ skip, limit, ...info });
       console.log(res.data);
+      var weishenhe = res.data.filter(item => item.type === '1');
 
-      this.$set(this, `debtTable`, res.data);
+      this.$set(this, `debtTable`, weishenhe);
     },
+    async searchelse({ skip = 0, limit = 10, ...info } = {}) {
+      console.log(status);
+
+      const res = await this.query({ skip, limit, ...info });
+      console.log(res.data);
+      var weishenhe = res.data.filter(item => item.type === '2');
+      console.log(weishenhe);
+
+      this.$set(this, `debtTable`, weishenhe);
+    },
+
     handleClick(newid) {
       this.$router.push({ path: '/institution/detail', query: { id: newid } });
     },