Kaynağa Gözat

保存修改意见

duy 2 yıl önce
ebeveyn
işleme
69e26624fc
1 değiştirilmiş dosya ile 21 ekleme ve 6 silme
  1. 21 6
      src/views/transfer/inspects.vue

+ 21 - 6
src/views/transfer/inspects.vue

@@ -124,7 +124,13 @@
                         </div>
                     </div>
                     <div class="textarea-box">
-                        <el-input v-model="reform.content" type="textarea" :autosize="{ minRows: 5}" resize="none" placeholder="请填写抽检意见"/>
+                        <div  @click="contentClick" v-if="ishowAllopinion" >
+                            <el-input v-model="reform.content" type="textarea" :autosize="{ minRows: 5}" resize="none" placeholder="请填写抽检意见" disabled/>
+                        </div>
+                       <div v-else>
+                        <el-input v-model="reform.myOpinion" type="textarea" :autosize="{ minRows: 5}" resize="none" placeholder="请填写抽检意见" />
+                       </div>
+                        
                     </div>
                     <div class="btn-box">
                         <el-button hc-btn @click="onCarrySpotChecksDrawerClose">
@@ -156,7 +162,7 @@
 </template>
 
 <script setup>
-import {ref, watch, onMounted, nextTick} from "vue";
+import {ref, watch, onMounted, nextTick,onActivated} from "vue";
 import {useAppStore} from "~src/store";
 import { getArrValue, getObjValue} from "js-fast-way"
 import HcTree from "~src/components/tree/hc-tree.vue"
@@ -188,7 +194,10 @@ watch(() => [
 onMounted(() => {
     setTableColumns()
 })
-
+//缓存被激活时
+onActivated(() => {
+    getTableData()
+})
 //树加载
 const treeLoading = ref(true)
 const treeNodeLoading = () => {
@@ -294,6 +303,7 @@ const tableRowClick = async({row}) => {
     fileInfo.value.pageNumber=row['approvalFileList'].length||0
     cscTableData1.value=getArrValue( row['approvalFileList'])
     isCarrySpotChecksDrawer.value = true
+    ishowAllopinion.value=true
     checkId.value=''
     const url=await viewPdf(row.id)
         pdfUrl.value=url
@@ -321,6 +331,7 @@ const changePdf=(row)=>{
 
 }
 const opid=ref('')
+
 //获取抽检意见
 const getopiniondata=async()=>{
     const {error, code, data, msg} = await inspectApi.getOpinion({
@@ -331,6 +342,7 @@ const getopiniondata=async()=>{
         let opiniondata=getObjValue(data)
         reform.value.content=opiniondata?.allOpinion
         reform.value.type=opiniondata?.allOpinion?.length>0?true:false
+        reform.value.myOpinion=opiniondata?.opinion
         opid.value=opiniondata?.id
     } 
 }
@@ -445,10 +457,13 @@ const cscTableData5 = ref([
 
 //抽检意见
 const reform = ref({
-    type: false, content: ''
+    type: false, content: '',myOpinion:''
 })
-
-
+const ishowAllopinion=ref(true)
+const contentClick=()=>{
+    console.log(11111);
+    ishowAllopinion.value=false
+}
 //显示右侧目录
 const isCarryDataShow = ref(true)
 const onCarryDataShow = () => {