| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <template>
- <div id="addObjToPlanContainer">
- <el-dialog v-if="showLeftTree" title="添加到督查计划" @close="closeHandler" :visible.sync="dialogFormVisible">
- <nodeTreeWithCheckBox @currentCheckedNodes="currentCheckedNodes"></nodeTreeWithCheckBox>
- <span slot="footer" class="dialog-footer" style="justify-content: flex-end;display: flex;">
- <el-button @click="dialogFormVisible=false">取 消</el-button>
- <el-button type="primary" @click="submitHandler">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import nodeTreeWithCheckBox from '../../../widgets/nodeTreeWithCheckBox.vue'
- import {addDcAndObjRel} from '../../../api/duChaDuiXiang_xsk_API.js'
- export default {
- components:{
- nodeTreeWithCheckBox
- },
- props: ['currentResCode','currentRsName','currentRsLong','currentRsLat'],
- data() {
- return {
- showLeftTree:false,
- dialogFormVisible:false,
- checkedNodes:[],//当前被选中的组
- currentResCode1:'',
- currentRsName1:'',
- currentRsLong1:'',
- currentRsLat1:'',
- };
- },
- watch:{
- currentCheckedNodes(n,o){
- this.checkedNodes = n;
- },
- currentResCode(n,o){
- this.currentResCode1 = n;
- },
- currentRsName(n,o){
- this.currentRsName1 = n;
- },
- currentRsLong(n,o){
- this.currentRsLong1 = n;
- },
- currentRsLat(n,o){
- this.currentRsLat1 = n;
- },
- },
- mounted(){
- this.dialogFormVisible = true;
- this.showLeftTree = true;
- this.currentResCode1 = this.currentResCode;
- this.currentRsName1 = this.currentRsName;
- this.currentRsLong1 = this.currentRsLong;
- this.currentRsLat1 = this.currentRsLat;
- },
- methods:{
- closeHandler(){
- this.showLeftTree = false;
- },
- currentCheckedNodes(item){
- this.checkedNodes = item;
- },
- showDialog(){
- this.dialogFormVisible = true;
- this.showLeftTree = true;
- },
- submitHandler(){
- var _self = this;
- for(var i=0;i<_self.checkedNodes.length;i++){
- addDcAndObjRel(_self.currentResCode1,
- _self.currentRsName1,
- _self.currentRsLat1,
- _self.currentRsLong1,
- '1',
- _self.checkedNodes[i].id).then((res)=>{
- if(res.success){
- _self.$message.success("添加成功");
- _self.$emit('addPbjToPlanSucc');
- _self.dialogFormVisible = false;
- }else{
- if(res.code == 201){
- _self.$message.warning(res.message);
- }
- }
- })
- }
- }
- }
- };
- </script>
- <style>
- </style>
|