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() { export function getXzqhList() {
return request({ return request({
url: 'crmXzqhDm/list', url: 'crmXzqh/treeOptions',
method: 'get', method: 'get',
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' 'Content-Type': 'application/json;charset=UTF-8'

View File

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