|
|
@@ -11,8 +11,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="cell-body">
|
|
|
- <el-table :data="tableData" height="610" style="width: 100%" :cell-style="cell_style"
|
|
|
- v-loading="loading" :header-cell-style="header_cell_style">
|
|
|
+ <el-table :data="tableData" height="610" style="width: 100%" :cell-style="cell_style" v-loading="loading"
|
|
|
+ :header-cell-style="header_cell_style">
|
|
|
<!-- <el-table-column label="id" align="center" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{scope.row.id}}</span>
|
|
|
@@ -63,16 +63,17 @@
|
|
|
</div>
|
|
|
</el-dialog> -->
|
|
|
<!-- 修改费率对话框 -->
|
|
|
- <el-dialog title="修改费率" custom-class="modify-feilv-dialog" :visible.sync="dialogModifyFeilvVisible"
|
|
|
- :close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('modifyForm')">
|
|
|
+ <el-dialog title="修改费率" custom-class="modify-feilv-dialog" :visible.sync="dialogModifyFeilvVisible" :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false" @close="dialog_close('modifyForm')">
|
|
|
<el-form :model="form" ref="modifyForm" :rules="modifyRules">
|
|
|
<el-form-item label="型号:" :label-width="formLabelWidth" :required="true" prop="air_config_modify">
|
|
|
- <el-input v-model="form.air_config_modify" autocomplete="off" readonly="" maxlength="3" ref="modifyFeilv_focus">
|
|
|
+ <el-input v-model="form.air_config_modify" autocomplete="off" disabled maxlength="3">
|
|
|
<template slot="append">匹</template>
|
|
|
</el-input>
|
|
|
+ <!-- <span>{{ form.air_config_modify }} 匹</span> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="费率:" :label-width="formLabelWidth" :required="true" prop="rate_modify">
|
|
|
- <el-input v-model="form.rate_modify" autocomplete="off" maxlength="4">
|
|
|
+ <el-input v-model="form.rate_modify" autocomplete="off" maxlength="4" ref="modifyFeilv_focus">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -83,8 +84,8 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 删除费率对话框 -->
|
|
|
- <el-dialog custom-class="el-dialog-delete-feilv" :visible.sync="dialog_delete_feilv"
|
|
|
- :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
|
|
|
+ <el-dialog custom-class="el-dialog-delete-feilv" :visible.sync="dialog_delete_feilv" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ :show-close="false">
|
|
|
<div slot="" class="del-account-body">
|
|
|
<img src="../../icons/serveAC/del_warning.png" alt="">
|
|
|
<div class="del-account-body-txt">是否确定将该【{{delForm.air_config}}】从列表中移除?</div>
|
|
|
@@ -124,12 +125,12 @@
|
|
|
}
|
|
|
var checkFeilv = (rule, value, callback) => {
|
|
|
if (!value) {
|
|
|
- return callback(new Error('请输入费率,最多4位整数或小数!'));
|
|
|
+ return callback(new Error('请输入费率,最多4位的整数或小数!'));
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- var reg = /^[1-9]{1,2}$|^[1-9][\.][0-9]{1,2}$/
|
|
|
+ var reg = /^(0\.[1-9]\d{0,1}|0\.0[1-9]{1}|[1-9]\d{0,3}(\.\d{1,2})?)$/
|
|
|
if (!reg.test(value)) {
|
|
|
- callback(new Error('必须正整数或小数'));
|
|
|
+ callback(new Error('必须大于0的整数或小数,长度为1-4位'));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
@@ -195,6 +196,13 @@
|
|
|
// 获取费率列表数据
|
|
|
this.get_list()
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ 'form.rate_modify': function(newValue, oldValue) {
|
|
|
+ // console.log('变量 form.rate_modify 的值从 ' + oldValue + ' 改变为 ' + newValue)
|
|
|
+ if (this.form.rate_modify == '.')
|
|
|
+ this.form.rate_modify = '0.';
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
delete_feilv(index, row) {
|
|
|
// console.log(index, row);
|
|
|
@@ -215,7 +223,7 @@
|
|
|
this.$message.error('返回数据格式问题,code未获取到!')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (res.code == 200) {
|
|
|
this.dialog_delete_feilv = false
|
|
|
this.$message.success('删除费率成功!')
|
|
|
@@ -346,16 +354,17 @@
|
|
|
*/
|
|
|
modifyFeilv_dialog(index, row) {
|
|
|
// console.log(index, row);
|
|
|
- this.dialogModifyFeilvVisible = true
|
|
|
- this.form.id = row.id
|
|
|
- this.form.air_config_modify = row.air_config.substr(0, row.air_config.length - 1)
|
|
|
- this.form.rate_modify = row.rate
|
|
|
+ this.dialogModifyFeilvVisible = true;
|
|
|
+ this.form.id = row.id;
|
|
|
+ this.form.air_config_modify = row.air_config.substr(0, row.air_config.length - 1);
|
|
|
+ this.form.rate_modify = row.rate;
|
|
|
+ var _this = this;
|
|
|
// 使金额输入框input_amount获得焦点
|
|
|
setTimeout(() => {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.modifyFeilv_focus.focus()
|
|
|
- })
|
|
|
- }, 100)
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ const input = _this.$refs.modifyFeilv_focus.focus();
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
},
|
|
|
/**
|
|
|
* 对话框关闭时清理数据
|
|
|
@@ -478,10 +487,10 @@
|
|
|
}
|
|
|
|
|
|
// .el-input__inner {
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 删除对话框的样式
|
|
|
.del-account-body {
|
|
|
display: flex;
|
|
|
@@ -489,11 +498,11 @@
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
height: 180px;
|
|
|
-
|
|
|
+
|
|
|
img {
|
|
|
width: 72px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.del-account-body-txt {
|
|
|
height: 58px;
|
|
|
line-height: 58px;
|
|
|
@@ -540,13 +549,13 @@
|
|
|
.modify-feilv-dialog {
|
|
|
height: 300px !important;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.el-dialog-delete-feilv {
|
|
|
height: 300px !important;
|
|
|
width: 460px !important;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.el-dialog-delete-feilv .el-dialog__header {
|
|
|
display: none !important;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|