| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
- <template>
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;">
- <p>督查对象类别</p>
- <el-select v-model="currentDCType" placeholder="请选择督查类型" style="margin-left:10px;">
- <el-option
- v-for="item in DCTypeOption"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <p>督查组分类</p>
- <el-select v-model="currentDcTermId" placeholder="请选择督查组分类" style="margin-left:10px;">
- <el-option
- v-for="item in DCTermOption"
- :key="item.id"
- :label="item.nm"
- :value="item.id">
- </el-option>
- </el-select>
- <el-button type="primary" style="margin-left:10px;" plain @click="addPICIDialogVisible = true;">添加督查组分类</el-button>
- </el-header>
- <el-main id="dcjhMain" @click="mainClickToCleanRow">
- <!-- cleanCurrentSelectedRow -->
- <el-button type="primary" @click="addDCTerm" style="margin-left:10px;float:right;">添加督查组</el-button>
- <editTable ref="et" :columnData='currentDcTableDataEditTableConfigObject' :tableData="currentDcTableData" :tableOtherParams="tableOtherParams" style="overflow:auto;"
- @rowEditDone="refreshAfterEdit"
- @rowDelete="deleteRow"
- :style="{'height':dcjhMainHeight+'px','max-height':dcjhMainHeight+'px'}"></editTable>
- <!-- <el-pagination
- small
- @current-change="handleCurrentChange"
- :pager-count="5"
- :current-page.sync="pageObject['pageIndex']"
- :page-size="pageObject['pageSize']"
- layout="total, prev, pager, next"
- :total="pageObject['total']">
- </el-pagination> -->
- </el-main>
- <el-footer>
- </el-footer>
- <el-dialog title="新建督查组分类" :visible.sync="addPICIDialogVisible">
- <el-form :model="piciForm" >
- <el-form-item label= '分类名称'>
- <el-input v-model="piciForm.name" placeholder="请输入内容"></el-input>
- </el-form-item>
- <el-form-item label="时间范围" >
- <el-date-picker
- v-model="piciForm.startDate"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="addPICIDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="appendPICI" >确 定</el-button>
- </div>
- </el-dialog>
- </el-container>
- </template>
- <script>
- import request from '../../utils/gw_ajax_request.js';
- import {getArenGrpMen, addDczOthersMens,getPlanNodeByPersid,getTermByPersid,getPersPlanType} from "@api/duChaPlan.js";
- import editTable from '@widget/editableTable.vue'
- import {planMangeOneConfig} from './planMangeOneConfig.js'
- export default {
- props: [],
- components: {
- 'editTable':editTable,
- },
- data() {
- return {
- currentDCType:'1',
- DCTypeOption:[
- {value:'1',label:'小水库督查'},
- {value:'2',label:'人饮督查'},
- {value:'3',label:'水毁督查'}
- ],
- pageObject:{
- pageSize:10,
- pageIndex:1,
- total:0,
- },
- jihuaId:'',
- dcjhMainHeight:0,
- currentDcTermId:'',
- currentDcTermObject:'',
- DCTermOption:[],
- currentDcTableData:[],
- planMangeOneConfig:planMangeOneConfig,
- currentDcTableDataEditTableConfigObject:planMangeOneConfig['xiaoshuiku'],
- addPICIDialogVisible:false,
- piciForm:{
- name:'',
- startDate:'',
- endDate:'',
- },
- }
- },
- computed:{
- tableOtherParams:function(){
- return {'userId':this.userId};
- },
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- userInAllNode:function(){//当前登录用户所在的所有组信息
- return JSON.parse(localStorage.getItem("allNode"))? JSON.parse(localStorage.getItem("allNode")): []
- },
- guId:function(){
- return localStorage.getItem("guid")? localStorage.getItem("guid"): '000'
- },
- orgName(){
- return localStorage.getItem("orgName")? localStorage.getItem("orgName"): ''
- },
- userType(){
- return localStorage.getItem("userType")? localStorage.getItem("userType"): '1'
- },
- currentShowLists:function(){
- return this.currentShowList.filter(item => item.persName.indexOf(this.member_search) > -1)
- },
- isAdmin:function(){
- return localStorage.getItem("isAdmin")? localStorage.getItem("isAdmin"): ''
- },
- },
- watch:{
- currentDCType:function(){
- console.log('点选了新的督查类型');
- if(this.currentDCType=='1'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['xiaoshuiku']
- }else if(this.currentDCType=='2'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['renyin']
- }else if(this.currentDCType=='3'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['shuihui']
- }else if(this.currentDCType=='4'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['shuiligongchengjianshe']
- }else if(this.currentDCType=='5'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['dixiahsui']
- }else if(this.currentDCType=='6'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['shuizha']
- }else if(this.currentDCType=='7'){
- this.currentDcTableDataEditTableConfigObject = planMangeOneConfig['shuiligongchengyunxing']
- }
- this.test_getDuChaPlanInformation();
- },
- currentDcTermId:function(){
- console.log('点选了新的督查组分类');
- this.getTermInformation();
- }
- },
- mounted(){
- this.getUserPlanType();
- this.dcjhMainHeight =700;
- },
- activated(){
- this.test_getDuChaPlanInformation();
- },
- methods:{
- getUserPlanType:function(){
- let _self = this;
- getPersPlanType(this.userId).then(res =>{
- this.DCTypeOption = res.data;
- this.DCTypeOption.forEach((option)=>{
- option['value'] = Number(option['id']) + '';
- option['label'] = option['name'];
- });
- this.currentDCType = this.DCTypeOption[0].value;
- // this.
- this.test_getDuChaPlanInformation();
- });
- },
- test_getDuChaPlanInformation:function(){
- //当下折中方案,需要后续更改,提供所需接口后进行抛弃 @wxcwater
- getPlanNodeByPersid(this.userId,this.currentDCType).then((res)=>{
- console.log(res);
- this.DCTermOption = res.data;
- this.currentDcTermId = this.DCTermOption.length>0?this.DCTermOption[0].id:'';
- this.jihuaId = this.DCTermOption.length>0?this.DCTermOption[0].pid:'';
- this.getTermInformation();
- });
- // getTermByPersid().then((res)=>{});
- },
- mainClickToCleanRow:function(){
- console.log('outerClick');
- this.$refs['et'].cleanCurrentSelectedRow();
- },
- getTermInformation:function(termId){
- getTermByPersid(this.userId,this.currentDCType,this.currentDcTermId).then((res)=>{
- this.currentDcTableData = res.data;
- console.log('当前督查批次信息'+this.currentDcTermObject);
- this.pageObject. pageIndex = 1;
- this.pageObject.total = this.currentDcTableData.length;
- this.currentDcTableData.forEach((element)=>{
- element['leader'] = null;
- element['exp'] = null;
- element['teamMember'] = [];
- element['concat'] = null;
- element['persAllDtoList'].forEach((per)=>{
- if(per.persType=='1'){
- element['leader'] = per;
- }else if(per.persType=='4'){
- element['exp'] = per;
- }else if(per.persType=='3'){
- element['concat'] = per;
- }else if(per.persType=='2'){
- element['teamMember'].push(per);
- }
- });
- });
- console.log(this.currentDcTableData);
- });
- // this.currentDcTableData = this.currentDcTermObject.children;
- },
- refreshAfterEdit:function(){
- this.getTermInformation();
- },
- handleCurrentChange:function(){},
- addDCTerm:function(){
- this.appendZU();
- },
- appendPICI() {
- // console.log(this.addPICITreeNode)
- var _self = this;
- // let params = {
- // 'guid': this.addPICITreeNode.code,
- // 'prsnTitle': this.piciForm.name,
- // 'prsnId': this.userId,
- // 'palnSttm': this.piciForm.startDate[0],
- // 'palnEntm': this.piciForm.startDate[1]
- // }
- let params = {
- 'prsnTitle': this.piciForm.name,
- 'orgId':this.guId,
- 'objType':this.currentDCType,
- 'palnSttm': this.piciForm.startDate[0],
- 'palnEntm': this.piciForm.startDate[1],
- 'orgName':this.orgName,
- 'persId':this.userId
- }
- request.post('/dc/insp/plan/addInspPlanBatch',params).then((res)=>{
- // const newChild = { id:res.data.code , pid:_self.addPICITreeNode.id,pnm:_self.piciForm.name,sttm:'',entm:'', children: [] };
- //to-do wxcwater 改这里。
- _self.test_getDuChaPlanInformation();
- _self.addPICIDialogVisible = false;
- });
- },
- appendZU() {
- console.log(this.currentDcTermId);
- let params = {
- 'prsnTitle': '新建督查组',
- 'guid': this.currentDcTermId,
- // 'palnSttm': this.piciForm.startDate[0],
- // 'palnEntm': this.piciForm.startDate[1]
- }
- request.post('/dc/insp/plan/addBisInspPlan',params).then((res)=>{
- const newChild = { nm:res.data.name ,id:res.data.code,type:res.data.type};
- //to-do 改这里
- this.$refs['et'].addOneRow(newChild);
- this.addZuDialogVisible = false;
- })
- },
- deleteRow:function(params){
- this.$confirm('是否删除督查组:'+params.row.nm+'?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request.post(`/dc/insp/group/delete?id=${params.row.id}`).then((res)=>{
- if(res.code!=50001&&res.code!='50001'){
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- }else{
- this.$message({
- type: 'error',
- message: '请先清空相关填报内容!'
- });
- }
- this.refreshAfterEdit();
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- deleteZU:function(node,data){
- },
- },
- }
- </script>
- <style>
- </style>
|