Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

ZaiZai 1 anno fa
parent
commit
aa86b340b6

+ 2 - 2
src/layout/index.vue

@@ -4,8 +4,8 @@
             <img :src="appViewBg" alt="">
         </div>
         <el-header class="hc-layout-header">
-            <div class="hc-layout-header-logo" :style="`width: ${isCollapse ? '90px' : '200px'};`" @click="logoClick">
-                <img id="logo-icon" :src="appLogoIcon" alt="">
+            <div class="hc-layout-header-logo" :style="`width: ${isCollapse ? '0px' : '200px'};`" @click="logoClick">
+                <!-- <img id="logo-icon" :src="appLogoIcon" alt=""> -->
                 <img v-show="!isCollapse" id="logo-name" :src="appLogoName" alt="">
             </div>
             <div class="header-top-collapse-bar" @click="collapseChange">

+ 10 - 3
src/views/transfer/components/conclusion/table-score.vue

@@ -25,10 +25,10 @@
             <span v-else>{{ row.normative || '-' }}</span>
         </template>
         <template #action="{ row }">
-            <el-button v-if="row.isEdit" type="success" size="small" @click="saveClick(row)">
+            <el-button v-if="row.isEdit" type="success" size="small" :diasbled="state" @click="saveClick(row)">
                 保存
             </el-button>
-            <el-button v-else type="primary" size="small" @click="editClick(row)">
+            <el-button v-else type="primary" size="small" :disabled="state" @click="editClick(row)">
                 编辑
             </el-button>
         </template>
@@ -55,18 +55,25 @@ const props = defineProps({
         type: [String, Number],
         default: '',
     },
+    state:{
+        type:Boolean,
+        default:false, //是否可以编辑
+    },
 })
 
 //变量
 const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
+const state = ref(props.state)
 const typeId = ref(props.type)
 
 //监听
 watch(() => [
     props.type,
-], ([type]) => {
+    props.state,
+], ([type, sta]) => {
     typeId.value = type
+    state.value = sta
     getTotalData()
 })
 

+ 17 - 5
src/views/transfer/writing-conclusion.vue

@@ -39,7 +39,7 @@
                                 </el-select>
                             </div>
                         </template>
-                        <TableScore :contract-id="contractId" :project-id="projectId" :type="searchFormScore.unitType" />
+                        <TableScore :contract-id="contractId" :project-id="projectId" :type="searchFormScore.unitType" :state="state" />
                     </HcCardItem>
                 </el-container>
                 <el-aside id="hc_table_aside" class="hc-table-aside">
@@ -61,8 +61,8 @@
                         <el-input v-model="opinionText" style="flex: 1;" :rows="3" placeholder="请输入抽检意见" type="textarea" resize="none" />
                         <el-button class="ml-4" hc-btn type="primary" :loading="submitLoading" @click="opinionTextEditHihe">保存</el-button>
                     </div>
-                    <div v-if="!opinionTextEdit" class="text-blue text-hover icon-1" @click="opinionTextEditShow">
-                        <HcIcon name="edit-2" />
+                    <div v-if="!opinionTextEdit " class="text-blue text-hover icon-1" @click="opinionTextEditShow">
+                        <HcIcon v-if="!state" name="edit-2" />
                     </div>
                 </div>
             </div>
@@ -97,8 +97,11 @@ const projectInfo = ref(useAppState.getProjectInfo)
 onMounted(() => {
     setSplitRef()
     getScore()
+   
+})
+onActivated(()=>{
+    getStatus()
 })
-
 //初始化设置拖动分割线
 const setSplitRef = () => {
     //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
@@ -115,7 +118,16 @@ const setSplitRef = () => {
         })
     }, 800)
 }
-
+//获取是否可以修改
+const state = ref(false)
+const getStatus = async ()=>{
+    const { error, code, data } = await initialgApi.getTable({
+        projectId: projectId.value,
+    })
+    if (!error && code === 200) {
+        state.value = data['status'] === 2 ? true : false
+    } 
+}
 const searchFormScore = ref({
     unitType: '1', score: false,
 })