guhongwei 5 lat temu
rodzic
commit
3153c1c5fe

+ 95 - 98
src/layout/financeclaims/manageMoneyForm.vue

@@ -1,108 +1,105 @@
 <template>
-    <div id="manageMoneyForm">
-        <el-row>
-            <el-col :span="24" class="form">
-                <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
-                    <el-col :span="24">
-                        <el-form-item label="产品名称" prop="title">
-                            <el-input v-model="ruleForm.title" placeholder="请输入产品名称"></el-input>
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="12">
-                        <el-form-item label="收益率" prop="rate">
-                            <el-input class="mongeyrate" v-model="ruleForm.rate" placeholder="收益率"></el-input>%
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="12">
-                        <el-form-item label="产品期限(个月)" prop="min_time">
-                            <el-input class="mongeyrate" v-model="ruleForm.min_time" placeholder="产品期限(小)"></el-input>~
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="12">
-                        <el-form-item prop="max_time" class="formItem">
-                            <el-input class="mongeyrate" v-model="ruleForm.max_time" placeholder="产品期限(大)"></el-input>
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="12">
-                        <el-form-item label="起购价格(元)" prop="buymin" >
-                            <el-input class="mongeyrate" v-model="ruleForm.buymin" placeholder="起购价格"></el-input>元
-                        </el-form-item>
-                    </el-col>
-
-                    <el-col :span="24">
-                        <el-form-item label="产品介绍">
-                            <el-input type="textarea" v-model="ruleForm.news" placeholder="请输入产品介绍"></el-input>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="24" class="btn">
-                        <el-button size="small" @click="resetForm('ruleForm')" >取消</el-button>
-                        <el-button type="primary" size="small" @click="submitForm('ruleForm')">提交</el-button>
-                    </el-col>
-                </el-form>
-            </el-col>
-        </el-row>
-    </div>
-    <!--:disabled="isAble"-->
+  <div id="manageMoneyForm">
+    <el-row>
+      <el-col :span="24" class="form">
+        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
+          <el-col :span="24">
+            <el-form-item label="产品名称" prop="title">
+              <el-input v-model="ruleForm.title" placeholder="请输入产品名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="收益率" prop="rate"> <el-input class="mongeyrate" v-model="ruleForm.rate" placeholder="收益率"></el-input>% </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="产品期限(个月)" prop="min_time">
+              <el-input class="mongeyrates" v-model="ruleForm.min_time" placeholder="产品期限(小)"></el-input>~
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item prop="max_time" class="formItem">
+              <el-input class="mongeyrates" v-model="ruleForm.max_time" placeholder="产品期限(大)"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="起购价格(元)" prop="buymin">
+              <el-input class="mongeyrate" v-model="ruleForm.buymin" placeholder="起购价格"></el-input>元
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="产品介绍">
+              <el-input type="textarea" v-model="ruleForm.news" placeholder="请输入产品介绍"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24" class="btn">
+            <el-button size="small" @click="resetForm('ruleForm')">取消</el-button>
+            <el-button type="primary" size="small" @click="submitForm('ruleForm')">提交</el-button>
+          </el-col>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+  <!--:disabled="isAble"-->
 </template>
 
 <script>
