|
@@ -8,29 +8,37 @@
|
|
|
</el-breadcrumb>
|
|
|
<div class="title">添加任务</div>
|
|
|
<el-form :model="form" label-width="100px">
|
|
|
- <el-form-item prop="sample_org_id" label="抽样机构" required>
|
|
|
- <el-input v-model="form.main_unit" @focus="getOrganizationsShow1 = true"></el-input>
|
|
|
+ <el-form-item prop="rymc" label="抽样机构" required>
|
|
|
+ <el-input v-model="form.rymc" @focus="getOrganizationsShow1 = true"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="check_org_id" label="检测机构" required>
|
|
|
- <el-input v-model="form.check_unit" @focus="getOrganizationsShow2 = true"></el-input>
|
|
|
+ <el-form-item prop="name" label="检测机构" required>
|
|
|
+ <el-input v-model="form.name" @focus="getOrganizationsShow2 = true"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="sample_address" label="地区" >
|
|
|
<el-cascader :options="region" v-model="sample_address"
|
|
|
- @change="handleChange" clearable >
|
|
|
+ @change="handleChange" clearable>
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
<!-- 底部按钮 -->
|
|
|
<el-form-item>
|
|
|
- <el-button type="success" @click="onSubmit()">保存</el-button>
|
|
|
- <el-button type="warning" @click="reBack">返回</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit()">添加</el-button>
|
|
|
+
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 抽样机构 -->
|
|
|
<!-- 选择抽样机构对话框 -->
|
|
|
<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-dialog title="机构选择" :visible.sync="getOrganizationsShow1" width="60%" :close-on-click-modal="false" @open="getOrganizations1()" class="dialogItem">
|
|
|
+ <el-form v-if="getOrganizationsShow1" :model="getOrganizationsForm1" class="chouyangjigou">
|
|
|
<!-- 表格数据区域-->
|
|
|
+ <!-- 搜索 -->
|
|
|
+ <el-form style="float:left" :inline="true">
|
|
|
+ <el-form-item label="关键字" size="small">
|
|
|
+ <el-input style="width:200px" v-model="queryInfo1.name_like"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-button size="medium" type="primary" icon="el-icon-search" @click="searchData1()">搜索</el-button>
|
|
|
+ <el-button size="medium" type="info" @click="reset1()">重置</el-button>
|
|
|
+ </el-form>
|
|
|
<el-table ref="multipleTable" :data="testList" row-key="id" @selection-change="handleSelectionChange1"
|
|
|
border stripe highlight-current-row style="width: 100%">
|
|
|
<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
|
|
@@ -45,7 +53,7 @@
|
|
|
<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"
|
|
|
+ :current-page="queryInfo1.pageNum" :page-sizes="[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>
|
|
@@ -56,9 +64,17 @@
|
|
|
|
|
|
<!-- 检测机构 -->
|
|
|
<!-- 选择检测机构对话框 -->
|
|
|
- <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-dialog title="机构选择" :visible.sync="getOrganizationsShow2" width="70%" :close-on-click-modal="false" @open="getOrganizations2()" class="dialogItem">
|
|
|
+ <el-form v-if="getOrganizationsShow2" :model="getOrganizationsForm2" class="jiancejigou" >
|
|
|
<!-- 表格数据区域-->
|
|
|
+ <!-- 搜索 -->
|
|
|
+ <el-form style="float:left" :inline="true">
|
|
|
+ <el-form-item label="关键字" size="small">
|
|
|
+ <el-input style="width:200px" v-model="queryInfo2.name_like"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-button size="medium" type="primary" icon="el-icon-search" @click="searchData()">搜索</el-button>
|
|
|
+ <el-button size="medium" type="info" @click="reset2()">重置</el-button>
|
|
|
+ </el-form>
|
|
|
<el-table ref="multipleTable" :data="testList2" row-key="id" @selection-change="handleSelectionChange2"
|
|
|
border stripe highlight-current-row style="width: 100%" >
|
|
|
<el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column>
|
|
@@ -67,19 +83,20 @@
|
|
|
{{ scope.$index+1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :key="table.prop" v-for="table in tableHeader" :label="table.label"
|
|
|
+ <el-table-column :key="table.prop" v-for="table in tableHeader2" :label="table.label"
|
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
|
</el-table>
|
|
|
<div class="footer">
|
|
|
- <!--检测机构分页器区域-->
|
|
|
+ <!--检测机构分页器区域-->
|
|
|
<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="[10, 15, 20]" :page-size="queryInfo2.pageSize"
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
|
|
|
-
|
|
|
+ <!-- 提交按钮 -->
|
|
|
<el-button type="success" @click="choseTest2()">提交</el-button>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
<!-- 地区表格区域 -->
|
|
|
<el-table ref="multipleTable" :data="regionList" row-key="id" border stripe highlight-current-row >
|
|
|
<el-table-column :key="table.prop" v-for="table in tableHeader3" :label="table.label"
|
|
@@ -88,9 +105,8 @@
|
|
|
<!-- 地区表格分页器 -->
|
|
|
<el-pagination @size-change="handleSizeChange3" @current-change="handleCurrentChange3"
|
|
|
:current-page="queryInfo3.pageNum" :page-sizes="[1,10, 15, 20]" :page-size="queryInfo3.pageSize"
|
|
|
- layout="total, sizes, prev, pager, next, jumper" :total="total3" background />
|
|
|
-
|
|
|
-
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="total3" background />
|
|
|
+ <el-button class="footbtn" type="warning" @click="reBack">返回</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -107,23 +123,18 @@ import {
|
|
|
// 地区单选
|
|
|
props: { multiple: true },
|
|
|
CodeToText:'',
|
|
|
+ id:'',
|
|
|
form: {
|
|
|
- // name:'',
|
|
|
- // bear_unit: '',
|
|
|
- // report_unit: '',
|
|
|
- // sample_number: '',
|
|
|
+ name:'',
|
|
|
+ rymc:'',
|
|
|
sample_address: '',
|
|
|
- // uploadtime: '',
|
|
|
- // groupname:'',
|
|
|
- // properties:'',
|
|
|
- // main_unit:[],
|
|
|
- // check_unit:[],
|
|
|
sample_org_id:'',
|
|
|
check_org_id:'',
|
|
|
task_id:''
|
|
|
},
|
|
|
currentRow: null,
|
|
|
currentRow2: null,
|
|
|
+ // 抽样地区
|
|
|
region: regionData[11].children,
|
|
|
sample_address:[],
|
|
|
// 机构地域表格数据
|
|
@@ -170,8 +181,7 @@ import {
|
|
|
queryInfo1: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- name:'',
|
|
|
- sample_org_id:''
|
|
|
+ groupname:'监管',
|
|
|
},
|
|
|
|
|
|
// 弹出检测机构弹窗
|
|
@@ -181,12 +191,13 @@ import {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
// keyWord: '',
|
|
|
- groupname:'检测机构',
|
|
|
+ groupname:'检测',
|
|
|
},
|
|
|
// 地区表格请求参数
|
|
|
queryInfo3: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ name_like:'',
|
|
|
},
|
|
|
//抽样机构列表
|
|
|
testList: [],
|
|
@@ -197,16 +208,39 @@ import {
|
|
|
// 表头
|
|
|
tableHeader: [{
|
|
|
label: '单位名称',
|
|
|
- prop: 'name',
|
|
|
- width: 300
|
|
|
+ prop: 'rymc',
|
|
|
+ // width: 300
|
|
|
// fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- label: '机构类型',
|
|
|
- prop: 'properties',
|
|
|
- width:150
|
|
|
+ label: '企业代码',
|
|
|
+ prop: 'qydm',
|
|
|
+ // width:150
|
|
|
// fixed: 'left'
|
|
|
}, {
|
|
|
+ label: '组别名称',
|
|
|
+ prop: 'groupname',
|
|
|
+ // width: 300
|
|
|
+ // fixed: 'left'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableHeader2: [{
|
|
|
+ label: '单位名称',
|
|
|
+ prop: 'name',
|
|
|
+ width: 300
|
|
|
+ // fixed: 'left'
|
|
|
+ },{
|
|
|
+ label: '依托单位',
|
|
|
+ prop: 'dtRelyOnUnit',
|
|
|
+ width: 300
|
|
|
+ // fixed: 'left'
|
|
|
+ },{
|
|
|
+ label: '机构性质',
|
|
|
+ prop: 'jgxz',
|
|
|
+ // width: 300
|
|
|
+ // fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '组别名称',
|
|
|
prop: 'groupname',
|
|
|
width: 300
|
|
@@ -216,7 +250,7 @@ import {
|
|
|
// 地区表格表头
|
|
|
tableHeader3:[{
|
|
|
label: '抽样机构',
|
|
|
- prop:'sampleOrgId.name',
|
|
|
+ prop:'sampleOrgId.rymc',
|
|
|
},{
|
|
|
label: '检测机构',
|
|
|
prop:'checkOrgId.name',
|
|
@@ -233,33 +267,18 @@ import {
|
|
|
// multipleSelection: null,
|
|
|
getOrganizationsForm1: {},
|
|
|
getOrganizationsForm2: {},
|
|
|
- // 选中的牵头单位
|
|
|
- orgs: [],
|
|
|
- orgs2: [],
|
|
|
// 上传成功文件列表
|
|
|
fileList: []
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- created:function(){
|
|
|
+ created(){
|
|
|
this.sample_org_id = this.id
|
|
|
this.task_id= this.$route.params.task_id
|
|
|
console.log(this.task_id)
|
|
|
- this.postTaskProfile()
|
|
|
+ // this.postTaskProfile()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 添加任务step2
|
|
|
- async postTaskProfile() {
|
|
|
- const result = await this.$http.post('postTaskProfile', {
|
|
|
- task_id: this.task_id,
|
|
|
- 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)
|
|
|
- },
|
|
|
// 获取选择抽样地区
|
|
|
handleChange() {
|
|
|
var that = this
|
|
@@ -270,35 +289,9 @@ import {
|
|
|
that.form.sample_address = loc
|
|
|
// console.log(loc)
|
|
|
},
|
|
|
- //保存
|
|
|
- async onSubmit() {
|
|
|
- // this.form['token'] = token
|
|
|
- // this.form['groupname'] = this.groupname
|
|
|
- // this.form['orgs'] = this.orgs
|
|
|
- // this.form['releaser'] = window.sessionStorage.getItem('rymc')
|
|
|
- // this.form['task_class'] = '专项监测'
|
|
|
- // 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)
|
|
|
-
|
|
|
- this.getOrganizations3()
|
|
|
- // 判断业务逻辑
|
|
|
- if (result.data.code == 0) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '创建任务成功'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: result.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ // 返回
|
|
|
reBack() {
|
|
|
- this.$router.push('addTask')
|
|
|
+ this.$router.push('specialMonitor')
|
|
|
},
|
|
|
// 获取抽样机构列表
|
|
|
async getOrganizations1() {
|
|
@@ -306,8 +299,6 @@ import {
|
|
|
const result = await this.$http.post('getOrganizations', this.queryInfo1)
|
|
|
this.testList = result.data.data.rows
|
|
|
this.total = result.data.data.total
|
|
|
- // this.sample_org_id = result.data.data.rows.id
|
|
|
- // console.log(result.data.data.rows.id)
|
|
|
},
|
|
|
|
|
|
// 获取检测机构列表
|
|
@@ -320,17 +311,14 @@ import {
|
|
|
},
|
|
|
//地区表格
|
|
|
async getOrganizations3() {
|
|
|
- // this.queryInfo3['token'] = token
|
|
|
const result = await this.$http.post('getJgTaskProfiles', {
|
|
|
task_id: this.task_id,
|
|
|
queryInfo3: this.queryInfo3,
|
|
|
})
|
|
|
this.regionList = result.data.data.rows
|
|
|
this.total3 = result.data.data.total
|
|
|
- this.task_id = result.data.rows.task_id
|
|
|
- console.log(this.task_id)
|
|
|
+ // console.log(task_id)
|
|
|
},
|
|
|
-
|
|
|
/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
|
|
|
setPageNum() {
|
|
|
this.queryInfo.pageNum = 1
|
|
@@ -346,6 +334,35 @@ import {
|
|
|
})
|
|
|
this.hander = false
|
|
|
},
|
|
|
+//搜索抽样机构
|
|
|
+ async searchData1() {
|
|
|
+ this.queryInfo1.pageNum = 1
|
|
|
+ this.getOrganizations1()
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ reset1(){
|
|
|
+ this.queryInfo1={
|
|
|
+ name_like:'',
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ groupname:'监管'}
|
|
|
+ this.getOrganizations1()
|
|
|
+ },
|
|
|
+ //搜索检测机构
|
|
|
+ async searchData() {
|
|
|
+ this.queryInfo2.pageNum = 1
|
|
|
+ this.getOrganizations2()
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ reset2(){
|
|
|
+ this.queryInfo2={
|
|
|
+ name_like:'',
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ groupname:'检测'}
|
|
|
+ this.getOrganizations2()
|
|
|
+ },
|
|
|
+
|
|
|
//抽样机构页码
|
|
|
/** 监听每页显示多少数据的改变 */
|
|
|
handleSizeChange1(newSize) {
|
|
@@ -379,39 +396,55 @@ import {
|
|
|
this.queryInfo3.pageNum = newPage
|
|
|
this.getOrganizations3()
|
|
|
},
|
|
|
-
|
|
|
//选中抽样(单选)
|
|
|
handleSelectionChange1(val) {
|
|
|
this.currentRow = val;
|
|
|
- console.log(this.currentRow)
|
|
|
- console.log(this.currentRow[0].name)
|
|
|
+ console.log('@@@',this.currentRow)
|
|
|
+ console.log('@@@',this.currentRow[0].name)
|
|
|
this.sample_org_id = this.currentRow[0].id
|
|
|
- console.log(this.sample_org_id)
|
|
|
+ console.log('@@@',this.sample_org_id)
|
|
|
},
|
|
|
//选中检测(单选)
|
|
|
handleSelectionChange2(val) {
|
|
|
this.currentRow2 = val;
|
|
|
this.check_org_id = this.currentRow2[0].id
|
|
|
console.log(this.currentRow2)
|
|
|
- console.log(this.currentRow2[0].name)
|
|
|
console.log(this.check_org_id)
|
|
|
},
|
|
|
// 抽样单位提交
|
|
|
async choseTest1() {
|
|
|
let that = this
|
|
|
- that.form.main_unit = that.currentRow[0].name
|
|
|
+ that.form.rymc = that.currentRow[0].rymc
|
|
|
that.getOrganizationsShow1 = false
|
|
|
- that.form.sample_org_id = that.currentRow[0].id
|
|
|
- console.log(that.form.sample_org_id)
|
|
|
-
|
|
|
},
|
|
|
// 检测单位提交
|
|
|
- choseTest2() {
|
|
|
+ async choseTest2() {
|
|
|
let that = this
|
|
|
- that.form.check_unit = that.currentRow2[0].name
|
|
|
+ that.form.name = that.currentRow2[0].name
|
|
|
that.form.check_org_id = that.currentRow2[0].id
|
|
|
that.getOrganizationsShow2 = false
|
|
|
- console.log(that.form.check_org_id)
|
|
|
+ console.log(that.currentRow2[0].id)
|
|
|
+ },
|
|
|
+//保存
|
|
|
+ async onSubmit() {
|
|
|
+ this.form['task_class'] = '专项监测'
|
|
|
+ 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)
|
|
|
+ this.getOrganizations3()
|
|
|
+ //判断业务逻辑
|
|
|
+ if (result.data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '创建任务成功'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: result.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
}
|
|
@@ -423,7 +456,7 @@ import {
|
|
|
}
|
|
|
|
|
|
.el-form {
|
|
|
- width: 800px;
|
|
|
+ width: 600px;
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
|
|
@@ -433,4 +466,20 @@ import {
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
-</style>
|
|
|
+ .jiancejigou{
|
|
|
+ width: 1200px;
|
|
|
+ }
|
|
|
+ .chouyangjigou{
|
|
|
+ width: 1000px;
|
|
|
+ }
|
|
|
+ .footbtn{
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ margin-left: 5px;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ // /deep/ !important
|
|
|
+ thead .el-table-column--selection .cell {
|
|
|
+ display: none!important;
|
|
|
+ }
|
|
|
+</style>
|