fix:行政区划

This commit is contained in:
zhangwenzan 2025-09-18 14:22:09 +08:00
parent f7050b1f92
commit 24e79521a4
2 changed files with 96 additions and 50 deletions

View File

@ -6,7 +6,7 @@ import request from '@/utils/request'
*/
export function getXzqhList() {
return request({
url: 'crmXzqhDm/list',
url: 'crmXzqh/treeOptions',
method: 'get',
headers: {
'Content-Type': 'application/json;charset=UTF-8'

View File

@ -63,28 +63,54 @@
@click="handlePoolAction">
同步数据
</el-button>
<div class="time-container">
<!-- 添加时间选择输入框 -->
<el-date-picker
v-if="poolId === 34557"
v-model="currentDateTime"
type="datetime"
placeholder="选择日期时间"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
class="time-select"
/>
<div v-if="poolId === 34557" class="time-container">
<el-form>
<el-row>
<el-col :span="1"><p>地区</p></el-col>
<el-col :span="10">
<el-table-column>
<el-cascader
v-if="poolId === 34557"
:props="{ checkStrictly: true }"
:options="xzqhOptions"
style="width: 150px"
v-model="selectedOptions"
placeholder="选择地区"
class="time-select"
clearable/>
</el-table-column>
</el-col>
<el-col :span="2"><p>开业日期</p></el-col>
<el-col :span="10">
<el-table-column>
<el-date-picker
v-if="poolId === 34557"
v-model="currentDateTime"
type="datetime"
style="width: 150px"
placeholder="选择日期时间"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
class="time-select"
/>
</el-table-column>
</el-col>
<el-col :span="1">
<el-button
v-if="poolId === 34557"
:loading="isSubmitting"
type="primary"
size="small"
style="margin-left: 2px;height: 40px"
@click="queryGsdjxxByDate"
>
查询
</el-button>
</el-col>
</el-row>
</el-form>
<!-- 添加查询按钮 -->
<el-button
v-if="poolId === 34557"
:loading="isSubmitting"
type="primary"
size="small"
style="margin-left: 2px;height: 40px"
@click="queryGsdjxxByDate"
>
查询
</el-button>
<!-- 操作反馈提示 -->
<div v-if="submitSuccess" class="success-message">
<el-alert :closable="false" title="查询成功!" type="success" show-icon/>
@ -203,13 +229,11 @@
</el-table-column>
<el-form-item style="padding-top: 30px">
地区
<el-select v-model="xzqhDm" placeholder="请选择">
<el-option
v-for="item in xzqhList"
:key="item.xzqhDm"
:label="item.xzqhMc"
:value="item.xzqhDm"/>
</el-select>
<el-cascader
:options="xzqhOptions"
v-model="selectedOptions"
:props="{ checkStrictly: true }"
clearable/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -262,12 +286,11 @@
</template>
<script>
import { crmCustomerPoolNameListAPI, crmCustomerPoolQueryAuthAPI } from '@/api/crm/customer'
import {crmCustomerPoolNameListAPI, crmCustomerPoolQueryAuthAPI} from '@/api/crm/customer'
import {getXzqhList} from '@/api/crm/xzqh'
import CustomerDetail from '../customer/Detail'
import TableMixin from '../mixins/Table'
import { getXzqhList } from '../../../api/crm/xzqh'
import { queryGsdjxxByDate, syGsdjxx } from '../../../api/crm/gsdjxx'
import {queryGsdjxxByDate, syGsdjxx} from '../../../api/crm/gsdjxx'
export default {
/** 客户管理 的 公海列表 */
@ -305,7 +328,9 @@ export default {
isSubmitting: false, //
autoCloseDelay: 3000, // 3
successTimer: null, //
errorTimer: null //
errorTimer: null, //
xzqhOptions: [],
selectedOptions: []
}
},
computed: {
@ -352,7 +377,8 @@ export default {
mounted() {
//
this.setDefaultDateTime()
this.queryGsdjxxByDate()
// this.queryGsdjxxByDate()
this.loadXzqhOptions()
},
created() {
this.getPoolList()
@ -384,7 +410,15 @@ export default {
clearTimeout(this.errorTimer)
const time = this.currentDateTime
queryGsdjxxByDate(time)
let xzqhDm = ''
if (this.selectedOptions) {
xzqhDm = this.selectedOptions[this.selectedOptions.length - 1]
}
let pa = {
rq: time,
xzqhDm: xzqhDm
}
queryGsdjxxByDate(pa)
.then(res => {
console.log('查询成功:', res.data)
this.list = res.data.list
@ -418,6 +452,15 @@ export default {
const day = String(now.getDate()).padStart(2, '0')
this.currentDateTime = `${year}-${month}-${day}`
},
loadXzqhOptions() {
getXzqhList().then(res => {
this.xzqhOptions = res.data
})
},
handleChange(value) {
console.log('选中的行政区划代码:', value)
//
},
/**
* 获取公海权限
*/
@ -428,28 +471,22 @@ export default {
.then(res => {
this.poolAuth = res.data || {}
})
.catch(() => {})
.catch(() => {
})
},
//
handlePoolAction() {
getXzqhList().then(resp => {
console.log(resp.data)
this.xzqhList = resp.data
this.openXky = true
})
this.openXky = true
},
//
sysGsdjxx() {
let xzqhMc = null
for (let i = 0; i < this.xzqhList.length; i++) {
if (this.xzqhList[i].xzqhDm === this.xzqhDm) {
xzqhMc = this.xzqhList[i].xzqhMc
}
if (!this.selectedOptions || this.month) {
this.$message.error('请选选择参数')
return
}
const pa = {
rq: this.month,
xzqhDm: this.xzqhDm,
xzqhMc: xzqhMc
xzqhDm: this.selectedOptions[this.selectedOptions.length - 1]
}
console.log(pa)
syGsdjxx(pa)
@ -495,7 +532,7 @@ export default {
/**
* 通过回调控制class
*/
cellClassName({ row, column, rowIndex, columnIndex }) {
cellClassName({row, column, rowIndex, columnIndex}) {
if (column.property === 'customerName') {
return 'can-visit--underline'
} else if (column.property === 'businessCheck') {
@ -525,4 +562,13 @@ export default {
.time-select {
margin-left: 50px;
}
p {
padding-left: 10px;
padding-top: 15px;
width: 100px;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>