16 changed files with 2067 additions and 467 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询企业信息管理列表
|
|||
export function listInfo(query) { |
|||
return request({ |
|||
url: '/build/enteInfo/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询企业信息管理详细
|
|||
export function getInfo(id) { |
|||
return request({ |
|||
url: '/build/enteInfo/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增企业信息管理
|
|||
export function addInfo(data) { |
|||
return request({ |
|||
url: '/build/enteInfo', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改企业信息管理
|
|||
export function updateInfo(data) { |
|||
return request({ |
|||
url: '/build/enteInfo', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除企业信息管理
|
|||
export function delInfo(id) { |
|||
return request({ |
|||
url: '/build/enteInfo/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出企业信息管理
|
|||
export function exportInfo(query) { |
|||
return request({ |
|||
url: '/build/enteInfo/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,62 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询监管检查和问题新增
|
|||
export function addNewInspections(query) { |
|||
return request({ |
|||
url: '/warn/inspections/new/add', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询监管检查列表
|
|||
export function listInspections(query) { |
|||
return request({ |
|||
url: '/warn/inspections/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询监管检查详细
|
|||
export function getInspections(id) { |
|||
return request({ |
|||
url: '/warn/inspections/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增监管检查
|
|||
export function addInspections(data) { |
|||
return request({ |
|||
url: '/warn/inspections', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改监管检查
|
|||
export function updateInspections(data) { |
|||
return request({ |
|||
url: '/warn/inspections', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除监管检查
|
|||
export function delInspections(id) { |
|||
return request({ |
|||
url: '/warn/inspections/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出监管检查
|
|||
export function exportInspections(query) { |
|||
return request({ |
|||
url: '/warn/inspections/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询整改通知书列表
|
|||
export function listRectification(query) { |
|||
return request({ |
|||
url: '/warn/rectification/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询整改通知书详细
|
|||
export function getRectification(id) { |
|||
return request({ |
|||
url: '/warn/rectification/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增整改通知书
|
|||
export function addRectification(data) { |
|||
return request({ |
|||
url: '/warn/rectification', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改整改通知书
|
|||
export function updateRectification(data) { |
|||
return request({ |
|||
url: '/warn/rectification', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除整改通知书
|
|||
export function delRectification(id) { |
|||
return request({ |
|||
url: '/warn/rectification/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出整改通知书
|
|||
export function exportRectification(query) { |
|||
return request({ |
|||
url: '/warn/rectification/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,421 @@ |
|||
<template> |
|||
<view> |
|||
<view class="cc-card cc-form-card"> |
|||
<view class="form-title">监督检查</view> |
|||
<view class="form-item"> |
|||
<text class="form-label">项目名称</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.projectName" class="form-input" placeholder="请选择项目名称" disabled/> |
|||
<picker mode="selector" :range="projectNames" @change="onProjectChange"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">检查类型</text> |
|||
<view class="form-content"> |
|||
<input v-model="showForm.checkType" class="form-input" placeholder="请选择检查类型" disabled/> |
|||
<picker mode="selector" :range="checkNameTypes" @change="onCheckTypeChange"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">检查时间</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.inspectionTime" class="form-input" placeholder="请选择检查时间" disabled/> |
|||
<picker mode="date" @change="onCheckTimeChange"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">检查单位</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.inspectionUnit" class="form-input" placeholder="请输入检查单位" /> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">被检查单位</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.inspectionPerson" class="form-input" placeholder="请输入被检查单位" /> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">组成成员</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.constituentMember" class="form-input" placeholder="请输入组成成员" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="cc-form-card" style="margin-top: 16px;"> |
|||
<view class="form-title"> |
|||
<view>检查通知</view> |
|||
<view class="form-tips">支持png、jpg、pdf、word等格式,不大于200M</view> |
|||
</view> |
|||
|
|||
<view class="form-item" style="margin-bottom: 0;"> |
|||
<uni-file-picker |
|||
:autoUpload="false" |
|||
file-mediatype="all" |
|||
file-extname="png,jpg,pdf,,doc,docx,xls,xlsx" |
|||
limit="10" |
|||
@select="handleSelectCheckFile" |
|||
@success="handleCheckFileSuccess" |
|||
></uni-file-picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="cc-form-card" style="margin-top: 16px;"> |
|||
<view class="form-title"> |
|||
<view>整改通知</view> |
|||
<view class="form-tips">支持png、jpg、pdf、word等格式,不大于200M</view> |
|||
</view> |
|||
|
|||
<view class="form-item" style="margin-bottom: 0;"> |
|||
<uni-file-picker limit="10" file-mediatype="all" file-extname="png,jpg,pdf,,doc,docx,xls,xlsx" @success="handleModifyFileSuccess"></uni-file-picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="cc-form-card" style="margin-top: 16px;"> |
|||
<view class="form-title"> |
|||
<view>整改回复</view> |
|||
<view class="form-tips">支持png、jpg、pdf、word等格式,不大于200M</view> |
|||
</view> |
|||
|
|||
<view class="form-item" style="margin-bottom: 0;"> |
|||
<uni-file-picker limit="10" file-mediatype="all" file-extname="png,jpg,pdf,,doc,docx,xls,xlsx" @success="handleReplyFileSuccess"></uni-file-picker> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getProjectListApi } from '@/api/system/project' |
|||
import { addNewInspections, getInspections, updateInspections } from '@/api/system/check/inspections' |
|||
import { addInspectionsDraft, getInspectionsDraft, updateInspectionsDraft } from '@/api/system/check/inspectionsDraft' |
|||
export default { |
|||
name: "MonitorAdd", |
|||
props: { |
|||
monitorDraftId: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
monitorId: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
form: { |
|||
"menuType": "0", |
|||
"inspectionTypes": null, |
|||
"inspectionTime": "", |
|||
"inspectionPerson": "", |
|||
"constituentMember": "", |
|||
"noticeAttachment": "", |
|||
"checklist": "", |
|||
"rectificationReport": null, |
|||
"createTime": null, |
|||
"updateTime": null, |
|||
"remark": null, |
|||
"createUid": null, |
|||
"updateUid": null, |
|||
"owerDept": null, |
|||
"proCode": "", |
|||
"proNo": "", |
|||
"projectName": "", |
|||
"checkType": "", |
|||
"inspectionUnit": "", |
|||
"rectificationDtoList": [] |
|||
}, |
|||
showForm: { |
|||
checkType: '' |
|||
}, |
|||
projectNames: [], |
|||
checkTypes: [], |
|||
checkNameTypes: [], |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
params: {orderBy: "create_time", sortBy: "desc"}, |
|||
data: { |
|||
projectName: '' |
|||
} |
|||
}, |
|||
projects: [], |
|||
projectNames: [] |
|||
} |
|||
}, |
|||
|
|||
created() { |
|||
console.log("88888888888888888888888") |
|||
console.log(this.monitorId) |
|||
|
|||
this.getProjectList() |
|||
this.getDicts("check_type").then((response) =>{ |
|||
this.checkTypes = response.data |
|||
this.checkNameTypes = this.checkTypes.map(item => item.dictLabel) |
|||
}) |
|||
if (this.monitorDraftId) { |
|||
getInspectionsDraft(this.draftId).then(res => { |
|||
this.form = res.data |
|||
this.showForm.checkType = this.checkTypeFormat(this.form.checkType) |
|||
}) |
|||
} else if (this.monitorId) { |
|||
getInspections(this.monitorId).then(res => { |
|||
this.form = res.data |
|||
this.showForm.checkType = this.checkTypeFormat(this.form.checkType) |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
// 获取项目列表 |
|||
getProjectList() { |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
getProjectListApi(this.queryParams).then(res => { |
|||
this.projects = res.records |
|||
this.projectNames = this.projects.map(item => item.projectName) |
|||
uni.hideLoading() |
|||
}) |
|||
}, |
|||
|
|||
// 处理选择项目 |
|||
onProjectChange(e) { |
|||
const index = e.detail.value |
|||
this.form.projectName = this.projects[index].projectName |
|||
this.form.proNo = this.projects[index].id |
|||
this.form.proCode = this.projects[index].proCode |
|||
this.$forceUpdate() |
|||
}, |
|||
|
|||
onCheckTypeChange(e) { |
|||
this.showForm.checkType = this.checkTypes[e.detail.value].dictLabel |
|||
this.form.checkType = this.checkTypes[e.detail.value].dictValue |
|||
}, |
|||
|
|||
onCheckTimeChange(e) { |
|||
this.form.inspectionTime = e.detail.value |
|||
}, |
|||
|
|||
//行政区划字典 |
|||
checkTypeFormat(checkType, column) { |
|||
return this.selectDictLabel( |
|||
this.checkTypes, |
|||
checkType |
|||
); |
|||
}, |
|||
|
|||
handleSelectCheckFile(e) { |
|||
const tempFiles = e.tempFiles |
|||
tempFiles.forEach(item => { |
|||
const reader = new FileReader() |
|||
reader.onload = (e) => { |
|||
const fileRaw = e.target.result |
|||
console.log(e.target.result) // 这里是文件的原始内容 |
|||
let formData = new FormData() |
|||
formData.append('file', fileRaw); |
|||
uploadFileData(formData).then(res => { |
|||
uni.showToast({ |
|||
title: `添加成功!`, |
|||
icon: 'none' |
|||
}) |
|||
}) |
|||
} |
|||
reader.readAsText(item.file) |
|||
// uni.readFile({ |
|||
// filePath: item, // 选择的文件路径 |
|||
// encoding: 'utf8', // 文件编码 |
|||
// success: (res) => { |
|||
// console.log('文件内容:', res.data); // 处理文件内容 |
|||
// }, |
|||
// fail: (err) => { |
|||
// console.error('读取文件失败:', err); |
|||
// } |
|||
// }); |
|||
}) |
|||
|
|||
// const tempFiles = e.tempFiles |
|||
// tempFiles.forEach(item => { |
|||
// uploadFileData({ file: item.file }).then(res => { |
|||
// console.log(res) |
|||
// }) |
|||
// }) |
|||
// console.log("1111111111") |
|||
// console.log(e) |
|||
}, |
|||
|
|||
// 判断必填项是否填写 |
|||
judgeAttrWrite() { |
|||
const form = this.form |
|||
if (!form.projectName) { |
|||
uni.showToast({ |
|||
title: `项目名称不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.checkType) { |
|||
uni.showToast({ |
|||
title: `检查类型不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.inspectionTime) { |
|||
uni.showToast({ |
|||
title: `检查时间不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.inspectionUnit) { |
|||
uni.showToast({ |
|||
title: `检查单位不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.inspectionPerson) { |
|||
uni.showToast({ |
|||
title: `被检查单位不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.constituentMember) { |
|||
uni.showToast({ |
|||
title: `组成成员不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
// if (!form.noticeAttachment) { |
|||
// uni.showToast({ |
|||
// title: `检查通知不能为空!`, |
|||
// icon: 'none' |
|||
// }) |
|||
// return false |
|||
// } |
|||
// if (!form.checklist) { |
|||
// uni.showToast({ |
|||
// title: `整改通知不能为空!`, |
|||
// icon: 'none' |
|||
// }) |
|||
// return false |
|||
// } |
|||
// if (!form.rectificationReport) { |
|||
// uni.showToast({ |
|||
// title: `整改回复不能为空!`, |
|||
// icon: 'none' |
|||
// }) |
|||
// return false |
|||
// } |
|||
return true |
|||
}, |
|||
|
|||
// 保存检查 |
|||
handleConfirm() { |
|||
if (!this.judgeAttrWrite()) { |
|||
return |
|||
} |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
console.log("88888888", this.form) |
|||
addNewInspections(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/list/index` |
|||
}); |
|||
}) |
|||
}, |
|||
|
|||
// 暂存功能 |
|||
handleConfirmDraft() { |
|||
if (!this.judgeAttrWrite()) { |
|||
return |
|||
} |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
console.log("88888888", this.form) |
|||
if (this.draftId) { |
|||
this.form.id = this.draftId |
|||
updateInspectionsDraft(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/list/index` |
|||
}); |
|||
}) |
|||
} else { |
|||
addInspectionsDraft(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/list/index` |
|||
}); |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
// 带问题列表的监督提交 |
|||
handleConfirmMonitor() { |
|||
if (this.monitorId) { |
|||
updateInspections(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/list/index` |
|||
}); |
|||
}) |
|||
} else { |
|||
addNewInspections(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/list/index` |
|||
}); |
|||
}) |
|||
} |
|||
|
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
</style> |
@ -0,0 +1,269 @@ |
|||
<template> |
|||
<view> |
|||
<view class="cc-form-card cc-card form-card"> |
|||
<view class="form-title">添加问题</view> |
|||
<view class="form-item"> |
|||
<text class="form-label">责任单位</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.responsibleUnit" class="form-input" placeholder="请选择责任单位" disabled/> |
|||
<picker mode="selector" :range="unitNameOptions" @change="onUnitNameChange"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">单位类型</text> |
|||
<view class="form-content"> |
|||
<input v-model="showForm.unitType" class="form-input" placeholder="请选择单位类型" disabled/> |
|||
<view class="uni-picker" style="position:relative"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">检查时间</text> |
|||
<view class="form-content"> |
|||
<input v-model="form.noticeBegainTime" class="form-input" placeholder="请选择检查时间" disabled/> |
|||
<picker mode="date" @change="handleDateChange"> |
|||
<view class="form-select"> |
|||
选择 |
|||
</view> |
|||
</picker> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="form-item"> |
|||
<text class="form-label">问题描述<text class="number-limit">{{countBuildContentNumber}}/300</text></text> |
|||
<view class="form-content"> |
|||
<textarea v-model="form.context" class="form-input" placeholder="请输入问题描述" rows="3" style="height: 51px;line-height: 17px;" maxlength="300"></textarea> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listInfo } from '@/api/system/check/enteInfo' |
|||
import { getRectification, addRectification, updateRectification } from '@/api/system/check/rectification' |
|||
export default { |
|||
props: { |
|||
inspectionId: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
problemId: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
form: { |
|||
// inspectionId: this.$route.query.inspectionId, |
|||
proNo: this.$route.query.proNo, |
|||
proCode: this.$route.query.proCode, |
|||
responsibleUnit: '', |
|||
responsibleUnitType: '', |
|||
noticeBegainTime: '', |
|||
context: '' |
|||
}, |
|||
showForm: { |
|||
unitType: '' |
|||
}, |
|||
projectTypes: ['请选择', '建筑', 'IT', '教育', '制造业'], // 可根据实际项目类型进行扩展 |
|||
proNo: this.$route.query.proNo, |
|||
proCode: this.$route.query.proCode, |
|||
projectName: this.$route.query.projectName, |
|||
unitData: {}, |
|||
unitOptions: [], |
|||
unitNameOptions: [], |
|||
unitTypeOptions: [ |
|||
{ |
|||
name: "设计单位", |
|||
value: "0", |
|||
}, |
|||
{ |
|||
name: "施工单位", |
|||
value: "1", |
|||
}, |
|||
{ |
|||
name: "监理单位", |
|||
value: "2", |
|||
}, |
|||
{ |
|||
name: "其他单位", |
|||
value: "3", |
|||
}, |
|||
{ |
|||
name: "项目法人", |
|||
value: "9", |
|||
}, |
|||
], |
|||
// 查询参数 |
|||
unitParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}, |
|||
menuType: this.$route.query.menuType |
|||
} |
|||
}, |
|||
|
|||
computed: { |
|||
countBuildContentNumber() { |
|||
return this.form.context.length |
|||
} |
|||
}, |
|||
|
|||
created() { |
|||
this.getUnit() |
|||
if (this.problemId) { |
|||
getRectification(this.problemId).then(res => { |
|||
this.form = res.data |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
getUnit() { |
|||
this.unitParams.data.proNo = this.proNo |
|||
this.unitParams.data.proCode = this.proCode |
|||
listInfo(this.unitParams).then((response) => { |
|||
this.unitData = response.data |
|||
if (response.data) { |
|||
this.unitOptions = response.data.enterpriseInfoList || [] |
|||
this.unitOptions.push({ |
|||
id: this.unitData.projectLegalPerson, |
|||
enterpriseName: this.unitData.projectLegalPerson, |
|||
enterpriseType: "9" |
|||
}) |
|||
if (this.menuType == "0") { |
|||
this.unitOptions=[] |
|||
this.unitOptions.unshift({ |
|||
id: this.unitData.projectLegalPerson, |
|||
enterpriseName: this.unitData.projectLegalPerson, |
|||
enterpriseType: "9", |
|||
}); |
|||
} |
|||
} |
|||
this.unitNameOptions = this.unitOptions.map(item => item.enterpriseName) |
|||
}); |
|||
}, |
|||
|
|||
// 处理责任单位 |
|||
onUnitNameChange(e) { |
|||
// this.form.region = e.detail.value; |
|||
const index = e.detail.value |
|||
this.form.responsibleUnit = this.unitOptions[index].enterpriseName |
|||
this.form.responsibleUnitType = this.unitOptions[index].enterpriseType |
|||
this.showForm.unitType = this.unitTypesFormat(this.form) |
|||
}, |
|||
|
|||
// 监督检查类型字典翻译 |
|||
unitTypesFormat(row, column) { |
|||
for (let i=0; i<this.unitTypeOptions.length; i++) { |
|||
if (row.responsibleUnitType == this.unitTypeOptions[i].value) { |
|||
return this.unitTypeOptions[i].name |
|||
} |
|||
} |
|||
}, |
|||
|
|||
handleDateChange(e) { |
|||
this.form.noticeBegainTime = e.detail.value |
|||
}, |
|||
|
|||
// 判断必填项是否填写 |
|||
judgeAttrWrite() { |
|||
const form = this.form |
|||
if (!form.responsibleUnit) { |
|||
uni.showToast({ |
|||
title: `责任单位不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.responsibleUnitType) { |
|||
uni.showToast({ |
|||
title: `单位类型不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.noticeBegainTime) { |
|||
uni.showToast({ |
|||
title: `检查时间不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
if (!form.context) { |
|||
uni.showToast({ |
|||
title: `问题描述不能为空!`, |
|||
icon: 'none' |
|||
}) |
|||
return false |
|||
} |
|||
return true |
|||
}, |
|||
|
|||
// 提交表单 |
|||
submitForm() { |
|||
if (!this.judgeAttrWrite()) { |
|||
return |
|||
} |
|||
uni.showLoading({ |
|||
title: '加载中...', |
|||
mask: true |
|||
}) |
|||
// 在这里处理表单提交的逻辑 |
|||
console.log("提交的表单数据:", this.form); |
|||
// 你可以进行数据校验,提交到后端等操作 |
|||
|
|||
if (this.problemId) { |
|||
this.form.id = this.problemId |
|||
updateRectification(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/problem/list?id=${this.proNo}&proCode=${this.proCode}&projectName=${this.projectName}` |
|||
}); |
|||
}) |
|||
} else { |
|||
addRectification(this.form).then(res => { |
|||
uni.showToast({ |
|||
title: `操作成功`, |
|||
icon: 'none' |
|||
}) |
|||
uni.navigateTo({ |
|||
url: `/pages/monitoring/problem/list?id=${this.proNo}&proCode=${this.proCode}&projectName=${this.projectName}` |
|||
}); |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
cancelForm() { |
|||
uni.navigateBack() |
|||
} |
|||
} |
|||
} |
|||
|
|||
</script> |
Loading…
Reference in new issue