加入抄表类型

This commit is contained in:
java110 2021-09-22 01:11:16 +08:00
parent ca1721f5aa
commit 49073798a1
14 changed files with 721 additions and 2 deletions

View File

@ -35,7 +35,6 @@
<div class="col-sm-10">
<select class="custom-select" v-model="addServiceInfo.isInstance">
<option selected disabled value="">必填,请填写是否实例</option>
<option value="T">微服务处理</option>
<option value="CMD">微服务指令</option>
<option value="Y"></option>
<option value="N"></option>

View File

@ -33,7 +33,6 @@
<div class="col-sm-10">
<select class="custom-select" v-model="editServiceInfo.isInstance">
<option selected disabled value="">必填,请填写是否实例</option>
<option value="T">微服务处理</option>
<option value="CMD">微服务指令</option>
<option value="Y"></option>
<option value="N"></option>

View File

@ -0,0 +1,37 @@
<div id="addMeterTypeModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<h3 class="m-t-none m-b ">添加抄表</h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">名称</label>
<div class="col-sm-10">
<input v-model="addMeterTypeInfo.typeName" type="text" placeholder="必填,请填写名称"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">说明</label>
<div class="col-sm-10">
<textarea v-model="addMeterTypeInfo.remark" placeholder="必填,请填写说明"
class="form-control"></textarea>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="saveMeterTypeInfo()"><i class="fa fa-check"></i>&nbsp;保存</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,111 @@
(function (vc) {
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
callBackFunction: vc.propTypes.string //父组件监听方法
},
data: {
addMeterTypeInfo: {
typeId: '',
typeName: '',
remark: '',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('addMeterType', 'openAddMeterTypeModal', function () {
$('#addMeterTypeModel').modal('show');
});
},
methods: {
addMeterTypeValidate() {
return vc.validate.validate({
addMeterTypeInfo: vc.component.addMeterTypeInfo
}, {
'addMeterTypeInfo.typeName': [
{
limit: "required",
param: "",
errInfo: "名称不能为空"
},
{
limit: "maxLength",
param: "12",
errInfo: "名称不能超过12"
},
],
'addMeterTypeInfo.remark': [
{
limit: "required",
param: "",
errInfo: "说明不能为空"
},
{
limit: "maxLength",
param: "200",
errInfo: "说明不能超过200"
},
],
});
},
saveMeterTypeInfo: function () {
if (!vc.component.addMeterTypeValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
vc.component.addMeterTypeInfo.communityId = vc.getCurrentCommunity().communityId;
//不提交数据将数据 回调给侦听处理
if (vc.notNull($props.callBackListener)) {
vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addMeterTypeInfo);
$('#addMeterTypeModel').modal('hide');
return;
}
vc.http.apiPost(
'meterType.saveMeterType',
JSON.stringify(vc.component.addMeterTypeInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#addMeterTypeModel').modal('hide');
vc.component.clearAddMeterTypeInfo();
vc.emit('meterTypeManage', 'listMeterType', {});
return;
}
vc.message(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
},
clearAddMeterTypeInfo: function () {
vc.component.addMeterTypeInfo = {
typeName: '',
remark: '',
};
}
}
});
})(window.vc);

View File

