|
@@ -28,8 +28,8 @@
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
<el-form-item>
|
|
|
- <el-button type="success" @click="onSubmit()">保存</el-button>
|
|
|
- <el-button @click="reBack">返回</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit()">保存</el-button>
|
|
|
+ <el-button type="warning" @click="reBack">返回</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 抽样机构 -->
|
|
@@ -78,23 +78,25 @@
|
|
|
: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"
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="total2" background />
|
|
|
-
|
|
|
+ <!-- 提交按钮 -->
|
|
|
<el-button type="success" @click="choseTest2()">提交</el-button>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 地区表格区域 -->
|
|
|
- <div class="diqubiaoge">
|
|
|
<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"
|
|
|
:prop="table.prop" align="center" :width="table.width" :fixed="table.fixed" />
|
|
|
</el-table>
|
|
|
- </div>
|
|
|
+<!-- 地区表格分页器 -->
|
|
|
+ <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 />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -111,6 +113,7 @@ import {
|
|
|
// 地区单选
|
|
|
props: { multiple: true },
|
|
|
CodeToText:'',
|
|
|
+ id:'',
|
|
|
form: {
|
|
|
// name:'',
|
|
|
bear_unit: '',
|
|
@@ -123,35 +126,12 @@ import {
|
|
|
main_unit:[],
|
|
|
check_unit:[],
|
|
|
sample_org_id:'',
|
|
|
- check_org_id:''
|
|
|
+ check_org_id:'',
|
|
|
+ task_id:''
|
|
|
},
|
|
|
currentRow: null,
|
|
|
currentRow2: null,
|
|
|
- //组别名称
|
|
|
- // group: [
|
|
|
- // {
|
|
|
- // value: '2',
|
|
|
- // label: '县级监管单位'
|
|
|
- // }, {
|
|
|
- // value: '3',
|
|
|
- // label: '市级监管单位'
|
|
|
- // },{
|
|
|
- // value: '4',
|
|
|
- // label: '省级监管单位'
|
|
|
- // }],
|
|
|
- //机构性质
|
|
|
- // field: [{
|
|
|
- // value: '1',
|
|
|
- // label: '政府部门'
|
|
|
- // }, {
|
|
|
- // value: '2',
|
|
|
- // label: '事业单位'
|
|
|
- // }, {
|
|
|
- // value: '3',
|
|
|
- // label: '企业'
|
|
|
- // }],
|
|
|
// 抽样地区
|
|
|
- // region: regionData,
|
|
|
region: regionData[11].children,
|
|
|
sample_address:[],
|
|
|
// 机构地域表格数据
|
|
@@ -211,6 +191,12 @@ import {
|
|
|
// keyWord: '',
|
|
|
groupname:'检测机构',
|
|
|
},
|
|
|
+ // 地区表格请求参数
|
|
|
+ queryInfo3: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ // task_id:''
|
|
|
+ },
|
|
|
//抽样机构列表
|
|
|
testList: [],
|
|
|
// 检测机构列表
|
|
@@ -236,44 +222,36 @@ import {
|
|
|
// fixed: 'left'
|
|
|
}
|
|
|
],
|
|
|
+ // 地区表格表头
|
|
|
tableHeader3:[{
|
|
|
label: '抽样机构',
|
|
|
- prop:'form.main_unit',
|
|
|
- width:260,
|
|
|
+ prop:'sampleOrgId.name',
|
|
|
},{
|
|
|
label: '检测机构',
|
|
|
- prop:'form.check_unit',
|
|
|
- width:260,
|
|
|
+ prop:'checkOrgId.name',
|
|
|
},{
|
|
|
label: '地区',
|
|
|
prop:'sample_address',
|
|
|
- // width:260,
|
|
|
},
|
|
|
],
|
|
|
// 总共多少条数据
|
|
|
total: 0,
|
|
|
total2: 0,
|
|
|
+ total3: 0,
|
|
|
// table表格多选选项
|
|
|
// 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()
|
|
|
- },
|
|
|
-
|
|
|
- mounted() {
|
|
|
- let that = this
|
|
|
+ this.postTaskProfile()
|
|
|
},
|
|
|
methods: {
|
|
|
// 添加任务step2
|
|
@@ -284,21 +262,10 @@ import {
|
|
|
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
|
|
|
+ this.sample_org_id = result.data.data.rows.id
|
|
|
+ this.check_org_id = result.data.data.rows.id
|
|
|
console.log(this.sample_org_id)
|
|
|
},
|
|
|
- //搜索
|
|
|
- // async search(){
|
|
|
- // this.queryInfo1.pageNum = 1
|
|
|
- // this.getOrganizations()
|
|
|
- // },
|
|
|
- //搜索
|
|
|
- // async search2(){
|
|
|
- // this.queryInfo2.pageNum = 1
|
|
|
- // this.getOrganizations()
|
|
|
- // },
|
|
|
-
|
|
|
// 获取选择抽样地区
|
|
|
handleChange() {
|
|
|
var that = this
|
|
@@ -311,20 +278,22 @@ import {
|
|
|
},
|
|
|
//保存
|
|
|
async onSubmit() {
|
|
|
- this.form['token'] = token
|
|
|
+ // this.form['token'] = token
|
|
|
this.form['groupname'] = this.groupname
|
|
|
- this.form['orgs'] = this.orgs
|
|
|
- this.form['releaser'] = window.sessionStorage.getItem('rymc')
|
|
|
+ // this.form['releaser'] = window.sessionStorage.getItem('rymc')
|
|
|
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)
|
|
|
-
|
|
|
- // 判断业务逻辑
|
|
|
+ this.getOrganizations3()
|
|
|
+ //判断业务逻辑
|
|
|
if (result.data.code == 0) {
|
|
|
- this.$router.push('routineMonitor')
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '创建任务成功'
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'error',
|
|
@@ -341,7 +310,7 @@ 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.rows.id
|
|
|
+ this.sample_org_id = result.data.data.rows.id
|
|
|
console.log(result.data.data.rows.id)
|
|
|
},
|
|
|
|
|
@@ -353,7 +322,17 @@ import {
|
|
|
this.total2 = result.data.data.total
|
|
|
// this.check_org_id = result.data.rows.id
|
|
|
},
|
|
|
-
|
|
|
+ //地区表格
|
|
|
+ async getOrganizations3() {
|
|
|
+ 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.data.rows.task_id
|
|
|
+ console.log(task_id)
|
|
|
+ },
|
|
|
/** 修复当用户在大于1的分页进行数据搜索没有返回值的问题 */
|
|
|
setPageNum() {
|
|
|
this.queryInfo.pageNum = 1
|
|
@@ -391,7 +370,17 @@ import {
|
|
|
this.queryInfo2.pageNum = newPage
|
|
|
this.getOrganizations2()
|
|
|
},
|
|
|
-
|
|
|
+//地区表格页码
|
|
|
+ /** 监听每页显示多少数据的改变 */
|
|
|
+ handleSizeChange3(newSize) {
|
|
|
+ this.queryInfo3.pageSize = newSize
|
|
|
+ this.getOrganizations3()
|
|
|
+ },
|
|
|
+ /** 监听页码的改变 */
|
|
|
+ handleCurrentChange3(newPage) {
|
|
|
+ this.queryInfo3.pageNum = newPage
|
|
|
+ this.getOrganizations3()
|
|
|
+ },
|
|
|
//选中抽样(单选)
|
|
|
handleSelectionChange1(val) {
|
|
|
this.currentRow = val;
|
|
@@ -445,9 +434,4 @@ import {
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
- .diqubiaoge{
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- width: 50%
|
|
|
- }
|
|
|
</style>
|