Commit a58d16a8 by 李宁

1

1 parent f7a34c31
......@@ -8,7 +8,7 @@
data: {
info: {},
busiFlag: '--',
busiFlag: '1',
areaCode: ''
},
created: function() {
......@@ -20,9 +20,11 @@
},
methods: {
httpRequest:function(param){
let origin = "https://hhzj.lgyzpt.com"
let origin = window.origin
if(origin.includes('localhost')>0 || origin=='null' || origin.includes('file:')>0 || window.origin.includes('testznzl')){
origin = 'https://testznzl.lgyzpt.com'
}else{
origin = "https://hhzj.lgyzpt.com"
}
return new Promise(function(resolve, reject){
......@@ -63,14 +65,17 @@
url = "https://testznzl.lgyzpt.com/activity/zjbPhone/addBusi.html"
}
window.location.replace(url+"?source=zhijian&phone="+this.info.accNbr+"&areaCode="+this.areaCode+"&campaignId="+this.info.campaignId)
//window.location.replace(url+"?source=zhijian&phone="+this.info.accNbr+"&areaCode="+this.areaCode+"&campaignId="+this.info.campaignId)
// window.location.replace(
// `${url}?source=zhijian\
// &phone=${this.info.accNbr}\
// &areaCode=${this.areaCode}\
// &campaignId=${this.info.campaignId}`
// );
window.location.replace(
`${url}?source=zhijian` +
`&areaCode=${this.areaCode}` +
`&accNbr=${this.info.accNbr}` +
`&sysId=${this.info.sysId}` +
`&orderId=${this.info.orderId}` +
`&areaType=${this.info.areaType}` +
`&campaignId=${this.info.campaignId}`
)
},
goBack(){
history.go(-1)
......
......@@ -36,6 +36,6 @@
<script src="js/axios.min.js"></script>
<script src="js/vue.min.js"></script>
<script src="js/result.js?666633"></script>
<script src="js/result.js?66663993"></script>
</body>
</html>
\ No newline at end of file
......@@ -2,7 +2,8 @@
"permissions": {
"allow": [
"Bash(tree src/ -I node_modules)",
"Bash(npm run serve)"
"Bash(npm run serve)",
"Bash(tree src/)"
],
"deny": [],
"ask": []
......
<template>
<div id="app">
<router-view/>
<keep-alive>
<router-view/>
</keep-alive>
</div>
</template>
......
......@@ -20,7 +20,7 @@
/>
</div>
<el-select v-model="formData.personnelTypes" placeholder="人员类型" class="filter-select" multiple clearable>
<el-option label="装维师傅" value="1"></el-option>
<el-option label="工维人员" value="1"></el-option>
<el-option label="支撑人员" value="2"></el-option>
</el-select>
<template v-if="addressStore.cityArr.length>0">
......@@ -174,7 +174,7 @@
<el-col :span="12">
<el-form-item label="人员类型" prop="personnelType">
<el-select v-model="updatePersonStore.personnelType" :disabled="!!updatePersonStore.row.id" @change="personnelTypeChange" style="width: 100%;">
<el-option label="装维师傅" value="1"></el-option>
<el-option label="工维人员" value="1"></el-option>
<el-option label="支撑人员" value="2"></el-option>
</el-select>
</el-form-item>
......
......@@ -26,7 +26,10 @@ const routes = [
{
path: '/opportunities',
name: 'OpportunityManagement',
component: OpportunityManagement
component: OpportunityManagement,
meta: {
keepAlive: true
}
},
{
path: '/opportunitiesDetail',
......
......@@ -123,7 +123,7 @@
</el-header>
<!-- 页面内容 -->
<el-main class="dashboard-main">
<el-main class="dashboard-main" id="mainContain">
<router-view />
</el-main>
</el-container>
......
......@@ -36,6 +36,7 @@
v-model="addressStore.city"
placeholder="选择地市"
@change="cityChange"
:disabled="getData.city!=''"
clearable>
<el-option
v-for="item in addressStore.cityArr"
......@@ -49,7 +50,7 @@
<el-select
v-model="addressStore.county"
placeholder="选择区县"
@change="countyChange"
:disabled="getData.county!=''"
clearable>
<el-option
v-for="item in addressStore.countyArr"
......@@ -121,6 +122,10 @@ export default {
county: '',
countyArr: [],
},
getData:{
city: '',
county: ''
},
formData:{
gridName: '',
gridCode: '',
......@@ -134,6 +139,9 @@ export default {
}
},
created(){
let pa = JSON.parse(localStorage.getItem('accountInfo'))
this.getData.city = pa.cityCode||''
this.getData.county = pa.countyCode||''
this.queryArea()
this.handleQuery()
......@@ -146,9 +154,24 @@ export default {
}).then(res=>{
if(res.code == 200){
this.addressStore.cityArr = res.data
this.setAddressShow()
}
})
},
setAddressShow(){
let ad = this.addressStore
let gd = this.getData
if(gd.city){
ad.city = gd.city
this.cityChange(ad.city)
if(gd.county){
ad.county = gd.county
}
}
},
cityChange(value){
let ad = this.addressStore
ad.city = value
......
......@@ -362,7 +362,7 @@
v-model="audioBusiStore.reason"
type="textarea"
:rows="4"
placeholder="请输入审核不通过的理由"
placeholder="请输入理由"
></el-input>
</el-form-item>
</el-form>
......@@ -646,7 +646,7 @@ export default {
let ad = this.audioBusiStore
if(!ad.reason){
this.$message.error('请输入不通过理由')
this.$message.error('请输入理由')
return
}
......@@ -672,6 +672,7 @@ export default {
},
goBack() {
// 使用浏览器返回,这样可以触发列表页的 beforeRouteLeave 钩子
this.$router.go(-1)
},
getStatusType(status) {
......
......@@ -408,12 +408,12 @@
</el-radio-group>
</el-form-item>
<el-form-item v-if="auditForm.result == '0'" label="不通过理由" required>
<el-form-item label="理由" required>
<el-input
v-model="auditForm.reason"
type="textarea"
:rows="4"
placeholder="请输入审核不通过的理由"
placeholder="请输入理由"
></el-input>
</el-form-item>
</el-form>
......@@ -523,6 +523,10 @@ export default {
// 分页
currentPage: 1,
pageSize: 20,
// 滚动位置相关
savedScrollPosition: 0,
currentScrollPosition: 0,
scrollTimer: null,
}
},
created(){
......@@ -532,12 +536,123 @@ export default {
this.getData.grid = pa.gridCode||''
this.queryArea()
this.queryBusi()
this.queryStatistics()
this.queryStatus()
this.queryAllBusiLabel()
},
mounted() {
// 延迟注册滚动事件监听器,确保DOM已完全加载
this.$nextTick(() => {
setTimeout(() => {
document.querySelector('#mainContain').addEventListener('scroll', this.handleScroll, { passive: true })
console.log('滚动事件监听器已注册')
}, 100)
})
},
// keep-alive 激活时的生命周期钩子
activated() {
// 重新注册滚动事件监听器
window.addEventListener('scroll', this.handleScroll, { passive: true })
console.log('组件被激活,重新注册滚动监听')
},
// 组件失活时移除监听器
deactivated() {
window.removeEventListener('scroll', this.handleScroll)
console.log('组件失活,移除滚动监听')
},
// 组件销毁时移除监听器
beforeDestroy() {
if (this.scrollTimer) {
clearTimeout(this.scrollTimer)
}
window.removeEventListener('scroll', this.handleScroll)
console.log('组件销毁,清理资源')
},
// 添加页面生命周期钩子
beforeRouteLeave(to, from, next) {
// 保存当前状态到 localStorage
this.saveState()
next()
},
methods: {
// 保存页面状态
saveState() {
const state = {
formData: this.formData,
addressStore: this.addressStore,
pageStore: this.pageStore,
scrollPosition: this.currentScrollPosition
}
localStorage.setItem('opportunityManagementState', JSON.stringify(state))
},
// 恢复页面状态
restoreState() {
const savedState = localStorage.getItem('opportunityManagementState')
if (savedState) {
try {
const state = JSON.parse(savedState)
// 恢复筛选条件
if (state.formData) {
this.formData = { ...this.formData, ...state.formData }
}
// 恢复地址选择
if (state.addressStore) {
this.addressStore = { ...this.addressStore, ...state.addressStore }
}
// 恢复分页
if (state.pageStore) {
this.pageStore = { ...this.pageStore, ...state.pageStore }
}
// 恢复滚动位置
if (state.scrollPosition !== undefined) {
this.savedScrollPosition = state.scrollPosition
}
// 清除保存的状态,避免过期数据
localStorage.removeItem('opportunityManagementState')
} catch (error) {
console.error('恢复状态失败:', error)
}
}else{
this.setAddressShow()
}
this.queryBusi()
},
// 滚动事件处理函数
handleScroll() {
// 使用节流优化性能
if (this.scrollTimer) {
clearTimeout(this.scrollTimer)
}
this.scrollTimer = setTimeout(() => {
this.currentScrollPosition = document.querySelector('#mainContain').scrollTop
console.log('当前滚动位置:', this.currentScrollPosition)
}, 100)
},
// 恢复滚动位置
restoreScrollPosition() {
if (this.savedScrollPosition > 0) {
// 使用多种方式确保兼容性
document.querySelector('#mainContain').scrollTop = this.savedScrollPosition
console.log('恢复滚动位置到:', this.savedScrollPosition)
// 重置保存的滚动位置
this.savedScrollPosition = 0
}
},
ifCanAudio(row){
return row.status!=3 || (row.opportunityType==2&&this.getData.grid)
},
......@@ -603,7 +718,8 @@ export default {
if(res.code == 200){
this.addressStore.cityArr = res.data
this.setAddressShow()
this.restoreState()
}
})
},
......@@ -671,7 +787,6 @@ export default {
}
}
}
},
cityChange(value){
let ad = this.addressStore
......@@ -765,8 +880,12 @@ export default {
}).then(res=>{
if(res.code == 200){
this.tableData = res.data.records
this.pageStore.total = res.data.total
// 数据加载完成后恢复滚动位置
this.$nextTick(() => {
this.restoreScrollPosition()
})
}else{
this.$message.error(res.message)
}
......@@ -846,8 +965,14 @@ export default {
this.selectedTag = ''
this.dateRange = []
this.currentPage = 1
// 清除保存的状态
localStorage.removeItem('opportunityManagementState')
},
checkDetail(row){
// 保存当前状态
this.saveState()
localStorage.setItem('detailId',row.id)
this.$router.push(`/opportunitiesDetail`)
......@@ -871,8 +996,8 @@ export default {
return
}
if (this.auditForm.result == '0' && !this.auditForm.reason.trim()) {
this.$message.error('审核不通过时必须填写理由')
if (!this.auditForm.reason.trim()) {
this.$message.error('请输入理由')
return
}
......
......@@ -211,6 +211,6 @@
<script src="js/vue.min.js"></script>
<script src="js/util.js"></script>
<script src="js/addressData.js"></script>
<script src="js/addBusi.js?0911"></script>
<script src="js/addBusi.js?0910001"></script>
</body>
</html>
\ No newline at end of file
......@@ -54,7 +54,7 @@
</div>
</div>
<!-- 营销人员 -->
<div class="info-row" data-node-id="294:2298" v-else>
<div class="info-row" data-node-id="294:2298" v-else-if="businessDetail.marketingStaffPhone">
<span class="info-label" data-node-id="294:2299">营销人员</span>
<div class="phone-container" data-node-id="294:2300">
<span class="info-value" data-node-id="294:2301">{{ businessDetail.marketingStaffPhone }}</span>
......@@ -228,7 +228,7 @@
<div class="cancel" @click="cdStore.isShow=false">取消</div>
<div class="submit" @click="cdSubmit">确认成单</div>
</div>
<div class="botTs">提交后将进入审核流程,审核通过前可以撤回</div>
<div class="botTs">提交后将进入审核流程</div>
</div>
</div>
......
......@@ -528,7 +528,7 @@ body {
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.9);
background: rgba(0, 0, 0, 0.7);
z-index: 99999;
display: flex;
align-items: center;
......
......@@ -256,14 +256,58 @@ new Vue({
*/
initData() {
this.haZjData = {
accNbr: utils.getUrlParam('phone'),
sysId: utils.getUrlParam('sysId'),
accNbr: utils.getUrlParam('accNbr'),
orderId: utils.getUrlParam('orderId'),
campaignId: utils.getUrlParam('campaignId'),
areaType: utils.getUrlParam('areaType'),
areaCode: utils.getUrlParam('areaCode'),
}
this.getAddress()
this.contactPhone = this.haZjData.accNbr
},
getAddress(){
this.httpRequest({
url: '/zhijian/ha/getOrderInfo',
data: {...this.haZjData,...{
realAddress: '无所谓',
latitude: '123.123',
longitude: '123.2123',
cmcc: false
}}
}).then(res=>{
if(res.code == '200'){
this.haZjData.address = res.data.addressName||''
}
})
},
httpRequest:function(param){
let origin = window.origin
if(origin.includes('localhost')>0 || origin=='null' || origin.includes('file:')>0 || window.origin.includes('testznzl')){
origin = 'https://testznzl.lgyzpt.com'
}else{
origin = "https://hazj.lgyzpt.com"
}
return new Promise(function(resolve, reject){
axios ({
method: 'post',
url:origin + param.url,
timeout: param.time||15000,
data:param.data,
headers: {
'Content-Type': 'application/json'
}
}).then((res) => {
resolve(res.data)
}).catch(res => {
reject(res)
})
})
},
/**
* 手机号脱敏处理
*/
......
......@@ -134,6 +134,8 @@ new Vue({
data: fd
})
if (result.code == 200) {
utils.toast('跟进提交成功!');
this.gjStore.isShow = false
......
......@@ -8,7 +8,7 @@ new Vue({
loginForm: {
employeeId: '',
phoneNumber: '',
verifyCode: ''
verifyCode: '123456'
},
countdown: 0,
countdownTimer: null,
......@@ -19,16 +19,16 @@ new Vue({
this.platform = type
localStorage.setItem('platform',type)
// if(type == 'gw'){
// this.loginForm.employeeId = '54321'
// this.loginForm.phoneNumber = '15611154004'
// }else if(type == 'yx'){
// this.loginForm.employeeId = '12345'
// this.loginForm.phoneNumber = '13718590607'
// }else{
// this.loginForm.employeeId = '54321'
// this.loginForm.phoneNumber = '13212789513'
// }
if(type == 'gw'){
this.loginForm.employeeId = '54321'
this.loginForm.phoneNumber = '15611154004'
}else if(type == 'yx'){
this.loginForm.employeeId = '12345'
this.loginForm.phoneNumber = '13718590607'
}else{
this.loginForm.employeeId = '54321'
this.loginForm.phoneNumber = '13212789513'
}
},
getVerifyCode() {
let pa = this.loginForm
......
......@@ -72,6 +72,6 @@
<script src="js/axios.min.js"></script>
<script src="js/vue.min.js"></script>
<script src="js/util.js"></script>
<script src="js/login.js?1233"></script>
<script src="js/login.js?123333"></script>
</body>
</html>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!