shudonghui hace 1 año
padre
commit
f83a3cb32d

+ 13 - 4
src/views/sop/sop-monitor/violation-registration/flow-dialog.vue

@@ -78,6 +78,7 @@
           class="sop-step-body"
         >
           <t-row :gutter="[0, 30]">
+            <template v-if="!IS_VIEW_MODE">
             <t-col :span="12">
               <div class="form-group-title"> 新增跟进 </div>
             </t-col>
@@ -100,8 +101,9 @@
                 <my-upload @change="fileChange"></my-upload>
               </t-form-item>
             </t-col>
+            </template>
             <t-col :span="12">
-              <div class="m-b-10px">
+              <div class="m-b-10px" v-if="!IS_VIEW_MODE">
                 历史明细查阅
                 <t-link
                   theme="primary"
@@ -111,7 +113,7 @@
                   <ChevronDownIcon v-else /></t-link
               ></div>
               <t-table
-                v-if="showHistory"
+                v-if="showHistory || IS_VIEW_MODE"
                 size="small"
                 row-key="id"
                 :columns="columns"
@@ -131,7 +133,7 @@
             </t-col>
           </t-row>
         </t-form>
-        <t-space class="sop-step-footer">
+        <t-space v-if="!IS_VIEW_MODE" class="sop-step-footer">
           <t-button theme="primary" @click="save">保存</t-button>
           <t-button theme="default" @click="emit('update:visible', false)"
             >取消</t-button
@@ -161,13 +163,20 @@ const props = defineProps({
       return {};
     },
   },
+  type: {
+    type: String,
+    default: 'new',
+  },
+
 });
 const emit = defineEmits(['update:visible', 'success']);
 
 const formRef = ref(null);
 const tableData = ref([]);
 const showHistory = ref(false);
-
+const IS_VIEW_MODE = computed(() => {
+  return props.type === 'view';
+});
 const title = computed(() => {
   return `违规信息(违规流水号:${props.curRow.code})`;
 });

+ 13 - 1
src/views/sop/sop-monitor/violation-registration/index.vue

@@ -47,6 +47,12 @@
         }"
         v-loading="tableLoading"
       >
+        <template #code="{ col, row }">
+          <more-content
+              :content="row[col.colKey]"
+              @action="handleDetail(row)"
+          ></more-content>
+        </template>
         <template #type="{ col, row }">
           {{ violationTypeFilter(row[col.colKey]) }}
         </template>
@@ -101,6 +107,7 @@
       v-if="perm.LINK_Follow"
       v-model:visible="showViolationFlowDialog"
       :curRow="curRow"
+      :type="viewType"
       @confirm="fetchData"
     ></violation-flow-dialog>
   </div>
@@ -122,7 +129,12 @@ const { perm } = usePermission();
 
 const showViolationFlowDialog = ref(false);
 const curRow = ref({});
-
+const viewType = ref('');
+const handleDetail = (row) => {
+  viewType.value = 'view';
+  curRow.value = row;
+  showViolationFlowDialog.value = true;
+};
 const handleFollow = (row) => {
   curRow.value = row;
   showViolationFlowDialog.value = true;