This commit is contained in:
jiangyinzhi
2024-07-26 10:33:01 +08:00
parent e19c6fa4ea
commit ec2f27d196
18 changed files with 258 additions and 119 deletions
+1 -1
View File
@@ -628,7 +628,7 @@ export default {
let item = JSON.parse(sessionStorage.getItem('tidCid')).item
if(!item.isPosition){
this.$notify({
message: '请在完成打卡之后提交',
message: '必须先在app打卡以后才能提交',
duration: 1000,
type: 'warning'
})
@@ -12,6 +12,7 @@
input-align="right"
placeholder="请输入"
required
:rules="[{ required: true }]"
/>
<van-field
v-model="formData.ltitude"
@@ -19,6 +20,7 @@
input-align="right"
placeholder="请输入"
required
:rules="[{ required: true }]"
/>
<van-field
v-model="formData.addressName"
@@ -26,6 +28,7 @@
input-align="right"
placeholder="请输入"
required
:rules="[{ required: true }]"
/>
<van-field
v-model="formData.clockType"
@@ -33,6 +36,7 @@
input-align="right"
placeholder="请输入"
required
:rules="[{ required: true }]"
/>
<van-field
v-model="formData.clockNum"
@@ -42,6 +46,7 @@
v-input.numNo0
type="number"
required
:rules="[{ required: true }]"
/>
<!-- <van-field
v-model="formData.clockTime"
@@ -70,6 +75,7 @@
</div>
<div class="pic">
<Uploader
ref="uploaderRef"
type="text1"
:value="text1"
:maxCount="1"
@@ -228,6 +234,26 @@ export default {
},
// 保存
save() {
if (this.$refs.uploaderRef.checkImgisUpload(this.text1)) {
this.$notify({
message: '图片尚在上传或上传失败',
duration: 1000,
background: 'red',
})
return
}
if (
this.text1 == null ||
this.text1 == [] ||
this.text1.length == 0
) {
this.$notify({
message: '请上传打卡照片',
duration: 1000,
background: 'red',
})
return
}
let params = {
...this.formData,
// clockAbout: JSON.stringify(this.text1),
+30 -29
View File
@@ -45,11 +45,11 @@
<van-uploader v-model="fileList" :max-count="3" :after-read="afterRead" :before-delete="delImg" @click-upload="onUpload" preview-size="100px" class="uploader" ref="file" />
<div class="tips tipImage" v-if="$store.getters.cityType&&fileList.length<1">请上传建筑外观照片</div>
<!-- <van-uploader v-model="fileList" multiple :max-count="3" :after-read="afterRead" :before-delete="delImg" @click-upload="onUpload" preview-size="100px" class="uploader" ref="file" /> -->
<van-field v-model="formData.buildAddr" :required="$store.getters.cityIsNx" :rules="[{ required: $store.getters.cityIsNx}]" center disabled clearable label="定位" placeholder="位置信息" class="location">
<!-- <van-field v-model="formData.buildAddr" :required="$store.getters.cityIsNx" :rules="[{ required: $store.getters.cityIsNx}]" center disabled clearable label="定位" placeholder="位置信息" class="location">
<template #button>
<van-button :disabled="showForm" native-type="button" size="small" type="primary" style="background: #0caea0" @click="getLocation">获取</van-button>
</template>
</van-field>
</van-field> -->
</van-cell-group>
</div>
</div>
@@ -339,7 +339,7 @@ export default {
tips7: false,
newAnswer: [], // 问答题存
loading:false,
result1: '',
result1: '无',
result222: '',
result333: '',
result444: '',
@@ -499,12 +499,12 @@ export default {
roomArea: '', // 数据机房面积
operationYear: '', // 建筑投运年份
peopleNum: '', // 用能人数
purchasePower: '', // 购电方式
basicCharge: '', // 基本电费
valleyElectricityPrices: '', // 是否享受峰谷平电价
photovoltaicArea: '', // 光伏总建设面积
photovoltaicPhotovoltaic: '', // 光伏总装机容量
reclaimedWater: '', // 是否采用再生水
purchasePower: '1', // 购电方式
basicCharge: '1', // 基本电费
valleyElectricityPrices: '2', // 是否享受峰谷平电价
photovoltaicArea: '0', // 光伏总建设面积
photovoltaicPhotovoltaic: '0', // 光伏总装机容量
reclaimedWater: '2', // 是否采用再生水
reclaimedWaterType: '', // 再生水类型
wallMaterials: '', // 外墙结构
doorWindowGlass: '', // 门窗玻璃
@@ -517,26 +517,26 @@ export default {
energyAudit: '', // 近三年是否进行过能源审计
heatPump: '', // 是否已使用热泵
solarWater: '', // 是否已使用太阳能热水
photovoltaic: '', // 是否已使用光伏
photovoltaic: '2', // 是否已使用光伏
enquireIds: '', // 问询中确认为是的选项id用逗号隔开(只保存为问询是的选项)
text1: '', // 图一
text2: '', // 图二
text3: '', // 图三
greenElectricityTrading: '' // 是否使用绿电交易
greenElectricityTrading: '2' // 是否使用绿电交易
},
// 页面回显数据
showData: {
buildType1: '请选择', // 建筑类型
buildTypepCode: '',
purchasePower1: '请选择', // 购电方式
purchasePower1: '普通代理', // 购电方式
reclaimedWaterType1: '请选择', // 再生水类型
wallMaterials1: '请选择', // 外墙结构
doorWindowGlass1: '请选择', // 门窗玻璃
windowFrameMaterial1: '请选择', // 窗框材料
itemizedMeasurementType1: '请选择', // 分项计量类型
basicCharge1: '请选择', // 基本电费
valleyElectricityPrices1: '请选择', // 是否享受峰谷平电价
reclaimedWater1: '请选择', // 是否采用再生水
basicCharge1: '有', // 基本电费
valleyElectricityPrices1: '否', // 是否享受峰谷平电价
reclaimedWater1: '否', // 是否采用再生水
itemizedMeter1: '请选择', // 是否有分项计量
energyPlatform1: '请选择', // 是否具有能源管理平台
energyAudit1: '请选择', // 近三年是否进行过能源审计
@@ -555,10 +555,10 @@ export default {
index15: '', // 近三年是否进行过能源审计
heatPump: '', // 是否已使用热泵
solarWater: '', // 是否已使用太阳能热水
photovoltaic: '', // 是否已使用光伏
photovoltaic: '否', // 是否已使用光伏
gfShow: '',
greenElectricityTrading1: '请选择', // 是否使用绿电交易
indexLd: '' // 是否使用绿电交易
greenElectricityTrading1: '否', // 是否使用绿电交易
indexLd: '2' // 是否使用绿电交易
},
qjnyArr: [], // 已使用清洁能源
wqjgArr: [], // 外墙结构
@@ -1987,12 +1987,12 @@ export default {
roomArea: '', // 数据机房面积
operationYear: '请选择', // 建筑投运年份
peopleNum: '', // 用能人数
purchasePower: '', // 购电方式
basicCharge: '', // 基本电费
valleyElectricityPrices: '', // 是否享受峰谷平电价
purchasePower: '1', // 购电方式
basicCharge: '1', // 基本电费
valleyElectricityPrices: '2', // 是否享受峰谷平电价
photovoltaicArea: '', // 光伏总建设面积
photovoltaicPhotovoltaic: '', // 光伏总装机容量
reclaimedWater: '', // 是否采用再生水
reclaimedWater: '2', // 是否采用再生水
reclaimedWaterType: '', // 再生水类型
wallMaterials: '', // 外墙结构
doorWindowGlass: '', // 门窗玻璃
@@ -2005,24 +2005,25 @@ export default {
energyAudit: '', // 近三年是否进行过能源审计
heatPump: '', // 是否已使用热泵
solarWater: '', // 是否已使用太阳能热水
photovoltaic: '', // 是否已使用光伏
photovoltaic: '2', // 是否已使用光伏
enquireIds: '', // 问询中确认为是的选项id用逗号隔开(只保存为问询是的选项)
text1: '', // 图一
text2: '', // 图二
text3: '', // 图三
greenElectricityTrading: '2', // 是否使用绿电交易
}),
// 页面回显数据
(this.showData = {
buildType1: '请选择', // 建筑类型
purchasePower1: '请选择', // 购电方式
purchasePower1: '普通代理', // 购电方式
reclaimedWaterType1: '请选择', // 再生水类型
wallMaterials1: '请选择', // 外墙结构
doorWindowGlass1: '请选择', // 门窗玻璃
windowFrameMaterial1: '请选择', // 窗框材料
itemizedMeasurementType1: '请选择', // 分项计量类型
basicCharge1: '请选择', // 基本电费
valleyElectricityPrices1: '请选择', // 是否享受峰谷平电价
reclaimedWater1: '请选择', // 是否采用再生水
basicCharge1: '有', // 基本电费
valleyElectricityPrices1: '否', // 是否享受峰谷平电价
reclaimedWater1: '否', // 是否采用再生水
itemizedMeter1: '请选择', // 是否有分项计量
energyPlatform1: '请选择', // 是否具有能源管理平台
energyAudit1: '请选择', // 近三年是否进行过能源审计
@@ -2041,9 +2042,9 @@ export default {
index15: '', // 近三年是否进行过能源审计
heatPump: '', // 是否已使用热泵
solarWater: '', // 是否已使用太阳能热水
photovoltaic: '', // 是否已使用光伏
photovoltaic: '否', // 是否已使用光伏
gfShow: '',
greenElectricityTrading1: '请选择', // 是否使用绿电交易
greenElectricityTrading1: '否', // 是否使用绿电交易
indexLd: '' // 是否使用绿电交易
}),
(this.qjnyArr = []), // 已使用清洁能源
+126 -58
View File
@@ -25,7 +25,9 @@
<!-- 状态popup -->
<van-popup v-model="statusPopup" position="top">
<van-popup v-model="statusPopup"
:zIndex="2010"
:overlayStyle="{ 'z-index': 2000 }" position="top">
<van-radio-group v-model="radio">
<van-cell-group>
<van-cell
@@ -40,17 +42,8 @@
</van-cell-group>
</van-radio-group>
</van-popup>
<!-- 日期popup -->
<!-- <van-popup v-model="datePopup" position="top"> -->
<!-- <van-datetime-picker
v-model="currentDate"
type="date"
@confirm="onConfirm"
@cancel="datePopup = false"
/> -->
<Year
ref="yearPopup"
:show="datePopup"
:startYear="1950"
v-model="currentDate"
@@ -60,10 +53,9 @@
title=""
@onConfirmYear="onConfirmYear"
@onCancelYear="onCancelYear" />
<!-- </van-popup> -->
<!-- 数据列表 -->
<div class="list">
<div class="list" v-if="isList" ref="scrollableDiv">
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
@@ -228,6 +220,7 @@
</div>
</div>
</van-list>
</van-pull-refresh>
</div>
<div class="btn" @click="Initiateappointment">
@@ -277,28 +270,88 @@ export default {
pageNum: 1, //当前页数
pageSize: 5, //每页多少条
taskType: null, //当前选择任务状态
appointmentTime: null, //当前选择的预约日期
year: null, //当前选择的预约日期
consName: null, //客户名称
},
refreshing: false,
timer: null,
scrollPosition: 0,
pageN: 1,
isList: false,
}
},
watch: {
'page.consName': {
handler() {
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.onSearch()
}, 1500)
}
}
},
beforeDestroy() {
// sessionStorage.removeItem('tidCid')
},
mounted() {
this.getTaskType()
const data = {
child:null,
code: null,
name: '无',
pCode: null,
value: null
async mounted() {
this.scrollPosition = sessionStorage.getItem('scrollableDiv') || 0
this.pageN = sessionStorage.getItem('pageNum') || 1
await this.getTaskType()
if (sessionStorage.getItem('taskTypeList')) {
this.page.taskType = sessionStorage.getItem('taskTypeList')
this.radio = this.taskType.findIndex(
item => item.code == this.page.taskType
)
}
if (sessionStorage.getItem('year')) {
this.page.year = sessionStorage.getItem('year')
}
if (sessionStorage.getItem('consName')) {
this.page.consName = sessionStorage.getItem('consName')
} else {
this.getTaskList()
}
this.clickRadio(data, 0)
},
methods: {
onRefresh() {
// 清空列表数据
this.finished = false
// 重新加载数据
// 将 loading 设置为 true,表示处于加载状态
// this.loading = true
this.page.taskType = ''
this.page.consName = ''
this.page.year = ''
sessionStorage.removeItem('year')
sessionStorage.removeItem('taskTypeList')
this.radio = ''
this.page.pageNum = 1
const data = {
child:null,
code: null,
name: '无',
pCode: null,
value: null
}
this.clickRadio(data, 0)
this.getTaskList()
},
//滚动DOM位置
scroll() {
this.$nextTick(() => {
const scrollableDiv = this.$refs.scrollableDiv
if (scrollableDiv) {
this.$refs.scrollableDiv.scrollTop = this.scrollPosition
this.scrollPosition = 0
sessionStorage.removeItem('scrollableDiv')
this.page.pageNum = this.pageN
this.page.pageSize = 5
}
})
},
aaa() {
var hhh = this.statusPopup
this.statusPopup = !hhh
@@ -308,6 +361,9 @@ export default {
var qqq = this.datePopup
this.datePopup = !qqq
this.statusPopup = false
this.$nextTick(()=> {
this.$refs.yearPopup.defaultIndex(this.page.year)
})
},
// 滑动加载
@@ -403,6 +459,12 @@ export default {
},
// 生成诊断报告
togenReport(item) {
this.pageN = this.page.pageNum
this.page.pageNum = 1
const scrollableDiv = this.$refs.scrollableDiv
if (scrollableDiv) {
this.scrollPosition = scrollableDiv.scrollTop || 0
}
const data = {
taskId: item.id,
customerId: item.customerId
@@ -448,6 +510,12 @@ export default {
},
// 获取任务管理列表
async getTaskList() {
this.isList = false
if (this.pageN + 1 > 1) {
this.page.pageSize = this.pageN * 5
sessionStorage.removeItem('pageNum')
}
console.log(this.page, 'ppppp');
const res = await taskList(this.page)
if (res.code == 0) {
this.taskList1 = res.data.list
@@ -459,15 +527,17 @@ export default {
this.immediateCheck = true
this.finished = false
}
this.isList = true
}
this.scroll()
},
// 获取状态下拉
getTaskType() {
async getTaskType() {
const info = {
codeSortId: 80000001031,
codeType: 'sbwxlx',
}
getCode(info).then((res) => {
await getCode(info).then((res) => {
if (res.code == 0) {
this.taskType = res.data
this.taskType.unshift({
@@ -484,46 +554,31 @@ export default {
clickRadio(item, index) {
this.radio = index
this.page.taskType = item.code
this.page.appointmentTime = ''
this.page.year = ''
this.page.pageNum = 1
this.allPage = 0
sessionStorage.setItem('taskTypeList', item.code||'')
sessionStorage.setItem('year', '')
this.getTaskList()
this.statusPopup = false
},
// 日期选择赋值
onConfirm(val) {
var date2 = new Date(val)
var y = date2.getFullYear()
var m = date2.getMonth() + 1
m = m < 10 ? '0' + m : m
var d = date2.getDate()
d = d < 10 ? '0' + d : d
let dateTime = y + '-' + m + '-' + d
this.page.pageNum = 1
this.page.appointmentTime = dateTime
this.allPage = 0
this.getTaskList()
this.datePopup = false
},
onConfirmYear(data) {
this.page.pageNum = 1
this.page.year = data.value
this.allPage = 0
sessionStorage.setItem('year', data.value)
this.getTaskList()
this.datePopup = false;
},
onCancelYear() {
this.datePopup = false;
this.page.year = ''
this.datePopup = false;
},
// 客户名称关键字查询
onSearch(){
this.page.pageNum = 1
this.allPage = 0
sessionStorage.setItem('consName', this.page.consName)
this.getTaskList()
},
goClockIn(item){
@@ -532,20 +587,31 @@ export default {
name: 'clockIn',
})
}
},
beforeRouteLeave(to, from, next) {
const scrollableDiv = this.$refs.scrollableDiv
if (scrollableDiv) {
this.scrollPosition = scrollableDiv.scrollTop || 0
sessionStorage.setItem('scrollableDiv', this.scrollPosition)
sessionStorage.setItem('pageNum', this.page.pageNum)
}
next()
}
}
</script>
<style lang="less" scoped>
.container {
height: calc(100vh - 50px);
overflow-y: auto;
height: 100vh;
overflow-y: auto;
}
.select-box {
width: 100%;
background: #fff;
font-size: 15px;
padding-bottom: 10px;
width: 100%;
background: #fff;
font-size: 15px;
padding-bottom: 10px;
position: fixed;
z-index: 2013;
}
.select {
// // width: 100%;
@@ -585,7 +651,9 @@ export default {
}
.list {
padding: 0 10px 100px;
padding: 90px 10px 20px;
height: calc(100% - 100px);
overflow: auto;
.list-item {
width: 100%;
margin-top: 16px;
@@ -742,9 +810,9 @@ export default {
}
::v-deep .van-popup--top {
top: unset;
left: 0;
width: 100%;
top: 90px;
left: 0;
width: 100%;
}
.address {