检查登记 新问题 提示语 检查区域 触底加载
This commit is contained in:
parent
b97c69b499
commit
fb531d17ba
@ -92,7 +92,8 @@
|
||||
|
||||
<query-selector :multiple="selectorInfo.isMultiple" :show="selectorInfo.showPopup"
|
||||
:defaultChecked="selectorInfo.defaultChecked" :title="selectorInfo.title" :lists="selectorInfo.dataLists"
|
||||
@search="handleShowSheet" @select="handleSelected" @close="selectorInfo.showPopup=false" />
|
||||
@search="handleShowSheet" @select="handleSelected" @close="selectorInfo.showPopup=false"
|
||||
:total="selectorInfo.totalCount" />
|
||||
|
||||
<view class="bottom-button">
|
||||
<button type="primary" @click="FullCheckUpdate">提交</button>
|
||||
@ -117,8 +118,8 @@
|
||||
AddCheckRecord,
|
||||
CheckTypeOrderPaged,
|
||||
CheckTypeLevelOrderPaged,
|
||||
OrderPagedAreaMineType,
|
||||
CheckProjectOrderPaged,
|
||||
OrderPagedAreaMineType2,
|
||||
CheckProjectOrderPaged2,
|
||||
OrderPagedProjectCategory,
|
||||
OrderPagedSafeCheckDetail,
|
||||
OrderPagedSuitAll,
|
||||
@ -193,6 +194,7 @@
|
||||
},
|
||||
|
||||
selectorInfo: {
|
||||
totalCount: 0,
|
||||
showPopup: false,
|
||||
isMultiple: false,
|
||||
title: '隐患原因',
|
||||
@ -209,6 +211,12 @@
|
||||
showPopup: false,
|
||||
showDelModalIndex: undefined,
|
||||
rules: {
|
||||
'RiskAreaNAME': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
trigger: ['blur', 'change'],
|
||||
message: '请选择检查区域'
|
||||
},
|
||||
'CHECKOBJECT_DESCRIPTION': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
@ -217,7 +225,8 @@
|
||||
'CHECKCONTENT': {
|
||||
type: 'string',
|
||||
required: true,
|
||||
trigger: ['blur', 'change']
|
||||
trigger: ['blur', 'change'],
|
||||
message: '请填写检查内容'
|
||||
}
|
||||
},
|
||||
}
|
||||
@ -295,44 +304,70 @@
|
||||
const ele = this.$refs
|
||||
if (this.model.Nav_ListCheckDetail == null || this.model.Nav_ListCheckDetail.length < 1) {
|
||||
uni.$showErrorInfo('请新增检查信息后再提交');
|
||||
} else if (this.model.Nav_ListCheckDetail[0].DESCREPTION == '' || this.model.Nav_ListCheckDetail[0]
|
||||
.DEMAND == '') {
|
||||
uni.$showErrorInfo('请完善检查信息');
|
||||
} else {
|
||||
ele['wForm'].validate().then(res => {
|
||||
this.model.Nav_ListCheckDetail.forEach(e => {
|
||||
e.Nav_CheckProject = null;
|
||||
e.Nav_CheckProjectCategory = null
|
||||
if (e.Nav_ListCheckDetailReason != null && e.Nav_ListCheckDetailReason.length >
|
||||
0) {
|
||||
e.Nav_ListCheckDetailReason.forEach(ec => {
|
||||
ec.Nav_RiskReason = null
|
||||
})
|
||||
}
|
||||
})
|
||||
AddCheckRecord(this.model).then(res => {
|
||||
|
||||
uni.$showMsgFunc('操作成功!', () => {
|
||||
var linkToUrl = 'safeCheckSign?tableKey=' + this.tableKey +
|
||||
'&ID=' + this.model.ID + '&taskID=' + this.TaskID //Url 传参
|
||||
uni.navigateTo({
|
||||
url: linkToUrl
|
||||
})
|
||||
}, 'success', 1000)
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log('校验失败', err)
|
||||
})
|
||||
}
|
||||
// else if (this.model.Nav_ListCheckDetail[0].DESCREPTION == '' || this.model.Nav_ListCheckDetail[0]
|
||||
// .DEMAND == '') {
|
||||
// uni.$showErrorInfo('请完善检查信息');
|
||||
// }
|
||||
var isOK = true
|
||||
this.model.Nav_ListCheckDetail.forEach(e => {
|
||||
if (!e.Nav_CheckProject.NAME || e.Nav_CheckProject.NAME.length < 1) {
|
||||
uni.$showErrorInfo('请选择检查项目' + e.ROW_NO)
|
||||
isOK = false
|
||||
} else if (!e.DESCREPTION || e.DESCREPTION.length < 1) {
|
||||
uni.$showErrorInfo('请填写检查问题描述' + e.ROW_NO)
|
||||
isOK = false
|
||||
} else if (!e.DEMAND || e.DEMAND.length < 1) {
|
||||
uni.$showErrorInfo('请填写整改建议与措施' + e.ROW_NO)
|
||||
isOK = false
|
||||
} else if (!e.QUESTION_LEVEL_SHOW || e.QUESTION_LEVEL_SHOW.length < 1) {
|
||||
uni.$showErrorInfo('请选择问题等级' + e.ROW_NO)
|
||||
isOK = false
|
||||
} else if (!e.ADDRESS || e.ADDRESS.length < 1) {
|
||||
uni.$showErrorInfo('请填写隐患地点' + e.ROW_NO)
|
||||
isOK = false
|
||||
}
|
||||
})
|
||||
if (!isOK)
|
||||
return false
|
||||
ele['wForm'].validate().then(res => {
|
||||
this.model.Nav_ListCheckDetail.forEach(e => {
|
||||
e.Nav_CheckProject = null;
|
||||
e.Nav_CheckProjectCategory = null
|
||||
if (e.Nav_ListCheckDetailReason != null && e.Nav_ListCheckDetailReason.length >
|
||||
0) {
|
||||
e.Nav_ListCheckDetailReason.forEach(ec => {
|
||||
ec.Nav_RiskReason = null
|
||||
})
|
||||
}
|
||||
})
|
||||
AddCheckRecord(this.model).then(res => {
|
||||
|
||||
uni.$showMsgFunc('操作成功!', () => {
|
||||
var linkToUrl = 'safeCheckSign?tableKey=' + this.tableKey +
|
||||
'&ID=' + this.model.ID + '&taskID=' + this.TaskID //Url 传参
|
||||
uni.navigateTo({
|
||||
url: linkToUrl
|
||||
})
|
||||
}, 'success', 1000)
|
||||
})
|
||||
}).catch(err => {
|
||||
if (err.length > 0) {
|
||||
uni.$showErrorInfo(err[0].message)
|
||||
} else {
|
||||
uni.$showErrorInfo('校验失败!')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 下拉数据加载
|
||||
async handleShowSheet(p) {
|
||||
async handleShowSheet(p, pageIndex) {
|
||||
if (p.name == undefined) {
|
||||
// 搜索
|
||||
var val = p
|
||||
p = this.selectorInfo
|
||||
p.val = val
|
||||
p.pageIndex = pageIndex
|
||||
}
|
||||
|
||||
const orgId = uni.getStorageSync('orgId')
|
||||
@ -345,6 +380,11 @@
|
||||
if (p.val) {
|
||||
extendRule(json, 'NAME', 9, p.val);
|
||||
}
|
||||
json.Limit = 20
|
||||
if (p.pageIndex) {
|
||||
json.Start = (p.pageIndex - 1) * json.Limit;
|
||||
json.PageIndex = p.pageIndex
|
||||
}
|
||||
// this.selectorInfo.isMultiple = true
|
||||
json.FilterGroup.Groups.push({
|
||||
'IsAnd': false,
|
||||
@ -356,14 +396,15 @@
|
||||
})
|
||||
json.Sort = 'NAME'
|
||||
// extendRule(json, 'CHECKOBJECT', 1, this.model.CHECKOBJECT);
|
||||
dataSelect = await OrderPagedAreaMineType(json).then(res => {
|
||||
if (res != undefined && res.length > 0) {
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
res[i].name = res[i].NAME
|
||||
dataSelect = await OrderPagedAreaMineType2(json).then(res => {
|
||||
this.selectorInfo.totalCount = res.TotalCount
|
||||
if (res != undefined && res.Data.length > 0) {
|
||||
for (let i = 0; i < res.Data.length; i++) {
|
||||
res.Data[i].name = res.Data[i].NAME
|
||||
// res[i].code = res[i].CODE
|
||||
}
|
||||
}
|
||||
return res
|
||||
return res.Data
|
||||
})
|
||||
} else if (p.name == 'CheckProjectNAME') {
|
||||
this.selectorInfo.isMultiple = false
|
||||
@ -372,14 +413,20 @@
|
||||
if (p.val) {
|
||||
extendRule(json, 'NAME', 9, p.val);
|
||||
}
|
||||
dataSelect = await CheckProjectOrderPaged(json).then(res => {
|
||||
if (res != undefined && res.length > 0) {
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
res[i].name = res[i].NAME,
|
||||
res[i].code = res[i].CODE
|
||||
json.Limit = 20
|
||||
if (p.pageIndex) {
|
||||
json.Start = (p.pageIndex - 1) * json.Limit;
|
||||
json.PageIndex = p.pageIndex
|
||||
}
|
||||
dataSelect = await CheckProjectOrderPaged2(json).then(res => {
|
||||
this.selectorInfo.totalCount = res.TotalCount
|
||||
if (res != undefined && res.Data.length > 0) {
|
||||
for (let i = 0; i < res.Data.length; i++) {
|
||||
res.Data[i].name = res.Data[i].NAME
|
||||
res.Data[i].code = res.Data[i].CODE
|
||||
}
|
||||
}
|
||||
return res
|
||||
return res.Data
|
||||
})
|
||||
} else if (p.name == 'CheckProjectCategoryNAME') {
|
||||
if (this.model.CHECKOBJECT == null || this.model.CHECKOBJECT.length < 1) {
|
||||
@ -431,6 +478,7 @@
|
||||
defaultChecked = []
|
||||
if (dataSelect.length) {
|
||||
this.selectorInfo = {
|
||||
totalCount: this.selectorInfo.totalCount,
|
||||
itemData: p.itemData,
|
||||
isMultiple: this.selectorInfo.isMultiple,
|
||||
showPopup: true,
|
||||
|
||||
@ -235,6 +235,17 @@ export function OrderPagedAreaMineType(params) {
|
||||
})
|
||||
})
|
||||
}
|
||||
export function OrderPagedAreaMineType2(params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.post("/BS/BSSafeCheck/OrderPagedAreaMineType", params).then((result) => {
|
||||
if (result.IsSuccessful) {
|
||||
resolve(result);
|
||||
}
|
||||
}).catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//获取检查项目
|
||||
export function CheckProjectOrderPaged(params) {
|
||||
@ -248,6 +259,17 @@ export function CheckProjectOrderPaged(params) {
|
||||
})
|
||||
})
|
||||
}
|
||||
export function CheckProjectOrderPaged2(params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.post("/BS/BSCheckProject/OrderPagedSTATUS", params).then((result) => {
|
||||
if (result.IsSuccessful) {
|
||||
resolve(result);
|
||||
}
|
||||
}).catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//获取检查项目分类
|
||||
export function OrderPagedProjectCategory(params) {
|
||||
@ -291,7 +313,7 @@ export function OrderPagedSuitAll(params) {
|
||||
//检查任务制定 获取检查依据
|
||||
export function LawOrderPaged(params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.post("/SC/StandardCreate/OrderPaged", params).then((result) => {///LR/Law/OrderPaged
|
||||
request.post("/SC/StandardCreate/OrderPaged", params).then((result) => { ///LR/Law/OrderPaged
|
||||
if (result.IsSuccessful) {
|
||||
resolve(result.Data);
|
||||
}
|
||||
@ -325,4 +347,4 @@ export function AddCheckRecord(params) {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user