祖安之光
2025-12-04 5d6531c446e2f312d70e6d10da4bd499e856af56
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="app-container">
    <div style="display: flex;justify-content: space-between">
      <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
<!--        <el-form-item>-->
<!--          <el-button-->
<!--              type="primary"-->
<!--              plain-->
<!--              icon="Plus"-->
<!--              @click="openDialog('add',{})"-->
<!--          >新增</el-button>-->
<!--        </el-form-item>-->
        <el-form-item v-if="isAdmin" label="单位:" >
          <el-select v-model="data.queryParams.companyId" placeholder="请选择" clearable @change="getList">
            <el-option
                v-for="item in companyList"
                :key="item.id"
                :label="item.name"
                :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="年份:">
          <el-date-picker
              v-model="data.queryParams.year"
              type="year"
              value-format="YYYY"
              placeholder="请选择年份"
          />
        </el-form-item>
        <el-form-item >
          <el-button type="primary" @click="getList">查询</el-button>
          <el-button type="primary" plain @click="reset">重置</el-button>
          <el-button type="primary" plain @click="downloadFile">导出</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div v-if="dataList">
    <div class="info-card">
      <span @click="toOverview">{{dataList.companyName}}</span>为<span @click="toOverview">{{dataList.companyType == 1?'民营':dataList.companyType == 2?'私营':dataList.companyType == 3?'企事业单位':'未知'}}</span>,属于<span @click="toOverview">{{dataList.industry || '未知'}}</span>,法人证书编号:<span @click="toOverview">{{dataList.legalPersonCode || '未知'}}</span>,法人代表:<span @click="toOverview">{{dataList.legalPerson || '未知'}}</span>,公司现有员工:<span @click="toDeptEmpAnalysis">{{dataList.totalEmployee || '未知'}}</span>人,其中专业技术人员<span @click="toDeptEmpAnalysis">{{dataList.professionalEmployee || '未知'}}</span>人,注册资本<span @click="toOverview">{{dataList.registeredCapital || '未知'}}</span>元,总办公地址:<span @click="toOverview">{{dataList.officeAddress || '未知'}}</span>,其他分场所地址:<span @click="toOverview">{{dataList.otherAddress || '暂无'}}</span>。
      <br>
      <br>
      <div v-if="Array.isArray(dataList.companyCertificateVOList) && dataList.companyCertificateVOList.length>0">
        <div v-for="cert in dataList.companyCertificateVOList"><span @click="toQualifications">{{cert.getTime?cert.getTime.substring(0,10) +',' : ''}}</span>取得了<span @click="toQualifications">{{cert.certificateName}}</span>,证书编号:<span @click="toQualifications">{{cert.certificateNum }}</span>,有效期至:<span @click="toQualifications">{{cert.effectiveTime?.substring(0,10)}}</span>;</div>
      </div>
    </div>
    <div class="info-card">
      公司目前有计算机总数:<span @click="toLedger">{{dataList.computerTotal || 0}}</span>台;其他办公设备:<span @click="toLedger">{{dataList.otherOfficeEquipment || 0}}</span>台(传真机、打印机、复印机等)
      <br>
      生产设备总台数:<span @click="toLedger">{{dataList.productionEquipment || 0}}</span>台
      <br>
      检测设备总计:<span @click="toVerificationPlan">{{dataList.detectionEquipment || 0}}</span>台。
    </div>
    <div class="info-card">
      企业质量方针是:<br>
      <span v-html="dataList.companyQualityPolicy" @click="toPolicy"></span>
      <br>
      <span @click="toObjective">{{dataList.year || '暂无'}}</span>年度公司年度质量目标:<br>
      <span @click="toObjective">{{dataList.companyQualityTarget?.join('、')}}</span>
    </div>
    <div class="info-card">
      自上次审核以来共签订了<span @click="toContract">{{dataList.contractLedger || 0}}</span>份合同,已交付<span @click="toContract">{{dataList.deliveredContract || 0}}</span>个合同。
    </div>
    <div class="info-card">
      <span @click="toSatisfied">{{dataList.year || '暂无'}}</span>年客户满意度为<span @click="toSatisfied">{{dataList.sumSatisficing + '%' || '暂无'}}</span>,<span @click="toInternalKnowledge">{{dataList.year || '暂无'}}</span>年取得<span @click="toInternalKnowledge">{{dataList.patent || 0}}</span>个专利(发明/实用新型/软著)。
    </div>
    <div class="info-card" v-if="dataList.trainPlanName && dataList.trainPlanName !== ''">
      <span @click="toTrainPlan">{{dataList.year || '暂无'}}</span>年度安排了<span @click="toTrainPlan">{{dataList.trainPlanName}}</span>。
    </div>
    <div class="info-card">
      <span @click="toInnerReview">{{dataList.year || '暂无'}}</span>进行了本年度内审,本次内审发现<span @click="toInnerReview">{{dataList.internalAuditCheckResult || 0}}</span>个不符合项。
      <br>
      <span @click="toAuditReport">{{dataList.year || '暂无'}}</span>进行了本年度管理评审,提出了<span @click="toImprovement">{{dataList.conStatisticNum || 0}}</span>个改进项。
    </div>
    <div class="info-card" v-if="dataList.outsourcedProduct && dataList.outsourcedProduct !== ''">
      外包过程包含<span @click="toOutsourced">{{dataList.outsourcedProduct}}</span>。
    </div>
    <div class="info-card">
      自上次审核以来,人员增加了<span @click="toPersonalFile">{{dataList.totalEmployeeAdd || 0}}</span>人,其中技术人员<span @click="toPersonalFile">{{dataList.professionalEmployeeAdd || 0}}</span>人,检测设备增加<span @click="toVerificationPlan">{{dataList.detectionEquipmentAdd || 0}}</span>台。<span @click="toTrainPlan">{{dataList.year || '暂无'}}</span>年培训实施<span @click="toTrainPlan">{{dataList.trainPlanCompleted || 0}}</span>次。
    </div>
    </div>
    <div v-else>
      暂无该企业信息
    </div>
  </div>
