|
@@ -16,31 +16,28 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="sample_address" label="地区" >
|
|
<el-form-item prop="sample_address" label="地区" >
|
|
<el-cascader :options="region" v-model="sample_address"
|
|
<el-cascader :options="region" v-model="sample_address"
|
|
- @change="handleChange">
|
|
|
|
|
|
+ @change="handleChange" clearable >
|
|
</el-cascader>
|
|
</el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- <el-form-item prop="sample_address" label="地区" >
|
|
|
|
+ <el-cascader :options="options" :props="props" v-model="sample_address" clearable ></el-cascader>
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 底部按钮 -->
|
|
<!-- 底部按钮 -->
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="success" @click="onSubmit()">保存</el-button>
|
|
<el-button type="success" @click="onSubmit()">保存</el-button>
|
|
<el-button @click="reBack">返回</el-button>
|
|
<el-button @click="reBack">返回</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
-
|
|
|
|
|
|
+<!-- 抽样机构 -->
|
|
<!-- 选择抽样机构对话框 -->
|
|
<!-- 选择抽样机构对话框 -->
|
|
- <el-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="50%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
|
|
|
|
|
|
+ <template scope-slot="scope">
|
|
|
|
+ <el-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="50%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
|
|
<el-form v-if="getOrganizationsShow1" :model="getOrganizationsForm1">
|
|
<el-form v-if="getOrganizationsShow1" :model="getOrganizationsForm1">
|
|
- <!-- 检索功能 -->
|
|
|
|
- <!-- <el-row :gutter="20">
|
|
|
|
- <el-col :span="6">
|
|
|
|
- <el-form-item label="单位名称" >
|
|
|
|
- <el-input v-model="queryInfo1.name"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="6">
|
|
|
|
- <el-button type="success" @click="search()" style="margin-top:40px">搜索</el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row> -->
|
|
|
|
- <!-- 表格数据区域-->
|
|
|
|
|
|
+ <!-- 表格数据区域-->
|
|
<el-table ref="multipleTable" :data="testList" row-key="id" @selection-change="handleSelectionChange1"
|
|
<el-table ref="multipleTable" :data="testList" row-key="id" @selection-change="handleSelectionChange1"
|
|
border stripe highlight-current-row style="width: 100%">
|
|
border stripe highlight-current-row style="width: 100%">
|
|
<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
|
|
<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
|
|
@@ -52,31 +49,22 @@
|
|
<el-table-column :key="table.prop" v-for="table in tableHeader" :label="table.label"
|
|
<el-table-column :key="table.prop" v-for="table in tableHeader" :label="table.label"
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
</el-table>
|
|
</el-table>
|
|
- <div class="footer">
|
|
|
|
- <!-- 分页器区域-->
|
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
|
- :current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper" :total="total" background />
|
|
|
|
- <el-button type="success" @click="choseTest1()">提交</el-button>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ <div class="footer">
|
|
|
|
+ <!--抽样机构分页器区域-->
|
|
|
|
+ <el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
|
|
|
|
+ :current-page="queryInfo1.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo1.pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="total" background />
|
|
|
|
+ <el-button type="success" @click="choseTest1()">提交</el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</el-form>
|
|
</el-form>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+<!-- 检测机构 -->
|
|
<!-- 选择检测机构对话框 -->
|
|
<!-- 选择检测机构对话框 -->
|
|
<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
|
|
<el-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="50%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
|
|
<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
|
|
<el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2">
|
|
- <!-- 检索功能 -->
|
|
|
|
- <!-- <el-row :gutter="20">
|
|
|
|
- <el-col :span="6">
|
|
|
|
- <el-form-item label="单位名称" >
|
|
|
|
- <el-input v-model="form.name"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col> -->
|
|
|
|
- <!-- <el-col :span="6">
|
|
|
|
- <el-button type="success" @click="search2()" style="margin-top:40px">搜索</el-button>
|
|
|
|
- </el-col> -->
|
|
|
|
- <!-- </el-row> -->
|
|
|
|
<!-- 表格数据区域-->
|
|
<!-- 表格数据区域-->
|
|
<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
|
|
<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
|
|
border stripe highlight-current-row style="width: 100%" >
|
|
border stripe highlight-current-row style="width: 100%" >
|
|
@@ -90,10 +78,11 @@
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
</el-table>
|
|
</el-table>
|
|
<div class="footer">
|
|
<div class="footer">
|
|
- <!--分页器区域-->
|
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
|
|
|
+ <!--检测机构分页器区域-->
|
|
|
|
+ <el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
|
|
:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
|
|
:current-page="queryInfo2.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo2.pageSize"
|
|
- layout="total, sizes, prev, pager, next, jumper" :total="total" background />
|
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
|
|
|
|
+
|
|
<el-button type="success" @click="choseTest2()">提交</el-button>
|
|
<el-button type="success" @click="choseTest2()">提交</el-button>
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -113,19 +102,22 @@ import {
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 地区单选
|
|
|
|
+ props: { multiple: true },
|
|
CodeToText:'',
|
|
CodeToText:'',
|
|
form: {
|
|
form: {
|
|
// name:'',
|
|
// name:'',
|
|
bear_unit: '',
|
|
bear_unit: '',
|
|
report_unit: '',
|
|
report_unit: '',
|
|
- // check_unit: '',
|
|
|
|
sample_number: '',
|
|
sample_number: '',
|
|
- sample_address: '',
|
|
|
|
|
|
+ // sample_address: '',
|
|
uploadtime: '',
|
|
uploadtime: '',
|
|
groupname:'',
|
|
groupname:'',
|
|
properties:'',
|
|
properties:'',
|
|
main_unit:[],
|
|
main_unit:[],
|
|
- check_unit:[]
|
|
|
|
|
|
+ check_unit:[],
|
|
|
|
+ sample_org_id:'',
|
|
|
|
+ check_org_id:''
|
|
},
|
|
},
|
|
currentRow: null,
|
|
currentRow: null,
|
|
currentRow2: null,
|
|
currentRow2: null,
|
|
@@ -154,7 +146,7 @@ import {
|
|
// }],
|
|
// }],
|
|
// 抽样地区
|
|
// 抽样地区
|
|
region: regionData,
|
|
region: regionData,
|
|
- sample_address: [],
|
|
|
|
|
|
+ sample_address:[],
|
|
// 机构地域表格数据
|
|
// 机构地域表格数据
|
|
underTask: [],
|
|
underTask: [],
|
|
underTasktotal: 0,
|
|
underTasktotal: 0,
|
|
@@ -171,14 +163,6 @@ import {
|
|
// myHeaders: {
|
|
// myHeaders: {
|
|
// Authorization: 'bearer'+ token//上传文件添加token
|
|
// Authorization: 'bearer'+ token//上传文件添加token
|
|
// },
|
|
// },
|
|
- // 任务表单
|
|
|
|
- // form: {
|
|
|
|
- // main_unit: [],
|
|
|
|
- // check_unit: [],
|
|
|
|
- // },
|
|
|
|
- // form: {
|
|
|
|
- // check_unit: [],
|
|
|
|
- // },
|
|
|
|
// 优先级选项
|
|
// 优先级选项
|
|
priority: [{
|
|
priority: [{
|
|
value: '0',
|
|
value: '0',
|
|
@@ -203,11 +187,12 @@ import {
|
|
|
|
|
|
// 弹出抽样机构弹窗
|
|
// 弹出抽样机构弹窗
|
|
getOrganizationsShow1: false,
|
|
getOrganizationsShow1: false,
|
|
- // 查询检测机构请求参数
|
|
|
|
|
|
+ // 查询抽样机构请求参数
|
|
queryInfo1: {
|
|
queryInfo1: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
name:'',
|
|
name:'',
|
|
|
|
+ sample_org_id:''
|
|
},
|
|
},
|
|
|
|
|
|
// 弹出检测机构弹窗
|
|
// 弹出检测机构弹窗
|
|
@@ -216,8 +201,8 @@ import {
|
|
queryInfo2: {
|
|
queryInfo2: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- keyWord: '',
|
|
|
|
- groupname:'检测机构'
|
|
|
|
|
|
+ // keyWord: '',
|
|
|
|
+ groupname:'检测机构',
|
|
},
|
|
},
|
|
//抽样机构列表
|
|
//抽样机构列表
|
|
testList: [],
|
|
testList: [],
|
|
@@ -258,6 +243,9 @@ import {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created:function(){
|
|
created:function(){
|
|
|
|
+ this.sample_org_id = this.id
|
|
|
|
+ this.task_id= this.$route.params.task_id
|
|
|
|
+ console.log(this.task_id)
|
|
this.postTaskProfile()
|
|
this.postTaskProfile()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -265,22 +253,29 @@ import {
|
|
let that = this
|
|
let that = this
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 获取机构列表
|
|
|
|
- async postTaskProfile() {
|
|
|
|
|
|
+ // 添加任务step2
|
|
|
|
+ async postTaskProfile() {
|
|
const result = await this.$http.post('postTaskProfile', {
|
|
const result = await this.$http.post('postTaskProfile', {
|
|
task_id: this.task_id,
|
|
task_id: this.task_id,
|
|
-
|
|
|
|
- })},
|
|
|
|
- //搜索
|
|
|
|
- async search(){
|
|
|
|
- this.queryInfo1.pageNum = 1
|
|
|
|
- this.getOrganizations()
|
|
|
|
|
|
+ sample_org_id:this.sample_org_id,
|
|
|
|
+ check_org_id:this.check_org_id,
|
|
|
|
+ sample_address:this.sample_address
|
|
|
|
+ })
|
|
|
|
+ this.sample_org_id = result.data.rows.id
|
|
|
|
+ this.check_org_id = result.data.rows.id
|
|
|
|
+ console.log(this.sample_org_id)
|
|
},
|
|
},
|
|
//搜索
|
|
//搜索
|
|
- async search2(){
|
|
|
|
- this.queryInfo2.pageNum = 1
|
|
|
|
- this.getOrganizations()
|
|
|
|
- },
|
|
|
|
|
|
+ // async search(){
|
|
|
|
+ // this.queryInfo1.pageNum = 1
|
|
|
|
+ // this.getOrganizations()
|
|
|
|
+ // },
|
|
|
|
+ //搜索
|
|
|
|
+ // async search2(){
|
|
|
|
+ // this.queryInfo2.pageNum = 1
|
|
|
|
+ // this.getOrganizations()
|
|
|
|
+ // },
|
|
|
|
+
|
|
// 获取选择抽样地区
|
|
// 获取选择抽样地区
|
|
handleChange() {
|
|
handleChange() {
|
|
var that = this
|
|
var that = this
|
|
@@ -289,6 +284,7 @@ import {
|
|
loc += CodeToText[this.sample_address[i]];
|
|
loc += CodeToText[this.sample_address[i]];
|
|
}
|
|
}
|
|
that.form.sample_address = loc
|
|
that.form.sample_address = loc
|
|
|
|
+ // console.log(loc)
|
|
},
|
|
},
|
|
//保存
|
|
//保存
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
@@ -298,10 +294,14 @@ import {
|
|
this.form['releaser'] = window.sessionStorage.getItem('rymc')
|
|
this.form['releaser'] = window.sessionStorage.getItem('rymc')
|
|
this.form['task_class'] = '专项监测'
|
|
this.form['task_class'] = '专项监测'
|
|
this.form['ispublic'] = 0
|
|
this.form['ispublic'] = 0
|
|
|
|
+ this.form['sample_org_id'] = this.sample_org_id
|
|
|
|
+ this.form['check_org_id'] = this.check_org_id
|
|
|
|
+ this.form['task_id'] = this.task_id
|
|
const result = await this.$http.post('postTaskProfile', this.form)
|
|
const result = await this.$http.post('postTaskProfile', this.form)
|
|
|
|
+
|
|
// 判断业务逻辑
|
|
// 判断业务逻辑
|
|
if (result.data.code == 0) {
|
|
if (result.data.code == 0) {
|
|
- this.$router.push('specialMonitor')
|
|
|
|
|
|
+ this.$router.push('routineMonitor')
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'error',
|
|
type: 'error',
|
|
@@ -310,31 +310,27 @@ import {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
reBack() {
|
|
reBack() {
|
|
- this.$router.push('addTaskZx')
|
|
|
|
|
|
+ this.$router.push('addTask')
|
|
},
|
|
},
|
|
// 获取抽样机构列表
|
|
// 获取抽样机构列表
|
|
async getOrganizations1() {
|
|
async getOrganizations1() {
|
|
this.queryInfo1['token'] = token
|
|
this.queryInfo1['token'] = token
|
|
const result = await this.$http.post('getOrganizations', this.queryInfo1)
|
|
const result = await this.$http.post('getOrganizations', this.queryInfo1)
|
|
- console.log(result.data.code);
|
|
|
|
- // 判断业务逻辑
|
|
|
|
- if (result.data.code == 0) {
|
|
|
|
this.testList = result.data.data.rows
|
|
this.testList = result.data.data.rows
|
|
this.total = result.data.data.total
|
|
this.total = result.data.data.total
|
|
- }
|
|
|
|
|
|
+ this.sample_org_id = result.data.rows.id
|
|
|
|
+ console.log(result.data.data.rows.id)
|
|
},
|
|
},
|
|
|
|
|
|
// 获取检测机构列表
|
|
// 获取检测机构列表
|
|
async getOrganizations2() {
|
|
async getOrganizations2() {
|
|
this.queryInfo2['token'] = token
|
|
this.queryInfo2['token'] = token
|
|
const result = await this.$http.post('getOrganizations', this.queryInfo2)
|
|
const result = await this.$http.post('getOrganizations', this.queryInfo2)
|
|
- console.log(result.data.code);
|
|
|
|
- // 判断业务逻辑
|
|
|
|
- if (result.data.code == 0) {
|
|
|
|
this.testList2 = result.data.data.rows
|
|
this.testList2 = result.data.data.rows
|
|
this.total2 = result.data.data.total
|
|
this.total2 = result.data.data.total
|
|
- }
|
|
|
|
|
|
+ // this.check_org_id = result.data.rows.id
|
|
},
|
|
},
|
|
|
|
+
|
|
/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
|
|
/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
|
|
setPageNum() {
|
|
setPageNum() {
|
|
this.queryInfo.pageNum = 1
|
|
this.queryInfo.pageNum = 1
|
|
@@ -350,41 +346,61 @@ import {
|
|
})
|
|
})
|
|
this.hander = false
|
|
this.hander = false
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+//抽样机构页码
|
|
/** 监听每页显示多少数据的改变 */
|
|
/** 监听每页显示多少数据的改变 */
|
|
- handleSizeChange(newSize) {
|
|
|
|
|
|
+ handleSizeChange1(newSize) {
|
|
this.queryInfo1.pageSize = newSize
|
|
this.queryInfo1.pageSize = newSize
|
|
this.getOrganizations1()
|
|
this.getOrganizations1()
|
|
},
|
|
},
|
|
-
|
|
|
|
/** 监听页码的改变 */
|
|
/** 监听页码的改变 */
|
|
- handleCurrentChange(newPage) {
|
|
|
|
|
|
+ handleCurrentChange1(newPage) {
|
|
this.queryInfo1.pageNum = newPage
|
|
this.queryInfo1.pageNum = newPage
|
|
this.getOrganizations1()
|
|
this.getOrganizations1()
|
|
},
|
|
},
|
|
|
|
+//检测机构页码
|
|
|
|
+ /** 监听每页显示多少数据的改变 */
|
|
|
|
+ handleSizeChange2(newSize) {
|
|
|
|
+ this.queryInfo2.pageSize = newSize
|
|
|
|
+ this.getOrganizations2()
|
|
|
|
+ },
|
|
|
|
+ /** 监听页码的改变 */
|
|
|
|
+ handleCurrentChange2(newPage) {
|
|
|
|
+ this.queryInfo2.pageNum = newPage
|
|
|
|
+ this.getOrganizations2()
|
|
|
|
+ },
|
|
|
|
+
|
|
//选中抽样(单选)
|
|
//选中抽样(单选)
|
|
handleSelectionChange1(val) {
|
|
handleSelectionChange1(val) {
|
|
this.currentRow = val;
|
|
this.currentRow = val;
|
|
console.log(this.currentRow)
|
|
console.log(this.currentRow)
|
|
console.log(this.currentRow[0].name)
|
|
console.log(this.currentRow[0].name)
|
|
|
|
+ this.sample_org_id = this.currentRow[0].id
|
|
|
|
+ console.log(this.sample_org_id)
|
|
},
|
|
},
|
|
//选中检测(单选)
|
|
//选中检测(单选)
|
|
handleSelectionChange2(val) {
|
|
handleSelectionChange2(val) {
|
|
this.currentRow2 = val;
|
|
this.currentRow2 = val;
|
|
|
|
+ this.check_org_id = this.currentRow2[0].id
|
|
console.log(this.currentRow2)
|
|
console.log(this.currentRow2)
|
|
console.log(this.currentRow2[0].name)
|
|
console.log(this.currentRow2[0].name)
|
|
|
|
+ console.log(this.check_org_id)
|
|
},
|
|
},
|
|
- // 抽样单位提交
|
|
|
|
- choseTest1() {
|
|
|
|
|
|
+// 抽样单位提交
|
|
|
|
+ async choseTest1() {
|
|
let that = this
|
|
let that = this
|
|
that.form.main_unit = that.currentRow[0].name
|
|
that.form.main_unit = that.currentRow[0].name
|
|
that.getOrganizationsShow1 = false
|
|
that.getOrganizationsShow1 = false
|
|
|
|
+ that.form.sample_org_id = that.currentRow[0].id
|
|
|
|
+ console.log(that.form.sample_org_id)
|
|
|
|
+
|
|
},
|
|
},
|
|
- // 检测单位提交
|
|
|
|
|
|
+// 检测单位提交
|
|
choseTest2() {
|
|
choseTest2() {
|
|
let that = this
|
|
let that = this
|
|
that.form.check_unit = that.currentRow2[0].name
|
|
that.form.check_unit = that.currentRow2[0].name
|
|
|
|
+ that.form.check_org_id = that.currentRow2[0].id
|
|
that.getOrganizationsShow2 = false
|
|
that.getOrganizationsShow2 = false
|
|
|
|
+ console.log(that.form.check_org_id)
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|