|
|
@@ -56,6 +56,12 @@
|
|
|
<!--新增、编辑样品类型-->
|
|
|
<el-dialog title="检测地点信息" :visible.sync="dialogVisible" width="720px" size="small">
|
|
|
<el-form :model="formData" ref="EntityForm" label-width="120px" label-position="top">
|
|
|
+ <el-form-item label="受检单位" required>
|
|
|
+ <el-select ref="ThrUnitSelect" v-model="formData.ThrUnitId" style="width:100%" placeholder="请选择" filterable >
|
|
|
+ <el-option v-for="item in thrUnitList" :key="item.Id" :label="item.Fullname" :value="item.Id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="检测地点名称" required>
|
|
|
<el-input v-model="formData.PositionName" placeholder="请输入" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -149,8 +155,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { mapGetters } from 'vuex';
|
|
|
- import api from '@/api/lims/customerposition';
|
|
|
+ import { mapGetters } from 'vuex'
|
|
|
+ import api from '@/api/lims/customerposition'
|
|
|
|
|
|
export default {
|
|
|
computed: {
|
|
|
@@ -175,6 +181,7 @@
|
|
|
customerOrigList: [],
|
|
|
projectTypeList: [],
|
|
|
selectedorg: [],
|
|
|
+ thrUnitList: [],
|
|
|
selectNodeId: '0',
|
|
|
selectNodeName: '根节点',
|
|
|
tmpShowSelectNodeName: '',
|
|
|
@@ -288,7 +295,7 @@
|
|
|
this.customerCheckBuildList()
|
|
|
this.gettreelist()
|
|
|
this.initDatas()
|
|
|
- //this.getDictOptions()
|
|
|
+ this.getDictOptions()
|
|
|
this.getProjectType()
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -331,20 +338,29 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- //保存信息
|
|
|
- saveEntity() {
|
|
|
+ // 保存信息
|
|
|
+ saveEntity () {
|
|
|
+ if (!this.formData.ThrUnitId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '受检单位不能为空'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.$refs['EntityForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.formData.CustomerId = this.CustomerId
|
|
|
this.formData.ParentId = 0
|
|
|
this.formData.PositionType = '检测地点'
|
|
|
this.formData.PositionTypeId = '1'
|
|
|
+ this.formData.ThrUnitId = parseInt(this.formData.ThrUnitId)
|
|
|
+ this.formData.ThrUnit = this.$refs['ThrUnitSelect'].selectedLabel
|
|
|
if (!this.formData.Id) {
|
|
|
this.addEntity()
|
|
|
} else {
|
|
|
this.updateEntity()
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
|
@@ -442,11 +458,10 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- getDictOptions() {
|
|
|
+ getDictOptions () {
|
|
|
api.getDictList(this.$axios).then(res => {
|
|
|
- //this.dictOptions.customerList = res.data.items['customerList']
|
|
|
- //this.dictOptions.projectList = res.data.items['projectList']
|
|
|
-
|
|
|
+ console.log(res.data.items)
|
|
|
+ this.thrUnitList = res.data.items['ThrUnitList']
|
|
|
}).catch(err => {
|
|
|
console.error(err)
|
|
|
})
|