@ -0,0 +1,58 @@
<div id = "chooseMeterTypeModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="chooseMeterTypeModelLabel" aria-hidden="true" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="chooseMeterTypeModelLabel">选择抄表类型</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class=" row">
<div class="col-lg-12">
<div class="ibox ">
<div class="row">
<div class="col-sm-7 m-b-xs">
</div>
<div class="col-sm-5">
<div class="input-group">
<input placeholder="输入抄表类型名称" type="text" v-model="chooseMeterTypeInfo._currentMeterTypeName" class="form-control form-control-sm">
<span class="input-group-append">
<button type="button" class="btn btn-sm btn-primary" v-on:click="queryMeterTypes()">查询</button>
</span>
</div>
</div>
</div>
<div class="table-responsive" style="margin-top:15px">
<table class="table table-striped">
<thead>
<tr>
<th class="text-center">抄表类型</th>
<th class="text-center">名称</th>
<th class="text-center">说明</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="meterType in chooseMeterTypeInfo.meterTypes">
<td class="text-center">{{meterType.typeId}}</td>
<td class="text-center">{{meterType.typeName}}</td>
<td class="text-center">{{meterType.remark}}</td>
<td>
<button class="btn btn-primary btn-xs" v-on:click="chooseMeterType(meterType)">选择</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,63 @@
(function(vc){
vc.extends({
propTypes: {
emitChooseMeterType:vc.propTypes.string,
emitLoadData:vc.propTypes.string
},
data:{
chooseMeterTypeInfo:{
meterTypes:[],
_currentMeterTypeName:'',
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('chooseMeterType','openChooseMeterTypeModel',function(_param){
$('#chooseMeterTypeModel').modal('show');
vc.component._refreshChooseMeterTypeInfo();
vc.component._loadAllMeterTypeInfo(1,10,'');
});
},
methods:{
_loadAllMeterTypeInfo:function(_page,_row,_name){
var param = {
params:{
page:_page,
row:_row,
communityId:vc.getCurrentCommunity().communityId,
name:_name
}
};
//发送get请求
vc.http.apiGet('meterType.listMeterTypes',
param,
function(json){
var _meterTypeInfo = JSON.parse(json);
vc.component.chooseMeterTypeInfo.meterTypes = _meterTypeInfo.meterTypes;
},function(){
console.log('请求失败处理');
}
);
},
chooseMeterType:function(_meterType){
if(_meterType.hasOwnProperty('name')){
_meterType.meterTypeName = _meterType.name;
}
vc.emit($props.emitChooseMeterType,'chooseMeterType',_meterType);
vc.emit($props.emitLoadData,'listMeterTypeData',{
meterTypeId:_meterType.meterTypeId
});
$('#chooseMeterTypeModel').modal('hide');
},
queryMeterTypes:function(){
vc.component._loadAllMeterTypeInfo(1,10,vc.component.chooseMeterTypeInfo._currentMeterTypeName);
},
_refreshChooseMeterTypeInfo:function(){
vc.component.chooseMeterTypeInfo._currentMeterTypeName = "";
}
}
});
})(window.vc);

View File

@ -0,0 +1,19 @@
<div class="modal fade" id="deleteMeterTypeModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<tr align="center"><th>确定删除抄表类型</th></tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteMeterTypeModel()">点错了</button>
<button type="button" class="btn btn-primary" v-on:click="deleteMeterType()">确认删除</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,52 @@
(function(vc,vm){
vc.extends({
data:{
deleteMeterTypeInfo:{
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('deleteMeterType','openDeleteMeterTypeModal',function(_params){
vc.component.deleteMeterTypeInfo = _params;
$('#deleteMeterTypeModel').modal('show');
});
},
methods:{
deleteMeterType:function(){
vc.component.deleteMeterTypeInfo.communityId=vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'meterType.deleteMeterType',
JSON.stringify(vc.component.deleteMeterTypeInfo),
{
emulateJSON:true
},
function(json,res){
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#deleteMeterTypeModel').modal('hide');
vc.emit('meterTypeManage','listMeterType',{});
return ;
}
vc.message(_json.msg);
},
function(errInfo,error){
console.log('请求失败处理');
vc.message(json);
});
},
closeDeleteMeterTypeModel:function(){
$('#deleteMeterTypeModel').modal('hide');
}
}
});
})(window.vc,window.vc.component);

View File

@ -0,0 +1,37 @@
<div id="editMeterTypeModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-body">
<h3 class="m-t-none m-b ">修改</h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">名称</label>
<div class="col-sm-10">
<input v-model="editMeterTypeInfo.typeName" type="text" placeholder="必填,请填写名称"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">说明</label>
<div class="col-sm-10">
<textarea v-model="editMeterTypeInfo.remark" placeholder="必填,请填写说明"
class="form-control"></textarea>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="editMeterType()"><i class="fa fa-check"></i>&nbsp;保存</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,101 @@
(function(vc,vm){
vc.extends({
data:{
editMeterTypeInfo:{
typeId:'',
typeName:'',
remark:'',
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('editMeterType','openEditMeterTypeModal',function(_params){
vc.component.refreshEditMeterTypeInfo();
$('#editMeterTypeModel').modal('show');
vc.copyObject(_params, vc.component.editMeterTypeInfo );
vc.component.editMeterTypeInfo.communityId = vc.getCurrentCommunity().communityId;
});
},
methods:{
editMeterTypeValidate:function(){
return vc.validate.validate({
editMeterTypeInfo:vc.component.editMeterTypeInfo
},{
'editMeterTypeInfo.typeName':[
{
limit:"required",
param:"",
errInfo:"名称不能为空"
},
{
limit:"maxLength",
param:"12",
errInfo:"名称不能超过12"
},
],
'editMeterTypeInfo.remark':[
{
limit:"required",
param:"",
errInfo:"说明不能为空"
},
{
limit:"maxLength",
param:"200",
errInfo:"说明不能超过200"
},
],
'editMeterTypeInfo.typeId':[
{
limit:"required",
param:"",
errInfo:"抄表类型不能为空"
}]
});
},
editMeterType:function(){
if(!vc.component.editMeterTypeValidate()){
vc.toast(vc.validate.errInfo);
return ;
}
vc.http.apiPost(
'meterType.updateMeterType',
JSON.stringify(vc.component.editMeterTypeInfo),
{
emulateJSON:true
},
function(json,res){
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#editMeterTypeModel').modal('hide');
vc.emit('meterTypeManage','listMeterType',{});
return ;
}
vc.message(_json.msg);
},
function(errInfo,error){
console.log('请求失败处理');
vc.message(errInfo);
});
},
refreshEditMeterTypeInfo:function(){
vc.component.editMeterTypeInfo= {
typeId:'',
typeName:'',
remark:'',
}
}
}
});
})(window.vc,window.vc.component);

View File

