Procházet zdrojové kódy

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_app into V0.0.2

jiawuxian před 2 roky
rodič
revize
73a7b381e9

+ 4 - 1
src/components/orgTree/index.vue

@@ -43,7 +43,10 @@ export default {
         if(!val){
           this.selected = null
         }else {
-          this.selected = this.value
+          if(this.treeData&&this.treeData.length>0){
+
+            this.selected = this.value
+          }
         }
       },
     },

+ 111 - 107
src/components/upload/index.vue

@@ -1,124 +1,128 @@
 <template>
-    <div>
-        <van-uploader
-          ref="uploader"
-          v-bind="$attrs"
-          v-model="fileList"
-          :before-read="beforeRead"
-          :after-read="afterRead"
-          :max-count="maxCount"
-          :max-size="maxSize * 1024*1024"/>
-    </div>
+  <div>
+    <van-uploader
+      ref="uploader"
+      v-bind="$attrs"
+      v-model="fileList"
+      :before-read="beforeRead"
+      :after-read="afterRead"
+      :max-count="maxCount"
+      @delete="deleteHandler"
+      :max-size="maxSize * 1024 * 1024"
+    />
+  </div>
 </template>
 <script>
-import {upload} from "@/api/public";
-import ImageCompressor from "js-image-compressor";
-import config from '@/config/index';
+import { upload } from '@/api/public'
+import ImageCompressor from 'js-image-compressor'
+import config from '@/config/index'
 export default {
-    props:{
-      value:{
-        type: Array,
-      },
-      //最大上传数量
-      maxCount:{
-        type: Number,
-        default: 6,
-      },
-      //文件大小,单位MB
-      maxSize:{
-        type: Number,
-        default: 5,
-      },
-
+  props: {
+    value: {
+      type: Array
     },
-    data() {
-      return {
-        fileList:[],
-        //上传之后的图片列表,双向绑定之后覆盖fileList
-        imageList:[]
-      };
+    //最大上传数量
+    maxCount: {
+      type: Number,
+      default: 6
     },
+    //文件大小,单位MB
+    maxSize: {
+      type: Number,
+      default: 5
+    }
+  },
+  data() {
+    return {
+      fileList: [],
+      //上传之后的图片列表,双向绑定之后覆盖fileList
+      imageList: []
+    }
+  },
 
-    mounted() {
-
-    },
-    watch:{
-      value:{
-        handler(val){
-          this.fileList = val.map(v=>{
-            console.log( window.origin ,' window.origin ')
-            let imgUrl =
-              process.env.NODE_ENV === "development"
-                ?  config.baseUrl + v.imgPath
-                : window.origin + v.imgPath;
-            return {
-              name: v.name,
-              url:  imgUrl,
-              path:v.imgPath,
-            }
-          })
-          
-        },
-        deep:true,
-        immediate:true
-      }
-    },
-    methods: {
-      //上传前压缩
-      beforeRead(file){
-        console.log(file,'图片压缩前')
-        return new Promise((resolve, reject) => {
-            new ImageCompressor({
-              file,
-              quality: 0.6,
-              success: (result) => {
-                //this.$toast('图片压缩成功')
-                console.log(result,'图片压缩后')
-                let imgFile = new File([result], result.name, {
-                  width: result.width,
-                  height: result.height,
-                  type: result.type,
-                });
-                console.log(imgFile,'后')
-                resolve(imgFile);
-              },
-              error: (e) => {
-                console.log('imageError:'+e);
-                this.$toast('图片压缩失败')
-                reject(e);
-              },
-             });
-        });
+  mounted() {},
+  watch: {
+    value: {
+      handler(val) {
+        this.fileList = val.map(v => {
+          console.log(window.origin, ' window.origin ')
+          let imgUrl = process.env.NODE_ENV === 'development' ? config.baseUrl + v.imgPath : window.origin + v.imgPath
+          return {
+            name: v.name,
+            url: imgUrl,
+            path: v.imgPath
+          }
+        })
       },
-      //上传到服务器
-      afterRead(fileObj){
-        let formData = new FormData();
-        formData.append("file", fileObj.file);
-        upload(formData, "image").then((res) => {
+      deep: true,
+      immediate: true
+    }
+  },
+  methods: {
+    //上传前压缩
+    beforeRead(file) {
+      console.log(file, '图片压缩前')
+      return new Promise((resolve, reject) => {
+        new ImageCompressor({
+          file,
+          quality: 0.6,
+          success: result => {
+            //this.$toast('图片压缩成功')
+            console.log(result, '图片压缩后')
+            let imgFile = new File([result], result.name, {
+              width: result.width,
+              height: result.height,
+              type: result.type
+            })
+            console.log(imgFile, '后')
+            resolve(imgFile)
+          },
+          error: e => {
+            console.log('imageError:' + e)
+            this.$toast('图片压缩失败')
+            reject(e)
+          }
+        })
+      })
+    },
+    //上传到服务器
+    afterRead(fileObj) {
+      let formData = new FormData()
+      formData.append('file', fileObj.file)
+      upload(formData, 'image')
+        .then(res => {
           /*上传成功*/
           let imgUrl =
-            process.env.NODE_ENV === "development"
-              ?  config.baseUrl + res.data.url
-              : window.origin + res.data.url;
-          this.imageList.push({ name: res.data.name, url: imgUrl,imgPath:res.data.url});
-          this.$emit("input",this.imageList);
-        }).catch((err) => {
+            process.env.NODE_ENV === 'development' ? config.baseUrl + res.data.url : window.origin + res.data.url
+          this.deleteHandler()
+          // this.$emit("input",this.imageList);
+        })
+        .catch(err => {
           /*上传失败*/
-          console.log(this.fileList,'this.fileList')
+          console.log(this.fileList, 'this.fileList')
           this.$toast.fail('上传失败')
-        });
-      },
+        })
     },
-    model:{
-      prop:'value',
-      event:'input'
+    //删除
+    deleteHandler() {
+      this.imageList = this.fileList
+      this.imageList.forEach(item => {
+        item.imgPath = item.path
+        delete item.path
+      })
+      this.$emit('input',this.imageList)
     }
-};
+  },
+  model: {
+    prop: 'value',
+    event: 'input'
+  }
+}
 </script>
 <style lang="scss" scoped>
-  .upload-text{
-    font-size: 18px;
-    color: #999;
-    margin-top: 5px;
-  }
+.upload-text {
+  font-size: 18px;
+  color: #999;
+  margin-top: 5px;
+}
 </style>

+ 1 - 1
src/components/writingPad/index.vue

@@ -3,7 +3,7 @@
     <vue-esign
       ref="esign"
       :width="800"
-      :height="400"
+      :height="300"
       :isCrop="isCrop"
       :isClearBgColor="false"
       :lineWidth="lineWidth"

+ 1 - 1
src/config/env.development.js

@@ -2,7 +2,7 @@
 module.exports = {
   title: 'soc-app-dev',
   baseUrl: 'http://localhost:9018', // 项目地址
-  baseApi: '/luowei', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
+  baseApi: '/dev', // 本地api请求地址,注意:如果你使用了代理,请设置成'/'
   APPID: 'xxx',
   APPSECRET: 'xxx',
   $cdn: 'https://www.sunniejs.cn/static'  //静态资源

+ 6 - 0
src/router/router.config.js

@@ -72,6 +72,12 @@ export let routers = [
     meta: { title: '培训参与人员签名', keepAlive: false }
   },
   {
+    path: '/personnelSigninfo/:id',
+    name: 'personnelSigninfo',
+    component: () => import('@/views/menu/training/components/personnelSignature.vue'),
+    meta: { title: '教育培训记录详情', keepAlive: false }
+  },
+  {
     path: '/rehearsalTaskSign/:id',
     name: 'rehearsalTaskSign',
     component: () => import('@/views/menu/rehearsalTask/components/rehearsalTaskSign.vue'),

+ 12 - 9
src/views/menu/monitoringCall/components/consultInfo.vue

@@ -2,7 +2,7 @@
   <div>
     <NavBar :go="{type:'push',path:'/monitoringCall'}" />
     <div class="bigBox">
-      <van-collapse v-model="activeNames">
+      <van-collapse v-model="activeNames" @open="addActiveNames">
         <div class="titleBox">
 
           <div class="textTitle">{{ taskData?.taskName }}</div>
@@ -123,18 +123,18 @@ export default {
         return
       }
 
-      // let startDate = JSON.parse(JSON.stringify(this.taskData.taskStartTime))
+      let startDate = JSON.parse(JSON.stringify(this.taskData.taskStartTime))
 
-      // startDate = Date.parse(new Date(startDate))
-      // let endDate = Date.parse(new Date())
-      // if (endDate - startDate <= 3600000) {
-      //   Dialog({ message: '该调阅未满一个小时请确认' })
+      startDate = Date.parse(new Date(startDate))
+      let endDate = Date.parse(new Date())
+      if (endDate - startDate <= 3600000) {
+        Dialog({ message: '该调阅未满一个小时请确认' })
         // 未满一小时不能结束调阅
-      // } else {
+      } else {
         this.$refs.scandialog.visible = true
 
-      //   startDate = new Date(startDate)
-      // }
+        startDate = new Date(startDate)
+      }
     },
     //文件上传
     resultImg(img) {
@@ -190,6 +190,9 @@ export default {
         this.$router.push('/monitoringCall')
       })
     },
+    addActiveNames(){
+      
+    }
     
   }
 }

+ 1 - 1
src/views/menu/monitoringCall/components/monitoringList.vue

@@ -144,7 +144,7 @@ export default {
 }
 .abnorText{
   font-size: 20px;
-  color: #ccc;
+  color: #aeaeae;
   padding-left: 10px;
   word-wrap:break-word;
 }

+ 1 - 1
src/views/menu/rehearsalTask/index.vue

@@ -431,7 +431,7 @@ export default {
     },
     //跳转详情
     goInfo(id) {
-      this.$router.push('/personnelSignature/' + id + '_info')
+      this.$router.push('/personnelSigninfo/' + id + '_info')
     },
     onCancel() {
       this.show = false

+ 17 - 12
src/views/menu/training/components/addTraining.vue

@@ -72,7 +72,9 @@
         name="content"
         label="培训内容"
         type="textarea"
-        row="2"
+        row="3"
+        maxlength="2000"
+        show-word-limit
         placeholder="请填写培训内容"
       />
       <!-- 总结 -->
@@ -84,6 +86,8 @@
         label="总结"
         type="textarea"
         row="3"
+        maxlength="2000"
+        show-word-limit
         placeholder="请结合网点进行总结"
       />
 
@@ -109,7 +113,7 @@
       <!-- 上传 -->
       <van-field readonly clickable name="uploader" label="上传图片">
         <template #input>
-          <Upload v-model="form.imageList"></Upload>
+          <Upload v-model="form.imageList" :maxCount="5" @input="listHandler"></Upload>
         </template>
       </van-field>
       <div class="btns">
@@ -180,7 +184,7 @@ export default {
               imgPath: item
             })
           })
