mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-11 14:17:24 +08:00
巡检设置 提示人
This commit is contained in:
parent
f53f0a6dd8
commit
6a8fb134c1
@ -78,9 +78,10 @@
|
||||
$('#addInspectionItemModel').modal('hide');
|
||||
vc.component.clearAddInspectionItemInfo();
|
||||
vc.emit('inspectionItemManage', 'listInspectionItem', {});
|
||||
vc.toast('成功,请记得设置题目');
|
||||
return;
|
||||
}
|
||||
vc.message(_json.msg);
|
||||
vc.toast(_json.msg);
|
||||
|
||||
},
|
||||
function(errInfo, error) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
@ -20,24 +20,24 @@
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
vc.component._initAddInspectionPlanDateInfo();
|
||||
vc.getDict('inspection_plan', "inspection_plan_period", function (_data) {
|
||||
vc.getDict('inspection_plan', "inspection_plan_period", function(_data) {
|
||||
console.log("收到字典参数:" + _data);
|
||||
vc.component.addInspectionPlanInfo.inspectionPlanPeriods = _data;
|
||||
});
|
||||
vc.getDict('inspection_plan', "state", function (_data) {
|
||||
vc.getDict('inspection_plan', "state", function(_data) {
|
||||
vc.component.addInspectionPlanInfo.states = _data;
|
||||
});
|
||||
vc.getDict('inspection_plan', "sign_type", function (_data) {
|
||||
vc.getDict('inspection_plan', "sign_type", function(_data) {
|
||||
vc.component.addInspectionPlanInfo.signTypes = _data;
|
||||
});
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addInspectionPlan', 'openAddInspectionPlanModal', function () {
|
||||
_initEvent: function() {
|
||||
vc.on('addInspectionPlan', 'openAddInspectionPlanModal', function() {
|
||||
$('#addInspectionPlanModel').modal('show');
|
||||
});
|
||||
vc.on("addInspectionPlanInfo", "notify", function (_param) {
|
||||
vc.on("addInspectionPlanInfo", "notify", function(_param) {
|
||||
if (_param.hasOwnProperty("staffId")) {
|
||||
vc.component.addInspectionPlanInfo.staffId = _param.staffId;
|
||||
vc.component.addInspectionPlanInfo.staffName = _param.staffName;
|
||||
@ -53,8 +53,7 @@
|
||||
return vc.validate.validate({
|
||||
addInspectionPlanInfo: vc.component.addInspectionPlanInfo
|
||||
}, {
|
||||
'addInspectionPlanInfo.inspectionPlanName': [
|
||||
{
|
||||
'addInspectionPlanInfo.inspectionPlanName': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "计划名称不能为空"
|
||||
@ -65,15 +64,12 @@
|
||||
errInfo: "巡检计划名称不能超过100位"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.inspectionRouteId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "巡检路线不能为空"
|
||||
}
|
||||
],
|
||||
'addInspectionPlanInfo.inspectionPlanPeriod': [
|
||||
{
|
||||
'addInspectionPlanInfo.inspectionRouteId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "巡检路线不能为空"
|
||||
}],
|
||||
'addInspectionPlanInfo.inspectionPlanPeriod': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "执行周期不能为空"
|
||||
@ -84,8 +80,7 @@
|
||||
errInfo: "执行周期格式错误"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.startTime': [
|
||||
{
|
||||
'addInspectionPlanInfo.startTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "计划开始时间不能为空"
|
||||
@ -96,8 +91,7 @@
|
||||
errInfo: "计划开始时间不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.endTime': [
|
||||
{
|
||||
'addInspectionPlanInfo.endTime': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "计划结束时间不能为空"
|
||||
@ -108,8 +102,7 @@
|
||||
errInfo: "计划结束时间不是有效的时间格式"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.signType': [
|
||||
{
|
||||
'addInspectionPlanInfo.signType': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "签到方式不能为空"
|
||||
@ -120,8 +113,7 @@
|
||||
errInfo: "签到方式格式错误"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.state': [
|
||||
{
|
||||
'addInspectionPlanInfo.state': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "状态不能为空"
|
||||
@ -132,16 +124,14 @@
|
||||
errInfo: "签到方式格式错误"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.remark': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注信息不能超过200位"
|
||||
},
|
||||
],
|
||||
'addInspectionPlanInfo.remark': [{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注信息不能超过200位"
|
||||
}, ],
|
||||
});
|
||||
},
|
||||
_initAddInspectionPlanDateInfo: function () {
|
||||
_initAddInspectionPlanDateInfo: function() {
|
||||
$('.addInspectionPlanStartTime').datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
@ -152,7 +142,7 @@
|
||||
todayBtn: true
|
||||
});
|
||||
$('.addInspectionPlanStartTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
.on('changeDate', function(ev) {
|
||||
var value = $(".addInspectionPlanStartTime").val();
|
||||
vc.component.addInspectionPlanInfo.startTime = value;
|
||||
});
|
||||
@ -166,7 +156,7 @@
|
||||
todayBtn: true
|
||||
});
|
||||
$('.addInspectionPlanEndTime').datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
.on('changeDate', function(ev) {
|
||||
var value = $(".addInspectionPlanEndTime").val();
|
||||
vc.component.addInspectionPlanInfo.endTime = value;
|
||||
let start = Date.parse(new Date(vc.component.addInspectionPlanInfo.startTime))
|
||||
@ -189,7 +179,7 @@
|
||||
e.currentTarget.blur();
|
||||
}
|
||||
},
|
||||
saveInspectionPlanInfo: function () {
|
||||
saveInspectionPlanInfo: function() {
|
||||
if (!vc.component.addInspectionPlanValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
@ -204,27 +194,27 @@
|
||||
vc.http.post(
|
||||
'addInspectionPlan',
|
||||
'save',
|
||||
JSON.stringify(vc.component.addInspectionPlanInfo),
|
||||
{
|
||||
JSON.stringify(vc.component.addInspectionPlanInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
$('#addInspectionPlanModel').modal('hide');
|
||||
vc.component.clearAddInspectionPlanInfo();
|
||||
vc.emit('inspectionPlanManage', 'reload', {});
|
||||
vc.toast('成功,请记得设置巡检人')
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
},
|
||||
clearAddInspectionPlanInfo: function () {
|
||||
clearAddInspectionPlanInfo: function() {
|
||||
var states = vc.component.addInspectionPlanInfo.states;
|
||||
var inspectionPlanPeriods = vc.component.addInspectionPlanInfo.inspectionPlanPeriods;
|
||||
var signTypes = vc.component.addInspectionPlanInfo.signTypes;
|
||||
@ -243,11 +233,11 @@
|
||||
inspectionPlanPeriods: inspectionPlanPeriods
|
||||
};
|
||||
},
|
||||
cleanInspectionPlanAddModel: function () {
|
||||
cleanInspectionPlanAddModel: function() {
|
||||
vc.component.clearAddInspectionPlanInfo();
|
||||
//员工select2
|
||||
vc.emit('addInspectionPlan', 'inspectionRouteSelect2', 'clearInspectionRoute', {});
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
@ -70,14 +70,16 @@
|
||||
},
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
let _json = JSON.parse(json)
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addInspectionRouteModel').modal('hide');
|
||||
vc.component.clearAddInspectionRouteInfo();
|
||||
vc.emit('inspectionRouteManage', 'listInspectionRoute', {});
|
||||
vc.toast('成功,请记得设置巡检点')
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
vc.toast(_json.msg);
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user