Ver código fonte

Merge branch 'web-v2' into web-v2-pro

dedsudiyu 1 ano atrás
pai
commit
9fd45e290a

BIN
src/assets/ZDimages/safetyCheck/icon_delete.png


+ 94 - 0
src/views/safetyCheck/components/addPage/addPage.vue

@@ -133,6 +133,14 @@
                   v-model="item.hazardDescribe">
                 </el-input>
               </el-form-item>
+              <el-form-item label="语音备注:" label-width="123px" class="el-form-item-bottom" v-if="item.voiceRemark[0]">
+                <div class="audio-box">
+                  <div class="audio-box-li" v-for="(voiceItem,voiceIndex) in item.voiceRemark" :key="voiceIndex">
+                    <div class="audio-box-li-l" @click="voicePlay(voiceItem.url)">{{voiceItem.times}}″</div>
+                    <img class="audio-box-li-r" @click="voiceDele('',index,voiceIndex)" src="@/assets/ZDimages/safetyCheck/icon_delete.png">
+                  </div>
+                </div>
+              </el-form-item>
               <el-form-item label="隐患照片" :prop="'checkHazardDtoList.'+index+'.uploadDtoList'" :rules="rules.uploadDtoList" label-width="123px">
                 <div class="for-img-box" v-for="(img,imgIndex) in item.uploadDtoList" :key="imgIndex">
                   <img class="for-img" :src="img.fileUrl" @click="lookImg(item.uploadDtoList,imgIndex)">
@@ -214,6 +222,14 @@
                   v-model="item2.hazardDescribe">
                 </el-input>
               </el-form-item>
+              <el-form-item label="语音备注:" label-width="123px" class="el-form-item-bottom" v-if="item2.voiceRemark[0]">
+                <div class="audio-box">
+                  <div class="audio-box-li" v-for="(voiceItem,voiceIndex) in item2.voiceRemark" :key="voiceIndex">
+                    <div class="audio-box-li-l" @click="voicePlay(voiceItem.url)">{{voiceItem.times}}″</div>
+                    <img class="audio-box-li-r" @click="voiceDele(item2,index2,voiceIndex)" src="@/assets/ZDimages/safetyCheck/icon_delete.png">
+                  </div>
+                </div>
+              </el-form-item>
               <el-form-item v-if="item2.checkFlag==0" label="隐患照片" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.uploadDtoList'" :rules="rules.uploadDtoList" label-width="123px">
                 <div class="for-img-box" v-for="(img,imgIndex) in item2.uploadDtoList" :key="imgIndex">
                   <img class="for-img" :src="img.fileUrl" @click="lookImg(item2.uploadDtoList,imgIndex)">
@@ -255,6 +271,7 @@
   import { getToken } from "@/utils/auth";
   import lookImgDialog from '@/components/lookImgDialog/lookImgDialog.vue'
   import { findCheckManage,checkOptionList,checkManageUpdate,countHazardNum } from '@/api/safetyCheck/index'
