zhouwenxuan
2024-02-20 5d6dd045d7a83a2388759a422b2408266f08eb97
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
<template>
  <div class="project-dialog">
    <el-dialog
        v-model="dialogVisible"
        title="评价的项目列表"
        width="800px"
        :before-close="handleClose"
    >
      <!-- 表格数据 -->
      <el-table v-loading="loading" :data="dataList" :border="true" ref="tableRef"  style="width: 100%;">
        <el-table-column label="序号" width="80" align="center" type="index" ></el-table-column>
        <el-table-column label="项目名称" prop="name" align="center" :show-overflow-tooltip="true" width="180" />
        <el-table-column label="委托单位" prop="client" align="center"  :show-overflow-tooltip="true" width="180"/>
        <el-table-column label="所属地市" prop="updateTime" align="center"  width="250">
          <template #default="scope">
            {{scope.row.area}}
          </template>
        </el-table-column>
        <el-table-column label="评价类型" prop="estimateTypeName" align="center"  width="150"/>
        <el-table-column label="业务范围" prop="businessName" align="center" :show-overflow-tooltip="true" width="150"/>
        <el-table-column label="项目负责人" prop="leaderName" align="center"  width="120" :show-overflow-tooltip="true"/>
        <el-table-column label="项目阶段"  align="center"  width="200">
          <template #default="scope">
            <div v-if="scope.row.process === 1" class="process1">
              <span>风险分析及计划评价</span>
            </div>
            <div v-else-if="scope.row.process === 2" class="process1 process2">
              <span>现场勘验</span>
            </div>
            <div v-else-if="scope.row.process === 3" class="process1 process3">
              <span>项目审核</span>
            </div>
            <div v-else-if="scope.row.process === 4" class="process1 process4">
              <span>出具报告</span>
            </div>
            <div v-else class="process1 process5">
              <span>项目归档</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="项目实施天数" prop="filingDate" align="center"  width="150"/>
<!--        <el-table-column label="项目变更" prop="" align="center"  width="120">-->
<!--          <template #default="scope">-->
<!--            <div style="cursor:pointer;color: #3b82f6;" >-->
<!--              <span v-if="scope.row.process !== 1" @click="goMenu('toFive',scope.row)">{{}}</span>-->
<!--              <span v-else></span>-->
<!--            </div>-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column label="预估金额(万元)" prop="contractMoney" align="center"  width="130"/>
        <el-table-column label="归档金额(万元)" prop="actualContractMoney" align="center"  width="130"/>
        <el-table-column label="缺失要件" prop="" align="center"  width="150">
          <template #default="scope">
            <div style="cursor:pointer;color: #3b82f6;" >
              <span v-if="scope.row.process === 5" @click="goMenu('toTwelve',scope.row)">{{scope.row.materialCnt}}</span>
              <span v-else></span>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="归档确认" prop="" align="center"  width="150">
          <template #default="scope">
            <div style="cursor:pointer;color: #3b82f6;" >
              <span v-if="scope.row.process === 5 && scope.row.personRecognition"  @click="goMenu('toThirteen',scope.row)">{{scope.row.personRecognition.recognitionCnt}}/{{scope.row.personRecognition.personCnt}}</span>
              <span v-else></span>
            </div>
          </template>
        </el-table-column>
        <el-table-column  label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="180">
          <template #default="scope">
            <el-button link type="primary" @click="toProcess('view',scope.row)">查看</el-button>
            <el-button link type="primary" @click="toProcess('edit',scope.row)">编辑</el-button>
<!--            <el-button link type="danger" @click="del(scope.row)">删除</el-button>-->
          </template>
        </el-table-column>
      </el-table>
      <div class="pag-container">
        <el-pagination
            v-model:current-page="search.queryParams.pageNum"
            v-model:page-size="search.queryParams.pageSize"
            :page-sizes="[10,15,20,25]"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
        />
      </div>
    </el-dialog>
 
  </div>
 
</template>
 
<script setup>
import {reactive, ref} from "vue";
import {getProjectList} from "@/api/projectManage/project";
const loading = ref(false);
const dataList = ref([]);
const tableRef  = ref(null);
const total = ref(0);
const dialogVisible = ref(false);
const router = useRouter();
const search = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    params:{
      projectPhase: '',
      personId: ''
    }
  },
});
const openDialog = async (val) => {
  search.queryParams.params.personId = val.id
   dialogVisible.value = true;
   await getList();
}
const getList = async () => {
  loading.value = true;
  console.log(search.queryParams,'search.queryParams')
  const res = await getProjectList(search.queryParams);
  if(res.code === 200 ){
    dataList.value = res.data.list.map(item => {
      return {
        ...item,
        process: item.reportProgress <=4 ? 1 : item.reportProgress >4 && item.reportProgress <=6 ? 2 : item.reportProgress >6 && item.reportProgress <=9 ? 3 :item.reportProgress >9 && item.reportProgress <=11 ? 4:5,
        leaderName: item.leader ? item.leader.name : '',
        area: item.district ? item.province + '/' + item.city + '/' + item.district : item.city?item.province + '/' + item.city:item.province ,
        filingDate: item.filingDate ? item.filingDate : conversionDays(item.createTime),
        contractMoney: item.contract ? item.contract.contractMoney : '',
        actualContractMoney: item.contract ? item.contract.actualContractMoney : ''
      }
    })
    console.log(dataList.value,'dataList.value')
    total.value = res.data.total
    loading.value = false;
  }
}
const handleClose = () => {
  dialogVisible.value = false;
}
const handleSizeChange = (val) => {
  search.queryParams.pageNum = 1;
  search.queryParams.pageSize = val
  getList()
}
const handleCurrentChange = (val) => {
  search.queryParams.pageNum = val
  getList()
}
 
const toProcess = (type,value,toPath) => {
  dialogVisible.value = false;
  value.type = type;
  router.push({ path: '/process', query: {id: value.id, type: type, toPath: toPath}});
}
const goMenu = (toPath,val) => {
  console.log("val",val)
  toProcess('edit',val,toPath);
}
const conversionDays = (createTime) => {
  let day = Date.now() - new Date(createTime).getTime();
  return Math.floor(day / 86400000) ;
}
 
defineExpose({
  openDialog
});
 
 
</script>
 
 
<style scoped lang="scss">
.project-dialog{
  .process1{
    border-radius: 5px;
    color: rgb(255, 255, 255);
    padding: 5px 10px;
    background: linear-gradient(90deg, rgb(127, 118, 253), rgb(218, 180, 246));
  }
  .process2{
    background: linear-gradient(90deg, rgb(255, 140, 138), rgb(239, 186, 141));
  }
  .process3 {
    background: linear-gradient(90deg, rgb(229, 119, 180), rgb(249, 159, 192));;
  }
  .process4 {
    background: linear-gradient(90deg, rgb(54, 115, 255), rgb(124, 196, 242));;
  }
  .process5 {
    background: linear-gradient(90deg, rgb(0, 195, 151), rgb(114, 232, 200));;
  }
 
}
.pag-container{
  margin-top: 20px;
  display: flex;
  justify-content: end;
}
</style>