zhouwx
2025-03-05 39f97341210dabcffbd50f1cea5bd697a602bb7b
src/views/safetyReview/projectManage/index.vue
@@ -65,17 +65,38 @@
        </div>
      </div>
    </div>
    <div class="tip" :class="{show: isShow}">
      <div class="titleTip">
        <div style="display: flex">
          当前存在未完结:安全评价项目
          <div style="cursor: pointer;border-radius: 8px;padding: 0 5px;color: #ed5565;" :class="{active: isActive}" @click="chooseUn" >
            {{search.num.safetyTotal}}
          </div> 个,检验检测项目
          <div style="color: #ed5565;margin-left: 5px;margin-right: 5px"> {{search.num.safetyCheckTotal}} </div>
          个,共
          <div style="color: #ed5565;margin-left: 5px;margin-right: 5px"> {{search.num.unFinishTotal}} </div>
          个
        </div>
        <el-icon @click="closeTip" style="cursor: pointer"><Close /></el-icon>
      </div>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="dataList" :border="true" ref="tableRef" :height="tableHeight" 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="agencyName" 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="所属地市" 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="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">
@@ -98,20 +119,20 @@
        </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="" 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="缺失要件"  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-if="scope.row.process === 5" @click="goMenu('toTwelve',scope.row)">{{scope.row.missingMaterialCnt}}</span>
            <span v-else></span>
          </div>
        </template>
@@ -119,16 +140,16 @@
      <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('toThirteen',scope.row)">{{}}</span>
            <span v-else></span>
            <span  v-if="scope.row.process === 5" @click="goMenu('toThirteen',scope.row)">{{scope.row.activeConfirm}}</span>
<!--            <span v-else></span>-->
          </div>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" 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>
          <el-button link type="primary" v-if="scope.row.reportProgress !== 14" @click="toProcess('edit',scope.row)">编辑</el-button>
          <el-button link type="danger" v-if="(isAgency && scope.row.reportProgress !== 14) || (!isAgency && scope.row.reportProgress !== 14)" @click="del(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -169,11 +190,33 @@
                size="large"
            />
          </el-form-item>
          <el-form-item  label="机构名称" >
            <el-select
                v-model="search.queryParams.agencyName"
                filterable
                remote
                @change="selectValue"
                reserve-keyword
                placeholder="所属机构"
                remote-show-suffix
                :remote-method="getCompanyList"
                :loading="loadingCompany"
                style="width:100%"
                clearable
            >
              <el-option
                  v-for="item in companyList"
                  :key="item.id"
                  :label="item.name"
                  :value="item.name"
              />
            </el-select>
          </el-form-item>
          <el-form-item  label="项目名称" >
            <el-input v-model="search.queryParams.name" placeholder="请输入项目名称"></el-input>
            <el-input v-model.trim="search.queryParams.name" placeholder="请输入项目名称"></el-input>
          </el-form-item>
          <el-form-item  label="委托单位">
            <el-input v-model="search.queryParams.client" placeholder="委托单位"></el-input>
            <el-input v-model.trim="search.queryParams.client" placeholder="委托单位"></el-input>
          </el-form-item>
          <el-form-item  label="业务范围">
            <el-select v-model="search.queryParams.business" class="m-2" size="large" placeholder="请选择" style="width: 100%" >
@@ -185,7 +228,7 @@
              />
            </el-select>
          </el-form-item>
          <el-form-item  label="评价类型">
          <el-form-item  label="类型">
            <el-select v-model="search.queryParams.estimateType" class="m-2" size="large" placeholder="请选择" style="width: 100%" >
              <el-option
                  v-for="item in estimateTypeList"
@@ -231,8 +274,11 @@
import {getDict} from "@/api/login";
import {getDictList} from "@/api/backManage/evaluate";
import Cookies from "js-cookie"
import {getAllAgency} from "@/api/backManage/insitution";
const router = useRouter();
const isActive = ref(false)
const isShow = ref(false)
const loading = ref(false);
const direction = ref('rtl');
const showDrawer = ref(false);
@@ -247,6 +293,7 @@
    pageNum: 1,
    pageSize: 20,
    name: '',
    agencyName: '',
    client: '',
    province: '',
    city: '',
@@ -254,6 +301,8 @@
    business: '',
    estimateType: '',
    phase: '',
    safetyCheck: 0,
    unFinish: null,
    params:{
      lostMaterial: null
    }
