|
|
@@ -51,7 +51,7 @@
|
|
|
<el-form-item prop="TestDepartId" label="受检单位" :rules="{ required: true, message: '受检单位不能为空!'}">
|
|
|
<el-select ref="selectTestDepart" v-model="formData.TestDepartId" filterable placeholder="请选择" style="width: 100%" @change="TestDepartChange"
|
|
|
:filter-method="TestDepartFilter" :disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3">
|
|
|
- <el-option v-for="item in TestDepartOptions" :key="item.Id" :label="item.PositionName" :value="item.Id">
|
|
|
+ <el-option v-for="item in TestDepartOptions" :key="item.Id" :label="item.Fullname" :value="item.Id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -59,23 +59,23 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="PositionCheckId" label="检测地点" :rules="{ required: true, message: '检测地点不能为空!'}">
|
|
|
<el-select ref="selectPositionCheck" v-model="formData.PositionCheckId" filterable placeholder="请选择"
|
|
|
- style="width: 70%" @change="changePositionCheck" :filter-method="positionCheckFilter"
|
|
|
+ style="width: 100%" @change="changePositionCheck" :filter-method="positionCheckFilter"
|
|
|
:disabled="DataStatus != 0 && DataStatus != 5&& DataStatus!=3">
|
|
|
<el-option v-for="item in PositionCheckOptions" :key="item.Id" :label="item.PositionName" :value="item.Id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <template>
|
|
|
- <el-popover
|
|
|
- placement="left"
|
|
|
- title="添加检测地点"
|
|
|
- width="200"
|
|
|
- trigger="click">
|
|
|
- <el-input ref="inputPositionCheck" v-model="PositionCheck" size="small" style="width: 70%"></el-input>
|
|
|
- <el-button size="small" style="width: 30%; text-align: center" @click="addPositionCheck">保存</el-button>
|
|
|
- <el-button slot="reference" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3"><i class="el-icon-plus"></i>
|
|
|
- </el-button>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
+ <!--<template>-->
|
|
|
+ <!--<el-popover-->
|
|
|
+ <!--placement="left"-->
|
|
|
+ <!--title="添加检测地点"-->
|
|
|
+ <!--width="200"-->
|
|
|
+ <!--trigger="click">-->
|
|
|
+ <!--<el-input ref="inputPositionCheck" v-model="PositionCheck" size="small" style="width: 70%"></el-input>-->
|
|
|
+ <!--<el-button size="small" style="width: 30%; text-align: center" @click="addPositionCheck">保存</el-button>-->
|
|
|
+ <!--<el-button slot="reference" :disabled="DataStatus != 0 && DataStatus != 5 && DataStatus != 3"><i class="el-icon-plus"></i>-->
|
|
|
+ <!--</el-button>-->
|
|
|
+ <!--</el-popover>-->
|
|
|
+ <!--</template>-->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -604,10 +604,10 @@
|
|
|
if (valid) {
|
|
|
this.formData.Instrument1 = this.CGRMeterOptions.join(',')
|
|
|
this.formData.Instrument2 = this.GRMeterOptions.join(',')
|
|
|
- /*if (this.formData.Instrument1 === '' || this.formData.Instrument2 === '') {
|
|
|
+ /* if (this.formData.Instrument1 === '' || this.formData.Instrument2 === '') {
|
|
|
this.$message.warning('检测依据不能为空!')
|
|
|
return
|
|
|
- }*/
|
|
|
+ } */
|
|
|
this.formData.PositionCheckId = parseInt(this.formData.PositionCheckId)
|
|
|
this.formData.TestDepartId = parseInt(this.formData.TestDepartId)
|
|
|
this.formData.TestDepart = this.$refs.selectTestDepart.selectedLabel + ''
|
|
|
@@ -840,8 +840,6 @@
|
|
|
this.GRMeterOptions = res.data.Instrument2.split(',')
|
|
|
if (res.data.TestDepartId === 0) {
|
|
|
this.formData.TestDepartId = ''
|
|
|
- } else {
|
|
|
- this.setPositionCheckOptions(res.data.TestDepartId)
|
|
|
}
|
|
|
if (res.data.PositionCheckId === 0) {
|
|
|
this.formData.PositionCheckId = ''
|
|
|
@@ -890,56 +888,74 @@
|
|
|
},
|
|
|
// 更改受检单位触发检测地点和分布区域的改变
|
|
|
TestDepartChange (Id) {
|
|
|
- // 更新检测地点
|
|
|
+ console.log(Id)
|
|
|
this.PositionCheckOptions = []
|
|
|
- this.PositionCheckOptionsBackUp = []
|
|
|
- this.formData.PositionCheckId = ''
|
|
|
- for (let j = 0; j < this.AllGradeInfo.length; j++) {
|
|
|
- if (this.AllGradeInfo[j].ParentId === Id) {
|
|
|
- this.PositionCheckOptionsBackUp.push(this.AllGradeInfo[j])
|
|
|
+ for (let j = 0; j < this.PositionCheckOptionsBackUp.length; j++) {
|
|
|
+ if (this.PositionCheckOptionsBackUp[j].ThrUnitId === Id) {
|
|
|
+ this.PositionCheckOptions.push(this.PositionCheckOptionsBackUp[j])
|
|
|
}
|
|
|
}
|
|
|
- Object.assign(this.PositionCheckOptions, this.PositionCheckOptionsBackUp)
|
|
|
- // 检测地点、安装地点 都默认为第一个
|
|
|
- if (this.PositionCheckOptions.length > 0) {
|
|
|
- this.formData.PositionCheckId = this.PositionCheckOptions[0].Id
|
|
|
- }
|
|
|
- this.TestDepartOptions = this.TestDepartOptionsBackUp
|
|
|
+ console.log(this.PositionCheckOptionsBackUp, 'this.PositionCheckOptionsBackUp==')
|
|
|
+ console.log(this.PositionCheckOptions, 'this.PositionCheckOptions==')
|
|
|
+ // ===========lnd
|
|
|
+ // // 更新检测地点
|
|
|
+ // this.PositionCheckOptions = []
|
|
|
+ // this.PositionCheckOptionsBackUp = []
|
|
|
+ // this.formData.PositionCheckId = ''
|
|
|
+ // for (let j = 0; j < this.AllGradeInfo.length; j++) {
|
|
|
+ // if (this.AllGradeInfo[j].ParentId === Id) {
|
|
|
+ // this.PositionCheckOptionsBackUp.push(this.AllGradeInfo[j])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Object.assign(this.PositionCheckOptions, this.PositionCheckOptionsBackUp)
|
|
|
+ // // 检测地点、安装地点 都默认为第一个
|
|
|
+ // if (this.PositionCheckOptions.length > 0) {
|
|
|
+ // this.formData.PositionCheckId = this.PositionCheckOptions[0].Id
|
|
|
+ // }
|
|
|
+ // this.TestDepartOptions = this.TestDepartOptionsBackUp
|
|
|
+ // ===========lnd
|
|
|
},
|
|
|
// 根据委托单位Id获取所有级联信息
|
|
|
getAllGrade (customerId) {
|
|
|
this.$axios.get('/limsreportelecground/allgradeinfo/' + customerId).then(res => {
|
|
|
- this.AllGradeInfo = res.data.items['AllGradeInfo']
|
|
|
- this.TestDepartOptions = []
|
|
|
- this.TestDepartOptionsBackUp = []
|
|
|
- if (!this.formData.TestDepartId) {
|
|
|
- this.formData.TestDepartId = ''
|
|
|
- }
|
|
|
- if (!this.formData.PositionCheckId) {
|
|
|
- this.formData.PositionCheckId = ''
|
|
|
- }
|
|
|
- this.PositionCheckOptions = []
|
|
|
- if (this.AllGradeInfo === null) {
|
|
|
- return
|
|
|
- }
|
|
|
- // 受检单位
|
|
|
- for (let i = 0; i < this.AllGradeInfo.length; i++) {
|
|
|
- if (this.AllGradeInfo[i].ParentId === 0) {
|
|
|
- this.TestDepartOptionsBackUp.push(this.AllGradeInfo[i])
|
|
|
- }
|
|
|
- }
|
|
|
- Object.assign(this.TestDepartOptions, this.TestDepartOptionsBackUp)
|
|
|
- // 检测地点
|
|
|
- if (this.TestDepartOptions.length > 0) {
|
|
|
- for (let i = 0; i < this.TestDepartOptions.length; i++) {
|
|
|
- for (let j = 0; j < this.AllGradeInfo.length; j++) {
|
|
|
- if (this.AllGradeInfo[j].ParentId === this.TestDepartOptions[i].Id) {
|
|
|
- this.PositionCheckOptionsBackUp.push(this.AllGradeInfo[j])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Object.assign(this.PositionCheckOptions, this.PositionCheckOptionsBackUp)
|
|
|
+ console.log(res.data)
|
|
|
+ this.TestDepartOptions = res.data.items['ThiUnits']
|
|
|
+ this.PositionCheckOptions = res.data.items['PositionCheck']
|
|
|
+ Object.assign(this.PositionCheckOptionsBackUp, this.PositionCheckOptions)
|
|
|
+ console.log(this.PositionCheckOptionsBackUp, 'this.PositionCheckOptionsBackUp')
|
|
|
+ // ========ln
|
|
|
+ // this.AllGradeInfo = res.data.items['AllGradeInfo']
|
|
|
+ // this.TestDepartOptions = []
|
|
|
+ // this.TestDepartOptionsBackUp = []
|
|
|
+ // if (!this.formData.TestDepartId) {
|
|
|
+ // this.formData.TestDepartId = ''
|
|
|
+ // }
|
|
|
+ // if (!this.formData.PositionCheckId) {
|
|
|
+ // this.formData.PositionCheckId = ''
|
|
|
+ // }
|
|
|
+ // this.PositionCheckOptions = []
|
|
|
+ // if (this.AllGradeInfo === null) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // // 受检单位
|
|
|
+ // for (let i = 0; i < this.AllGradeInfo.length; i++) {
|
|
|
+ // if (this.AllGradeInfo[i].ParentId === 0) {
|
|
|
+ // this.TestDepartOptionsBackUp.push(this.AllGradeInfo[i])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Object.assign(this.TestDepartOptions, this.TestDepartOptionsBackUp)
|
|
|
+ // // 检测地点
|
|
|
+ // if (this.TestDepartOptions.length > 0) {
|
|
|
+ // for (let i = 0; i < this.TestDepartOptions.length; i++) {
|
|
|
+ // for (let j = 0; j < this.AllGradeInfo.length; j++) {
|
|
|
+ // if (this.AllGradeInfo[j].ParentId === this.TestDepartOptions[i].Id) {
|
|
|
+ // this.PositionCheckOptionsBackUp.push(this.AllGradeInfo[j])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Object.assign(this.PositionCheckOptions, this.PositionCheckOptionsBackUp)
|
|
|
+ // ========ln
|
|
|
this.getDataEntry()
|
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
|
@@ -1008,12 +1024,13 @@
|
|
|
return
|
|
|
}
|
|
|
// 刷新子列表
|
|
|
- this.$refs['DataoperaCompoment'].resetFormData()
|
|
|
+ this.$refs['DataoperaCompoment'].resetFormData(res.data.PositionCheckId)
|
|
|
this.$refs['DataoperaCompoment'].dialogVisible = true
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
})
|
|
|
},
|
|
|
+ // 编辑
|
|
|
EditEntity (row) {
|
|
|
this.$refs['DataoperaCompoment'].subListEditEntity(row.Id)
|
|
|
this.$refs['DataoperaCompoment'].dialogVisible = true
|