|
@@ -2,9 +2,10 @@
|
|
|
<view class="switchRecord-container">
|
|
|
<!--顶部导航栏-->
|
|
|
<scroll-view class="scroll-view" scroll-x="true" @scroll="scroll">
|
|
|
- <view class="scroll-view-item" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id" :class="navIndex==index ? 'activite' : ''" @tap="checkIndex(index)">
|
|
|
+ <view class="scroll-view-item" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id"
|
|
|
+ :class="navIndex==index ? 'activite' : ''" @tap="checkIndex(index)">
|
|
|
{{tab.name}}
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</scroll-view>
|
|
|
<!-- 内容 -->
|
|
|
<swiper :current="navIndex" @change="tabChange" class="swiper_content">
|
|
@@ -14,15 +15,15 @@
|
|
|
</swiper-item>
|
|
|
<swiper-item class="swiper_item">
|
|
|
<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
|
|
|
- <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
+ <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
</swiper-item>
|
|
|
<swiper-item class="swiper_item">
|
|
|
<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
|
|
|
- <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
+ <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
</swiper-item>
|
|
|
<swiper-item class="swiper_item">
|
|
|
<DetailedFeedbackList v-if="globalParameter.isLeader" :listArray="listArray" />
|
|
|
- <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
+ <FeedbackList v-else :listArray="listArray" @click="onClick" @nextPage="onNextPage" />
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
<!-- 新增 -->
|
|
@@ -34,7 +35,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { ref } from "vue"
|
|
|
+ import { ref, computed } from "vue"
|
|
|
import * as link from '@/lib/link'
|
|
|
import rest from '@/stores/rest'
|
|
|
import { onLoad, onShow } from "@dcloudio/uni-app";
|
|
@@ -42,12 +43,11 @@
|
|
|
import { formatDate } from '@/lib/util'
|
|
|
import FeedbackList from './FeedbackList.vue'
|
|
|
import DetailedFeedbackList from './DetailedFeedbackList.vue'
|
|
|
-
|
|
|
+
|
|
|
import { useUserStore } from '@/lib/store';
|
|
|
- import { storeToRefs } from 'pinia';
|
|
|
const store = useUserStore();
|
|
|
- const { globalParameter } = storeToRefs(store);
|
|
|
-
|
|
|
+ const globalParameter = computed(() => store.getGlobalParameter);
|
|
|
+
|
|
|
const queryParams = ref({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
@@ -58,29 +58,29 @@
|
|
|
const navIndex = ref(0)
|
|
|
const tabBars = ref([
|
|
|
{
|
|
|
- name:'全部',
|
|
|
+ name: '全部',
|
|
|
id: 0
|
|
|
},
|
|
|
{
|
|
|
- name:'待受理',
|
|
|
+ name: '待受理',
|
|
|
id: 1
|
|
|
},
|
|
|
{
|
|
|
- name:'受理中 ',
|
|
|
+ name: '受理中 ',
|
|
|
id: 2
|
|
|
},
|
|
|
{
|
|
|
- name:'已办结 ',
|
|
|
+ name: '已办结 ',
|
|
|
id: 3
|
|
|
}
|
|
|
])
|
|
|
-
|
|
|
- const scroll = (e: any) => {
|
|
|
- console.log("scroll",e);
|
|
|
- scrollTop.value = e.detail.scrollTop;
|
|
|
+
|
|
|
+ const scroll = (e : any) => {
|
|
|
+ console.log("scroll", e);
|
|
|
+ scrollTop.value = e.detail.scrollTop;
|
|
|
};
|
|
|
- const checkIndex = (idx:number) => {
|
|
|
- if (navIndex.value !== idx){
|
|
|
+ const checkIndex = (idx : number) => {
|
|
|
+ if (navIndex.value !== idx) {
|
|
|
navIndex.value = idx;
|
|
|
switch (idx) {
|
|
|
case 0:
|
|
@@ -101,23 +101,23 @@
|
|
|
getList()
|
|
|
}
|
|
|
}
|
|
|
- const tabChange = async(e:any) => {
|
|
|
+ const tabChange = async (e : any) => {
|
|
|
let _idx = e.detail.current
|
|
|
checkIndex(_idx)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const listArray = ref([])
|
|
|
const list = ref() //处方列表
|
|
|
const total = ref(0)
|
|
|
const status = ref('loading')
|
|
|
-
|
|
|
+
|
|
|
const getList = async () => {
|
|
|
try {
|
|
|
// loaded.value = true;
|
|
|
- let res = await rest.get('/zyyp/feedback/page', queryParams.value,globalParameter.value.authCode)
|
|
|
+ let res = await rest.get('/zyyp/feedback/page', queryParams.value, globalParameter.value.authCode)
|
|
|
let _list = res.list
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
if (queryParams.value.pageNo === 1) {
|
|
|
list.value = _list;
|
|
|
} else {
|
|
@@ -128,45 +128,45 @@
|
|
|
if (res.total && queryParams.value.pageNo >= total.value / queryParams.value.pageSize) {
|
|
|
status.value = "noMore"
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} catch (e) {
|
|
|
} finally {
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
const titleArray = [
|
|
|
- { title: '办件编号', key: 'id' },
|
|
|
- { title: '登记时间', key: 'createTime' },
|
|
|
+ { title: '办件编号', key: 'id' },
|
|
|
+ { title: '登记时间', key: 'createTime' },
|
|
|
];
|
|
|
const leaderArray = [
|
|
|
{ title: '编号', key: 'id' },
|
|
|
{ title: '内容', key: 'fkxq' },
|
|
|
]
|
|
|
-
|
|
|
+
|
|
|
const getFormattedData = (listData) => {
|
|
|
- const selectedArray = globalParameter.value.isLeader ? leaderArray : titleArray;
|
|
|
- const formattedData = listData.map(item => {
|
|
|
- const formattedItem = selectedArray.map(titleItem => {
|
|
|
- let value = item[titleItem.key];
|
|
|
- if (titleItem.key === 'createTime') {
|
|
|
- value = formatDate(item[titleItem.key], '{y}-{m}-{d} {h}:{i}:{s}');
|
|
|
- }
|
|
|
- return {
|
|
|
- title: titleItem.title,
|
|
|
- value: value
|
|
|
- };
|
|
|
+ const selectedArray = globalParameter.value.isLeader ? leaderArray : titleArray;
|
|
|
+ const formattedData = listData.map(item => {
|
|
|
+ const formattedItem = selectedArray.map(titleItem => {
|
|
|
+ let value = item[titleItem.key];
|
|
|
+ if (titleItem.key === 'createTime') {
|
|
|
+ value = formatDate(item[titleItem.key], '{y}-{m}-{d} {h}:{i}:{s}');
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ title: titleItem.title,
|
|
|
+ value: value
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ formattedData: formattedItem,
|
|
|
+ };
|
|
|
});
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- formattedData: formattedItem ,
|
|
|
- };
|
|
|
- });
|
|
|
- listArray.value = formattedData;
|
|
|
- console.log("查询",listArray.value)
|
|
|
+ listArray.value = formattedData;
|
|
|
+ console.log("查询", listArray.value)
|
|
|
};
|
|
|
-
|
|
|
- const onNextPage = ()=> {
|
|
|
+
|
|
|
+ const onNextPage = () => {
|
|
|
if (!list.value || queryParams.value.pageNo > (total.value / queryParams.value.pageSize)) {
|
|
|
return false;
|
|
|
}
|
|
@@ -179,113 +179,114 @@
|
|
|
queryParams.value.pageNo++;
|
|
|
getList();
|
|
|
}
|
|
|
-
|
|
|
- const onClick = (e)=> {
|
|
|
+
|
|
|
+ const onClick = (e) => {
|
|
|
link.goBJDetails(e.id)
|
|
|
}
|
|
|
- const onClickAdd = ()=> {
|
|
|
+ const onClickAdd = () => {
|
|
|
link.goBJDetails()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
onLoad((data) => {
|
|
|
// alert("onLoad:" + JSON.stringify(globalParameter.value))
|
|
|
queryParams.value.zjhm = aesDecrypt(data.hzsfzh)
|
|
|
- let zjhm = aesDecrypt(data.hzsfzh)
|
|
|
- let name = aesDecrypt(data.hzxm)
|
|
|
})
|
|
|
-
|
|
|
- onShow(() => {
|
|
|
+
|
|
|
+ onShow(() => {
|
|
|
queryParams.value.pageNo = 1;
|
|
|
- if (!globalParameter.value.zjhm || !globalParameter.value.userName || !globalParameter.value.authCode || !globalParameter.value.isLeader) {
|
|
|
- queryParams.value.zjhm = localStorage.getItem('zjhm');
|
|
|
- globalParameter.value.zjhm = localStorage.getItem('zjhm');
|
|
|
- globalParameter.value.userName = localStorage.getItem('userName');
|
|
|
- globalParameter.value.authCode = localStorage.getItem('authCode');
|
|
|
- }
|
|
|
- const isLeaderStr = localStorage.getItem('isLeader');
|
|
|
- globalParameter.value.isLeader = isLeaderStr === 'true';
|
|
|
+ queryParams.value.zjhm = globalParameter.value.zjhm;
|
|
|
getList()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
-.switchRecord-container {
|
|
|
- display: flex;
|
|
|
- background-color: #f2f2f2;
|
|
|
- flex-direction: column;
|
|
|
- height: calc(100vh);
|
|
|
- position: relative;
|
|
|
+ .switchRecord-container {
|
|
|
+ display: flex;
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ flex-direction: column;
|
|
|
+ height: calc(100vh);
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .scroll-view {
|
|
|
+ background-color: #fff;
|
|
|
+ color: #3D3D3D;
|
|
|
+ display: flex;
|
|
|
+ overflow-x: auto;
|
|
|
+ white-space: nowrap;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
|
|
|
- .scroll-view {
|
|
|
- background-color: #fff;
|
|
|
- color: #3D3D3D;
|
|
|
- display: flex;
|
|
|
- overflow-x: auto;
|
|
|
- white-space: nowrap;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
+ .scroll-view-item {
|
|
|
+ display: inline-block;
|
|
|
+ width: calc(100% / 4);
|
|
|
+ height: 88rpx;
|
|
|
+ line-height: 88rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ position: relative;
|
|
|
+ /* 添加相对定位 */
|
|
|
+ box-sizing: border-box;
|
|
|
+ /* 确保边框在总宽度内计算 */
|
|
|
|
|
|
- .scroll-view-item {
|
|
|
- display: inline-block;
|
|
|
- width: calc(100% / 4);
|
|
|
- height: 88rpx;
|
|
|
- line-height: 88rpx;
|
|
|
- text-align: center;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 400;
|
|
|
- position: relative; /* 添加相对定位 */
|
|
|
- box-sizing: border-box; /* 确保边框在总宽度内计算 */
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ display: inline-block;
|
|
|
+ width: 50%;
|
|
|
+ /* 默认宽度为50% */
|
|
|
+ margin: 0 auto;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 25%;
|
|
|
+ /* 使其居中 */
|
|
|
+ height: 2rpx;
|
|
|
+ /* 默认未选中的高度 */
|
|
|
+ background: #fff;
|
|
|
+ /* 默认未选中的颜色 */
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
|
|
|
- &::after {
|
|
|
- content: '';
|
|
|
- display: inline-block;
|
|
|
- width: 50%; /* 默认宽度为50% */
|
|
|
- margin: 0 auto;
|
|
|
- position: absolute;
|
|
|
- bottom: 0;
|
|
|
- left: 25%; /* 使其居中 */
|
|
|
- height: 2rpx; /* 默认未选中的高度 */
|
|
|
- background: #fff; /* 默认未选中的颜色 */
|
|
|
- z-index: 1;
|
|
|
- }
|
|
|
+ &.activite {
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1E92F0;
|
|
|
|
|
|
- &.activite {
|
|
|
- font-weight: 600;
|
|
|
- color: #1E92F0;
|
|
|
- &::after {
|
|
|
- background: #1E92F0;
|
|
|
- height: 4rpx;
|
|
|
- width: 50%;
|
|
|
+ &::after {
|
|
|
+ background: #1E92F0;
|
|
|
+ height: 4rpx;
|
|
|
+ width: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- .swiper_content {
|
|
|
- background-color: #f2f2f2;
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- .feedback-add-icon {
|
|
|
- position: absolute;
|
|
|
- bottom: 300rpx;
|
|
|
- right: 32rpx;
|
|
|
- width: 120rpx;
|
|
|
- height: 120rpx;
|
|
|
- @include flex-center;
|
|
|
- flex-direction: column;
|
|
|
- border-radius: 50%;
|
|
|
- background-color: #fff;
|
|
|
- box-shadow: 0px 4px 10px 0px rgba(216, 216, 216, 0.8),inset 0px 4px 10px 0px rgba(216, 216, 216, 0.3);
|
|
|
- .add-icon {
|
|
|
- margin-top: 16rpx;
|
|
|
- width: 55rpx;
|
|
|
- height: 55rpx;
|
|
|
- }
|
|
|
- .add-title {
|
|
|
- color: #1E92F0;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ .swiper_content {
|
|
|
+ background-color: #f2f2f2;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .feedback-add-icon {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 300rpx;
|
|
|
+ right: 32rpx;
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ @include flex-center;
|
|
|
+ flex-direction: column;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0px 4px 10px 0px rgba(216, 216, 216, 0.8), inset 0px 4px 10px 0px rgba(216, 216, 216, 0.3);
|
|
|
+
|
|
|
+ .add-icon {
|
|
|
+ margin-top: 16rpx;
|
|
|
+ width: 55rpx;
|
|
|
+ height: 55rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .add-title {
|
|
|
+ color: #1E92F0;
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|