</template>
 
<script setup>
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {delCompany, getCompany} from "@/api/onlineEducation/company";
import Cookies from "js-cookie";
import useUserStore from "@/store/modules/user";
import {getDepEmpsDetail, getSituationSumDetail} from "@/api/staffManage/staff";
import * as echarts from 'echarts';
import {getSixInspectionDetail} from "@/api/assetManage/assetMng";
import {generateWordDocument} from './components/exportDoc.js'
import {useRouter} from "vue-router";
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const data = reactive({
  queryParams: {
    companyId: null,
    year: ''
  },
  total: 0,
  dataList: {},
  companyList: [],
  isAdmin: false
});
 
const { queryParams, total, dataList,companyList, isAdmin } = toRefs(data);
const userInfo = ref()
const router = useRouter()
onMounted(async ()=>{
  data.queryParams.year = new Date().getFullYear().toString()
  userInfo.value = JSON.parse(Cookies.get('userInfo'))
  if(userStore.roles.includes('admin')){
    data.isAdmin = true
    await getCompanyList()
  }else{
    data.isAdmin = false
    data.queryParams.companyId = userStore.companyId
  }
  await getList()
})
 
onUnmounted(()=>{
 
})
const toOverview = () => {
  router.push({path: '/build/companyInfo/overview'})
}
 
const toDeptEmpAnalysis = () => {
  router.push({path: '/work/humanResources/empResource/deptEmpAnalysis'})
}
 
const toQualifications = () => {
  router.push({path: '/build/companyInfo/qualifications'})
}
 
const toLedger = () => {
  router.push({path: '/work/assetManagement/infrastructureMng/ledger'})
}
const toVerificationPlan = ()=>{
  router.push({path: '/work/assetManagement/toolsMonitorMeasure/annualVerificationPlan'})
}
const toPolicy = ()=>{
  router.push({path: '/build/companyInfo/policy'})
}
const toObjective = ()=>{
  router.push({path: '/build/companyInfo/qualityObjectives/objective'})
}
 
