加入设备保养 标准

This commit is contained in:
wuxw 2022-11-06 21:45:12 +08:00
parent b88ecab045
commit ccf614692f
12 changed files with 575 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,53 @@
<div id="addMaintainanceStandardModel" class="modal fade" 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 "><span>
<vc:i18n name="添加" namespace="addMaintainanceStandard"></vc:i18n>
</span></h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='巡检项目' namespace='addMaintainanceStandard'></vc:i18n>
</span></label>
<div class="col-sm-10">
<input v-model="addMaintainanceStandardInfo.standardName" type="text"
:placeholder="vc.i18n('必填,请填写巡检项目','addMaintainanceStandard')"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='备注' namespace='addMaintainanceStandard'></vc:i18n>
</span></label>
<div class="col-sm-10">
<textarea v-model="addMaintainanceStandardInfo.remark"
:placeholder="vc.i18n('必填,请填写备注','addMaintainanceStandard')"
class="form-control"></textarea>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="saveMaintainanceStandardInfo()"><i class="fa fa-check"></i>&nbsp;
<span>
<vc:i18n name="保存"></vc:i18n>
</span>
</button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal">
<span>
<vc:i18n name="取消"></vc:i18n>
</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,99 @@
(function (vc) {
vc.extends({
propTypes: {
callBackListener: vc.propTypes.string, //父组件名称
callBackFunction: vc.propTypes.string //父组件监听方法
},
data: {
addMaintainanceStandardInfo: {
standardId: '',
standardName: '',
remark: '',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('addMaintainanceStandard', 'openAddMaintainanceStandardModal', function () {
$('#addMaintainanceStandardModel').modal('show');
});
},
methods: {
addMaintainanceStandardValidate() {
return vc.validate.validate({
addMaintainanceStandardInfo: vc.component.addMaintainanceStandardInfo
}, {
'addMaintainanceStandardInfo.standardName': [
{
limit: "required",
param: "",
errInfo: "巡检项目不能为空"
},
{
limit: "maxLength",
param: "256",
errInfo: "巡检项目不能超过256"
},
],
'addMaintainanceStandardInfo.remark': [
{
limit: "required",
param: "",
errInfo: "备注不能为空"
},
{
limit: "maxLength",
param: "512",
errInfo: "备注不能超过512"
},
],
});
},
saveMaintainanceStandardInfo: function () {
if (!vc.component.addMaintainanceStandardValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
vc.component.addMaintainanceStandardInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'/maintainance.saveMaintainanceStandard',
JSON.stringify(vc.component.addMaintainanceStandardInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#addMaintainanceStandardModel').modal('hide');
vc.component.clearAddMaintainanceStandardInfo();
vc.emit('maintainanceStandardManage', 'listMaintainanceStandard', {});
return;
}
vc.message(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
},
clearAddMaintainanceStandardInfo: function () {
vc.component.addMaintainanceStandardInfo = {
standardName: '',
remark: '',
};
}
}
});
})(window.vc);

View File

@ -11,7 +11,7 @@
$('#deleteMaintainanceItemModel').modal('show');
});
},
methods: {
methods: {
deleteMaintainanceItem: function () {
vc.component.deleteMaintainanceItemInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.apiPost(

View File

@ -0,0 +1,19 @@
<div class="modal fade" id="deleteMaintainanceStandardModel" 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"> <span><vc:i18n name="请确认您的操作!"></vc:i18n></span></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><span><vc:i18n name="确定删除保养标准" namespace="deleteMaintainanceStandard"></vc:i18n></span></th></tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteMaintainanceStandardModel()"><span><vc:i18n name="点错了"></vc:i18n></span></button>
<button type="button" class="btn btn-primary" v-on:click="deleteMaintainanceStandard()"><span><vc:i18n name="确认删除!"></vc:i18n></span></button>
</div>
</div>
</div>
</div>

View File

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

View File

@ -0,0 +1,49 @@
<div id="editMaintainanceStandardModel" class="modal fade" 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 "><span>
<vc:i18n name="修改" namespace="editMaintainanceStandard"></vc:i18n>
</span></h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='巡检项目' namespace='editMaintainanceStandard'></vc:i18n>
</span> </label>
<div class="col-sm-10">
<input v-model="editMaintainanceStandardInfo.standardName" type="text"
:placeholder="vc.i18n('必填,请填写巡检项目','editMaintainanceStandard')"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='备注' namespace='editMaintainanceStandard'></vc:i18n>
</span> </label>
<div class="col-sm-10">
<textarea v-model="editMaintainanceStandardInfo.remark"
:placeholder="vc.i18n('必填,请填写备注','editMaintainanceStandard')"
class="form-control"></textarea>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="editMaintainanceStandard()"><i class="fa fa-check"></i>&nbsp;<span>
<vc:i18n name="保存"></vc:i18n>
</span></button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
data-dismiss="modal"><span>
<vc:i18n name="取消"></vc:i18n>
</span></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,101 @@
(function (vc, vm) {
vc.extends({
data: {
editMaintainanceStandardInfo: {
standardId: '',
standardName: '',
remark: '',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('editMaintainanceStandard', 'openEditMaintainanceStandardModal', function (_params) {
vc.component.refreshEditMaintainanceStandardInfo();
$('#editMaintainanceStandardModel').modal('show');
vc.copyObject(_params, vc.component.editMaintainanceStandardInfo);
vc.component.editMaintainanceStandardInfo.communityId = vc.getCurrentCommunity().communityId;
});
},
methods: {
editMaintainanceStandardValidate: function () {
return vc.validate.validate({
editMaintainanceStandardInfo: vc.component.editMaintainanceStandardInfo
}, {
'editMaintainanceStandardInfo.standardName': [
{
limit: "required",
param: "",
errInfo: "巡检项目不能为空"
},
{
limit: "maxLength",
param: "256",
errInfo: "巡检项目不能超过256"
},
],
'editMaintainanceStandardInfo.remark': [
{
limit: "required",
param: "",
errInfo: "备注不能为空"
},
{
limit: "maxLength",
param: "512",
errInfo: "备注不能超过512"
},
],
'editMaintainanceStandardInfo.standardId': [
{
limit: "required",
param: "",
errInfo: "编号不能为空"
}]
});
},
editMaintainanceStandard: function () {
if (!vc.component.editMaintainanceStandardValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
vc.http.apiPost(
'/maintainance.updateMaintainanceStandard',
JSON.stringify(vc.component.editMaintainanceStandardInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#editMaintainanceStandardModel').modal('hide');
vc.emit('maintainanceStandardManage', 'listMaintainanceStandard', {});
return;
}
vc.message(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
},
refreshEditMaintainanceStandardInfo: function () {
vc.component.editMaintainanceStandardInfo = {
standardId: '',
standardName: '',
remark: '',
}
}
}
});
})(window.vc, window.vc.component);

BIN
public/pages/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,117 @@
<div>
<div class="row">
<div class="col-lg-12">
<div class="ibox ">
<div class="ibox-title">
<h5><span>
<vc:i18n name="查询条件"></vc:i18n>
</span></h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-4">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请选择巡检项目','maintainanceStandardManage')"
v-model="maintainanceStandardManageInfo.conditions.standardName"
class=" form-control">
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_queryMaintainanceStandardMethod()">
<i class="glyphicon glyphicon-search"></i> <span>
<vc:i18n name="查询"></vc:i18n>
</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5><span>
<vc:i18n name="保养标准" namespace="maintainanceStandardManage"></vc:i18n>
</span></h5>
<div class="ibox-tools" style="top:10px;">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_openAddMaintainanceStandardModal()">
<i class="glyphicon glyphicon-plus"></i>
<span>
<vc:i18n name="添加" namespace="maintainanceStandardManage"></vc:i18n>
</span>
</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"><span>
<vc:i18n name='巡检项目' namespace='maintainanceStandardManage'></vc:i18n>
</span></th>
<th class="text-center"><span>
<vc:i18n name='创建时间' namespace='maintainanceStandardManage'></vc:i18n>
</span></th>
<th class="text-center"><span>
<vc:i18n name='备注' namespace='maintainanceStandardManage'></vc:i18n>
</span></th>
<th class="text-center"><span>
<vc:i18n name='操作'></vc:i18n>
</span></th>
</tr>
</thead>
<tbody>
<tr v-for="maintainanceStandard in maintainanceStandardManageInfo.maintainanceStandards">
<td class="text-center">{{maintainanceStandard.standardName}}</td>
<td class="text-center">{{maintainanceStandard.createTime}}</td>
<td class="text-center">{{maintainanceStandard.remark}}</td>
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openEditMaintainanceStandardModel(maintainanceStandard)"><span>
<vc:i18n name='修改'></vc:i18n>
</span></button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openDeleteMaintainanceStandardModel(maintainanceStandard)"><span>
<vc:i18n name='删除'></vc:i18n>
</span></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/addMaintainanceStandard" callBackListener="" callBackFunction=""></vc:create>
<vc:create path="property/editMaintainanceStandard"></vc:create>
<vc:create path="property/deleteMaintainanceStandard"></vc:create>
</div>

View File

@ -0,0 +1,84 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
maintainanceStandardManageInfo: {
maintainanceStandards: [],
total: 0,
records: 1,
moreCondition: false,
standardId: '',
conditions: {
standardId: '',
standardName: '',
communityId: vc.getCurrentCommunity().communityId,
}
}
},
_initMethod: function () {
vc.component._listMaintainanceStandards(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('maintainanceStandardManage', 'listMaintainanceStandard', function (_param) {
vc.component._listMaintainanceStandards(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.component._listMaintainanceStandards(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listMaintainanceStandards: function (_page, _rows) {
vc.component.maintainanceStandardManageInfo.conditions.page = _page;
vc.component.maintainanceStandardManageInfo.conditions.row = _rows;
var param = {
params: vc.component.maintainanceStandardManageInfo.conditions
};
//发送get请求
vc.http.apiGet('/maintainance.listMaintainanceStandard',
param,
function (json, res) {
var _maintainanceStandardManageInfo = JSON.parse(json);
vc.component.maintainanceStandardManageInfo.total = _maintainanceStandardManageInfo.total;
vc.component.maintainanceStandardManageInfo.records = _maintainanceStandardManageInfo.records;
vc.component.maintainanceStandardManageInfo.maintainanceStandards = _maintainanceStandardManageInfo.data;
vc.emit('pagination', 'init', {
total: vc.component.maintainanceStandardManageInfo.records,
currentPage: _page
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_openAddMaintainanceStandardModal: function () {
vc.emit('addMaintainanceStandard', 'openAddMaintainanceStandardModal', {});
},
_openEditMaintainanceStandardModel: function (_maintainanceStandard) {
vc.emit('editMaintainanceStandard', 'openEditMaintainanceStandardModal', _maintainanceStandard);
},
_openDeleteMaintainanceStandardModel: function (_maintainanceStandard) {
vc.emit('deleteMaintainanceStandard', 'openDeleteMaintainanceStandardModal', _maintainanceStandard);
},
_queryMaintainanceStandardMethod: function () {
vc.component._listMaintainanceStandards(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function () {
if (vc.component.maintainanceStandardManageInfo.moreCondition) {
vc.component.maintainanceStandardManageInfo.moreCondition = false;
} else {
vc.component.maintainanceStandardManageInfo.moreCondition = true;
}
}
}
});
})(window.vc);