+  import { delUserHaikang } from '@/api/laboratory/subject'
   export default {
     name: 'addPage',
     props:{
@@ -318,6 +335,29 @@
     },
     mounted(){},
     methods:{
+      //语音备忘播放
+      voicePlay(item){
+        let myaudio = new Audio();
+        myaudio.src = item;
+        myaudio.play();
+      },
+      //语音备忘删除
+      async voiceDele(item,index,voiceIndex){
+        let self = this;
+        this.$confirm('确定删除此语音吗?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          if(self.addForm.checkCategory==1){//综合检查
+            self.addForm.checkHazardDtoList[index].voiceRemark.splice(voiceIndex,1);
+          }else if(self.addForm.checkCategory==2){//专项检查
+            item.voiceRemark.splice(voiceIndex,1);
+          }
+        }).then(() => {
+
+        }).catch(() => {});
+      },
       //保存/提交按钮
       upDataButton(type){
         this.$refs["addForm"].validate(valid => {
@@ -325,6 +365,12 @@
             let obj = JSON.parse(JSON.stringify(this.addForm));
             obj.manageStatus = type
             if(this.addForm.checkCategory==1){//综合检查
+              //语音备注JSON对象转字符串
+              for(let i=0;i<obj.checkHazardDtoList.length;i++){
+                if(obj.checkHazardDtoList[i].voiceRemark){
+                  obj.checkHazardDtoList[i].voiceRemark=JSON.stringify(obj.checkHazardDtoList[i].voiceRemark)
+                }
+              }
               if(obj.checkResult === 0){
                 if(!obj.checkHazardDtoList[0]){
                   this.msgError('请添加隐患检查项')
@@ -339,11 +385,16 @@
                 obj.checkHazardDtoList = [];
               }
             }else if(this.addForm.checkCategory==2){//专项检查
+
               let list=[]
               let checkFlagList=[];
               for(let i=0;i<this.addForm.checkHazardInfoVoList.length;i++){
                 for(let b=0;b<this.addForm.checkHazardInfoVoList[i].checkHazardDtoList.length;b++){
                   checkFlagList.push(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag)
+                  //语音备注JSON对象转字符串
+                  if(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].voiceRemark){
+                    this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].voiceRemark=JSON.stringify(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].voiceRemark)
+                  }
                   let obj={
                     checkFlag:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag,
                     checkCategory:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkCategory,
@@ -353,6 +404,7 @@
                     hazardDescribe:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardDescribe,
                     hazardLevel:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardLevel,
                     uploadDtoList:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].uploadDtoList,
+                    voiceRemark:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].voiceRemark,
                     code:this.addForm.checkHazardInfoVoList[i].code,
                     hazardId:this.addForm.checkHazardInfoVoList[i].hazardId,
                     hazardName:this.addForm.checkHazardInfoVoList[i].hazardName,
@@ -370,6 +422,7 @@
               }
               obj.checkHazardDtoList=list;
             }
+
             checkManageUpdate(obj).then(response => {
               this.msgSuccess(response.msg);
               this.$parent.goAddPage(4);
@@ -386,6 +439,7 @@
             response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
             for(let i=0;i<response.data.checkHazardDtoList.length;i++){
               response.data.checkHazardDtoList[i].lookType = true;
+              response.data.checkHazardDtoList[i].voiceRemark = JSON.parse(response.data.checkHazardDtoList[i].voiceRemark);
             }
           }else if(response.data.checkCategory==2){//专项检查
             response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
@@ -395,6 +449,7 @@
                 item.lookType = true;
                 item.checkHazardDtoList.forEach(function(item2) {
                   item2.hazardCheckCode=item2.code
+                  item2.voiceRemark=JSON.parse(item2.voiceRemark)
                 })
               })
             }
@@ -823,6 +878,45 @@
       .for-big-box-special:last-of-type{
         border-bottom: none;
       }