const toContract = ()=>{
  router.push({path: '/work/marketingManagement/contractManagement/contractLedger'})
}
const toSatisfied = ()=>{
  router.push({path: '/work/marketingManagement/satisfiedEvaluste/report'})
}
const toInternalKnowledge = () =>{
  router.push({path: '/work/knowledgePlatform/internalKnowledge'})
}
const toTrainPlan = ()=>{
  router.push({path: '/work/humanResources/onlineEducation/trainPlan'})
}
const toInnerReview = ()=>{
  router.push({path: '/work/digitalFileDep/internalAudit/innerReviewSheet'})
}
const toAuditReport = ()=>{
  router.push({path: '/work/digitalFileDep/mngAudit/mngAuditReport'})
}
const toImprovement = ()=>{
  router.push({path: '/work/digitalFileDep/continuousImprovement'})
}
const toOutsourced = ()=>{
  router.push({path: '/work/procurementPlatform/outsourcingCooperate/outsourcedProductName'})
}
const toPersonalFile =()=>{
  router.push({path: '/work/humanResources/empResource/personalFile'})
}
const getList = async () => {
  loading.value = true
  const res = await getSituationSumDetail(data.queryParams)
  if(res.code == 200){
    data.dataList = res.data
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
 
const getCompanyList = async ()=>{
  const queryParams = {
    pageNum: 1,
    pageSize: 999
  }
  const res = await getCompany(queryParams)
  if (res.code == 200) {
    data.companyList = res.data.list?res.data.list:[]
    data.queryParams.companyId = data.companyList[0].id
  } else {
    ElMessage.warning(res.message)
  }
}
 
const downloadFile = async ()=>{
    if(data.dataList){
      const tableData = {
        ...data.dataList,
        companyTypeName: data.dataList.companyType== 1?'民营':data.dataList.companyType == 2?'私营':data.dataList.companyType == 3?'企事业单位':'未知',
        certList: data.dataList.companyCertificateVOList ? data.dataList.companyCertificateVOList.map((item,i)=>{
          return {
            ...item,
            index: i + 1,
            getTime: item.getTime ? item.getTime.substring(0,10): '',
            effectiveTime: item.effectiveTime ? item.effectiveTime.substring(0,10): ''
          }
        }): [],
        qualityTarget: data.dataList.companyQualityTarget ? data.dataList.companyQualityTarget.join('、'): '',
        otherAddress: data.dataList.otherAddress? data.dataList.otherAddress : '暂无',
        trainPlanName: data.dataList.trainPlanName? `安排了${data.dataList.trainPlanName},对质量方面的提升也起到了至关重要的作用` : '无培训计划',
        outsourcedProduct: data.dataList.outsourcedProduct? `外包过程包含${data.dataList.outsourcedProduct},从供应商选择开始,就要进行审核、评价,确认选择合适的供应商进行外包。从首件、样件、产品都会进行检验确认,符合要求的产品才能入厂进行生产。定期对供应商进行评价,持续确保供应商符合我们产品的要求。` : '暂无外包过程。',
      }
      try {
        generateWordDocument('/summaryInfo.docx', tableData, tableData.companyName + '情况汇总.docx');
      } catch (error){
        ElMessage({
          type: 'warning',
          message: '导出失败'
        });
      }
    }else{
      ElMessage.warning('暂无数据')
    }
}
 
/** 重置新增的表单以及其他数据  */
const reset= async()=> {
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    companyId: null,
    year: new Date().getFullYear().toString()
  }
  await getCompanyList()
  await getList()
}
 
</script>
<style lang="scss" scoped>
  .info-card{
    background:#fff;
    padding: 20px;
    border-radius: 0.6rem;
    border: 1px solid #f0f0f0;
    margin-bottom: 10px;
 
    span{
      color: #2563EB;
      cursor: pointer;
      &:hover{
        text-decoration: underline;
      }
    }
  }
</style>