fix: BUG修改
This commit is contained in:
parent
4e732e78bf
commit
402c7c7b8b
@ -134,7 +134,7 @@
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择违章人员" prop="workerInfoList" v-if="addEditForm.handleResult != 2">
|
||||
<el-select :disabled="isDetail" multiple v-model="selectList" placeholder="请选择" clearable @change="dutySelectChange">
|
||||
<el-select :disabled="isDetail" filterable multiple v-model="selectList" placeholder="请选择" clearable @change="dutySelectChange">
|
||||
<el-option v-for="(item, index) in workerListOptions" :key="index" :label="item.workerName" :value="item.id"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -25,16 +25,16 @@
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
align="center"
|
||||
|
||||
prop="regionCode"
|
||||
:label="$t('message.quality.unit')"
|
||||
prop="enterpriseName"
|
||||
label="整改单位"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
|
||||
prop="dutyName"
|
||||
prop="dutyUserName"
|
||||
:label="$t('message.quality.rectificationPeople')"
|
||||
>
|
||||
</el-table-column>
|
||||
@ -94,13 +94,13 @@
|
||||
]"
|
||||
>
|
||||
<el-input
|
||||
placeholder="请输入区域名称"
|
||||
placeholder="请输入区域名称"
|
||||
v-model="form.regionName"
|
||||
:disabled="dialogType == 2"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- 责任单位 start -->
|
||||
<el-form-item :label="$t('message.quality.personWork')">
|
||||
<!-- 整改单位 -->
|
||||
<el-form-item label="整改单位">
|
||||
<el-select
|
||||
v-model="form.dutyId"
|
||||
filterable
|
||||
@ -117,18 +117,15 @@
|
||||
:label="item.enterpriseName"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="float: left">{{ item.enterpriseName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 责任单位 end -->
|
||||
<!-- 责任人 start -->
|
||||
<el-form-item :label="$t('message.quality.personLiable')">
|
||||
<!-- 整改人 start -->
|
||||
<el-form-item label="整改人">
|
||||
<el-select
|
||||
v-model="form.personId"
|
||||
filterable
|
||||
multiple
|
||||
@change="changeDutyId"
|
||||
:placeholder="$t('message.quality.pleaseSelect')"
|
||||
style="width: 100%"
|
||||
prop="personId"
|
||||
@ -137,10 +134,9 @@
|
||||
<el-option
|
||||
v-for="item in notifierOrPeopleList"
|
||||
:key="item.userId"
|
||||
:label="item.notifierOrPeopleList"
|
||||
:label="item.realName"
|
||||
:value="item.userId"
|
||||
>
|
||||
<span style="float: left">{{ item.realName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -243,7 +239,7 @@ export default {
|
||||
form: {
|
||||
regionName: '',
|
||||
dutyId: '',
|
||||
personId: [],
|
||||
personId: null,
|
||||
intendanceIds: [],
|
||||
intendanceNames: '',
|
||||
remark: '',
|
||||
@ -255,6 +251,7 @@ export default {
|
||||
created() {
|
||||
this.projectSn = this.$store.state.projectSn
|
||||
this.getQualityRegionList()
|
||||
this.getUpdateUnitListFn();
|
||||
},
|
||||
methods: {
|
||||
// 获取列表信息
|
||||
@ -282,15 +279,10 @@ export default {
|
||||
this.editDialog = true
|
||||
this.title ='新增区域'
|
||||
this.dialogType = 1
|
||||
this.getNotifierOrPeopleList()
|
||||
},
|
||||
//切换 整改人
|
||||
changeDutyId(value) {
|
||||
for (let i = 0; i < this.notifierOrPeopleList.length; i++) {
|
||||
if (value == this.notifierOrPeopleList[i].userId) {
|
||||
this.form.dutyName = this.notifierOrPeopleList[i].workerName
|
||||
}
|
||||
}
|
||||
this.getUpdatePersonListFn();
|
||||
},
|
||||
//切换 通知人
|
||||
changeIntendanceIds(value) {
|
||||
@ -315,12 +307,20 @@ export default {
|
||||
}
|
||||
console.log('编辑',value)
|
||||
this.form.regionName = value.regionName
|
||||
this.form.dutyId = value.dutyId ? value.dutyId : ''
|
||||
if(value.enterpriseInfos && value.enterpriseInfos.length > 0){
|
||||
this.form.dutyId = value.enterpriseInfos.map(item => {
|
||||
return item.id
|
||||
})
|
||||
}
|
||||
if(value.systemUsers && value.systemUsers.length > 0){
|
||||
this.form.personId = value.systemUsers.map(item => {
|
||||
return item.userId
|
||||
})
|
||||
}
|
||||
this.form.remark = value.remark
|
||||
this.form.id = value.id
|
||||
this.title = '编辑区域'
|
||||
this.dialogType = 2
|
||||
this.getNotifierOrPeopleList()
|
||||
this.editDialog = true
|
||||
},
|
||||
//新增下级---按钮
|
||||
@ -338,23 +338,9 @@ export default {
|
||||
this.editDialog = true
|
||||
this.title = this.$t('message.quality.newJunior')
|
||||
this.dialogType = 3
|
||||
this.getNotifierOrPeopleList()
|
||||
},
|
||||
|
||||
//获取 整改人 通知人下拉列表
|
||||
getNotifierOrPeopleList() {
|
||||
let data = {
|
||||
projectSn: this.projectSn,
|
||||
enterpriseId: this.enterpriseId
|
||||
}
|
||||
getProjectChilderSystemUserListApi(data).then((res) => {
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
console.log('------整改人', res)
|
||||
console.log('------form', this.form)
|
||||
this.notifierOrPeopleList = res.result
|
||||
}
|
||||
})
|
||||
// 获取整改单位列表
|
||||
getUpdateUnitListFn(){
|
||||
getEnterpriseInfoListApi({projectSn: this.projectSn}).then(res=>{
|
||||
console.log(res);
|
||||
if(res.code==200){
|
||||
@ -362,12 +348,45 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取整改人列表
|
||||
getUpdatePersonListFn(){
|
||||
let data = {
|
||||
projectSn: this.projectSn,
|
||||
enterpriseId: this.form.dutyId?this.form.dutyId.join(','):""
|
||||
}
|
||||
getProjectChilderSystemUserListApi(data).then((res) => {
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
this.notifierOrPeopleList = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// //获取 整改人 通知人下拉列表
|
||||
// getNotifierOrPeopleList() {
|
||||
// let data = {
|
||||
// projectSn: this.projectSn,
|
||||
// enterpriseId: this.enterpriseId
|
||||
// }
|
||||
// getProjectChilderSystemUserListApi(data).then((res) => {
|
||||
// console.log(res);
|
||||
// if (res.code == 200) {
|
||||
// console.log('------整改人', res)
|
||||
// console.log('------form', this.form)
|
||||
// this.notifierOrPeopleList = res.result
|
||||
// }
|
||||
// })
|
||||
// getEnterpriseInfoListApi({projectSn: this.projectSn}).then(res=>{
|
||||
// console.log(res);
|
||||
// if(res.code==200){
|
||||
// this.enterpriseInfoList = res.result
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
//弹窗---保存按钮
|
||||
submit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let data = {
|
||||
dutyId: this.form.dutyId,
|
||||
dutyName: this.form.dutyName,
|
||||
// intendanceIds: this.form.intendanceIds.join(','),
|
||||
intendanceNames: this.form.intendanceNames,
|
||||
@ -376,6 +395,16 @@ export default {
|
||||
projectSn: this.projectSn,
|
||||
parentRegion: this.form.parentRegion
|
||||
}
|
||||
if(this.form.dutyId && this.form.dutyId.length > 0){
|
||||
data.enterpriseInfos = this.form.dutyId.map(item => {
|
||||
return {id: item}
|
||||
})
|
||||
}
|
||||
if(this.form.personId && this.form.personId.length > 0){
|
||||
data.systemUsers = this.form.personId.map(item => {
|
||||
return {userId: item}
|
||||
})
|
||||
}
|
||||
if (this.dialogType == 1) {
|
||||
addQualityRegionApi(data).then((res) => {
|
||||
// console.log(res);
|
||||
|
||||
@ -635,7 +635,7 @@
|
||||
prop="inspectTime"
|
||||
>
|
||||
<el-date-picker
|
||||
:disabled="type == 'detail'"
|
||||
:disabled="true"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 400px"
|
||||
v-model="addForm1.inspectTime"
|
||||
@ -742,7 +742,7 @@
|
||||
prop="verifyManId"
|
||||
>
|
||||
<el-select
|
||||
:disabled="type == 'detail'"
|
||||
:disabled="true"
|
||||
v-model="addForm1.verifyManId"
|
||||
filterable
|
||||
style="width: 400px"
|
||||
@ -1101,7 +1101,7 @@
|
||||
prop="inspectTime"
|
||||
>
|
||||
<el-date-picker
|
||||
:disabled="type == 'detail'"
|
||||
:disabled="true"
|
||||
style="width: 400px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="addForm2.inspectTime"
|
||||
@ -1949,7 +1949,7 @@ import { VueCropper } from 'vue-cropper'
|
||||
import {
|
||||
getSubdivisionProjectApi //所有分部分项工程, 以父子节点形式呈现
|
||||
} from '@/assets/js/api/quality'
|
||||
|
||||
import moment from 'moment'
|
||||
var VUE = null
|
||||
export default {
|
||||
components: {
|
||||
@ -2389,6 +2389,7 @@ export default {
|
||||
let pathLabels =
|
||||
this.$refs['formRegion1'].getCheckedNodes()[0].pathLabels
|
||||
let data = this.$refs['formRegion1'].getCheckedNodes()[0].data
|
||||
console.log(data,666)
|
||||
// console.log(pathLabels,data)
|
||||
let text = ''
|
||||
for (let i = 0; i < pathLabels.length; i++) {
|
||||
@ -2407,7 +2408,7 @@ export default {
|
||||
this.addForm1.regionName = text
|
||||
// console.log(data.intendanceIds.split(','))
|
||||
// console.log(text)
|
||||
if (data.intendanceIds.split(',') > 0) {
|
||||
if (data.intendanceIds && data.intendanceIds.split(',') > 0) {
|
||||
for (let j = 0; j < data.intendanceIds.split(',').length; j++) {
|
||||
if (this.addForm1.notifyPerson > 0) {
|
||||
this.addForm1.notifyPerson = []
|
||||
@ -2421,6 +2422,8 @@ export default {
|
||||
console.log(' this.addForm1.notifyPerson================', this.addForm1.notifyPerson);
|
||||
this.subcontractList = data.enterpriseInfos;
|
||||
this.crewUpdateList = data.systemUsers;
|
||||
console.log(this.subcontractList,777)
|
||||
console.log(this.crewUpdateList,888)
|
||||
} else if (this.recordType == 2) {
|
||||
let pathLabels =
|
||||
this.$refs['addFormRegion2'].getCheckedNodes()[0].pathLabels
|
||||
@ -2607,6 +2610,20 @@ export default {
|
||||
|
||||
this.fileList3 = []
|
||||
}
|
||||
let date = new Date()
|
||||
let nowDate = moment(date).format('YYYY-MM-DD HH:mm:ss')
|
||||
this.addForm1.inspectTime = nowDate
|
||||
this.addForm2.inspectTime = nowDate
|
||||
// 默认选择核验人逻辑
|
||||
let index = this.crewList.findIndex(item => {
|
||||
return item.userId == this.$store.state.userInfo.userId
|
||||
})
|
||||
if(index != -1){
|
||||
this.addForm1.verifyManId = this.$store.state.userInfo.userId
|
||||
} else {
|
||||
this.addForm1.verifyManId = this.$store.state.userInfo.realName
|
||||
}
|
||||
// 逻辑结束
|
||||
this.addDialog = true
|
||||
this.getPositionList()
|
||||
this.getDescribeClassifyList()
|
||||
@ -2750,23 +2767,25 @@ export default {
|
||||
this.addForm1.remark = ''
|
||||
}
|
||||
},
|
||||
|
||||
// 获取分包单位
|
||||
getDivisionUnitFn(){
|
||||
let data = {
|
||||
// enterpriseTypeId: this.subcontractType,
|
||||
pageNo: 1,
|
||||
pageSize: 999,
|
||||
projectSn: this.projectSn
|
||||
}
|
||||
getSubcontractListApi(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.subcontractList = res.result.records
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取分包单位
|
||||
getEnterprise(type) {
|
||||
if (type != 1) {
|
||||
this.showEnterpriseDialog = true
|
||||
}
|
||||
// let data = {
|
||||
// // enterpriseTypeId: this.subcontractType,
|
||||
// pageNo: 1,
|
||||
// pageSize: 999,
|
||||
// projectSn: this.projectSn
|
||||
// }
|
||||
// getSubcontractListApi(data).then((res) => {
|
||||
// if (res.code == 200) {
|
||||
// this.subcontractList = res.result.records
|
||||
// }
|
||||
// })
|
||||
},
|
||||
//切换分包公司类型
|
||||
changeSubcontractType(val) {
|
||||
@ -3070,6 +3089,9 @@ export default {
|
||||
data.notifyPerson = this.addForm1.notifyPerson.join(',')
|
||||
data.imageUrl = imgUrl.join(',')
|
||||
data.fileUrl = fileUrl.join(',')
|
||||
if(data.verifyManId == this.$store.state.userInfo.realName){
|
||||
data.verifyManId = this.$store.state.userInfo.userId
|
||||
}
|
||||
} else {
|
||||
data = JSON.parse(JSON.stringify(this.addForm2))
|
||||
data.regionId =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user