@@ -264,9 +313,14 @@
    investigationTotal: 0,
    reviewTotal: 0,
    reportTotal: 0,
    archiveTotal: 0
    archiveTotal: 0,
    unFinishTotal: 0,
    safetyCheckTotal: 0,
    safetyTotal: 0
  }
});
const companyList = ref([])
const loadingCompany = ref(false)
const searchTime = ref([]);
const area = ref([]);
const businessList = ref([]);
@@ -282,13 +336,16 @@
    label: '否'
  }
])
const title = ref('')
const tableRef  = ref(null);
const tableHeight = ref(0);
const dataList = ref([]);
const total = ref(0);
const isAgency = ref(false);
onMounted(() => {
  Cookies.remove('projectId')
  Cookies.remove('end')
  Cookies.remove('btn')
  getList();
  getStatistics();
  getArea();
@@ -299,6 +356,8 @@
  window.onresize = () => {
    tableHeight.value = window.innerHeight - tableRef.value.$el.offsetTop - 170;
  };
  const userInfo = JSON.parse(Cookies.get('userInfo'))
  isAgency.value = userInfo.identity === 1;
});
const chooseType = ref('');
@@ -306,6 +365,7 @@
  chooseType.value = val;
  search.queryParams.phase = val;
  getList();
  getStatistics()
}
const getList = async () => {
  loading.value = true;
@@ -316,14 +376,18 @@
        ...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),
        area: item.district ? item.province + '/' + item.city + '/' + item.district : item.city != item.province ? item.province + '/' + item.city: item.province ,
        filingDate: item.filingDate ? conversionDays(item.filingDate,item.createTime) : conversionDays('',item.createTime),
        contractMoney: item.contract ? item.contract.contractMoney : '',
        actualContractMoney: item.contract ? item.contract.actualContractMoney : ''
        actualContractMoney: item.contract ? item.contract.actualContractMoney : '',
        activeConfirm: item.personRecognition ?  item.personRecognition.recognitionCnt +  '/' +  item.personRecognition.personCnt: '',
        missingMaterialCnt:  3-item.materialCnt,
        activeConfirmOut: item.personRecognition ? "\'" + item.personRecognition.recognitionCnt +  '/' +  item.personRecognition.personCnt: '',
      }
    })
    total.value = res.data.total
    loading.value = false;
    console.log('11',dataList.value)
  }else{
    ElMessage.warning(res.message)
  }
@@ -341,14 +405,16 @@
  search.queryParams.pageNum = 1;
  search.queryParams.pageSize = val
  getList()
  getStatistics()
}
const handleCurrentChange = (val) => {
  search.queryParams.pageNum = val
  getList()
  getStatistics()
}
const toProcess = (type,value,toPath) => {
  value.type = type;
  router.push({ path: '/process', query: {id: value.id, type: type, toPath: toPath}});
  router.push({ path: '/process', query: {id: value.id, type: type, toPath: toPath, process: value.reportProgress}});
}
const getArea = async ()=>{
@@ -391,6 +457,8 @@
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          getList()
          getStatistics()
        }else{
          ElMessage.warning(res.message)
        }
@@ -421,6 +489,7 @@
    pageNum: 1,
    pageSize: 20,
    name: '',
    agencyName: '',
    client: '',
    province: '',
    city: '',
@@ -428,6 +497,8 @@
    business: '',
    estimateType: '',
    phase: '',
    safetyCheck: 0,
    unFinish: null,
    params: {
      lostMaterial: null
    }
@@ -437,8 +508,13 @@
  getStatistics();
  showDrawer.value = false;
}
const conversionDays = (createTime) => {
  let day = Date.now() - new Date(createTime).getTime();//日期转时间戳
const conversionDays = (time,createTime) => {
  let day = "";
  if(time) {
    day = new Date(time).getTime() - new Date(createTime).getTime();//日期转时间戳
  }else {
    day = Date.now() - new Date(createTime).getTime();//日期转时间戳
  }
  return Math.floor(day / 86400000) ;//时间戳获取天数
}
const handleChange = (value) => {
@@ -457,7 +533,7 @@
  '项目名称':'name',
  '委托单位':'client',
  '所属地市': 'area',
  '评价类型': 'estimateTypeName',
  '类型': 'estimateTypeName',
  '业务范围': 'businessName',
  '项目负责人': 'leaderName',
  '项目阶段': {
@@ -477,22 +553,83 @@
    }
  },
  '项目实施天数': 'filingDate',
  '项目变更': '',
  '预估金额(万元)': 'contractMoney',
  '归档金额(万元)': 'actualContractMoney',
  '缺失要件': 'materialCnt',
  '归档确认': ''
  '缺失要件': 'missingMaterialCnt',
  '归档确认': 'activeConfirmOut'
});
const goMenu = (toPath,val) => {
  console.log("val",val)
  toProcess('edit',val,toPath);
}
const selectValue = (val) => {
  console.log('val',val)
  if(val == ""){
    companyList.value = []
  }
  // data.companyList.forEach(item => {
  //   if(item.name === val){
  //     data.queryParams.companyId = item.id
  //   }
  // })
}
const getCompanyList = async (val)=>{
  if(val != ""){
    loadingCompany.value = true;
    const queryParams = {
      name: val
    }
    const res = await getAllAgency(queryParams)
    if (res.code == 200) {
      loadingCompany.value = false;
      companyList.value = res.data
    } else {
      ElMessage.warning(res.message)
    }
  }
}
const chooseUn = () => {
  isActive.value = !isActive.value
  if(isActive.value){
    search.queryParams.unFinish = 1
  }else {
    search.queryParams.unFinish = null
  }
  getList()
  getStatistics()
}
const closeTip = () => {
 isShow.value = true
}
</script>
<style scoped lang="scss">
.project-container{
  .active {
    background-color: #fcc6cb;
    //border: 1px solid #dab4f6;
  }
  .show{
    display: none;
  }
  .tip{
    margin-top: 10px;
    margin-bottom: 15px;
    margin-left: 20px;
  }
  .titleTip{
    font-size: 15px;
    font-weight: 800;
    display: flex;
    padding: 8px;
    color: #e6a23c;
    background-color: #FCF5EB;
    align-items: center;
    justify-content: space-between;
  }
  .header{
    margin: 15px 10px;
    display: flex;