mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化巡检功能
This commit is contained in:
parent
3fcd85e93f
commit
36148f0475
@ -1,5 +1,4 @@
|
||||
<div id="addInspectionPlanModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div id="addInspectionPlanModel" 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">
|
||||
@ -10,17 +9,13 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">计划名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addInspectionPlanInfo.inspectionPlanName" type="text"
|
||||
placeholder="必填,请填写计划名称" class="form-control">
|
||||
<input v-model="addInspectionPlanInfo.inspectionPlanName" 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">
|
||||
<vc:create path="property/inspectionRouteSelect2"
|
||||
parentModal="addInspectionPlanModel"
|
||||
callBackListener="addInspectionPlanInfo" callBackFunction="notify"
|
||||
namespace="addInspectionPlan">
|
||||
<vc:create path="property/inspectionRouteSelect2" parentModal="addInspectionPlanModel" callBackListener="addInspectionPlanInfo" callBackFunction="notify" namespace="addInspectionPlan">
|
||||
</vc:create>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,15 +33,13 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">开始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addInspectionPlanInfo.startTime" type="text"
|
||||
placeholder="必填,请填写开始时间" class="form-control addInspectionPlanStartTime">
|
||||
<input v-model="addInspectionPlanInfo.startTime" type="text" placeholder="必填,请填写开始时间" class="form-control addInspectionPlanStartTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">结束时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addInspectionPlanInfo.endTime" type="text" placeholder="必填,请填写结束时间"
|
||||
class="form-control addInspectionPlanEndTime">
|
||||
<input v-model="addInspectionPlanInfo.endTime" type="text" placeholder="必填,请填写结束时间" class="form-control addInspectionPlanEndTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -74,19 +67,15 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea v-model="addInspectionPlanInfo.remark" type="text" placeholder="选填,请填写备注"
|
||||
class="form-control">
|
||||
<textarea v-model="addInspectionPlanInfo.remark" type="text" placeholder="选填,请填写备注" class="form-control">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="saveInspectionPlanInfo()">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveInspectionPlanInfo()">
|
||||
<i class="fa fa-check"></i> 保存
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
v-on:click="cleanInspectionPlanAddModel()"
|
||||
data-dismiss="modal">
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" v-on:click="cleanInspectionPlanAddModel()" data-dismiss="modal">
|
||||
<i class="fa fa-close"></i> 取消
|
||||
</button>
|
||||
</div>
|
||||
@ -96,4 +85,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,4 +1,4 @@
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
parentModal: vc.propTypes.string,
|
||||
@ -16,23 +16,23 @@
|
||||
watch: {
|
||||
inspectionRouteSelect2Info: {
|
||||
deep: true,
|
||||
handler: function () {
|
||||
handler: function() {
|
||||
vc.emit($props.callBackListener, $props.callBackFunction, this.inspectionRouteSelect2Info);
|
||||
}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
this._initInspectionRouteSelect2();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('inspectionRouteSelect2', 'setInspectionRoute', function (_param) {
|
||||
_initEvent: function() {
|
||||
vc.on('inspectionRouteSelect2', 'setInspectionRoute', function(_param) {
|
||||
vc.copyObject(_param, this.inspectionRouteSelect2Info);
|
||||
var option = new Option(_param.routeName,_param.inspectionRouteId, true, true);
|
||||
this.inspectionRouteSelect2Info.inspectionRouteSelector.append(option);
|
||||
|
||||
var option = new Option(_param.routeName, _param.inspectionRouteId, true, true);
|
||||
this.inspectionRouteSelect2Info.inspectionRouteSelector.append(option);
|
||||
|
||||
});
|
||||
|
||||
vc.on('inspectionRouteSelect2', 'clearInspectionRoute', function (_param) {
|
||||
vc.on('inspectionRouteSelect2', 'clearInspectionRoute', function(_param) {
|
||||
this.inspectionRouteSelect2Info = {
|
||||
inspectionRoutes: [],
|
||||
inspectionRouteId: '',
|
||||
@ -42,27 +42,27 @@
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_initInspectionRouteSelect2: function () {
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function () {};
|
||||
_initInspectionRouteSelect2: function() {
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||
$.fn.select2.defaults.set('width', '100%');
|
||||
this.inspectionRouteSelect2Info.inspectionRouteSelector = $('#inspectionRouteSelector').select2({
|
||||
placeholder: '必填,请选择巡检路线',
|
||||
allowClear: true,//允许清空
|
||||
allowClear: true, //允许清空
|
||||
//multiple: true,//允许多选
|
||||
escapeMarkup: function (markup) {
|
||||
escapeMarkup: function(markup) {
|
||||
return markup;
|
||||
}, // 自定义格式化防止xss注入
|
||||
ajax: {
|
||||
url: "/callComponent/inspectionRouteManage/list",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
headers:{
|
||||
headers: {
|
||||
'APP-ID': '8000418004',
|
||||
'TRANSACTION-ID' : vc.uuid(),
|
||||
'TRANSACTION-ID': vc.uuid(),
|
||||
'REQ-TIME': vc.getDateYYYYMMDDHHMISS(),
|
||||
'SIGN' : ''
|
||||
'SIGN': ''
|
||||
},
|
||||
data: function (params) {
|
||||
data: function(params) {
|
||||
console.log("param", params);
|
||||
var _term = "";
|
||||
if (params.hasOwnProperty("term")) {
|
||||
@ -71,11 +71,11 @@
|
||||
return {
|
||||
routeName: _term,
|
||||
page: 1,
|
||||
row: 10,
|
||||
row: 300,
|
||||
communityId: vc.getCurrentCommunity().communityId
|
||||
};
|
||||
},
|
||||
processResults: function (data) {
|
||||
processResults: function(data) {
|
||||
return {
|
||||
results: this._filterInspectionRouteData(data.inspectionRoutes)
|
||||
};
|
||||
@ -83,14 +83,14 @@
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
$('#inspectionRouteSelector').on("select2:select", function (evt) {
|
||||
$('#inspectionRouteSelector').on("select2:select", function(evt) {
|
||||
//这里是选中触发的事件
|
||||
//evt.params.data 是选中项的信息
|
||||
this.inspectionRouteSelect2Info.inspectionRouteId = evt.params.data.id;
|
||||
this.inspectionRouteSelect2Info.routeName = evt.params.data.text;
|
||||
});
|
||||
|
||||
$('#inspectionRouteSelector').on("select2:unselect", function (evt) {
|
||||
$('#inspectionRouteSelector').on("select2:unselect", function(evt) {
|
||||
//这里是取消选中触发的事件
|
||||
//如配置allowClear: true后,触发
|
||||
this.inspectionRouteSelect2Info.inspectionRouteId = '';
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
});
|
||||
},
|
||||
_filterInspectionRouteData: function (_InspectionRoute) {
|
||||
_filterInspectionRouteData: function(_InspectionRoute) {
|
||||
var _tmpInspectionRoutes = [];
|
||||
for (var i = 0; i < _InspectionRoute.length; i++) {
|
||||
var _tmpInspectionRoute = {
|
||||
@ -111,4 +111,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user