Browse Source

feat: 堤防-巡查计划-编辑计划

feature-sy-v1.0.0
易浩轩 1 year ago
parent
commit
c439b7e4fc
  1. 118
      src/views/runManage/engineering/inspectionPlan/Dike.vue

118
src/views/runManage/engineering/inspectionPlan/Dike.vue

@ -1,14 +1,12 @@
<!-- 巡查计划管理-堤防 -->
<script>
import { getDictionaryList, postInspectionPlanlist, postInspectionPlan, putEmbankmentInspection, deleteEmbankmentInspection, postEmbankmentInspectionChecklist, getInspectionPlan, deleteInspectionPlan, postUserList } from '@/api/management'
import { getDictionaryList, postInspectionPlanlist, postInspectionPlan, putInspectionPlan, postEmbankmentInspectionChecklist, getInspectionPlan, deleteInspectionPlan, postUserList } from '@/api/management'
export default {
name: 'InspectionItems',
data() {
return {
searchInput: '',
dialogVisible: false,
ContentType: '',
loading: false,
patrolType: [], //
personnelList: [], //
examType: [], //
@ -58,19 +56,31 @@ export default {
//
editTableItem(row) {
getInspectionPlan(row.id).then((res) => {
console.log('🚀res🚀', res)
// select
res.data.otherConfig.selectUser.forEach(element => {
postUserList({
data: {
timeView: {
timeField: "create_time"
},
},
cv: {
name: "nickName",
type: "like",
value: element.nickName
},
pageSize: 100,
pageNum: 1
}).then((res) => {
this.personnelList.push(res.records[0])
})
});
this.ruleForm = res.data
this.ruleForm.type = res.data.type.toString()
this.dialogVisible = true
this.ruleForm.cycleType = res.data.cycleType.toString()
this.changePatrolType(res)
this.dialogVisible = true
})
// putEmbankmentInspection({ id: row.id }).then((res) => {
// console.log('🚀res🚀', res)
// this.ruleForm.name = res.data.name
// this.ruleForm.type = res.data.type
// this.dialogVisible = true
// console.log(this.examType);
// })
},
//
deleteTableItem(row) {
@ -80,21 +90,9 @@ export default {
this.getTableData()
})
},
//
addPatrolItem() {
this.ruleForm.items.push(
{
content: '',
parts: ['', '', '']
}
)
},
//
newInspectionItems() {
this.dialogVisible = true
getDictionaryList('xs_cycle_type').then((res) => {
this.patrolType = res.data
})
this.ruleForm = {
name: '',
type: '',
@ -102,11 +100,11 @@ export default {
frequency: '',
cycleType: '',
reminderTime: '',
selectUser: [],
operators: [],
otherConfig: {
week: '',
time: ''
time: '',
selectUser: [],
}
}
},
@ -115,7 +113,7 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
let user = []
this.ruleForm.selectUser.forEach(element => {
this.ruleForm.otherConfig.selectUser.forEach(element => {
let a = {
name: element.nickName,
uid: element.id
@ -124,11 +122,19 @@ export default {
});
console.log('🚀user🚀', user)
this.ruleForm.operators = user
postInspectionPlan(this.ruleForm).then((res) => {
console.log('🚀res🚀', res)
this.getTableData()
this.dialogVisible = false
})
if (this.ruleForm.id) {
putInspectionPlan(this.ruleForm).then((res) => {
console.log('🚀res🚀', res)
this.getTableData()
this.dialogVisible = false
})
} else {
postInspectionPlan(this.ruleForm).then((res) => {
console.log('🚀res🚀', res)
this.getTableData()
this.dialogVisible = false
})
}
} else {
console.log('校验不通过');
return false;
@ -161,7 +167,6 @@ export default {
},
//
searchUser(e) {
console.log(this.ruleForm.selectUser);
postUserList({
data: {
timeView: {
@ -181,7 +186,7 @@ export default {
console.log('🚀用户数据🚀', this.ruleForm.operators)
})
},
getTableData() {
getTableData(search) {
postInspectionPlanlist({
data: {
timeView: {
@ -190,7 +195,8 @@ export default {
},
cv: {
name: "name",
type: "like"
type: "like",
value: search
},
pageSize: this.pageData.pageSize,
pageNum: this.pageData.pageNum
@ -204,42 +210,18 @@ export default {
}
},
mounted() {
this.pageData.total = this.tableData.length
//
this.getTableData()
getDictionaryList('xs_classfy').then((res) => {
console.log('🚀检查类型🚀', res)
if (res.data && Array.isArray(res.data)) {
res.data.forEach(element => {
element.dictValue = element.dictValue
});
this.examType = res.data
console.log('🚀this.examType🚀', this.examType)
}
})
getDictionaryList('df_xs_c_classfy').then((res) => {
if (res.data && Array.isArray(res.data)) {
console.log('🚀res.data🚀', res.data)
}
})
//
postInspectionPlanlist({
data: {
timeView: {
timeField: "create_time"
}
},
cv: {
name: "name",
type: "like",
value: this.searchInput
},
pageSize: this.pageData.pageSize,
pageNum: this.pageData.pageNum
}).then((res) => {
if (res) {
this.tableData = res.records
this.pageData.total = res.total
}
console.log('🚀res1🚀', res)
getDictionaryList('xs_cycle_type').then((res) => {
this.patrolType = res.data
})
},
}
@ -254,11 +236,11 @@ export default {
<div class="top-search">
<span>计划名称</span>
<el-input class="search-input" v-model="searchInput" placeholder="请输入计划名称" />
<el-button class="search-btn" type="success">搜索</el-button>
<el-button class="search-btn" type="success" @click="getTableData(searchInput)">搜索</el-button>
</div>
<el-button class="search-btn" style=" margin-right: 16px;margin-bottom: 8px; float: right;" type="success"
@click="newInspectionItems()">添加</el-button>
<el-table class="table" :data="tableData" border>
<el-table class="table" height="650" :data="tableData" border>
<el-table-column type="index" align="center" label="序号" width="100">
</el-table-column>
<el-table-column prop="name" align="center" label="计划名称">
@ -332,13 +314,13 @@ export default {
<el-radio :label="7">星期日</el-radio>
</el-radio-group>
<el-time-picker v-if="ruleForm.cycleType != 2 && ruleForm.type == 0" v-model="ruleForm.reminderTime"
value-format="hh:mm:ss" placeholder="请选择时间点" />
value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择时间点" />
<el-date-picker v-if="ruleForm.cycleType == 2 || ruleForm.type != 0" v-model="ruleForm.reminderTime"
value-format="yyyy-MM-dd hh:mm:ss" type="datetime" placeholder="选择日期时间" />
</el-form-item>
<el-form-item label-width="120px" label="巡查人员" prop="operators">
<el-select v-model="ruleForm.selectUser" multiple filterable remote :remote-method="searchUser" value-key="id"
placeholder="请输入关键词搜索用户" prop="selectUser">
<el-select v-model="ruleForm.otherConfig.selectUser" multiple filterable remote :remote-method="searchUser"
value-key="id" placeholder="请输入关键词搜索用户" prop="selectUser">
<el-option v-for="item in personnelList" :key="item.id" :label="item.nickName" :value="item">
</el-option>
</el-select>

Loading…
Cancel
Save