-  export default {
-    name: 'manageMoneyForm',
-    props: {
-      ruleForm: null,
-      hkList: null,
-      dbList: null,
+export default {
+  name: 'manageMoneyForm',
+  props: {
+    ruleForm: null,
+    hkList: null,
+    dbList: null,
+  },
+  components: {},
+  data: () => ({
+    rules: {
+      rate: [
+        { required: true, message: '请输入收益率', trigger: 'blur' },
+        { pattern: /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '请输入大于0的数字' },
+      ],
+      min_time: [
+        { required: true, message: '请输入产品期限', trigger: 'blur' },
+        { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
+      ],
+      max_time: [
+        { required: true, message: '请输入产品期限', trigger: 'blur' },
+        { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
+      ],
+      title: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
+      buymin: [
+        { required: true, message: '请输入起购价格', trigger: 'blur' },
+        { pattern: /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '请输入大于0的数字' },
+      ],
+    },
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    submitForm() {
+      this.$emit('submitForm', { data: this.ruleForm });
     },
-    components: {},
-    data: () => ({
-      rules: {
-        rate: [
-          { required: true, message: '请输入收益率', trigger: 'blur' },
-          { pattern: /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '请输入大于0的数字' },
-        ],
-        min_time: [
-          { required: true, message: '请输入产品期限', trigger: 'blur' },
-          { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
-        ],
-        max_time: [
-          { required: true, message: '请输入产品期限', trigger: 'blur' },
-          { pattern: /^\+?[1-9]\d*$/, message: '请输入大于0的正整数' },
-        ],
-        title: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
-        buymin: [
-          { required: true, message: '请输入起购价格', trigger: 'blur' },
-          { pattern: /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/, message: '请输入大于0的数字' },
-        ],
-      },
-    }),
-    created() {},
-    computed: {},
-    methods: {
-      submitForm() {
-        this.$emit('submitForm', { data: this.ruleForm });
-      },
-      resetForm() {
-        this.$emit('resetForm');
-      },
+    resetForm() {
+      this.$emit('resetForm');
     },
-  };
+  },
+};
 </script>
 
 <style lang="less" scoped>
-    .form {
-        padding: 0 200px 0 0;
-    }
-    .mongeyrate {
-        width: 95%;
-    }
-    /deep/.formItem .el-form-item__content {
-        margin-left: 0 !important;
-    }
-    .btn {
-        text-align: center;
-        padding: 30px 0;
-    }
+.form {
+  padding: 0 200px 0 0;
+}
+.mongeyrate {
+  width: 50%;
+}
+.mongeyrates {
+  width: 98%;
+}
+/deep/.formItem .el-form-item__content {
+  margin-left: 0 !important;
+}
+.btn {
+  text-align: center;
+  padding: 30px 0;
+}
 </style>

+ 105 - 106
src/views/financeclaims/manageMoneyDetail.vue

@@ -1,123 +1,122 @@
 <template>
-    <div id="manageMoneyDetail">
-        <el-row>
-            <el-col :span="24" class="debt">
-                <el-col :span="24" class="top">
-                    <topInfo :topTitle="topTitle" :display="display"></topInfo>
-                </el-col>
-                <el-col :span="24" class="main">
-                    <el-col :span="24" class="back">
-                        <detailTop @goBack="goBack"></detailTop>
-                    </el-col>
-                    <el-col :span="24" class="info">
-                        <manageMoneyForm :ruleForm="ruleForm" @submitForm="submitForm" @resetForm="resetForm"></manageMoneyForm>
-                    </el-col>
-                </el-col>
-            </el-col>
-        </el-row>
-    </div>
+  <div id="manageMoneyDetail">
+    <el-row>
+      <el-col :span="24" class="debt">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle" :display="display"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="back">
+            <detailTop @goBack="goBack"></detailTop>
+          </el-col>
+          <el-col :span="24" class="info">
+            <manageMoneyForm :ruleForm="ruleForm" @submitForm="submitForm" @resetForm="resetForm"></manageMoneyForm>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script>
-  import topInfo from '@/layout/common/topInfo.vue';
-  import detailTop from '@/layout/common/detailTop.vue';
-  import manageMoneyForm from '@/layout/financeclaims/manageMoneyForm.vue';
-  import { createNamespacedHelpers, mapGetters ,mapState} from 'vuex';
-  const { mapActions: managemoney } = createNamespacedHelpers('managemoney');
-  export default {
-    name: 'manageMoneyDetail',
-    props: {},
-    components: {
-      topInfo, //头部导航
-      detailTop, //头部返回
-      manageMoneyForm, //添加理财产品
-
-    },
-    data: () => ({
-      display: 'none',
-      topTitle: '债权产品信息',
-      ruleForm: {},
-    }),
-    created() {
-      this.searchInfo();
+import topInfo from '@/layout/common/topInfo.vue';
+import detailTop from '@/layout/common/detailTop.vue';
+import manageMoneyForm from '@/layout/financeclaims/manageMoneyForm.vue';
+import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
+const { mapActions: managemoney } = createNamespacedHelpers('managemoney');
+export default {
+  name: 'manageMoneyDetail',
+  props: {},
+  components: {
+    topInfo, //头部导航
+    detailTop, //头部返回
+    manageMoneyForm, //添加理财产品
+  },
+  data: () => ({
+    display: 'none',
+    topTitle: '债权产品信息',
+    ruleForm: {},
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
     },
-    computed: {
-      ...mapState(['user']),
-      id() {
-        return this.$route.query.id;
-      },
+  },
+  methods: {
+    ...managemoney(['create', 'fetch', 'update', 'orUpdate']),
+    async searchInfo() {
+      if (this.id) {
+        const res = await this.fetch(this.id);
+        this.$set(this, `ruleForm`, res.data);
+      }
     },
-    methods: {
-      ...managemoney([ 'create','fetch','update','orUpdate']),
-      async searchInfo() {
-        if (this.id) {
-          const res = await this.fetch(this.id);
-          this.$set(this, `ruleForm`, res.data);
-        }
-      },
-      // 提交
-      async submitForm({ data }) {
-        let res;
-        let befupdate;
-        let finaldata;
-        if (this.id) {
-          var orupdate={};
-          orupdate.mmid = this.id;
-          befupdate=await this.orUpdate(orupdate);
-          if(befupdate.data.status=='SUCCESS'){
-            res = await this.update(data);
-            if (res.errcode === 0) {
-              this.$message({
-                message: '信息修改成功',
-                type: 'success',
-              });
-            }
-          }else{
-            this.$message({
-              message: '该消息已发布不可修改',
-              type: 'error',
-            });
-          }
-        } else {
-          finaldata = data;
-          finaldata.jgid = this.user.userid;
-          alert(JSON.stringify(finaldata));
-          res = await this.create(finaldata);
+    // 提交
+    async submitForm({ data }) {
+      let res;
+      let befupdate;
+      let finaldata;
+      if (this.id) {
+        var orupdate = {};
+        orupdate.mmid = this.id;
+        befupdate = await this.orUpdate(orupdate);
+        if (befupdate.data.status == 'SUCCESS') {
+          res = await this.update(data);
           if (res.errcode === 0) {
             this.$message({
-              message: '信息创建成功',
+              message: '信息修改成功',
               type: 'success',
             });
           }
+        } else {
+          this.$message({
+            message: '该消息已发布不可修改',
+            type: 'error',
+          });
+        }
+      } else {
+        finaldata = data;
+        finaldata.jgid = this.user.userid;
+        alert(JSON.stringify(finaldata));
+        res = await this.create(finaldata);
+        if (res.errcode === 0) {
+          this.$message({
+            message: '信息创建成功',
+            type: 'success',
+          });
         }
-        if (this.$checkRes(res)) this.resetForm();
-        console.log(res.data);
-      },
-      // 取消
-      resetForm() {
-        this.$router.push({ path: '/financeclaims/manageMoneyIndex' });
-      },
-      // 返回
-      goBack() {
-        this.$router.go(-1);
-      },
+      }
+      if (this.$checkRes(res)) this.resetForm();
+      console.log(res.data);
+    },
+    // 取消
+    resetForm() {
+      this.$router.push({ path: '/financeclaims/manageMoneyIndex' });
+    },
+    // 返回
+    goBack() {
+      this.$router.go(-1);
     },
-  };
+  },
+};
 </script>
 
 <style lang="less" scoped>
-    .debt {
-        padding: 20px;
-    }
-    .top {
-        border-bottom: 1px solid #ccc;
-    }
-    .main {
-        border-radius: 10px;
-        margin: 20px 0 0 0;
-        box-shadow: 0 0 3px #666;
-    }
-    .main .back {
-        padding: 10px 0 10px 15px;
-    }
+.debt {
+  padding: 20px;
+}
+.top {
+  border-bottom: 1px solid #ccc;
+}
+.main {
+  border-radius: 10px;
+  margin: 20px 0 0 0;
+  box-shadow: 0 0 3px #666;
+}
+.main .back {
+  padding: 10px 0 10px 15px;
+}
 </style>

+ 1 - 1
vue.config.js

@@ -34,7 +34,7 @@ module.exports = {
         ws: true,
       },
       '/api': {
-        target: 'http://10.16.9.108:9001',
+        target: 'http://free.liaoningdoupo.com',
         changeOrigin: true,
         ws: true,
       },