-          data.imageList = list
+          data.imageList = list || []
         }
         Object.assign(this.form, data)
         // checkPeople
@@ -267,7 +271,9 @@ export default {
       this.lackPeopleList = list
     },
     //上传附件成功
-    listHandler(list) {},
+    listHandler(list) {
+      this.form.imageList = list || []
+    },
     //表单提交前校验
     beforSubmitV() {
       this.falg = false
@@ -327,14 +333,13 @@ export default {
         message: `是否${type === 2 ? '提交' : '保存'}培训数据?`
       })
         .then(() => {
-          this.beforSubmitV() //校验
-          if (!this.falg) {
-            //校验通过触发
-
-            if (type === 1) {
-              //type 1保存2提交
-              this.submitHandlerConfirm(type)
-            } else {
+          if (type === 1) {
+            //type 1保存2提交
+            this.submitHandlerConfirm(type)
+          } else {
+            this.beforSubmitV() //校验
+            if (!this.falg) {
+              //校验通过触发
               this.$refs.form.validate().then(() => {
                 this.submitHandlerConfirm(type)
               })

+ 34 - 14
src/views/menu/training/components/personnelSignature.vue

@@ -3,54 +3,61 @@
     <NavBar :go="{type:'push',path:'/training'}"/>
 
     <div class="mainItem">
-      <div>标题</div>
+      <div class="label"> 标题</div>
       <div>{{ trainingData?.title }}</div>
     </div>
     <div class="mainItem">
-      <div>单位名称</div>
+      <div class="label">单位名称</div>
       <div>{{ trainingData?.orgName }}</div>
     </div>
     <div class="mainItem">
-      <div>培训类型</div>
+      <div class="label">培训类型</div>
       <div>{{ trainingData?.typeText }}</div>
     </div>
     <div class="mainItem">
-      <div>培训开始时间</div>
+      <div class="label">培训开始时间</div>
       <div>{{ trainingData?.trainingStartDateTime }}</div>
     </div>
     <div class="mainItem">
-      <div>培训结束时间</div>
+      <div class="label">培训结束时间</div>
       <div>{{ trainingData?.trainingEndDateTime }}</div>
     </div>
     <div class="mainItem">
-      <div>主持人</div>
+      <div class="label">主持人</div>
       <div>{{ trainingData?.hostName }}</div>
     </div>
     <div class="mainItem">
-      <div>培训内容</div>
+      <div class="label">记录人</div>
+      <div>{{ trainingData?.recorderName }}</div>
+    </div>
+    <div class="mainItem">
+      <div class="label">培训内容</div>
       <div>{{ trainingData?.content }}</div>
     </div>
     <div class="mainItem">
-      <div>总结</div>
+      <div class="label">总结</div>
       <div>{{ trainingData?.note }}</div>
     </div>
     <div class="mainItem">
-      <div>参与人员</div>
+      <div class="label">参与人员</div>
       <div>{{ taskUserList }}</div>
     </div>
     <div class="mainItem">
-      <div>缺席人员</div>
+      <div class="label">缺席人员</div>
       <div>{{ qsUserList }}</div>
     </div>
     <div class="mainItem">
-      <div>上传图片</div>
+      <div class="label">上传图片</div>
       
       <imgCom :width="'100'" v-for="item in imgList" :key="item" :height="'100'" :src="item"></imgCom>
       
     </div>
     <div class="mainItem" v-if="this.$route.params.id.split('_')[1]==='info'">
-      <div>参与人员签名图片</div>
-      <imgCom :width="'100'" v-for="item in signUserList" :key="item.userId" :height="'100'" :src="item.signImage||''"></imgCom>
+      <div class="label labelPeople">参与人员签名图片</div>
+      <template v-for="item in signUserList"  >
+        
+        <imgCom :width="'100'" v-if="item.signImage" :key="item.userId" :height="'100'"  :src="item.signImage"></imgCom>
+      </template>
 
      
     </div>
@@ -168,6 +175,19 @@ export default {
   padding: 34px;
   justify-content: space-between;
   background-color: #fff;
+  overflow: scroll;
+  div{
+    flex: 1;
+    text-align: right;
+  }
+  .label{
+    width: 200px;
+    flex: none;
+    text-align: left;
+  }
+  .labelPeople{
+    width: 300px;
+  }
 }
 .btns {
   background-color: #fff;
@@ -177,6 +197,6 @@ export default {
   width: 100%;
 }
 .sheet {
-  height: 60%;
+  height: 45%;
 }
 </style>

+ 31 - 12
src/views/menu/training/index.vue

@@ -12,14 +12,14 @@
         <van-col span="12"
           ><van-field
             v-model="fieldValue"
-            is-link
+            
             label-width="3em"
             clearable
             :disabled="showStatus"
             label="状态"
             placeholder=""
             @click="showStatus = true"
-          />
+          ><van-icon name="arrow-down" slot="button"/></van-field>
           <van-popup v-model="showStatus" round position="bottom">
             <van-picker
               title="状态"
@@ -41,7 +41,9 @@
             placeholder=""
             :disabled="showDate"
             @click="showDate = true"
-          />
+          >
+            <van-icon name="arrow-down" slot="button"
+          /></van-field>
           <van-popup v-model="showDate" round position="bottom">
             <van-datetime-picker
               v-model="presentDate"
@@ -57,14 +59,17 @@
         <van-col span="24"
           ><van-field
             v-model="typeName"
-            is-link
+            
             label-width="3em"
             clearable
             label="类型"
             :disabled="typeStatus"
             placeholder=""
             @click="typeStatus = true"
-          />
+          >
+        
+          <van-icon name="arrow-down" slot="button"/>
+        </van-field>
           <van-popup v-model="typeStatus" round position="bottom">
             <van-picker
               title="类型"
@@ -116,7 +121,7 @@
             </div>
             <div class="mainItem" @click="goInfo(item.id)">
               <div>培训时间</div>
-              <div>{{ item.startDate }}</div>
+              <div>{{ item.trainingStartDateTime }}</div>
             </div>
             <div class="mainItem">
               <div>签名情况</div>
@@ -127,7 +132,7 @@
       </van-list>
     </div>
     <!-- 卡片弹框 -->
-    <van-dialog v-model="conditionShow" title="签名情况" show-cancel-button>
+    <van-dialog v-model="conditionShow" title="签名情况" show-confirm-button  confirm-button-text="关闭" @closed="beforeClose">
       <div class="conditionCls">
         <div class="title">已签名人员({{ participationList.num }}人):</div>
         <div class="people">{{ participationList.list }}</div>
@@ -242,6 +247,7 @@ export default {
     },
     //判断是否展示签名按钮
     isSignature(list) {
+      
       let falg = false
       let timefalg = false
       //value1 当前登陆用户ID
@@ -270,6 +276,7 @@ export default {
     },
     //判断是否展示登记按钮
     isSign(list) {
+      
       let falg = false
       let timefalg = false
       //value1 当前登陆用户ID
@@ -332,9 +339,9 @@ export default {
       if (this.statusValue) {
         obj.status = this.statusValue
       }
-   
-        obj.orgId = this.cascaderValue||JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID'))+''||''
-     
+
+      obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
+
       if (this.currentDate) {
         obj.date = this.currentDate + '-01'
       }
@@ -450,7 +457,7 @@ export default {
         console.log(res, 'ssss')
         let { meg, code, data } = res
         data.map(item => {
-          if (item.sign !== 1) {
+          if (item.sign != 1) {
             this.absenceList.list.push(item.userName)
             this.absenceList.num++
           } else {
@@ -470,9 +477,21 @@ export default {
     signature(id) {
       this.$router.push('/personnelSignature/' + id + '_edit')
     },
+    //关闭弹框
+    beforeClose() {
+      console.log('sssssssss');
+      ;(this.participationList = {
+        list: [], // 参与人员
+        num: 0 //人数
+      }),
+        (this.absenceList = {
+          list: [],
+          num: 0
+        })
+    },
     //跳转详情
     goInfo(id) {
-      this.$router.push('/personnelSignature/' + id + '_info')
+      this.$router.push('/personnelSigninfo/' + id + '_info')
     },
     onChange(picker, value, index) {},
     onCancel() {