Prechádzať zdrojové kódy

修改广西综合保税区大屏进出口数据菜单中进出口,和排名的漏洞

sakura 1 rok pred
rodič
commit
37ffab2213
2 zmenil súbory, kde vykonal 18 pridanie a 13 odobranie
  1. 12 9
      src/views/RANK/index.vue
  2. 6 4
      src/views/TOTEXP/index.vue

+ 12 - 9
src/views/RANK/index.vue

@@ -63,7 +63,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="RANKList" @selection-change="handleSelectionChange">
+    <el-table  :data="RANKList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="保税区" align="center" prop="deptName">
         <template slot-scope="scope">
@@ -130,8 +130,8 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="ranking" label-width="100px" label="出入口总值">
-          <el-input  v-model="form.ranking" placeholder="请输入出入口总值" ></el-input>
+        <el-form-item prop="ranking" label-width="100px" label="排名">
+          <el-input  v-model="form.ranking" placeholder="请输入排名" ></el-input>
         </el-form-item>
 
       </el-form>
@@ -194,11 +194,11 @@ export default {
           { required: true, message: "保税区ID不能为空", trigger: "blur" }
         ],
         year: [
-          { required: true, message: "年份不能为空", trigger: "blur" },
-          { trigger: 'blur', validator: this.validatorFloatNum }
+          { required: true, message: "年份不能为空", trigger: "blur" }
         ],
         ranking: [
-          { required: true, message: "排名不能为空", trigger: "blur" }
+          { required: true, message: "排名不能为空", trigger: "blur" },
+          { trigger: 'blur', validator: this.validatorFloatNum }
         ],
       }
     };
@@ -234,6 +234,7 @@ export default {
 
       // 获取近三年
       let nearYearArr = [];
+      nearYearArr.push(curYear)
       for (let i = 1; i <= 4; i++) {
         nearYearArr.push(curYear - i + '');
       }
@@ -284,6 +285,7 @@ export default {
       const id = row.id || this.ids
       getRANK(id).then(response => {
         this.form = response.data;
+        this.form.deptId = Number(this.form.deptId)
         this.open = true;
         this.title = "修改广西保税区排名";
       });
@@ -291,6 +293,7 @@ export default {
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
+        debugger
         if (valid) {
           if (this.form.id != null) {
             updateRANK(this.form).then(response => {
@@ -329,14 +332,14 @@ export default {
       let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
       if (!reg.test(value)) {
         callback(new Error('请输入数字和正确格式的数字'));
-      } else if (value.split('.').length > 2) {
+      } else if (value.split('.').length >= 1) {
         callback(new Error('请输入正确格式的数字')); //防止输入多个小数点
-      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
+      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 6) {
         callback(new Error('最多只能输入两位小数')); //小数点后两位
       } else {
         callback();
       }
-    },
+    }
   }
 };
 </script>

+ 6 - 4
src/views/TOTEXP/index.vue

@@ -63,7 +63,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="TOTEXPList" @selection-change="handleSelectionChange">
+    <el-table :data="TOTEXPList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
 <!--      <el-table-column label="主键" align="center" prop="id">-->
 <!--        <template slot-scope="scope">-->
@@ -145,8 +145,8 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="imExport" label-width="100px" label="出口总值">
-          <el-input  v-model="form.imExport" placeholder="请输入出口总值" ></el-input>
+        <el-form-item prop="imExport" label-width="100px" label="出口总值">
+          <el-input  v-model="form.imExport" placeholder="请输入出口总值" ></el-input>
         </el-form-item>
 
       </el-form>
@@ -248,6 +248,7 @@ export default {
 
       // 获取近三年
       let nearYearArr = [];
+      nearYearArr.push(curYear)
       for (let i = 1; i <= 4; i++) {
         nearYearArr.push(curYear - i + '');
       }
@@ -297,6 +298,7 @@ export default {
       const id = row.id || this.ids
       getTOTEXP(id).then(response => {
         this.form = response.data;
+        this.form.deptId = Number(this.form.deptId)
         this.open = true;
         this.title = "修改保税区进出口总值数据";
       });
@@ -345,7 +347,7 @@ export default {
         callback(new Error('请输入数字和正确格式的数字'));
       } else if (value.split('.').length > 2) {
         callback(new Error('请输入正确格式的数字')); //防止输入多个小数点
-      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
+      } else if (value.indexOf('.') != -1 && value.split('.')[1].length > 6) {
         callback(new Error('最多只能输入两位小数')); //小数点后两位
       } else {
         callback();