Browse Source

fix:查看明细展示全部信息框

liziliang 6 ngày trước cách đây
mục cha
commit
b9b2b675ed

+ 25 - 0
src/components/InputDiv/index.vue

@@ -0,0 +1,25 @@
+<template>
+  <div contenteditable="true" @blur="updateValue" v-text="content" class="editable-div"></div>
+</template>
+
+<script setup lang="ts">
+const content = defineModel("text");
+
+const updateValue = (event: Event) => {
+  const target = event.target as HTMLElement;
+  console.log(target);
+  content.value = target.innerText;
+};
+</script>
+
+<style scoped>
+.editable-div {
+  border: none;
+  outline: none;
+}
+
+.editable-div:focus {
+  border: 1px solid #66afe9;
+  box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
+}
+</style>

+ 69 - 11
src/views/unqualified/DetailCom.vue

@@ -85,26 +85,58 @@
                 link
                 type="primary"
                 size="small"
+                class="no-print"
                 @click="handleDownload(item)"
-              >下载附件</el-button
+              >下载附件
+              </el-button
               >
+            </div>
+          </div>
+        </td>
+      </tr>
+      <tr v-for="(item, index) in contentArray2" :key="index">
+        <td colspan="6">
+          <div class="sale-box">
+            <div class="sale-title">{{ item.title }}</div>
+            <div class="sale-content">
+            </div>
+            <div class="sale-bottom">
+              <div class="desc" v-if="item.title.includes('分析处置要求')">
+                技术人员:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+              </div>
+              <div class="desc" v-if="item.title.includes('分析处置要求')">
+                联系电话:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               </div>
+              <div class="desc" v-if="item.title.includes('分析处置要求')">
+                责任部门:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+              </div>
+              <div class="desc" v-if="item.title.includes('原因分析') && saleModel.auditType === '1' ">分析单位:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc" v-if="item.title.includes('原因分析') && saleModel.auditType === '2' ">责任部门:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc" v-if="item.title.includes('采取的措施')">责任部门:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc" v-if="item.title.includes('措施落实') ">责任部门:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc" v-if="item.title.includes('不合格品评审(审理)处置意见:') ">签字:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc" v-if="item.title.includes('组长(或分管领导)审批意见:') ">签字:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+              <div class="desc">时间: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
             </div>
-          </td>
-        </tr>
+          </div>
+        </td>
+      </tr>
     </table>
   </div>
 </template>
 
 <script setup>
-const saleModel = ref({});
+import * as originalArray from "lodash-es";
+import Now from "lodash-es/now.js";
 
+const saleModel = ref({});
+const date = new Date();
+const now = date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日";
 const contentArray = ref([]);