@ -0,0 +1,44 @@
<div class="row">
<div class="col-lg-12">
<div class="ibox ">
<div class="ibox-title">
<h5>抄表类型信息</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" v-if="viewMeterTypeInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;" v-on:click="_openSelectMeterTypeInfoModel()">
<i class="glyphicon glyphicon-search"></i> 选择抄表类型</button>
<button type="button" v-if="viewMeterTypeInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddMeterTypeInfoModel()">
<i class="glyphicon glyphicon-plus"></i> 添加抄表类型</button>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<label class="col-form-label" >名称:</label>
<label class="">{{viewMeterTypeInfo.typeName}}</label>
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
<label class="col-form-label" >说明:</label>
<label class="">{{viewMeterTypeInfo.remark}}</label>
</div>
</div>
</div>
</div>
</div>
</div>
<vc:create path="property/addMeterType"
callBackListener="viewMeterTypeInfo"
callBackFunction="chooseMeterType"
></vc:create>
<vc:create path="property/chooseMeterType"
emitChooseMeterType="viewMeterTypeInfo"
emitLoadData="viewMeterTypeInfo"
></vc:create>
</div>

View File

@ -0,0 +1,49 @@
/**
抄表类型 组件
**/
(function(vc){
vc.extends({
propTypes: {
callBackListener:vc.propTypes.string, //父组件名称
callBackFunction:vc.propTypes.string //父组件监听方法
},
data:{
viewMeterTypeInfo:{
index:0,
flowComponent:'viewMeterTypeInfo',
typeName:'',
remark:'',
}
},
_initMethod:function(){
//根据请求参数查询 查询 业主信息
vc.component._loadMeterTypeInfoData();
},
_initEvent:function(){
vc.on('viewMeterTypeInfo','chooseMeterType',function(_app){
vc.copyObject(_app, vc.component.viewMeterTypeInfo);
vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewMeterTypeInfo);
});
vc.on('viewMeterTypeInfo', 'onIndex', function(_index){
vc.component.viewMeterTypeInfo.index = _index;
});
},
methods:{
_openSelectMeterTypeInfoModel(){
vc.emit('chooseMeterType','openChooseMeterTypeModel',{});
},
_openAddMeterTypeInfoModel(){
vc.emit('addMeterType','openAddMeterTypeModal',{});
},
_loadMeterTypeInfoData:function(){
}
}
});
})(window.vc);

View File

@ -0,0 +1,66 @@
<div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>抄表类型</h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddMeterTypeModal()">
<i class="glyphicon glyphicon-plus"></i>
添加
</button>
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">抄表类型</th>
<th class="text-center">名称</th>
<th class="text-center">说明</th>
<th class="text-center">创建时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="meterType in meterTypeManageInfo.meterTypes">
<td class="text-center">{{meterType.typeId}}</td>
<td class="text-center">{{meterType.typeName}}</td>
<td class="text-center">{{meterType.remark}}</td>
<td class="text-center">{{meterType.createTime}}</td>
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openEditMeterTypeModel(meterType)">修改</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openDeleteMeterTypeModel(meterType)">删除</button>
</div>
</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>
</div>
</div>
</div>
</div>
<vc:create path="property/addMeterType" callBackListener="" callBackFunction=""></vc:create>
<vc:create path="property/editMeterType"></vc:create>
<vc:create path="property/deleteMeterType"></vc:create>
</div>

View File

@ -0,0 +1,84 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
meterTypeManageInfo: {
meterTypes: [],
total: 0,
records: 1,
moreCondition: false,
typeId: '',
conditions: {
typeId: '',
typeName: '',
communityId: vc.getCurrentCommunity().communityId
}
}
},
_initMethod: function () {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('meterTypeManage', 'listMeterType', function (_param) {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.component._listMeterTypes(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listMeterTypes: function (_page, _rows) {
vc.component.meterTypeManageInfo.conditions.page = _page;
vc.component.meterTypeManageInfo.conditions.row = _rows;
var param = {
params: vc.component.meterTypeManageInfo.conditions
};
//发送get请求
vc.http.apiGet('meterType.listMeterType',
param,
function (json, res) {
var _meterTypeManageInfo = JSON.parse(json);
vc.component.meterTypeManageInfo.total = _meterTypeManageInfo.total;
vc.component.meterTypeManageInfo.records = _meterTypeManageInfo.records;
vc.component.meterTypeManageInfo.meterTypes = _meterTypeManageInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.meterTypeManageInfo.records,
currentPage: _page
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddMeterTypeModal: function () {
vc.emit('addMeterType', 'openAddMeterTypeModal', {});
},
_openEditMeterTypeModel: function (_meterType) {
vc.emit('editMeterType', 'openEditMeterTypeModal', _meterType);
},
_openDeleteMeterTypeModel: function (_meterType) {
vc.emit('deleteMeterType', 'openDeleteMeterTypeModal', _meterType);
},
_queryMeterTypeMethod: function () {
vc.component._listMeterTypes(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function () {
if (vc.component.meterTypeManageInfo.moreCondition) {
vc.component.meterTypeManageInfo.moreCondition = false;
} else {
vc.component.meterTypeManageInfo.moreCondition = true;
}
}
}
});
})(window.vc);