Browse Source

专家评分接口调用

duy 1 year ago
parent
commit
91b730f7c9

+ 8 - 0
src/api/modules/initial/initial.js

@@ -162,4 +162,12 @@ export default {
             params: form,
         }, msg)
     },
+      //在线验收-查看验收报告
+      async getTable(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertConclusion/getTable',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
 }

+ 36 - 0
src/api/modules/transfer/write-conclusion.js

@@ -0,0 +1,36 @@
+import { httpApi } from '../../request/httpApi'
+
+export default {
+      //验收申请-是否生成打分表
+      async creatScore(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertConclusion/creatScore',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //验收申请-是否生成打分表
+    async updateScore(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertConclusion/updateScore',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //专家评分-根据单位获取打分项
+    async getItemByUnit(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertScore/getItemByUnit',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+      //专家评分-专家评分-编辑
+      async updateExpertScore(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveExpertScore/update',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
+}

+ 40 - 47
src/views/transfer/components/conclusion/table-score.vue

@@ -1,16 +1,16 @@
 <template>
     <HcTable ui="no-border" is-new :column="tableColumn" :datas="tableData" :loading="tableLoading" :is-index="false">
-        <template #key3="{ row }">
+        <template #integralityDeduction="{ row }">
             <div v-if="row.isEdit" class="table-score-input-box">
-                <el-input v-model="row.key3" placeholder="" />
+                <el-input v-model="row.integralityDeduction" placeholder="" />
             </div>
-            <span v-else>{{ row.key3 || '-' }}</span>
+            <span v-else>{{ row.integralityDeduction || '-' }}</span>
         </template>
-        <template #key5="{ row }">
+        <template #normativeDeduction="{ row }">
             <div v-if="row.isEdit" class="table-score-input-box">
-                <el-input v-model="row.key5" placeholder="" />
+                <el-input v-model="row.normativeDeduction" placeholder="" />
             </div>
-            <span v-else>{{ row.key5 || '-' }}</span>
+            <span v-else>{{ row.normativeDeduction || '-' }}</span>
         </template>
         <template #action="{ row }">
             <el-button v-if="row.isEdit" type="success" size="small" @click="saveClick(row)">
@@ -26,6 +26,7 @@
 <script setup>
 import { onMounted, ref, watch } from 'vue'
 import { getArrValue } from 'js-fast-way'
+import writeApi from '~api/transfer/write-conclusion'
 
 
 //参数
@@ -54,66 +55,58 @@ watch(() => [
     props.type,
 ], ([type]) => {
     typeId.value = type
+    getTotalData()
 })
 
 //渲染完成
 onMounted(() => {
-
+    getTotalData()
 })
 
 //表格数据
 const tableColumn = ref([
-    { key:'key1', name: '项目' },
-    { key:'key2', name: '完整性', width: 80, align: 'center' },
-    { key:'key3', name: '扣分', width: 80, align: 'center' },
-    { key:'key4', name: '规范性', width: 80, align: 'center' },
-    { key:'key5', name: '扣分', width: 80, align: 'center' },
+    { key:'scoreItem', name: '项目' },
+    { key:'integrality', name: '完整性', width: 80, align: 'center' },
+    { key:'integralityDeduction', name: '扣分', width: 80, align: 'center' },
+    { key:'normative', name: '规范性', width: 80, align: 'center' },
+    { key:'normativeDeduction', name: '扣分', width: 80, align: 'center' },
     { key:'action', name: '操作', width: 80, align: 'center' },
 ])
 const tableData = ref([
-    {
-        id: 1,
-        key1: '设计变更及竣工图',
-        key2: '',
-        key3: '',
-        key4: '',
-        key5: '',
-    },
-    {
-        id: 2,
-        key1: '施工准备文件',
-        key2: '',
-        key3: '',
-        key4: '',
-        key5: '',
-    },
-    {
-        id: 3,
-        key1: '试验资料(含工地试验室资质证书、仪器标定证书等)',
-        key2: '',
-        key3: '',
-        key4: '',
-        key5: '',
-    },
-    {
-        id: 4,
-        key1: '安全生产、文明施工资料',
-        key2: '',
-        key3: '',
-        key4: '',
-        key5: '',
-    },
+   
 ])
 
 const tableLoading = ref(false)
-
+const getTotalData = async ()=>{
+    tableLoading.value = true
+    const { error, code, data } = await writeApi.getItemByUnit({
+        projectId: projectId.value,
+        unitType:typeId.value,
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+     
+    } else {
+        tableData.value = []
+     
+    }
+}
 //编辑
 const editClick = (row) => {
     row.isEdit = true
 }
 //保存
-const saveClick = (row) => {
-    row.isEdit = false
+const saveClick = async (row) => {
+
+    const { error, code, msg } = await writeApi.updateExpertScore({
+      ...row,
+    })
+    if (!error && code === 200) {
+        window.$message.success(msg)
+        row.isEdit = false
+     
+    } 
 }
 </script>
 

+ 16 - 1
src/views/transfer/initial-expert.vue

@@ -26,7 +26,7 @@
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="transfer_initial_expert_btn_history_report">
-                    <el-button color="#38b54a" hc-btn style="color: white" @click="onSubmitReportClick">
+                    <el-button color="#38b54a" hc-btn style="color: white" @click="getReportClick">
                         <HcIcon name="history" />
                         <span>查看验收报告</span>
                     </el-button>
@@ -318,6 +318,21 @@ const previewClick = async ()=>{
 
     }
 }
+//查看验收报告
+
+const getReportClick = async ()=>{
+    const { error, code, data, msg } = await initialgApi.getTable({
+        projectId: projectId.value,
+    })
+    if (!error && code === 200) {
+        if (data) {
+            window.open(data, '_blank')
+        } else {
+            window.$message?.warning('文件不存在')
+        }
+
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 32 - 7
src/views/transfer/writing-conclusion.vue

@@ -26,28 +26,28 @@
                         <template #extra>
                             <span class="text-red">{{ tips }}</span>
                         </template>
-                        <TableStats :contract-id="contractId" :project-id="projectId" @changeTips="changeTips" />
+                        <TableStats :contract-id="contractId" :project-id="projectId" @change-tips="changeTips" />
                     </HcCardItem>
                     <HcCardItem id="hc_table_score" title="专家验收评分表:">
                         <template #header>
                             <span>专家验收评分表:</span>
-                            <el-checkbox v-model="searchFormScore.score" class="size-xl">生成打分表</el-checkbox>
+                            <el-checkbox v-model="searchFormScore.score" class="size-xl" @change="changeScore">生成打分表</el-checkbox>
                         </template>
                         <template #extra>
                             <div class="w-40">
-                                <el-select v-model="searchFormScore.type" placeholder="参建方类型表">
+                                <el-select v-model="searchFormScore.unitType" placeholder="参建方类型表">
                                     <el-option label="业主建设单位" value="1" />
                                     <el-option label="监理单位" value="2" />
                                     <el-option label="施工单位" value="3" />
                                 </el-select>
                             </div>
                         </template>
-                        <TableScore :contract-id="contractId" :project-id="projectId" :type="searchFormScore.type" />
+                        <TableScore :contract-id="contractId" :project-id="projectId" :type="searchFormScore.unitType" />
                     </HcCardItem>
                 </el-container>
                 <el-aside id="hc_table_aside" class="hc-table-aside">
                     <HcCardItem title="抽检意见记录汇总:">
-                        <TableOpinion :contract-id="contractId" :project-id="projectId" @opinionTap="tableOpinionTap" />
+                        <TableOpinion :contract-id="contractId" :project-id="projectId" @opinion-tap="tableOpinionTap" />
                     </HcCardItem>
                 </el-aside>
             </el-container>
@@ -86,6 +86,7 @@ import TableStats from './components/conclusion/table-stats.vue'
 import TableOpinion from './components/conclusion/table-opinion.vue'
 import TableScore from './components/conclusion/table-score.vue'
 import initialgApi from '~api/initial/initial'
+import writeApi from '~api/transfer/write-conclusion'
 
 //变量
 const router = useRouter()
@@ -97,6 +98,7 @@ const projectInfo = ref(useAppState.getProjectInfo)
 //渲染完成
 onMounted(() => {
     setSplitRef()
+    getScore()
 })
 
 //初始化设置拖动分割线
@@ -117,10 +119,33 @@ const setSplitRef = () => {
 }
 
 const searchFormScore = ref({
-    type: '', score: true,
+    unitType: '1', score: false,
 })
+//获取是否打分
+const getScore = async ()=>{
+    const { error, code, data, msg } = await writeApi.creatScore({
+     projectId:projectId.value,
 
-
+    })
+    if (!error && code === 200) {
+       if (data === 1) {
+        searchFormScore.value.score = true
+       } else {
+        searchFormScore.value.score = false
+       }
+    } else {
+        searchFormScore.value.score = false
+    }
+}
+const changeScore = async (val)=>{
+    const { error, code, data, msg } = await writeApi.updateScore({
+     projectId:projectId.value,
+     isSelect:val ? 1 : 0,
+    })
+    if (!error && code === 200) {
+        window.$message.success(msg)
+    }
+}
 //查看意见
 const isOpinionModal = ref(false)
 const opRow = ref({})