+
+    }
+    /*语音备注*/
+    .audio-box{
+      padding: 16px 0 6px 16px;
+      box-sizing: border-box;
+      width: 898px;
+      min-height: 20px;
+      background: #F5F5F5;
+      border-radius: 4px 4px 4px 4px;
+      .audio-box-li{
+        display: flex;
+        justify-content: flex-start;
+        align-items: center;
+        margin-bottom: 10px;
+        .audio-box-li-l{
+          width: 278px;
+          height: 20px;
+          background: #0183FA;
+          border-radius: 4px 4px 4px 4px;
+          text-align: right;
+          display: inline-block;
+          font-style: normal;
+          font-size: 14px;
+          font-family: Microsoft YaHei, Microsoft YaHei;
+          font-weight: 400;
+          color: #FFFFFF;
+          line-height: 20px;
+          padding-right: 26px;
+          box-sizing: border-box;
+          cursor: pointer;
+        }
+        .audio-box-li-r{
+          width: 16px;
+          height: 16px;
+          margin-left: 6px;
+          cursor: pointer;
+        }
+      }
     }
     .bottom-button-max-box{
       height:80px;

+ 105 - 1
src/views/safetyCheck/components/infoPage/infoPage.vue

@@ -115,6 +115,18 @@
                     </div>
                   </div>
                 </div>
+                <div class="min-content-box" v-if="item.voiceRemark[0]">
+                  <div class="left-min-content-box">
+                    <p></p>
+                    <p>语音备注</p>
+                    <p></p>
+                  </div>
+                  <div class="right-min-content-box" style="height:120px; padding: 10px; overflow-y: auto;">
+                    <div class="audio-box-li" v-for="(voiceItem,voiceIndex) in item.voiceRemark" :key="voiceIndex">
+                      <div class="audio-box-li-l" @click="voicePlay(voiceItem.url)">{{voiceItem.times}}″</div>
+                    </div>
+                  </div>
+                </div>
               </div>
               <div class="content-box">
                 <div class="min-content-box">
@@ -217,6 +229,13 @@
                   v-model="item2.hazardDescribe">
                 </el-input>
               </el-form-item>
+              <el-form-item label="语音备注:" label-width="123px" class="el-form-item-bottom" v-if="item2.voiceRemark[0]">
+                <div class="audio-box">
+                    <div class="audio-box-li" v-for="(voiceItem,voiceIndex) in item2.voiceRemark" :key="voiceIndex">
+                        <div class="audio-box-li-l" @click="voicePlay(voiceItem.url)">{{voiceItem.times}}″</div>
+                    </div>
+                </div>
+              </el-form-item>
               <el-form-item v-if="item2.checkFlag==0" label="隐患照片"  label-width="123px">
                 <div class="for-img-box" v-for="(img,imgIndex) in item2.uploadDtoList" :key="imgIndex">
                   <img class="for-img" :src="img.fileUrl" @click="lookImg(item2.uploadDtoList,imgIndex)">
@@ -278,21 +297,38 @@ import { getToken } from '@/utils/auth'
       this.findCheckManage();
     },
     methods:{
+      //语音备忘播放
+      voicePlay(item){
+        let myaudio = new Audio();
+        myaudio.src = item;
+        myaudio.play();
+      },
       //查询详情
       findCheckManage(){
         findCheckManage({id:this.propsInfoData.id}).then(response => {
-          if(response.data.checkCategory==2){
+          if(response.data.checkCategory==1){//综合检查
+            response.data.checkResult = response.data.checkResult === 0 || response.data.checkResult === 1?response.data.checkResult:"";
+            response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
+            response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
+            for(let i=0;i<response.data.checkHazardDtoList.length;i++){
+              response.data.checkHazardDtoList[i].lookType = true;
+              response.data.checkHazardDtoList[i].voiceRemark = JSON.parse(response.data.checkHazardDtoList[i].voiceRemark);
+            }
+          } else if(response.data.checkCategory==2){//专项检查
             if(response.data.checkHazardInfoVoList[0]){
               response.data.checkHazardInfoVoList.forEach(function(item) {
                 item.lookType = true;
                 item.checkHazardDtoList.forEach(function(item2) {
                   item2.hazardCheckCode=item2.code
+                  item2.voiceRemark=JSON.parse(item2.voiceRemark)
                 })
               })
             }
           }
           this.$set(this,'addForm',response.data);
+          console.log(this.addForm)
         });
+
       },
       //开关详情页面
       addDialogOpen(type,data){
@@ -565,6 +601,36 @@ import { getToken } from '@/utils/auth'
           flex-direction: column;
           .min-content-box{
             display: flex;
+            /*语音备注*/
+            .audio-box-li{
+              display: flex;
+              justify-content: flex-start;
+              align-items: center;
+              margin-bottom: 10px;
+              .audio-box-li-l{
+                width: 278px;
+                height: 20px;
+                background: #0183FA;
+                border-radius: 4px 4px 4px 4px;
+                text-align: right;
+                display: inline-block;
+                font-style: normal;
+                font-size: 14px;
+                font-family: Microsoft YaHei, Microsoft YaHei;
+                font-weight: 400;
+                color: #FFFFFF;
+                line-height: 20px;
+                padding-right: 26px;
+                box-sizing: border-box;
+                cursor: pointer;
+              }
+              .audio-box-li-r{
+                width: 16px;
+                height: 16px;
+                margin-left: 6px;
+                cursor: pointer;
+              }
+            }
             .left-min-content-box{
               display: flex;
               flex-direction: column;
@@ -728,6 +794,44 @@ import { getToken } from '@/utils/auth'
       .for-big-box-special:last-of-type{
         border-bottom: none;
       }
+      /*语音备注*/
+      .audio-box{
+        padding: 16px 0 6px 16px;
+        box-sizing: border-box;
+        width: 898px;
+        min-height: 20px;
+        background: #F5F5F5;
+        border-radius: 4px 4px 4px 4px;
+        .audio-box-li{
+          display: flex;
+          justify-content: flex-start;
+          align-items: center;
+          margin-bottom: 10px;
+          .audio-box-li-l{
+            width: 278px;
+            height: 20px;
+            background: #0183FA;
+            border-radius: 4px 4px 4px 4px;
+            text-align: right;
+            display: inline-block;
+            font-style: normal;
+            font-size: 14px;
+            font-family: Microsoft YaHei, Microsoft YaHei;
+            font-weight: 400;
+            color: #FFFFFF;
+            line-height: 20px;
+            padding-right: 26px;
+            box-sizing: border-box;
+            cursor: pointer;
+          }
+          .audio-box-li-r{
+            width: 16px;
+            height: 16px;
+            margin-left: 6px;
+            cursor: pointer;
+          }
+        }
+      }
     }
   }
   ::v-deep .is-disabled{