Explorar el Código

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

coys hace 2 años
padre
commit
f1a2794202

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

@@ -66,7 +66,11 @@ export default {
         if(!val){
           this.selected = null
         }else{
-          this.selected =  formatDate(val,this.type[this.dateType].value);
+          if(this.dateType === 'time'){
+            this.selected = val
+          }else {
+            this.selected =  formatDate(val,this.type[this.dateType].value);
+          }
         }
       },
       immediate: true

+ 4 - 13
src/components/nfcPopup/more.vue

@@ -6,9 +6,9 @@
           <p v-if="showBottomBox" class="top-text">将手机背部靠近NFC标签扫描</p>
           <div class="image-box">
             <img class="background-image" v-if="!nfcImage" src="../../assets/img/NFCphone.png" alt="" >
-            <img class="nfc-image" v-else :src="nfcImage" alt="" @click="nfcTakePhotos">
+            <img class="nfc-image" v-else :src="imgUrl(nfcImage)" alt="" @click="nfcTakePhotos">
           </div>
-          <p v-if="file" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{'文件名:'+file}}</p>
+<!--          <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>
@@ -56,8 +56,6 @@ export default {
         label:'checkName',
         value:'nfccdoe'
       },
-      //是否可点击遮罩层关闭
-      closeOverlay:true,
       //提交按钮
       showBtn:false,
       file:null,
@@ -74,14 +72,9 @@ 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,
-        urlPath:this.nfcImage,
-        url
+        url: this.nfcImage,
       }
       this.$emit('change',data);
       this.visible = false;
@@ -97,7 +90,6 @@ export default {
       this.showBottomBox = true;
       this.selectNFC = null;
       this.dataList = [];
-      this.closeOverlay = true;
       this.file = null;
       this.imageError = null;
     },
@@ -117,9 +109,8 @@ export default {
       formData.append('file',imgFile);
       upload(formData,'image').then(res=>{
         //上传成功后,将图片显示在页面上并禁用退出
-        this.nfcImage = res.data.url;
+        this.nfcImage =  res.data.url;
         this.showBottomBox = false;
-        this.closeOverlay = false;
       })
     },
     //压缩图片

+ 17 - 13
src/components/orgTree/index.vue

@@ -2,8 +2,10 @@
   <div class="orgTree">
     <tree-select
       @select="onSelect"
-      v-model="orgId"
+      v-model="selected"
       :options="treeData"
+      :clearable="false"
+      :backspaceRemoves="false"
       placeholder="请选择归属机构"
       :normalizer="tenantIdnormalizer"
       :show-count="true"
@@ -17,38 +19,41 @@
 import TreeSelect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { deptTreeList } from '@/api/public'
