马宇豪
2023-11-30 e312d5fcded7492d434d3bab48d31f0c3fc1dbfb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<template>
  <div class="container">
    <div class="header">
      <div>
        <el-icon :size="20">
          <Location />
        </el-icon>
        <span>我的位置:</span>
        <el-breadcrumb :separator-icon="ArrowRight">
          <el-breadcrumb-item><a href="#" @click="back">{{ state.firstClass }}</a></el-breadcrumb-item>
          <el-breadcrumb-item>查看详情</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      <div>
        <el-button plain @click="back">返回上级</el-button>
      </div>
    </div>
    <div class="main" v-if="state.firstClass == '通知公告'">
      <div class="title">{{state.content.title}}</div>
      <el-divider border-style="dashed"/>
      <div class="time">更新时间:{{state.content.updateTime?state.content.updateTime:state.content.createTime}}</div>
      <div v-html="state.content.content"></div>
    </div>
    <div class="main" v-if="state.firstClass == '法律法规'">
      <div class="title">{{state.content.title}}</div>
      <div class="sub-title">{{state.content.subTitle}}</div>
      <div class="info"><span>法律法规类别:{{state.content.lawType}}</span><span>颁布机构:{{state.content.pubAgency}}</span><span>颁布日期:{{state.content.pubDate}}</span></div>
      <el-divider border-style="dashed"/>
      <div class="time">更新时间:{{state.content.updateTime?state.content.updateTime:state.content.createTime}}</div>
      <div v-html="state.content.content"></div>
    </div>
    <div class="main" v-if="state.firstClass == '机构公示'">
      <div class="title">{{state.content.name}}</div>
      <el-divider border-style="dashed"/>
      <div class="time">更新时间:{{state.content.updateTime?state.content.updateTime:state.content.createTime}}</div>
      <el-row>
        <el-col :span="4">所在地区:</el-col>
        <el-col :span="8">{{state.content.province}}<span v-if="state.content.province&&state.content.city">/</span>{{state.content.city}}<span v-if="state.content.city&&state.content.district">/</span>{{state.content.district}}</el-col>
        <el-col :span="4">详细地址:</el-col>
        <el-col :span="8">{{state.content.address}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">社会信用代码:</el-col>
        <el-col :span="8">{{state.content.creditCode}}</el-col>
        <el-col :span="4">资质证书编号:</el-col>
        <el-col :span="8">{{state.content.certNumber}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">发证日期:</el-col>
        <el-col :span="8">{{state.content.issueDate}}</el-col>
        <el-col :span="4">有效日期:</el-col>
        <el-col :span="8">{{state.content.validDate}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">办公场所面积:</el-col>
        <el-col :span="8">{{state.content.workArea}}㎡</el-col>
        <el-col :span="4">档案室面积:</el-col>
        <el-col :span="8">{{state.content.archiveArea}}㎡</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">法定代表人:</el-col>
        <el-col :span="8">{{state.content.legalPerson}}</el-col>
        <el-col :span="4">法人电话:</el-col>
        <el-col :span="8">{{state.content.legalPhone}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">机构负责人:</el-col>
        <el-col :span="8">{{state.content.manager}}</el-col>
        <el-col :span="4">负责人电话:</el-col>
        <el-col :span="8">{{state.content.managerPhone}}</el-col>
      </el-row>
      <el-row>
        <el-col :span="4">业务范围:</el-col>
        <el-col :span="20">{{state.content.business}}</el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script setup>
import {onMounted, ref, reactive, watch, onUnmounted, defineExpose, defineEmits} from "vue"
import { ArrowRight } from '@element-plus/icons-vue'
import {ElMessage} from "element-plus";
import {getLawsDetails, getNoticeDetails, getPublishDetails} from "../../api/home/homePage";
import { getDict } from "@/api/login"
 
const route = useRoute()
const router = useRouter()
const redirect = ref(undefined);
const state = reactive({
  firstClass: '',
  content: {},
  busList: []
})
const emit = defineEmits(['backJump'])
onMounted(()=>{
  getBusiness()
})
 
onUnmounted(()=>{
 
})
 
watch(route, (newRoute) => {
  redirect.value = newRoute.query && newRoute.query.redirect;
}, { immediate: true });
 
const openDetail = async (type,id)=>{
  state.content = {}
  state.firstClass = type
  if(type == '通知公告'){
    const res = await getNoticeDetails({noticeId: id})
    if(res.code == 200){
      state.content = res.data
      if(state.content.updateTime){state.content.updateTime.substring(0.,16)}
      state.content.createTime = state.content.createTime.substring(0.,16)
    }else{
      ElMessage.warning(res.message)
    }
  }
  if(type == '法律法规'){
    const res = await getLawsDetails({lawId: id})
    if(res.code == 200){
      state.content = res.data
      if(state.content.updateTime){state.content.updateTime.substring(0.,16)}
      state.content.createTime = state.content.createTime.substring(0.,16)
    }else{
      ElMessage.warning(res.message)
    }
  }
  if(type == '机构公示'){
    const res = await getPublishDetails({agencyId: id})
    if(res.code == 200){
      state.content = res.data
      if(state.content.updateTime){state.content.updateTime.substring(0.,16)}
      state.content.createTime = state.content.createTime.substring(0.,16)
      state.content.issueDate = state.content.issueDate.substring(0,10)
      state.content.validDate = state.content.validDate.substring(0,10)
      state.content.business = getName(state.content.business)
    }else{
      ElMessage.warning(res.message)
    }
  }
}
 
 
const back = ()=>{
  if(state.firstClass == '通知公告'){
    emit('backJump',2)
  }
  if(state.firstClass == '法律法规'){
    emit('backJump',3)
  }
  if(state.firstClass == '机构公示'){
    emit('backJump',4)
  }
}
 
const getBusiness = async ()=>{
  const res = await getDict({dictType: 'sys_business_scope'})
  if(res.code == 200){
    state.busList = res.data
  }else{
    ElMessage.warning(res.message)
  }
}
 
const getName = (str)=>{
  const arr = str.split(',')
  const newArr = arr.map((item)=>{
    return state.busList.find(i=>i.id == Number(item))?.label
  })
  return newArr.join(',')
}
 
defineExpose({
  openDetail
})
 
</script>
 
<style lang='scss' scoped>
.container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 170px;
 
  .header{
    width: 1200px;
    height: 60px;
    margin: 20px 0 0;
    padding: 0 15px;
    border-radius: 4px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    &>div{
      display: flex;
      align-items: center;
    }
  }
  .main{
    width: 1200px;
    border-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0,0,0,.04);
    padding: 20px 15px 40px;
    background: #fff;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
 
    .title{
      font-size: 1.8rem;
      color: #333;
      font-weight: bolder;
      text-align: center;
    }
    .sub-title{
      font-size: 1.6rem;
      color: #333;
      text-align: center;
      margin: 10px 0;
    }
    .info{
      display: flex;
      align-items: center;
      justify-content: space-around;
      text-align: center;
      font-size: 15px;
      color: #666;
    }
    .time{
      display: flex;
      align-items: center;
      justify-content: space-around;
      text-align: center;
      font-size: 15px;
      color: #666;
      margin-bottom: 15px;
    }
 
    .el-row{
      border: 1px solid #e6e6e6;
      border-bottom: none;
      font-size: 18px;
      color: #333;
      font-weight: 600;
      font-family: "PingFang SC";
 
      &:last-of-type{
        border-bottom: 1px solid #e6e6e6;
      }
      .el-col{
        padding: 15px;
        border-right: 1px solid #e6e6e6;
 
        &:last-of-type{
          border-right: none;
        }
      }
      .el-col-4{
        color: #666;
        font-weight: normal;
      }
    }
  }
}
</style>