YangJian0701 2 роки тому
батько
коміт
ffe6037868

+ 11 - 6
src/components/FormList.vue

@@ -152,15 +152,15 @@ const props = defineProps({
     default: () => [],
   },
 });
-
-const formList = computed(() => {
-  return props.formList;
-});
-
 // 表单对象
 const formValue = reactive({
   pdf: '',
 });
+formValue.formList = computed(() => {
+  return props.formList;
+});
+
+
 
 // 查询数据
 const queryData = reactive({
@@ -174,9 +174,13 @@ const classList = ref([]);
 
 // CAD刷新
 const handleRefresh = (index) => {
-  formValue.formList[
+  console.log('cad',formValue.formList)
+  formValue.formList[index].T_value =  ''
+  setTimeout(()=>{
+    formValue.formList[
     index
   ].T_value = `http://coldverifylocal.coldbaozhida.com/CAD/download?type=upload&filename=${queryData.T_task_id}_${queryData.T_VerifyTemplate_id}_${formValue.formList[index].T_id}.png`;
+  },3000)
 };
 
 // CAD编辑
@@ -239,6 +243,7 @@ const getClassList = async () => {
       T_task_id: queryData.T_task_id,
     });
     classList.value = res.Data || [];
+    console.log('88888888888888',res)
   } catch (e) {
     console.log(e);
   }

+ 18 - 9
src/views/data/edit/FormList.vue

@@ -116,16 +116,23 @@ const props = defineProps({
 const formValue = reactive({
   formList: [],
 });
-
+//监听单个时间点击赋值
 watch(
   () => props.time,
   (newValue) => {
-    console.log('时间',classList)
-    const index = formValue.formList.findIndex((item) => item.T_label === 7);
-    formValue.formList[index].T_value = newValue;
+    console.log('时间', newValue,newValue.length,newValue.slice(0,16))
+    formValue.formList.forEach((item, i) => {
+
+      if (item.T_label === 7) {
+        formValue.formList[i].T_value = newValue.length==19?newValue.slice(0,16):newValue
+      }
+      if (item.T_label === 12) {
+        formValue.formList[i].T_value[0] = newValue.length==19?newValue.slice(0,16):newValue
+      }
+    })
   }
 );
-
+//监听框选时间区间选择时间
 watch(
   () => props.temporalInterval,
   (newValue) => {
@@ -212,16 +219,17 @@ const getTemplateList = async () => {
     const { data: res } = await getVerifyTemplateMapDataList(queryData);
     formValue.formList = res.Data || [];
     formValue.formList.forEach((item,index) => {
-      console.log(item,item.T_value,index)
+      console.log('循环',item,item.T_value,index)
       if (item.T_label === 3 || item.T_label === 9) {
         item.T_value = item.T_value ? item.T_value.split('|') : null;
-      }else if(item.T_label === 12){
-        if(item.T_value==null){
+      }else if(item.T_label == 12){
+        if(item.T_value==''){
+          console.log('12处理哈',item.T_value )
           item.T_value = [null,null]
         }else{
           item.T_value = item.T_value.split('/')
         }
-        console.log('12处理哈',item.T_value )
+        
       }else if( item.T_label === 13){ 
         item.T_value = item.T_value ? [item.T_value.split('/')[0].split('|'),item.T_value.split('/')[1]]: [null,null];
         
@@ -229,6 +237,7 @@ const getTemplateList = async () => {
         item.T_value = item.T_value ? item.T_value : null;
       }
     });
+    console.log('结果',formValue.formList)
   } catch (e) {
     console.log(e);
   }

+ 42 - 22
src/views/data/edit/ImportVue.vue

@@ -5,17 +5,25 @@
     :show-icon="false"
     preset="dialog"
     title="导入"
-    positive-text="确认"
-    negative-text="取消"
-    @positive-click="submitCallback"
   >
     <n-form :model="formValue" label-width="auto" show-require-mark>
       <n-form-item label="数据">
         <n-upload :default-upload="false" :max="1" @change="handleChange">
-          <n-button>上传文件</n-button>
+          <div style="display: flex;align-items: center;">
+            <n-button>上传文件</n-button>
+            <div style="margin-left: 20px;color: #2d8cf0;">进度:{{ sum }}/{{ dataList.length }}</div>
+          </div>
         </n-upload>
       </n-form-item>
     </n-form>
+    <div style="float: right;">
+      <n-button @click="showModal=false">
+        取消
+      </n-button>
+      <n-button type="primary" @click="submitCallback" :disabled="dataList.length==0" style="margin-left: 20px;">
+        确认
+      </n-button>
+    </div>
   </n-modal>
 </template>
 
@@ -23,6 +31,7 @@
 import { addTaskData } from '@/api';
 import { read, utils } from 'xlsx';
 import { useDateFormat } from '@vueuse/core';
+import { ref, watch } from 'vue';
 
 const props = defineProps({
   task: {
@@ -32,7 +41,7 @@ const props = defineProps({
 });
 
 const message = useMessage();
-
+const sum = ref(0)
 // 是否展示 Modal
 const showModal = ref(false);
 
@@ -81,29 +90,40 @@ const formValue = reactive({
 const showImportModal = () => {
   showModal.value = true;
 };
-
+watch(showModal,(newVal)=>{
+  console.log('监听',newVal)
+  if(!newVal){
+    sum.value = 0
+    dataList.value=[]
+  }
+})
 //
-const submitCallback = () => {
-  if (dataList.value.length > 0) {
-    dataList.value.forEach((item) => {
-      addTask(item);
-    });
+const submitCallback = async () => {
+  for (let i = 0; i <  dataList.value.length; i++) {
+      let resIt  = await addTask(dataList.value[i]);
+      sum.value +=1
+      if(resIt.data.Code!=200){
+        break
+      }
   }
 };
 
 //
 const addTask = async (item) => {
-  const { data: res } = await addTaskData({
-    T_task_id: props.task.T_task_id,
-    T_sn: item['SN'],
-    T_id: item['编号'],
-    T_t: item['温度'],
-    T_rh: item['湿度'],
-    T_time: item['记录时间'],
-  });
-  if (res.Code === 200) {
-    message.success(res.Msg);
-  }
+  return new Promise(resolve=>{
+    setTimeout(() => {
+      const res = addTaskData({
+        T_task_id: props.task.T_task_id,
+        T_sn: item['SN'],
+        T_id: item['编号'],
+        T_t: item['温度'],
+        T_rh: item['湿度'],
+        T_time: item['记录时间'],
+      });
+      resolve(res)
+    },200)
+   
+  })
 };
 </script>
 

+ 0 - 4
src/views/data/edit/index.vue

@@ -91,7 +91,6 @@
       </n-form-item>
     </template>
     <n-space justify="end">
-      <n-button type="primary" @click="chooseTime">选择时间</n-button>
       <n-popconfirm @positive-click="deleteTask">
         <template #trigger>
           <n-button type="error">删除该点</n-button>
@@ -467,9 +466,6 @@ const chartOptions2 = {
   series: [],
 };
 
-const chooseTime = ()=>{
-  console.log('选择时间点',formValue)
-}
 
 
 // 删除

+ 33 - 3
src/views/equipment/index.vue

@@ -52,14 +52,36 @@
         </n-form-item>
       </template>
       <n-form-item label="备注(默认:产品存放区域)" path="T_remark">
-        <n-input v-model:value="formValue.T_remark" type="textarea" />
+        <n-radio-group v-model:value="formValue.T_remark" style="width: 100%;">
+          <div>
+            <n-radio value="产品存放区域">
+              产品存放区域
+            </n-radio>
+          </div>
+          <div>
+            <n-radio value="车厢外环境">
+              车厢外环境
+            </n-radio>
+          </div>
+          <div>
+            <n-radio value="药品存放区域">
+              药品存放区域
+            </n-radio>
+          </div>
+          <div>
+            <n-radio :value="otherVal">
+              其他
+            </n-radio>
+            <n-input v-if="!['产品存放区域','车厢外环境','药品存放区域'].includes(formValue.T_remark)" v-model:value="otherVal" type="textarea"/>
+          </div> 
+        </n-radio-group>
       </n-form-item>
     </n-form>
   </n-modal>
 </template>
 
 <script setup>
-import { h } from 'vue';
+import { h, ref, watch } from 'vue';
 import { NButton, NSpace, NPopconfirm, NInput } from 'naive-ui';
 import {
   getDeviceClassListList,
@@ -79,7 +101,11 @@ const queryData = reactive({
   T_sn: '',
   T_class: task.T_class,
 });
-
+const otherVal = ref('')
+watch(otherVal,(newval)=>{
+  console.log('将变化',newval)
+  formValue.T_remark = newval
+})
 // 需要展示的列
 const columns = [
   {
@@ -186,6 +212,10 @@ const submitCallback = () => {
 
 // 显示编辑
 const showEditModal = (row) => {
+  console.log('显示编辑',row)
+ if(!['产品存放区域','车厢外环境','药品存放区域'].includes(row.T_remark)){
+  otherVal.value = row.T_remark;
+ }
   modal.title = '修改编号';
   modal.showModal = true;
   formValue.Id = row.Id;

+ 14 - 7
src/views/report/audit/TabFour.vue

@@ -61,21 +61,26 @@ const loading = ref(false);
 // 需要展示的列
 const columns = [
   {
-    title: 'ID',
-    key: 'T_id',
-  },
-  {
     title: '设备编号',
-    key: 'T_Class_id',
+    key: 'T_id',
   },
   {
     title: 'SN',
     key: 'T_sn',
-  },
-  {
+  },{
     title: '温度℃',
     key: 'T_t',
   },
+  {
+    title: '湿度%',
+    key: 'T_rh',
+  },
+  {
+    title: '记录时间',
+    key: 'T_time',
+  },
+  
+  
 ];
 
 // 分页数据源
@@ -95,6 +100,8 @@ const extractTask = async () => {
     loading.value = true;
     const { data: res } = await extractTaskData({
       T_task_id: queryData.T_task_id,
+      T_id:queryData.T_id,
+      T_sn:queryData.T_sn,
       Time_start: queryData.Time_start,
       Time_end: queryData.Time_end,
     });

+ 14 - 18
src/views/report/create/index.vue

@@ -22,7 +22,7 @@
     </n-scrollbar>
   </div>
   <n-modal
-    style="width: 30%"
+    style="width: 40%"
     v-model:show="modal.showModal"
     :show-icon="false"
     preset="dialog"
@@ -58,16 +58,14 @@
             />
           </div>
         </template>
-        <n-scrollbar
-          style="max-height: 300px"
-          trigger="none"
-          ref="scrollbarRef"
+        <div
+          style="max-height: 20px;overflow-y: auto;" ref="scrollbarRef"
         >
           <div class="flex" v-for="(item, index) of items" :key="index">
             <n-badge class="mr-5" type="info" :value="index + 1" />
             <span>{{ item }}</span>
           </div>
-        </n-scrollbar>
+        </div>
       </n-card>
     </template>
     <template #action>
@@ -207,6 +205,7 @@ const items = computed(() => {
     : [];
 });
 
+
 // 验证报告生成 获取生成结果
 const generateKeyInfo = async (key) => {
   const { data: res } = await generateKey({
@@ -219,10 +218,9 @@ const generateKeyInfo = async (key) => {
   } else {
     clearTimeout(timer);
   }
-  scrollbarRef.value.scrollTo({
-    top: 9999,
-    behavior: 'smooth',
-  });
+  // scrollbarRef.value.scrollTop = 999999
+//  console.log('scrollbarRef',scrollbarRef.value)
+ 
   keyInfo.value = res;
 };
 
@@ -327,24 +325,22 @@ const getClassList = async () => {
 const getTemplateList = async () => {
   try {
     const { data: res } = await getVerifyTemplateMapDataList(queryData);
+    console.log('999999999999999',res)
     formValue.formList = res.Data;
 
     formValue.formList.forEach(item => {
-      if (item.T_label === 3 || item.T_label == 9){
+      if (item.T_label === 3){
+        item.T_value = item.T_value ? item.T_value.split('|') : [];
+      }else if(item.T_label == 9){
         item.T_value = item.T_value ? item.T_value.split('|') : null;
       }else if (item.T_label === 12) {
-        item.T_value = item.T_value
-          ? [item.T_value.split('/')[0], item.T_value.split('/')[1]]
-          : null;
+        item.T_value = item.T_value? [item.T_value.split('/')[0], item.T_value.split('/')[1]]: [null,null];
       } else if (item.T_label === 13) {
-        item.T_value = item.T_value
-          ? [item.T_value.split('/')[0].split('|'), item.T_value.split('/')[1]]
-          : null;
+        item.T_value = item.T_value? [item.T_value.split('/')[0].split('|'), item.T_value.split('/')[1]]: [null,null];
       } else {
         item.T_value = item.T_value ? item.T_value : null;
       }
     });
-    console.log('==-=-=-=-=**********', formValue.formList)
   } catch (e) {
     console.log(e);
   }

+ 5 - 1
src/views/scheme/index.vue

@@ -317,7 +317,11 @@ const getTemplateList = async () => {
     formValue.formList = res.Data;
     formValue.formList.forEach((item) => {
       if (item.T_label === 3 || item.T_label === 9) {
-        item.T_value = item.T_value ? item.T_value.split('|') : null;
+        if(item.T_value=='' || item.T_value=='|' || item.T_value==null){
+          item.T_value = null;
+        }else{
+          item.T_value = item.T_value.split('|')
+        }
       } else {
         item.T_value = item.T_value ? item.T_value : null;
       }