1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <template>
- <div>
- <el-button size="mini" type="primary" @click="query_arealist(dialogVisible = true)">新 建 管 辖 范 围</el-button>
- <el-dialog title="新建管辖区域" append-to-body :visible.sync="dialogVisible" width="400px">
- <el-cascader
- style="width:100%"
- class="width-240"
- v-model="value"
- :options="arealist"
- size="small"
- :props="{ checkStrictly: true }"
- @change="cascaderChange">
- </el-cascader>
- <div slot="footer" class="dialog-footer">
- <el-button size="small" @click="dialogVisible = false">取 消</el-button>
- <el-button size="small" type="primary" @click="submit()">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {mapGetters} from 'vuex'
- export default {
- props:['data'],
- data () {
- return {
- dialogVisible:false,
- value:[],
- arealist:[]
- }
- },
- computed:{
- ...mapGetters({
- dataToForm:'dataToForm'
- })
- },
- methods:{
- async query_arealist() {
- const res = await this.$api.requested({
- "classname": "system.tools",
- "method": "query_arealist",
- "content": {
- }
- })
- this.arealist = this.tool.createMenu(res.data)
- },
- cascaderChange (val) {
- console.log(val)
- },
- async submit () {
- if(this.value.length === 0) return this.$message({
- message:'请选择省份',
- type:'warning'
- })
- const res = await this.$api.requested({
- "id":"20221011144303",
- "content": {
- "sa_salearea_salescopeid":0,
- "sa_saleareaid":this.dataToForm.sa_saleareaid,
- "province":this.value[0],
- "city":this.value[1]?this.value[1]:'',
- "county":this.value[2]?this.value[2]:''
- }
- })
-
- this.tool.showMessage(res,()=>{
- this.dialogVisible = false
- this.$emit('onSuccess')
- })
- }
- }
- }
- </script>
- <style>
- </style>
|