Przeglądaj źródła

Merge branch 'dev' of http://10.87.10.227:4000/jzyd_yyds/soc_app into dev

coys 2 lat temu
rodzic
commit
18746b970a

+ 5 - 0
src/App.vue

@@ -28,4 +28,9 @@ html,body,div,h1,h2,h3,h4,h5,p{
   -webkit-user-select:none; /* WebKit内核私有属性 */
   -ms-user-select:none; /* IE私有属性(IE10及以后) */
 }
+.fieldset{
+  border: none;
+  padding: 0;
+  margin: 0;
+}
 </style>

+ 6 - 1
src/components/dateCell/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="date-cell van-hairline--bottom" >
-    <van-cell :title="title" is-link :label="selected" @click="clickItem">
+    <van-cell v-if="disabled" :title="title" is-link :label="selected" />
+    <van-cell v-else :title="title" is-link :label="selected" @click="clickItem">
       <template #right-icon>
         <van-icon name="underway-o" style="font-weight: 600;line-height: inherit;color:#008cd6;" />
       </template>
@@ -25,6 +26,10 @@ import {formatDate} from "@/filters/filter";
 
 export default {
   props:{
+    disabled:{
+      type: Boolean,
+      default: false,
+    },
     //默认值
     value:{
       type: String,

+ 32 - 11
src/components/nfcPopup/more.vue

@@ -1,12 +1,15 @@
 <template>
   <div class="nfc-popup">
-    <van-popup v-model="visible" get-container="nfc-popup" lock-scroll :close-on-click-overlay="closeOverlay">
+    <van-popup v-model="visible" get-container="nfc-popup" lock-scroll>
       <div class="nfc-panel">
         <div>
           <p v-if="showBottomBox" class="top-text">将手机背部靠近NFC标签扫描</p>
           <div class="image-box">
-            <img class="nfc-image" v-show="nfcImage" :src="nfcImage" alt="" @click="nfcTakePhotos">
+            <img class="background-image" v-if="!nfcImage" src="../../assets/img/NFCphone.png" alt="" >
+            <img class="nfc-image" v-else :src="nfcImage" alt="" @click="nfcTakePhotos">
           </div>
+          <p v-if="file" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{'文件名:'+file}}</p>
+          <p v-if="imageError">{{'Error:'+imageError}}</p>
           <div v-if="showBottomBox" class="bottom-box">
             <div>
               <img :src="require('../../assets/img/icon/NFC扫描-01.png')" />
@@ -18,8 +21,8 @@
             </div>
           </div>
           <div v-else>
-            <select-cell title="点击选择NFC列表" @change="changeNFC" v-model="selectNFC" :prop="prop" :dataList="dataList"/>
-            <van-button v-if="showBtn" type="primary"  size="small" block plain @click="onConfirm">确定</van-button>
+            <select-cell title="需要拍照的NFC" @change="changeNFC" v-model="selectNFC" :prop="prop" :dataList="dataList"/>
+            <van-button v-if="showBtn" type="info"  size="small" block @click="onConfirm">确认该照片</van-button>
           </div>
         </div>
       </div>
@@ -33,6 +36,7 @@ import SelectCell from "@/components/selectCell";
 import {baseImg} from "@/views/menu/LZRegister/api";
 import {upload} from "@/api/public";
 import ImageCompressor from "js-image-compressor";
+import config from "@/config";
 export default {
   components:{SelectCell},
   data(){
@@ -54,7 +58,10 @@ export default {
       },
       //是否可点击遮罩层关闭
       closeOverlay:true,
+      //提交按钮
       showBtn:false,
+      file:null,
+      imageError:null
     }
   },
   watch:{
@@ -66,9 +73,15 @@ export default {
   },
   methods:{
     onConfirm(){
+      if(!this.selectNFC) return this.$toast('请选择NFC');
+      let url =
+        process.env.NODE_ENV === "development"
+          ?  config.baseUrl + this.nfcImage
+          : window.origin + this.nfcImage;
       let data = {
         nfcCode:this.selectNFC,
-        url:this.nfcImage,
+        urlPath:this.nfcImage,
+        url
       }
       this.$emit('change',data);
       this.visible = false;
@@ -85,6 +98,8 @@ export default {
       this.selectNFC = null;
       this.dataList = [];
       this.closeOverlay = true;
+      this.file = null;
+      this.imageError = null;
     },
     //显示弹窗
     show(list){
@@ -95,6 +110,7 @@ export default {
     //上传前
     async fileChange(e){
       let file = e.target.files[0];
+      this.file = e.target.files[0].name;
      // let fileName = e.target.files[0].name;
       let imgFile = await this.imageCompress(file);
       let formData = new FormData();
@@ -108,6 +124,7 @@ export default {
     },
     //压缩图片
     imageCompress(file){
+       this.file = file.name;
        return new Promise((resolve,reject)=>{
         new ImageCompressor({
           file,
@@ -125,6 +142,7 @@ export default {
           error: (e) => {
             console.log('imageError:'+e);
             this.$toast('图片压缩失败')
+            this.imageError = e;
             reject(e);
           },
         });
@@ -132,6 +150,8 @@ export default {
     },
     //拍照
     nfcTakePhotos(){
+      this.file = null;
+      this.imageError = null;
       this.$refs.upload.click();
     },
   }
@@ -149,8 +169,6 @@ export default {
 <style scoped lang="scss">
 .nfc-panel{
   width: 400px;
-  background:url('../../assets/img/NFCphone.png') center no-repeat;
-  background-size: 50%;
   >div{
     padding: 30px;
   }
@@ -162,19 +180,22 @@ export default {
 .image-box{
   width: 100%;
   height: 350px;
-  padding: 20px;
   display: flex;
   align-items: center;
   justify-content: center;
 }
+.background-image{
+  width:240px;
+  height: 240px;
+}
 .nfc-image{
-  width: 300px;
-  height: 300px;
+  width: 100%;
+  height: 100%;
   background-color: #fff;
 }
 .bottom-box{
   display: flex;
-  justify-content: space-around;
+  justify-content: space-around;//
   align-items: center;
   >div{
     display: flex;

+ 7 - 1
src/components/selectCell/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="date-cell">
-    <van-cell :title="title" :label="label" is-link @click="clickItem"/>
+    <van-cell v-if="disabled" :title="title" :label="label" is-link/>
+    <van-cell v-else :title="title" :label="label" is-link  @click="clickItem"/>
     <van-popup v-model="showPicker" round lazy-render position="bottom" :close-on-popstate="true" get-container="#app">
       <van-picker
         v-bind="$attrs"
@@ -19,6 +20,11 @@
 import {getDict} from "@/api/toConsult";
 export default {
   props:{
+    //禁用
+    disabled:{
+      type: Boolean,
+      default: false,
+    },
     //双向绑定的数据
     value:{
       type: [String,Number],

+ 9 - 21
src/components/upload/index.vue

@@ -6,7 +6,6 @@
           v-model="fileList"
           :before-read="beforeRead"
           :after-read="afterRead"
-          multiple
           :max-count="maxCount"
           :max-size="maxSize * 1024*1024"/>
     </div>
@@ -34,7 +33,9 @@ export default {
     },
     data() {
       return {
-        fileList:[]
+        fileList:[],
+        //上传之后的图片列表,双向绑定之后覆盖fileList
+        imageList:[]
       };
     },
 
@@ -72,13 +73,13 @@ export default {
               success: (result) => {
                 //this.$toast('图片压缩成功')
                 console.log(result,'图片压缩后')
-                let img = new File([result], result.name, {
+                let imgFile = new File([result], result.name, {
                   width: result.width,
                   height: result.height,
                   type: result.type,
                 });
-                console.log(img,'后')
-                resolve(img);
+                console.log(imgFile,'后')
+                resolve(imgFile);
               },
               error: (e) => {
                 console.log('imageError:'+e);
@@ -90,33 +91,20 @@ export default {
       },
       //上传到服务器
       afterRead(fileObj){
-        console.log(fileObj,'flie');
         let formData = new FormData();
         formData.append("file", fileObj.file);
-
         upload(formData, "image").then((res) => {
-          console.log( config,'222')
           /*上传成功*/
           let imgUrl =
             process.env.NODE_ENV === "development"
               ?  config.baseUrl + res.data.url
               : window.origin + res.data.url;
-          let arr = [];
-          let emitList=[]
-          console.log(imgUrl,'imgUrl');
-
-          arr.push({ name: res.data.name, url: imgUrl,imgPath:res.data.url});
-          //emitList.push(res.data.url)
-          this.fileList = arr;
-          console.log(this.fileList,arr,'tttttttt')
-          //emit完整图片URL路径
-          this.$emit("input",arr);
-          // //非完整图片URL路径
-          // this.$emit("imgUrl", res.data.url);
+          this.imageList.push({ name: res.data.name, url: imgUrl,imgPath:res.data.url});
+          this.$emit("input",this.imageList);
         }).catch((err) => {
           /*上传失败*/
           console.log(this.fileList,'this.fileList')
-          //this.$refs.imageUpload.handleRemove(fileObj.file);
+          this.$toast.fail('上传失败')
         });
       },
     },

+ 45 - 41
src/views/menu/LZRegister/edit.vue

@@ -95,47 +95,48 @@
 
 
       <!--  检查项目2    -->
-      <div class="card" v-if="selectArea">
-        <van-collapse v-model="activeNames" v-for="v in checkList" :key="v.itemid">
-          <van-collapse-item :title="v.itemname" :name="v.itemname" >
-            <div v-for="(item,index) in v.checkitemlist" :key="item.pointdataid">
-              <van-cell :title="item.pointname">
-                <template #right-icon>
-                  <van-switch
-                    v-model="item.resvalue"
-                    :active-value="1"
-                    :inactive-value="0"
-                    inactive-color="#4fc08d"
-                    active-color="orange"
-                    @change="switchChange(item)"
-                    size="20" />
-                </template>
-              </van-cell>
-              <van-cell-group v-show="item.resvalue">
-                <van-field
-                  v-model="item.resremark"
-                  rows="1"
-                  autosize
-                  label="情况描述:"
-                  type="textarea"
-                  placeholder="请输入"/>
-                <div class="upload-box" >
-                  <uploader v-model="item.imgData" multiple />
-                </div>
-                <select-cell title="整改期限" v-model="item.rectificationDeadline"  :dict="'rectification_deadline'" is-link/>
-              </van-cell-group>
-              <date-cell v-if="item.businessType === 1" v-for="(val,ind) in item.protectionVo" :title="val.protectionName"  v-model="val.statusUpdateTime" :key="val.id" date-type="datetime" />
-            </div>
-          </van-collapse-item>
-        </van-collapse>
-      </div >
-
-      <p class="warning-msg" v-if="getDicts(taskInfo.status,'resumption_status') === '未开始' || getDicts(taskInfo.status,'resumption_status') === '进行中'">需要完成所有区域的履职内容才能提交内容</p>
-      <div class="flex-box" v-if="getDicts(taskInfo.status,'resumption_status') === '未开始' || getDicts(taskInfo.status,'resumption_status') === '进行中'">
-        <van-button type="default" style="width: 28%;" plain  @click="goBack">取消</van-button>
-        <van-button type="info" style="width: 28%;" plain hairline @click="saveData">保存</van-button>
-        <van-button type="info" style="width: 28%;"  @click="submitData">提交</van-button>
-      </div>
+      <fieldset class="fieldset" disabled >
+        <div class="card" v-if="selectArea">
+          <van-collapse v-model="activeNames" v-for="v in checkList" :key="v.itemid">
+            <van-collapse-item :title="v.itemname" :name="v.itemname" >
+              <div v-for="(item,index) in v.checkitemlist" :key="item.pointdataid">
+                <van-cell :title="item.pointname">
+                  <template #right-icon>
+                    <van-switch
+                      v-model="item.resvalue"
+                      :active-value="1"
+                      :inactive-value="0"
+                      inactive-color="#4fc08d"
+                      active-color="orange"
+                      @change="switchChange(item)"
+                      size="20" />
+                  </template>
+                </van-cell>
+                <van-cell-group v-show="item.resvalue">
+                  <van-field
+                    v-model="item.resremark"
+                    rows="1"
+                    autosize
+                    label="情况描述:"
+                    type="textarea"
+                    placeholder="请输入"/>
+                  <div class="upload-box" >
+                    <uploader v-model="item.imgData"/>
+                  </div>
+                  <select-cell title="整改期限" v-model="item.rectificationDeadline"  :dict="'rectification_deadline'" is-link/>
+                </van-cell-group>
+                <date-cell v-if="item.businessType === 1" v-for="(val,ind) in item.protectionVo" :title="val.protectionName"  v-model="val.statusUpdateTime" :key="val.id" date-type="datetime" />
+              </div>
+            </van-collapse-item>
+          </van-collapse>
+        </div >
+        <p class="warning-msg">需要完成所有区域的履职内容才能提交内容</p>
+        <div class="flex-box">
+          <van-button type="default" style="width: 28%;" plain  @click="goBack">取消</van-button>
+          <van-button type="info" style="width: 28%;" plain hairline @click="saveData">保存</van-button>
+          <van-button type="info" style="width: 28%;"  @click="submitData">提交</van-button>
+        </div>
+      </fieldset>
     </div>
 
     <!--  nfc弹窗  -->
@@ -364,10 +365,12 @@ export default {
       this.checkItemList = [];
       this.NFCNum = 0;
     },
+    //切换开关时添加操作时间
     switchChange(item){
       console.log(item,'666')
       item.resTime = formatDate(new Date());
     },
+    //添加图片时的回调
     changeNfcImg(imgItem){
       console.log(imgItem,'imgItem')
       let arr = [];
@@ -378,6 +381,7 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+
   .lz-edit{
     height: 100%;
     overflow: hidden;

+ 9 - 6
src/views/menu/LZRegister/index.vue

@@ -19,7 +19,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'HH:mm')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:false}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -34,7 +34,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'HH:mm')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:true}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -49,7 +49,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'HH:mm')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:true}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -71,7 +71,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'YYYY-MM-DD')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:false}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -86,7 +86,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'YYYY-MM-DD')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:true}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -101,7 +101,7 @@
                   :title="v.planName"
                   :label="formatTime(v.planStartTime,v.planEndTime,'YYYY-MM-DD')"
                   is-link
-                  :to="{path:path,query:{id:v.id}}"
+                  :to="{path:path,query:{id:v.id,disabled:true}}"
                   :value="getDicts(v.status,'resumption_status')"
                   :value-class="`title-orange`"/>
               </van-cell-group>
@@ -222,6 +222,9 @@ export default {
   .van-cell-group{
     background-color: #fff;
   }
+  .van-tabs__line{
+    background-color: #008cd6;
+  }
 }
 </style>
 <style lang="scss" scoped>