| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888 |
- <template>
- <div class="problem_dialog">
- <el-form ref="problemForm" :rules="rules" :model="problemForm" label-width="120px">
- <el-form-item>
- <el-button type="text" @click="selectPblm" style="float: left;">选择问题</el-button>
- </el-form-item>
- <el-form-item label="检查对象" style="text-align:left">
- <el-select v-model="t1" value-key="inspPblmsName" placeholder="请选择" disabled>
- <el-option v-for="(item,index) in problemList" :key="index" :label="item.inspPblmsName" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="检查项目" style="text-align:left">
- <el-select v-model="t2" placeholder="请选择" value-key="checkPointName" disabled>
- <el-option v-for="(item,index) in currentCheckPointList" :key="index" :label="item.checkPointName" :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="问题名称和描述" style="text-align:left">
- <el-input v-model="t3" type="textarea" :rows="4" placeholder="" disabled></el-input>
- </el-form-item>
- <el-form-item label="检查对象名称" style="text-align:left">
- <div v-if="showStation">
- <el-select v-model="problemForm.cwsCode" placeholder="请选择" clearable :disabled="stationDisabled" @change="stationChange">
- <el-option v-for="(item,index) in stationList" :key="index" :label="item.inspObjName" :value="item.id">
- </el-option>
- </el-select>
- <el-button
- v-if="!stationDisabled"
- @click="toAddNewStation"
- type="text">
- <i class="el-icon-circle-plus"></i>
- </el-button>
- </div>
- <div v-if="showTown">
- <el-select v-model="townSelected" value-key="adName" placeholder="请选择" clearable>
- <el-option v-for="(item,index) in townList" :key="index" :label="item.adName" :value="item">
- </el-option>
- </el-select>
- <el-button
- @click="toAddNewTown"
- type="text">
- <i class="el-icon-circle-plus"></i>
- </el-button>
- </div>
- <div v-if="showVillage">
- <el-select v-model="villageSelected" value-key="inspObjName" placeholder="请选择" clearable>
- <el-option v-for="(item,index) in villageList" :key="index" :label="item.inspObjName" :value="item">
- </el-option>
- </el-select>
- <el-button
- @click="toAddNewVillage"
- type="text">
- <i class="el-icon-circle-plus"></i>
- </el-button>
- </div>
- </el-form-item>
- <el-form-item label="行政区划" style="text-align:left">
- <el-input v-model="problemForm.inspAddDesc" type="text" placeholder="" readonly></el-input>
- </el-form-item>
- <el-form-item label="严重程度:" style="text-align:left" prop="inspPblmCate">
- <div v-if="t3 && t3.indexOf('[其他]') == -1">
- <p v-if="inspPblmCate == 0" style="color: green">一般</p>
- <p v-if="inspPblmCate == 1" style="color: orange">较重</p>
- <p v-if="inspPblmCate == 2" style="color: red">严重</p>
- </div>
- <el-select
- v-else
- v-model="inspPblmCate"
- clearable
- placeholder="请选择">
- <el-option
- v-for="item in supervisionState"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="典型问题" style="text-align:left">
- <el-radio v-model="problemForm.ifCasePblm" label="1">是</el-radio>
- <el-radio v-model="problemForm.ifCasePblm" label="0">否</el-radio>
- </el-form-item>
- <el-form-item label="详细描述" prop="inspPblmDesc">
- <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="problemForm.inspPblmDesc" required>
- </el-input>
- </el-form-item>
- <el-form-item label="原因分析" prop="pblmReason">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="problemForm.pblmReason">
- </el-input>
- </el-form-item>
- <el-form-item label="整改建议" prop="pblmSggtn">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="problemForm.pblmSggtn">
- </el-input>
- </el-form-item>
- <el-form-item label="上传照片">
- <upload ref="uploadFile" :url="`/pdcApi/file/insert?bizId=`" @uploadOver="removeNewSupervision"></upload>
- </el-form-item>
- <el-form-item style="margin-top: 50px">
- <el-button type="primary" @click="onSubmit('problemForm')" style="width: 100px;float:right">保存</el-button>
- </el-form-item>
- </el-form>
- <el-dialog
- class="pblmEascader"
- title="选择问题"
- width="60%"
- append-to-body
- :visible.sync="pblmEascaderVisible">
- <pblmEascader :objType="27" @modelData="modelData" :vmodelData="newPblmValue" :t3="t3"></pblmEascader>
- <span slot="footer">
- <el-button @click="pblmEascaderVisible=false">返 回</el-button>
- <el-button type="primary" @click="submitEascader">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :title="isStation ? '新增监测站点' : '新增接收端'"
- width="60%"
- append-to-body
- :visible.sync="addNewStationVisible">
- <el-form :model="newStationObj" label-width="120px" :rules="stationRule" ref="stationForm">
- <el-form-item :label="isStation ? '站点名称' : '接收端名称'" prop="inspObjName">
- <el-input type="text" placeholder="请输入站点名称" v-model="newStationObj.inspObjName" required>
- </el-input>
- </el-form-item>
- <!-- <el-form-item label="所在地点">
- <el-input type="text" placeholder="请输入所在地点" v-model="newStationObj.location">
- </el-input>
- </el-form-item> -->
- <el-form-item label="行政区划">
- <el-input type="text" placeholder="" readonly v-model="newStationObj.location">
- </el-input>
- <div style="margin: 5px 0;">
- <span>选择乡</span>
- <el-select v-model="townSelectedStation" value-key="adName" placeholder="请选择" clearable>
- <el-option v-for="(item,index) in townsList" :key="index" :label="item.adName" :value="item">
- </el-option>
- </el-select>
- <!-- <el-button
- @click="toAddNewTown"
- type="text">
- <i class="el-icon-circle-plus"></i>
- </el-button> -->
-  
- <span>选择村</span>
- <el-select v-model="villageSelectedStation" value-key="adName" placeholder="请选择" clearable>
- <el-option v-for="(item,index) in villagesList" :key="index" :label="item.adName" :value="item">
- </el-option>
- </el-select>
- <!-- <el-button
- @click="toAddNewVillage"
- type="text">
- <i class="el-icon-circle-plus"></i>
- </el-button> -->
- </div>
- </el-form-item>
- </el-form>
- <span slot="footer">
- <el-button @click="addNewStationVisible=false">返 回</el-button>
- <el-button type="primary" @click="addNewStation">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="新增乡镇"
- width="60%"
- append-to-body
- :visible.sync="addNewTownVisible">
- <div style="margin: 10px; cursor: pointer; color: #5cb6ff">
- <span @click="addCustomDivision('town')"><i class="el-icon-circle-plus"></i> 新增</span>
- </div>
- <div class="radio_wrapper">
- <el-radio v-model="addTownValue" style="margin: 10px" v-for="(town,index) in townsList" :label="town.adCode" :key="index">{{town.adName}}</el-radio>
- </div>
- <span slot="footer">
- <el-button @click="addNewTownVisible=false">返 回</el-button>
- <el-button type="primary" @click="addNewTown">确 定</el-button>
- </span>
- </el-dialog>
- <add-custom-division-com v-if="customDiviDialogVisible" :rootCode="rootCode" @addSuccess="addSuccess" @cancelHundler="cancelHundler"></add-custom-division-com>
- <el-dialog
- title="新增村"
- width="60%"
- append-to-body
- :visible.sync="addNewVillageVisible">
- <div style="margin: 10px; cursor: pointer; color: #5cb6ff">
- <span @click="addCustomDivision('village')"><i class="el-icon-circle-plus"></i> 新增</span>
- </div>
- <el-cascader-panel :props="villageProps" v-model="addVillageValue" ref="cascaderRef"></el-cascader-panel>
- <span slot="footer">
- <el-button @click="addNewVillageVisible=false">返 回</el-button>
- <el-button type="primary" @click="addNewVillage">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import request from '@util/gw_ajax_request.js'
- import pblmEascader from '../../duChaTianBao/project/pblmEascader'
- import addCustomDivisionCom from '../../duChaTianBao/shanhong/addCustomDivisionCom'
- import {
- submitUpload,
- getAdXBaseData
- } from "@api/duChaAPI.js";
- import {
- getStationListApi,
- addNewStationApi,
- getTownsListApi,
- getVillageListApi
- } from "@api/duChaTianBao.js";
- export default {
- props: ['objId', 'objName', 'villType', 'objType', 'engId', 'regId','newModelData','adCode','adName'],
- data() {
- let _this = this
- return {
- problemForm: {
- t1: '',
- t2: '',
- t3: '',
- villType: '',
- objId: "",
- regid: '',
- objType: "",
- // inspPblmName: "",
- inspPblmCate:"",
- inspPblmDesc: "",
- inspAddDesc: '', //行政区划详细地址
- ifCasePblm: '0',
- pblmStat: "",
- dataStat: "",
- nm: "",
- recPers: "",
- note: "",
- gwComFiles: []
- },
- inspPblmCate:"",
- imgList: [],
- videoList: [],
- audioList: [],
- pblmStat: '',
- gwComFiles: [],
- problemList: [],
- tempResult:[], // add by lch
- currentCheckPointList: [],
- currentProblemDescList: [],
- t1: '',
- t2: '',
- t3: '',
- xiangqingmiaoshu: '',
- wenTiLeiBie:"",
- jianChaXiangMu:"",
- supervisionState: [
- {
- value: "0",
- label: "一般"
- },
- {
- value: "1",
- label: "较重"
- },
- {
- value: "2",
- label: "严重"
- }
- ],
- rules: {
- inspPblmDesc: [{
- required: true,
- message: '请输入问题描述',
- trigger: 'blur'
- },
- ],
- pblmReason: [{
- required: true,
- message: '请输入问题描述',
- trigger: 'blur'
- },
- ],
- pblmSggtn: [{
- required: true,
- message: '请输入问题描述',
- trigger: 'blur'
- },
- ],
- },
- stationRule: {
- inspObjName: [{
- required: true,
- message: '请输入站点名称',
- trigger: 'blur'
- },
- ],
- },
- isClicked: false,
- pblmEascaderVisible: false,
- newPblmValue: [],
- stationList: [],
- addNewStationVisible: false,
- addNewTownVisible: false,
- addNewVillageVisible: false,
- newStationObj: {
- inspObjName: '', //暗访对象名称
- location: '', //详细地址
- adCode: '',
- adName: ''
- },
- townAdName: '',
- townList: [], //乡镇列表
- townsList: [], //乡镇列表
- townSelected: null,
- selectAdCode: '',
- villageList: [], //村列表
- villagesList: [],
- villageSelected: '',
- townaddObj: null,
- addTownValue: '', //添加乡镇时所选乡镇的adCode
- addVillageValue: '',
- villageProps: {
- lazy: true,
- lazyLoad (node, resolve) {
- _this.curNode = node
- _this.curResolve = resolve
- const { level } = node;
- if(level < 1){
- _this.cascaderTown(node, resolve)
- }else{
- _this.cascaderVillage(node, resolve)
- }
-
- }
- },
- townSelectedStation: null, //监测站行政区划
- villageSelectedStation: null, //监测站行政区划
- customDiviDialogVisible: false,
- rootCode: '',
- curNode: null,
- curResolve: null,
- curTownName: '',
- adFullName: ''
- }
- },
- components: {
- upload: resolve => {
- require(["@widget/uploadFile.vue"], resolve);
- },
- pblmEascader,
- addCustomDivisionCom
- },
- computed: {
- recPers() {
- return localStorage.getItem('userid') ? localStorage.getItem('userid') : '';
- },
- stationDisabled(){
- return this.t1.indexOf('县') > -1
- },
- showStation(){
- if(this.t1){
- return this.t1.indexOf('站') > -1 || this.t1.indexOf('接收') > -1 || this.t1.indexOf('县') > -1
- }
- },
- showTown(){
- if(this.t1){
- return this.t1.indexOf('乡') > -1
- }
- },
- showVillage(){
- if(this.t1){
- return this.t1.indexOf('村') > -1
- }
- },
- isStation(){
- return this.t1.indexOf('站') > -1
- },
- isReceive(){
- return this.t1.indexOf('接收') > -1
- },
- },
- mounted() {
- this.newPblmValue = this.newModelData;
- if(this.newPblmValue){
- this.t1 = this.newPblmValue.model[0];
- this.t2 = this.newPblmValue.model[1];
- this.t3 = this.newPblmValue.label;
- this.getYanZhongChengDu();
- }
- this.problemForm.inspAddDesc = this.adName
- this.newStationObj.location = this.adName
- this.getStationList()
- this.getTownList()
- },
- methods:{
- cascaderTown(node, resolve){
- let adCode = this.adCode
- let townsList = []
- getTownsListApi(adCode,this.regId).then(
- (res) => {
- if (res.success && res.data) {
- this.townsList = res.data;
- this.townsList.forEach(item=>{
- townsList.push({value: item.adCode,label: item.adName, leaf: node.level})
- })
- } else {
- this.townsList = [];
- }
- console.log(townsList)
- resolve(townsList)
- },
- (err) => {
- }
- );
- },
- cascaderVillage(node, resolve, resolveLast){
- let villagesList = []
- console.log(node)
- this.rootCode = node.value
- getVillageListApi(node.value,this.regId).then(
- (res) => {
- if (res.success && res.data) {
- this.villagesList = res.data;
- this.villagesList.forEach(item=>{
- villagesList.push({value: item.adCode,label: item.adName, leaf: node.level})
- })
- } else {
- this.villagesList = [];
- }
- if(resolveLast){
- let newItemIndex = villagesList.length - 1
- let newItemArray = [villagesList[newItemIndex]]
- resolve(newItemArray)
- }else{
- resolve(villagesList)
- }
- },
- (err) => {
- }
- );
- },
- getYanZhongChengDu(){
- request.post('/dc/insp/pblms/getPblmsByType', {
- inspPblmsName:this.t1,
- checkPoint:this.t2,
- pblmDesc:this.t3,
- type: this.objType
- }).then(res => {
- if (res.success) {
- this.inspPblmCate=res.data.inspPblmCate;
- }
- })
- },
- toAddNewStation(){
- this.getTownsList()
- this.addNewStationVisible = true
- },
- // 添加监测站/接收端
- addNewStation(){
- let inspObjType
- if(this.t1.indexOf('站') > -1){
- inspObjType = 1
- }else if(this.t1.indexOf('接收') > -1){
- inspObjType = 2
- }
- this.$refs.stationForm.validate(valid=>{
- if(valid){
- let data = {
- inspObjType: inspObjType,
- rgstrId: this.regId,
- recPersId: this.recPers
- }
- Object.assign(data,this.newStationObj)
- addNewStationApi(data).then(
- (res) => {
- if (res.success) {
- this.$message.success('添加成功')
- this.getStationList()
- this.addNewStationVisible = false
- } else {
- this.$message.success(res.message)
- }
- },
- (err) => {
- }
- );
- }else{
- return false
- }
- })
- },
- toAddNewTown(){
- this.getTownsList()
- this.addNewTownVisible = true
- },
- addNewTown(){
- if(!this.addTownValue){
- this.$message.warning('请选择乡镇')
- return
- }
- let adName
- this.townsList.forEach(ele=>{
- if(ele.adCode == this.addTownValue){
- adName = ele.adName
- }
- })
- let data = {
- adCode: this.addTownValue,
- adName: adName,
- inspObjName: adName,
- inspObjType: 3,
- rgstrId: this.regId,
- recPersId: this.recPers
- }
- addNewStationApi(data).then(
- (res) => {
- if (res.success) {
- this.$message.success('添加成功')
- this.getTownList()
- this.addNewTownVisible = false
- } else {
- this.$message.success(res.message)
- }
- },
- (err) => {
- }
- );
- },
- toAddNewVillage(){
- this.addNewVillageVisible = true
- },
- addNewVillage(){
- let addVillageValue = this.addVillageValue[1]
- if(!addVillageValue){
- this.$message.warning('请选择村')
- return
- }
- let adName
- this.villagesList.forEach(ele=>{
- if(ele.adCode == addVillageValue){
- adName = ele.adName
- }
- })
- let cascaderNodes = this.$refs.cascaderRef.getCheckedNodes()
- this.curTownName = cascaderNodes[0].parent.data.label
- let data = {
- adCode: addVillageValue,
- adName: `${this.curTownName}-${adName}`,
- inspObjName: adName,
- inspObjType: 4,
- rgstrId: this.regId,
- recPersId: this.recPers
- }
- addNewStationApi(data).then(
- (res) => {
- if (res.success) {
- this.$message.success('添加成功')
- this.getVillageList()
- this.addNewVillageVisible = false
- } else {
- this.$message.success(res.message)
- }
- },
- (err) => {
- }
- );
- },
- // 问题提交
- onSubmit(problemForm) {
- let _self = this;
- if(this.showStation){
- this.stationList.forEach(ele=>{
- if(ele.id == this.problemForm.cwsCode){
- this.problemForm['newVillName'] = ele.inspObjName
- }
- })
- }else if(this.showTown){
- this.townList.forEach(ele=>{
- if(ele.adCode == this.problemForm.cwsCode){
- this.problemForm['newVillName'] = ele.inspObjName
- }
- })
- }else if(this.showVillage){
- this.villageList.forEach(ele=>{
- if(ele.adCode == this.problemForm.cwsCode){
- this.problemForm['newVillName'] = ele.inspObjName
- }
- })
- }
- this.problemForm['adCode'] = this.adCode
- this.problemForm['adFullName'] = this.adName
- if(!_self.isClicked){
- _self.$refs[problemForm].validate((valid) => {
- if (valid) {
- _self.problemForm.villType = '27';
- _self.problemForm.recPers = _self.recPers
- _self.problemForm.objId = _self.objId;
- _self.problemForm.regid = _self.regId;
- _self.problemForm.nm = _self.objName
- _self.problemForm.objType = '27';
- _self.problemForm.pblmStat = "0";
- _self.problemForm['inspPblmCate'] = _self.inspPblmCate;// add by lch 解决添加问题时 该字段不能为空的错
- _self.problemForm['inspPblmName'] = _self.t1;
- _self.problemForm['inspPblmDesc'] = _self.problemForm.inspPblmDesc;
- _self.problemForm['inspPlbmType'] = _self.t2;
- // this.problemForm['inspPblmName'] = this.t3.pblmDesc;
- _self.problemForm['inspPblmCode'] = _self.t3;
- _self.problemForm['pblmsTypeId'] = _self.newPblmValue.model[2];
- if (!_self.problemForm.inspPblmName) {
- _self.$message.info('问题类别不能为空')
- return
- }
- if (!_self.problemForm.inspPlbmType) {
- _self.$message.info('检查项目不能为空')
- return
- }
- if (!_self.problemForm.inspPblmCode) {
- _self.$message.info('问题描述不能为空')
- return
- }
- _self.isClicked = true
- request.post('/dc/insp/pblm', _self.problemForm).then(res => {
- if (res.success) {
- _self.pblmId = res.data.pblmId;
- _self.gwComFiles = [];
- _self.pblmStat = res.data.pblmStat;
- if (_self.$refs.uploadFile.submitUpload(res.data.pblmId)) {
- _self.removeNewSupervision();
- }
- }
- _self.isClicked = false
- })
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- }
- },
- // 获取监测站/接收端列表数据
- getStationList(){
- let inspObjType
- if(this.t1.indexOf('站') > -1){
- inspObjType = 1
- }else if(this.t1.indexOf('接收') > -1){
- inspObjType = 2
- }
- let data = {
- inspObjType: inspObjType,
- rgstrId: this.regId
- }
- getStationListApi(data).then(
- (res) => {
- if (res.success && res.data) {
- this.stationList = res.data;
- } else {
- this.stationList = [];
- }
- },
- (err) => {
- }
- );
- },
- // 获取乡镇数据
- getTownList(){
- let data = {
- inspObjType: 3,
- rgstrId: this.regId
- }
- getStationListApi(data).then(
- (res) => {
- if (res.success && res.data) {
- this.townList = res.data;
- } else {
- this.townList = [];
- }
- },
- (err) => {
- }
- );
- },
- // 获取村数据
- getVillageList(){
- let data = {
- inspObjType: 4,
- rgstrId: this.regId
- }
- getStationListApi(data).then(
- (res) => {
- if (res.success && res.data) {
- this.villageList = res.data;
- } else {
- this.villageList = [];
- }
- },
- (err) => {
- }
- );
- },
- // 获取乡镇列表数据
- getTownsList(){
- let adCode = this.adCode
- getAdXBaseData(adCode).then(
- (res) => {
- if (res.success && res.data) {
- this.townsList = res.data;
- this.adFullName = res.data[0].adFullName
- } else {
- this.townsList = [];
- }
- },
- (err) => {
- }
- );
- },
- // 获取村列表数据
- getVillagesList(){
- let adCode = this.selectAdCode
- getAdXBaseData(adCode).then(
- (res) => {
- if (res.success && res.data) {
- this.villagesList = res.data;
- this.adFullName = res.data[0].adFullName
- } else {
- this.villagesList = [];
- }
- },
- (err) => {
- }
- );
- },
- // 文件上传
- submitUpload() {
- this.$refs.upload.submit();
- },
- updatefilelist(arg) {
- request.post('/dc/insp/pblm/update', {
- pblmId: this.pblmId,
- gwComFiles: arg,
- pblmStat: this.pblmStat
- }).then(res => {
- this.removeNewSupervision()
- });
- },
- removeNewSupervision(arg) {
- if (arg) {
- console.log(arg);
- var args = this.gwComFiles.concat(arg);
- this.updatefilelist(args);
- return;
- }
- this.$message.success('保存成功')
- this.$emit('closeDialog')
- this.gwComFiles = [];
- this.$refs.uploadFile.init();
- },
- problemListChange: function (item) {
- this.currentCheckPointList = item.checkPoints;
- },
- currentCheckPointListChange: function (item) {
- this.currentProblemDescList = item.pblmDescs;
- },
- modelData(val){
- this.newPblmValue = val;
- this.t1 = this.newPblmValue.model[0];
- this.t2 = this.newPblmValue.model[1];
- this.t3 = this.newPblmValue.label;
- },
- selectPblm(){
- this.pblmEascaderVisible = true;
- },
- submitEascader(){
- if(!this.newPblmValue.model.length){
- this.$message.warning('问题不能为空');
- return;
- }
- this.pblmEascaderVisible = false;
- },
- stationChange(val){
- this.stationList.forEach(ele=>{
- if(ele.id == val){
- this.problemForm.inspAddDesc = ele.location
- }
- })
- },
- addCustomDivision(type){
- if(type == 'town'){
- this.rootCode = this.adCode
- }
- this.customDiviDialogVisible = true
- },
- // 添加自定义行政区划成功
- addSuccess(){
- if(this.curNode){
- let cascaderNodes = this.$refs.cascaderRef.getCheckedNodes()
- this.cascaderVillage(cascaderNodes[0], this.curResolve, 'resolveLast')
- }else{
- this.getTownsList()
- }
- this.customDiviDialogVisible = false
- },
- cancelHundler(){
- this.customDiviDialogVisible = false
- }
- },
- watch: {
- townSelected(val){
- if(val){
- this.townAdName = `${this.adName}-${val.adName}`
- this.problemForm.inspAddDesc = this.townAdName
- this.selectAdCode = val.adCode
- this.problemForm.cwsCode = val.adCode
- }else{
- this.selectAdCode = this.adCode
- this.problemForm.inspAddDesc = this.adName
- }
- },
- villageSelected(val){
- if(val){
- let adName = `${this.adName}-${val.adName}`
- this.problemForm.inspAddDesc = adName
- this.selectAdCode = val.adCode
- this.problemForm.cwsCode = val.adCode
- }else{
- this.selectAdCode = this.townSelected.adCode
- this.problemForm.inspAddDesc = this.townAdName
- }
- },
- t1(val){
- if(val){
- if(val.indexOf('站') > -1 || val.indexOf('接收') > -1){
- this.getStationList()
- }else if(val.indexOf('乡') > -1){
- this.getTownList()
- }else if(val.indexOf('村') > -1){
- this.getVillageList()
- }else{
- this.problemForm.inspAddDesc = this.adName
- }
- this.problemForm.cwsCode = ''
- }
- },
- townSelectedStation(val){
- if(val){
- this.newStationObj.adName = val.adName
- this.newStationObj.adCode = val.adCode
- this.newStationObj.location = `${this.adName}-${val.adName}`
- this.selectAdCode = val.adCode
- this.getVillagesList()
- }else{
- this.newStationObj.adName = this.adName
- this.newStationObj.adCode = this.adCode
- this.newStationObj.location = this.adName
- }
- },
- villageSelectedStation(val){
- if(val){
- this.newStationObj.adName = val.adName
- this.newStationObj.adCode = val.adCode
- this.newStationObj.location = `${this.adName}-${this.townSelectedStation.adName}-${val.adName}`
- }else{
- this.newStationObj.adName = this.adName
- this.newStationObj.adCode = this.adCode
- this.newStationObj.location = this.townSelectedStation.adName
- }
- }
- },
- }
- </script>
- <style>
- .media_item {
- float: left;
- width: 60px;
- font-size: 32px;
- }
- .pblmEascader .el-dialog__body {
- height: 15vh;
- overflow: auto;
- }
- .problem_dialog .el-icon-circle-plus{
- font-size: 16px;
- }
- </style>
|