-
 export default {
   components: {
     TreeSelect
   },
   props: {
     value: {
-      type: String,
+      type: [String,Number],
       default: null
     }
   },
   data() {
     return {
       treeData: [],
-      orgId: null
+      selected: null,
     }
   },
   created() {
-    this.getTreeList()
+    this.getTreeList();
+
   },
   watch: {
     value: {
       handler(val) {
-        this.orgId = val
-       
-      }
-    }
+        if(!val){
+          this.selected = null
+        }else {
+          this.selected = this.value
+        }
+      },
+    },
   },
   methods: {
     /** treeSelect组件自定义数据*/
     tenantIdnormalizer(node, instanceId) {
-      if (!node.children) {
+      if (!node.children || !node.children.length) {
         delete node.children
       }
       return {
@@ -72,7 +77,7 @@ export default {
     }
   },
   model: {
-    prop: 'orgId',
+    prop: 'value',
     event: 'change'
   }
 }
@@ -83,13 +88,12 @@ export default {
 <style lang="scss">
 .orgTree {
   font-size: 28px;
-  height: 100%;
   svg {
     background-size: 22px 22px;
     width: 22px;
     height: 22px;
   }
-  
+
   .vue-treeselect__control {
     width: 100%;
     height: 90px;

+ 20 - 11
src/components/selectCell/index.vue

@@ -64,11 +64,15 @@ export default {
       columns: [],
     }
   },
-  created() {
-    if(!this.dict) return;
-    this.queryDict();
-  },
   watch:{
+    dict:{
+      handler(val){
+        if(!val) return;
+        if(this.dataList.length) return;
+        this.queryDict();
+      },
+      immediate: true
+    },
     dataList:{
       handler(val){
         if(this.dict) return;
@@ -78,25 +82,30 @@ export default {
     },
     value:{
       handler (val) {
+        console.log(val, '6666')
         if(!val){
           this.selected = null;
           this.label = null;
         }else{
-          this.columns.forEach(v=>{
-            if(v[this.prop.value] === val){
-              this.selected = v;
-              this.label = v[this.prop.label];
-            }
-          })
+          setTimeout(()=>{
+            this.columns.forEach(v=> {
+              console.log(v[this.prop.value], '7777')
+              if (v[this.prop.value] === val) {
+                this.selected = v;
+                this.label = v[this.prop.label];
+              }
+            })
+          },200)
           // this.selected = val;
           // this.label = val.dictLabel;
         }
       },
-      immediate: true
+      immediate:true
     }
   },
   methods:{
     queryDict(){
+      console.log(this.dict,'this.dict')
       getDict( this.dict ).then(res => {
         let { code, data, msg } = res;
         if (code == 200) {

+ 2 - 0
src/main.js

@@ -10,10 +10,12 @@ import 'vant/lib/index.css';
 import router from './router'
 import store from './store'
 import dayjs from "dayjs";
+import {imgUrl} from "@/utils";
 // 设置 js中可以访问 $cdn
 import config, { $cdn } from '@/config'
 Vue.prototype.$cdn = $cdn
 Vue.prototype.dayjs = dayjs
+Vue.prototype.imgUrl = imgUrl;
 
 // 移动端适配
 import 'amfe-flexible'

+ 2 - 0
src/utils/index.js

@@ -3,6 +3,7 @@
  */
 
 import config from "@/config";
+import {isString} from "v-calendar/src/utils/_";
 
 /**
  * Parse the time to string
@@ -104,6 +105,7 @@ export function param2Obj(url) {
  * */
 //根据当前环境拼接图片地址
 export function imgUrl(url){
+  if(!url) return "";
   return  process.env.NODE_ENV === "development"
     ?  config.baseUrl + url
     :  window.origin + url;

+ 31 - 20
src/views/menu/LZRegister/edit.vue

@@ -54,7 +54,7 @@
 
             </van-cell>
             <van-cell v-show="nfcImage.length > 0" :border="false" >
-              <img v-if="enable" class="nfc-img" v-for="(v,i) in nfcImage" :src="v.url" alt="" :key="v.url">
+              <img class="nfc-img" v-for="(v,i) in selectArea.nfclist" v-if="v.img" :src="imgUrl(v.img)" alt="" :key="v.img">
             </van-cell>
           </div>
         </van-panel>
@@ -124,9 +124,16 @@
                   <div class="upload-box" >
                     <uploader v-model="item.imgData"/>
                   </div>
-                  <select-cell :disabled="enable" title="整改期限" v-model="item.rectificationDeadline"  :dict="'rectification_deadline'" />
+                  <select-cell :disabled="!enable" title="整改期限" v-model="item.rectificationDeadline"  :dict="'rectification_deadline'" />
                 </van-cell-group>
-                <date-cell :disabled="enable" 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" />
+                <date-cell
+                  :disabled="!enable"
+                  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>
@@ -153,7 +160,6 @@ import Uploader from '@/components/upload';
 import NfcPopup from '@/components/nfcPopup/more';
 import {taskDetails,saveTaskData} from "@/views/menu/LZRegister/api";
 import {formatDate} from "@/filters/filter";
-import {imgUrl} from "@/utils";
 export default {
   components:{NavBar,SelectCell,DateCell,Uploader,NfcPopup},
   data(){
@@ -189,15 +195,15 @@ export default {
   },
   computed:{
   },
-  watch:{
-    NFCList(){
-      if(!this.NFCList) return;
-      let arr = this.NFCList.filter(item=>{
-        return item.status == 0;
-      })
-      this.NFCNum = arr.length;
-    },
-  },
+  // watch:{
+  //   NFCList(){
+  //     if(!this.NFCList) return;
+  //     let arr = this.NFCList.filter(item=>{
+  //       return item.status == 0;
+  //     })
+  //     this.NFCNum = arr.length;
+  //   },
+  // },
   methods:{
     //初始化数据
     getData() {
@@ -217,7 +223,7 @@ export default {
           ...res.data.taskObj
         }
         this.taskInfo.nfcScaning = res.data.nfcScaning;
-        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2;
+        this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2; //是否可编辑
         this.areaList = res.data.taskarealist;
         this.activeArea(this.areaList[0],0);
         this.getAllCheckItemNum();
@@ -248,9 +254,9 @@ export default {
         dateTime:new Date(),
         isSubmit:0,
         resumptionId:this.$route.query.id,
-        year: this.taskInfo.year,
+        lfghfear: this.taskInfo.year,
         quarter: this.taskInfo.quarter,
-        nfcData:[],
+        nfcData:this.nfcImage,
         pointdata,
       }
       saveTaskData(data).then(res=>{
@@ -312,7 +318,7 @@ export default {
     getNFCItemNum(){
       let num = 0;
       this.selectArea.nfclist.forEach(v=>{
-        if(v.status === 0 ){
+        if(v.status === 0 || !v.img){
           num++;
         }
       })
@@ -375,6 +381,7 @@ export default {
       this.checkList = [];
       this.checkItemList = [];
       this.NFCNum = 0;
+      this.enable = false;
     },
     //切换开关时添加操作时间
     switchChange(item){
@@ -384,9 +391,13 @@ export default {
     //添加图片时的回调
     changeNfcImg(imgItem){
       console.log(imgItem,'imgItem')
-      let arr = [];
-      arr.push(imgItem);
-      this.nfcImage = arr;
+      this.selectArea.nfclist.forEach(v=>{
+        if(v.nfccdoe === imgItem.nfcCode){
+          v.img = imgItem.url;
+          this.nfcImage.push(v);
+        }
+      })
+      console.log( this.selectArea.nfclist,this.nfcImage,'nfcObj')
     },
   }
 }

+ 29 - 31
src/views/menu/workTime/index.vue

@@ -2,30 +2,11 @@
   <div class="works-time">
     <nav-bar></nav-bar>
     <div class="form-box">
-      <van-cell
-        is-link
-        readonly
-        title="机构"
-        :label="orgInfo.orgName"
-        @click="showPopup"
-      />
-      <van-popup v-model="showOrg" round position="bottom">
-        <van-cascader
-          v-model="orgInfo.orgId"
-          :value="orgInfo.orgId"
-          title="选择机构"
-          :options="options"
-          @close="showOrg = false"
-          @change ='changeTree'
-          @finish="onFinish"
-          :field-names="fieldNames"
-        />
-      </van-popup>
-
+      <org-tree v-model="formData.orgId" @change="orgChange"></org-tree>
       <!--   选择日期   -->
       <van-collapse v-model="activeCalendar">
         <van-collapse-item title="日期" :label="formData.ymdDate" name="1">
-          <calendar ref="calendar" :orgId="orgId"  @change="onChange" @copy="getCopyData"></calendar>
+          <calendar ref="calendar" :orgId="formData.orgId"  @change="onChange" @copy="getCopyData"></calendar>
         </van-collapse-item>
       </van-collapse>
 
@@ -47,8 +28,10 @@
 
       <!--  选择时间    -->
       <van-cell-group >
-        <van-cell title="开始时间" is-link  :label="formData.workTime" @click="formData.isDisabled?null:showTimePopup(1)"/>
-        <van-cell title="结束时间" is-link  :label="formData.workOffTime"  @click="formData.isDisabled?null:showTimePopup(0)"/>
+        <date-cell :disabled="formData.isDisabled" title="开始时间" v-model="formData.workTime" type="time"></date-cell>
+        <date-cell :disabled="formData.isDisabled" title="结束时间" v-model="formData.workOffTime" type="time"></date-cell>
+<!--        <van-cell title="开始时间" is-link  :label="formData.workTime" @click="formData.isDisabled?null:showTimePopup(1)"/>-->
+<!--        <van-cell title="结束时间" is-link  :label="formData.workOffTime"  @click="formData.isDisabled?null:showTimePopup(0)"/>-->
         <van-popup v-model="showTime" round  position="bottom" >
           <van-datetime-picker
             v-model="selectedTime"
@@ -75,23 +58,27 @@
 <script>
 import NavBar from '@/components/NavBar';
 import Calendar from '@/components/Calendar';
+import OrgTree from '@/components/orgTree';
+import DateCell from '@/components/dateCell';
 import {mapGetters} from "vuex";
 import {deptTreeList} from "@/api/public";
 import {editWorkTime} from "@/views/menu/workTime/api";
+import {dataList} from "@/views/menu/educationStatistics/api";
 export default {
-  components:{NavBar,Calendar},
+  components:{NavBar,Calendar,OrgTree,DateCell},
   data(){
     return{
-      orgInfo:{
-        orgId:null,
-        orgName:null,
-      },
+      // orgInfo:{
+      //   orgId:null,
+      //   orgName:null,
+      // },
       formData:{
         workTime:null,
         workOffTime:null,
         isEnable:null,
         ymdDate:null,
         isDisabled:false,
+        orgId:null,
       },
       dates:[],
       activeCalendar:['1'],
@@ -112,12 +99,22 @@ export default {
     }
   },
   mounted() {
-    this.getTreeList();
+    this.formData.orgId = this.orgId;
   },
   computed:{
     ...mapGetters(['orgName','orgId']),
   },
   methods:{
+    orgChange(){
+      // let data = {
+      //   ...this.query
+      // }
+      // data.date = `${this.query.date}-01`;
+      // if(!this.query.orgId) return this.$toast('请选择机构');
+      // dataList(data).then(res=>{
+      //   this.dataList = res.data;
+      // })
+    },
     //切换状态
     changeRadio(s){
       this.formData.isEnable = s;
@@ -175,9 +172,10 @@ export default {
     },
     //提交
     onsubmit(){
+      if(!this.formData.orgId) return this.$toast('请选择机构');
       if(this.isCopy){
         let data = {
-          orgIdList:[this.orgInfo.orgId],
+          orgIdList:[this.formData.orgId],
           workTimeList:this.dates
         }
         editWorkTime(data).then(res=>{
@@ -187,7 +185,7 @@ export default {
         })
       }else {
         let data = {
-          orgIdList:[this.orgInfo.orgId],
+          orgIdList:[this.formData.orgId],
           workTimeList:[this.formData]
         }
         editWorkTime(data).then(res => {

+ 2 - 2
vue.config.js

@@ -93,11 +93,11 @@ module.exports = defineConfig({
         }
       },
       '/dev': {
-        target: "http://10.87.10.55:8081",
+        target: "http://10.87.10.55:8080",
         // ws:true,
         changOrigin:true,
         pathRewrite:{
-          '^/dev-serve':'/'
+          '^/dev':'/'
         }
       },
       '/chao': {