优化代码

This commit is contained in:
wuxw 2023-11-02 15:15:20 +08:00
parent 779ba5de66
commit 1ca6624963
3 changed files with 33 additions and 49 deletions

View File

@ -77,17 +77,7 @@
errInfo: "应用密钥不能超过200个字符"
},
],
'editSmallWeChatInfo.payPassword': [{
limit: "required",
param: "",
errInfo: "支付密码不能为空"
},
{
limit: "maxin",
param: "1,200",
errInfo: "支付密码不能超过200个字符"
},
],
'editSmallWeChatInfo.wechatId': [{
limit: "required",
param: "",
@ -98,11 +88,6 @@
param: "",
errInfo: "配置不能为空"
}],
'editSmallWeChatInfo.mchId': [{
limit: "required",
param: "",
errInfo: "商户id不能为空"
}],
});
},

View File

@ -3,9 +3,9 @@
<div class="col-lg-12">
<div class="ibox ">
<div class="ibox-title">
<h5><span>
<vc:i18n name="查询条件"></vc:i18n>
</span></h5>
<h5>
<vc:i18n name="查询条件"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;">
</div>
@ -14,12 +14,14 @@
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请选择名称','meterMachineManage')" v-model="meterMachineManageInfo.conditions.machineNameLike" class=" form-control">
<input type="text" :placeholder="vc.i18n('请选择名称','meterMachineManage')"
v-model="meterMachineManageInfo.conditions.machineNameLike" class=" form-control">
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请选择表号','meterMachineManage')" v-model="meterMachineManageInfo.conditions.address" class=" form-control">
<input type="text" :placeholder="vc.i18n('请选择表号','meterMachineManage')"
v-model="meterMachineManageInfo.conditions.address" class=" form-control">
</div>
</div>
<div class="col-sm-3">
@ -34,7 +36,8 @@
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryMeterMachineMethod()">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_queryMeterMachineMethod()">
<i class="glyphicon glyphicon-search"></i> <span>
<vc:i18n name="查询"></vc:i18n>
</span>
@ -54,7 +57,8 @@
</div>
<div class="col-sm-4">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请填写房屋编号 楼栋-单元-房屋','meterMachineManage')" v-model="meterMachineManageInfo.conditions.roomNameLike" class=" form-control">
<input type="text" :placeholder="vc.i18n('请填写房屋编号 楼栋-单元-房屋','meterMachineManage')"
v-model="meterMachineManageInfo.conditions.roomNameLike" class=" form-control">
</div>
</div>
<div class="col-sm-3">
@ -79,9 +83,9 @@
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5><span>
<vc:i18n name="智能水电表" namespace="meterMachineManage"></vc:i18n>
</span></h5>
<h5>
<vc:i18n name="智能水电表" namespace="meterMachineManage"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-white btn-sm" v-on:click="_openCustomRead()">
<vc:i18n name="手工抄表" namespace="meterMachineManage"></vc:i18n>
@ -162,12 +166,14 @@
<td class="text-center">{{meterMachine.curReadingTime}}</td>
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openEditMeterMachineModel(meterMachine)">
<button class="btn-white btn btn-xs"
v-on:click="_openEditMeterMachineModel(meterMachine)">
<vc:i18n name='修改'></vc:i18n>
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openDeleteMeterMachineModel(meterMachine)"><span>
<button class="btn-white btn btn-xs"
v-on:click="_openDeleteMeterMachineModel(meterMachine)"><span>
<vc:i18n name='删除'></vc:i18n>
</span></button>
</div>
@ -179,13 +185,6 @@
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
<!-- 分页 -->
<vc:create path="frame/pagination"></vc:create>

View File

@ -26,26 +26,26 @@
}
},
_initMethod: function() {
vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listMeterType();
$that._listFactorys();
},
_initEvent: function() {
vc.on('meterMachineManage', 'listMeterMachine', function(_param) {
vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function(_currentPage) {
vc.component._listMeterMachines(_currentPage, DEFAULT_ROWS);
$that._listMeterMachines(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listMeterMachines: function(_page, _rows) {
vc.component.meterMachineManageInfo.conditions.page = _page;
vc.component.meterMachineManageInfo.conditions.row = _rows;
$that.meterMachineManageInfo.conditions.page = _page;
$that.meterMachineManageInfo.conditions.row = _rows;
let param = {
params: vc.component.meterMachineManageInfo.conditions
params: $that.meterMachineManageInfo.conditions
};
//发送get请求
@ -53,11 +53,11 @@
param,
function(json, res) {
var _meterMachineManageInfo = JSON.parse(json);
vc.component.meterMachineManageInfo.total = _meterMachineManageInfo.total;
vc.component.meterMachineManageInfo.records = _meterMachineManageInfo.records;
vc.component.meterMachineManageInfo.meterMachines = _meterMachineManageInfo.data;
$that.meterMachineManageInfo.total = _meterMachineManageInfo.total;
$that.meterMachineManageInfo.records = _meterMachineManageInfo.records;
$that.meterMachineManageInfo.meterMachines = _meterMachineManageInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.meterMachineManageInfo.records,
total: $that.meterMachineManageInfo.records,
currentPage: _page
});
},
@ -90,14 +90,14 @@
vc.jumpToPage('/#/pages/machine/meterMachineDetail?machineId=' + _meterMachine.machineId)
},
_queryMeterMachineMethod: function() {
vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function() {
if (vc.component.meterMachineManageInfo.moreCondition) {
vc.component.meterMachineManageInfo.moreCondition = false;
if ($that.meterMachineManageInfo.moreCondition) {
$that.meterMachineManageInfo.moreCondition = false;
} else {
vc.component.meterMachineManageInfo.moreCondition = true;
$that.meterMachineManageInfo.moreCondition = true;
}
},
_listMeterType: function(_page, _rows) {