+const contentArray2 = ref([]);
 const refreshView = (row) => {
   saleModel.value = row;
-
   contentArray.value = [];
-
   if (row.remark1 && JSON.parse(row.remark1).content) {
     let remark1 = JSON.parse(row.remark1);
     contentArray.value.push({
@@ -114,19 +146,19 @@ const refreshView = (row) => {
   }
   if (row.remark2 && JSON.parse(row.remark2).content) {
     let remark2 = JSON.parse(row.remark2);
-    contentArray.value.push({ ...remark2, title: "分析处置要求:" });
+    contentArray.value.push({...remark2, title: "分析处置要求:"});
   }
   if (row.remark3 && JSON.parse(row.remark3).content) {
     let remark3 = JSON.parse(row.remark3);
-    contentArray.value.push({ ...remark3, title: "原因分析:" });
+    contentArray.value.push({...remark3, title: "原因分析:"});
   }
   if (row.remark4 && JSON.parse(row.remark4).content) {
     let remark4 = JSON.parse(row.remark4);
-    contentArray.value.push({ ...remark4, title: "采取的措施:" });
+    contentArray.value.push({...remark4, title: "采取的措施:"});
   }
   if (row.remark5 && JSON.parse(row.remark5).content) {
     let remark5 = JSON.parse(row.remark5);
-    contentArray.value.push({ ...remark5, title: "措施落实:" });
+    contentArray.value.push({...remark5, title: "措施落实:"});
   }
   if (row.remark6 && JSON.parse(row.remark6).content) {
     let remark6 = JSON.parse(row.remark6);
@@ -142,6 +174,23 @@ const refreshView = (row) => {
       title: "组长(或分管领导)审批意见:",
     });
   }
+  if (row.isEdit !== '是') {
+    console.log("fsdfsdfsdf")
+    contentArray2.value = [
+      {title: "不合格现象(质量问题)描述:"},
+      {title: "分析处置要求:"},
+      {title: "原因分析:"},
+      {title: "采取的措施:"},
+      {title: "措施落实:"},
+      {title: "不合格品评审(审理)处置意见:"},
+      {title: "组长(或分管领导)审批意见:"}
+    ];
+    nextTick(() => {
+      // 5. 执行切片逻辑
+      contentArray2.value = contentArray2.value.slice(contentArray.value.length);
+      console.log("dfdfdfdf", contentArray2.value)
+    });
+  }
 };
 
 const handleDownload = (item) => {
@@ -164,7 +213,7 @@ const handleDownload = (item) => {
   document.body.removeChild(link);
 };
 
-defineExpose({ refreshView });
+defineExpose({refreshView});
 </script>
 
 <style scoped lang="scss">
@@ -174,10 +223,12 @@ defineExpose({ refreshView });
   //font-weight: bold;
   margin-bottom: 10px;
 }
+
 .sale-right {
   text-align: right;
   width: 800px;
 }
+
 table {
   width: 800px;
   margin: 0 auto;
@@ -198,6 +249,7 @@ td {
     margin-bottom: 5px;
     text-align: start;
   }
+
   .sale-content {
     font-size: 16px;
     min-height: 60px;
@@ -205,13 +257,19 @@ td {
     text-align: start;
     padding: 0 8px;
   }
+
   .sale-bottom {
     display: flex;
     justify-content: flex-end;
     margin-top: 10px;
   }
+
   .desc {
     margin-right: 20px;
   }
 }
+
+.no-print {
+  display: none !important;
+}
 </style>

+ 1 - 0
src/views/unqualified/handle2.vue

@@ -77,6 +77,7 @@ const disabledDate = (time) => {
 const auditType = ref("1");
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   auditType.value = row.auditType;
   drawerVisible.value = true;
   dutyDept.value = JSON.parse(row.remark2).user2;

+ 3 - 5
src/views/unqualified/handle20.vue

@@ -1,13 +1,9 @@
 <template>
 
-  <el-drawer v-model="drawerVisible" size="1000" id="print">
-    <div>
-      <el-button type="primary" v-print="'#print'">打印</el-button>
-    </div>
+  <el-drawer v-model="drawerVisible" size="1000">
     <div>
       <DetailCom ref="detailComRef"></DetailCom>
     </div>
-
     <el-form
       ref="remarkRef"
       :model="remark"
@@ -139,6 +135,7 @@
 
     <template #footer>
       <div class="drawer-bottom">
+        <el-button @click="cancelClick">暂存</el-button>
         <el-button @click="cancelClick">取消</el-button>
         <el-button type="primary" @click="confirmClick">提交</el-button>
       </div>
@@ -158,6 +155,7 @@ const saleModel = ref({});
 const userStore = useUserStore();
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark2).user2;

+ 1 - 0
src/views/unqualified/handle21.vue

@@ -82,6 +82,7 @@ const disabledDate = (time) => {
 };
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark2).user2;

+ 1 - 0
src/views/unqualified/handle3.vue

@@ -80,6 +80,7 @@ const disabledDate = (time) => {
 const auditType = ref("1");
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   auditType.value = row.auditType;
   drawerVisible.value = true;
   saleModel.value = row;

+ 1 - 0
src/views/unqualified/handle4.vue

@@ -80,6 +80,7 @@ const disabledDate = (time) => {
 };
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark4).user;

+ 1 - 0
src/views/unqualified/handle5.vue

@@ -80,6 +80,7 @@ const disabledDate = (time) => {
 };
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark5).user;

+ 1 - 0
src/views/unqualified/handle6.vue

@@ -61,6 +61,7 @@ const disabledDate = (time)=> {
 }
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark6).user;

+ 1 - 0
src/views/unqualified/handle7.vue

@@ -64,6 +64,7 @@ const disabledDate = (time)=> {
 }
 const dutyDept = ref("");
 const showDrawer = (row) => {
+  row.isEdit = '是';
   drawerVisible.value = true;
   saleModel.value = row;
   dutyDept.value = JSON.parse(row.remark7).user;