فهرست منبع

Merge branch 'v0.0.9' of http://10.87.21.221:8000/jzyd_yyds/soc_app into v0.0.9

zhulu 1 سال پیش
والد
کامیت
c7d98f6537

+ 8 - 0
src/api/public.js

@@ -220,3 +220,11 @@ export function wholeTreeSelect(para) {
     data: para,
   })
 }
+//修改个人印章
+export function updateSignatureSeal(data) {
+  return request({
+    url: '/system/user/updateSignatureSeal',
+    method: 'post',
+    data: data,
+  })
+}

+ 1 - 0
src/components/layouts/index.vue

@@ -67,6 +67,7 @@ export default {
         this.$store.commit('SET_USER_SUBUSERLIST', info.subUserList)
         this.$store.commit('SET_MASTER_USER_ID', info.masterUserId)
         this.$store.commit('SET_MASTER_USER_NAME', info.masterUserName)
+        this.$store.commit('SET_MASTER_SIGNATURE_SEAL', info.user.signatureSeal)
         //登陆之后手动触发一次水印数据刷新
           this.$parent.$refs.watercom.getWater(1)
       })

+ 23 - 2
src/components/writingPad/index.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="bixgBox">
 
-  
+
     <vue-esign
       ref="esign"
       :width="800"
@@ -12,6 +12,7 @@
       :lineWidth="lineWidth"
       :lineColor="lineColor"
       :bgColor.sync="bgColor"
+      :image-url="oldSignatureSeal"
     />
   </div>
     <van-row>
@@ -19,16 +20,28 @@
         <van-button type="info" @click="cancelReset">返回</van-button>
         <van-button type="info" @click="handleReset">清除重签</van-button>
         <van-button type="info" @click="handleGenerate">确定</van-button>
+        <van-button v-if="showIntoBtn" type="info" @click="handleIntoImg">引入</van-button>
       </van-col>
     </van-row>
   </div>
 </template>
 <script>
 import vueEsign from 'vue-esign'
+//import vueEsign from '@/components/esign'
 import { Dialog } from 'vant'
 
 export default {
   name: 'SocAppIndex',
+  props: {
+    showIntoBtn: {
+      type: Boolean,
+      default: true
+    },
+    oldSignatureSeal: {
+      type: String,
+      default: ""
+    },
+  },
   components: {
     vueEsign,
     Dialog
@@ -56,11 +69,19 @@ export default {
         .then(res => {
           this.resultImg = res
           this.$refs.esign.reset()
-          this.$emit('resultImg', res)
+          this.$emit('resultImg', res,"")
         })
         .catch(err => {
           Dialog({ message: '不能签名为空白' }) // 画布没有签字时会执行这里 'Not Signned'
         })
+    },
+    handleIntoImg(){
+      if (this.oldSignatureSeal !== "" && this.oldSignatureSeal !== null && this.oldSignatureSeal !== "null"){
+        //this.$emit('useOldImg', this.oldSignatureSeal)
+        this.$emit('resultImg', "",this.oldSignatureSeal)
+      }else {
+        Dialog({ message: '你还未维护签名印章,请到APP端“我的”页面上传个人印章' })
+      }
     }
   }
 }

+ 8 - 1
src/store/modules/user.js

@@ -18,10 +18,12 @@ const state = {
   masterUserName: JSON.parse(sessionStorage.getItem("SET_MASTER_USER_NAME"))||null,
   //主用户id
   masterUserId: JSON.parse(sessionStorage.getItem("SET_MASTER_USER_ID"))||null,
+  //用户个人印章
+  signatureSeal: JSON.parse(sessionStorage.getItem("SET_MASTER_SIGNATURE_SEAL"))||null,
   //主用户机构名称
   // masterUserOrgName: JSON.parse(sessionStorage.getItem("SET_MASTER_USER_ORG_NAME"))||null,
 
-  
+
 }
 const mutations = {
   SET_USER_NAME(state, name) {
@@ -68,6 +70,11 @@ const mutations = {
     state.masterUserName = val;
     sessionStorage.setItem("SET_MASTER_USER_NAME", JSON.stringify(val))
   },
+
+  SET_MASTER_SIGNATURE_SEAL(state, val) {
+    state.signatureSeal = val;
+    sessionStorage.setItem("SET_MASTER_SIGNATURE_SEAL", JSON.stringify(val))
+  },
   // SET_MASTER_USER_ORG_NAME(state, val) {
   //   state.masterUserOrgName = val;
   //   sessionStorage.setItem("SET_MASTER_USER_ORG_NAME", JSON.stringify(val))

+ 111 - 4
src/views/home/isMy.vue

@@ -1,9 +1,23 @@
 <template>
-  <div v-if="!showServer" class="about-container">
+  <div v-if="showMine" class="about-container">
     <top-bar></top-bar>
     <div  class="item-list">
 
-
+      <van-cell is-link @click="clickMine">
+        <!-- 使用 title 插槽来自定义标题 -->
+        <template #title>
+          <p class="item-title">
+            <!--            <van-icon size=".5rem" name="smile-comment-o" color="#008cd6"/>-->
+            <van-image
+              width="0.6rem"
+              height="0.6rem"
+              style="margin-left: 10px;float: left"
+              :src="require('@/assets/img/my/server.png')"
+            />
+            <span class="custom-title">签名印章</span>
+          </p>
+        </template>
+      </van-cell>
       <van-cell is-link @click="clickServe">
         <!-- 使用 title 插槽来自定义标题 -->
         <template #title>
@@ -37,7 +51,7 @@
     </div>
   </div>
   <!-- 消息详情 -->
-  <div v-else class="serve-detail">
+  <div v-else-if="showServer" class="serve-detail">
     <van-nav-bar
       title="客服服务"
       left-arrow
@@ -51,18 +65,65 @@
       </div>
     </div>
   </div>
+  <!-- 个人印章 -->
+  <div v-else class="serve-detail">
+    <van-nav-bar
+      title="签名印章"
+      left-arrow
+      @click-left="onClickLeft"
+    />
+    <div class="detail-box" v-if="dataInfo">
+      <div class="message-content">
+        <div class="text-content">
+          <div class="mainItem" style="margin-top: 10%;">
+            <van-row>
+              <van-col :span="6" class="label">
+<!--                <div style="text-align: center;">签名印章</div>-->
+              </van-col>
+              <van-col :span="18">
+                <imgCom
+                  :width="'150'"
+                  :list="imgList"
+                  v-for="item in imgList"
+                  :key="item"
+                  :height="'150'"
+                  :src="item"
+                ></imgCom>
+              </van-col>
+            </van-row>
+            <div class="btns" style="text-align: center;margin-top: 10px;">
+              <van-button v-if="signatureSeal" type="info" size="small" @click="showSignHandler">重置签名印章</van-button>
+              <van-button v-else size="small" type="info" @click="showSignHandler">新增签名印章</van-button>
+            </div>
+            <van-action-sheet v-model="showSign" title="签名" class="sheet">
+              <writingPad ref="esign" :show-into-btn="false" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+            </van-action-sheet>
+            <!-- <div class="label">上传图片</div> -->
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
 import TopBar from '@/components/TopBar'
 import {getServer} from '@/views/home/api'
 import { getOperatings } from '@/views/menu/operate/api'
+import imgCom from "@/components/imgCom/index.vue";
+import writingPad from "@/components/writingPad/index.vue";
+import {base64ToBlob} from "@/utils/base64TurnImg";
+import {upload,updateSignatureSeal} from "@/api/public";
 export default {
   name: 'isMy',
-  components: { TopBar },
+  components: {writingPad, imgCom, TopBar },
   data() {
     return {
       showServer:false,
+      showMine:true,
+      imgList:[],
+      signatureSeal:"",
+      showSign:false,
       dataInfo:{
         content:'每一代PCIe标准的速度都实现了翻倍的增长,例如我们熟悉的PCIe 3.0与PCIe 4.0,其单通道速度就分别为8GT/s与16GT/s,考虑到数据编码方案(均为128b/130b)效率,最终换算为我们更熟悉的单位时则是984.6MB/s与1969MB/s。看到这里,想必大家都能联想到PCIe 3.0与4.0固态硬盘常见的速率水平,由于它们都采用4通道,因此上限速率能够达到3500MB/s以及7000MB/s以上。\n' +
           '\n' +
@@ -70,11 +131,20 @@ export default {
       },
     }
   },
+  created() {
+    this.showServer = false;
+    this.showMine =true;
+    let imgUrl = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
+    if (imgUrl !== "" && imgUrl !== null && imgUrl !== "null"){
+      this.signatureSeal = imgUrl;
+    }
+  },
   mounted() {
     this.initData();
   },
   methods: {
     initData(){
+      this.imgList = this.signatureSeal.split(',') || [];
       getServer({code:'CUSTOMER_SERVICE'}).then(res => {
         let data = res.data;
         if(data){
@@ -86,11 +156,48 @@ export default {
       this.$router.push({path:"/operate"})
     },
     clickServe(){
+      this.showMine = false;
       this.showServer = true;
     },
+    clickMine(){
+      this.showMine = false;
+      this.showServer = false;
+    },
     onClickLeft(){
+      this.showMine = true;
       this.showServer = false;
     },
+    showSignHandler(){
+      this.showSign = true;
+    },
+    cancelSign()
+    {
+      this.showSign = false
+    },
+    //上传签名图到服务器
+    resultImg(img) {
+      let obj = base64ToBlob(img)
+      let formData = new FormData()
+
+      obj.name = '签名.jpg'
+      formData.append('file', base64ToBlob(img))
+
+      upload(formData, 'image')
+        .then(res => {
+          /*上传成功*/
+          let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+          updateSignatureSeal({"signatureSeal":imgUrl}).then(res => {
+            this.showSign = false;
+            this.imgList = imgUrl.split(',') || [];
+            this.$store.commit('SET_MASTER_SIGNATURE_SEAL', imgUrl)
+          })
+
+          // this.$emit("imgUrl", res.data.url);
+        })
+        .catch(err => {
+          /*上传失败*/
+        })
+    },
   }
 }
 </script>

+ 47 - 29
src/views/menu/monitoringCall/components/consultInfo.vue

@@ -40,9 +40,9 @@
           <areaPassage
               ref="passage"
               :list="retrievalAreaList"
-              :taskId="$route.params.id.split('_')[0]"            
+              :taskId="$route.params.id.split('_')[0]"
               @resetList="getHostHandlerA"
-            ></areaPassage>   
+            ></areaPassage>
           <!-- </van-collapse-item>        -->
         </div>
       </van-collapse>
@@ -62,10 +62,14 @@
       </div>
     </div>
     <van-action-sheet v-model="showSign" :title="shwoSignTitle" class="sheet">
-            <writingPad ref="esign" @resultImg="resultSginImg" @cancelSign="cancelSign"></writingPad>
+        <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultSignImg" @cancelSign="cancelSign"></writingPad>
     </van-action-sheet>
     <!-- 扫描弹框 -->
     <scandialog ref="scandialog" @input="resultImg" @changeNFC="getNFC"></scandialog>
+
+    <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+      <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+    </van-dialog>
   </div>
 </template>
 <script>
@@ -95,6 +99,9 @@ export default {
       showSign:false,
       shwoSignTitle:"签名",
       signImgUrl:"",
+      oldSignatureSeal:"",
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
     }
   },
   components: {
@@ -116,6 +123,9 @@ export default {
   created() {
     this.init(1)
   },
+  mounted() {
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
+  },
   methods: {
     //项目初始化获取数据
     init(num=0) {
@@ -141,7 +151,6 @@ export default {
     },
     getHostHandler(num = 0) {
       // num//判断是不是第一次初始化
-      console.log(num);
       // getSysDeviceByTaskId({ taskId: this.$route.params.id.split('_')[0] }).then(res => {
       //   let { code, data, msg } = res
       //   if (code == 200) {
@@ -163,9 +172,6 @@ export default {
              let tempList= this.taskData.coreMonitoringTaskRegistrationMonitorVOList.filter(item=>item.areaCode == area.dictValue);
              if(tempList && tempList.length>0)
              {
-                console.log("tempList",tempList);
-                console.log("tempList",tempList[0].coreMonitoringTaskMonitorInfoList.findIndex(x=>{
-                 return x.situation=="1"})>-1);
                 if(tempList[0].coreMonitoringTaskMonitorInfoList && tempList[0].coreMonitoringTaskMonitorInfoList.findIndex(x=>{
                  return x.situation=="1";
                 })>-1)
@@ -174,7 +180,7 @@ export default {
                 }
                 else{
                   this.$set(area, 'type', 1)
-                }              
+                }
              }
              else{
               this.$set(area, 'type', 0)
@@ -188,7 +194,6 @@ export default {
             })
            }
 
-           console.log("areaList",areaList);
            this.retrievalAreaList=areaList;
           // this.dataList.forEach(item => {
           //   this.$set(item, 'situation', '') //异常情况初始化默认值
@@ -218,7 +223,7 @@ export default {
         if (endDate - startDate) {
           this.shwoSignTitle= `调阅时长为${this.dateTime(endDate - startDate)},是否结束调阅?`;
           this.showSign=true;
-         
+
 
           // Dialog.confirm({
           //   title: '提示',
@@ -273,26 +278,39 @@ export default {
     {
       this.showSign=false;
     },
+    confirmSignImg(){
+      // this.cancelSign();
+      // this.submitSign(this.oldSignatureSeal);
+      this.signImgUrl = this.oldSignatureSeal;
+      this.showSign=false;
+      this.$refs.scandialog.visible = true
+      this.globalLoading = true
+    },
      //上传签名图到服务器
-    resultSginImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
+    resultSignImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
 
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
 
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          this.signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          this.showSign=false;
-          this.$refs.scandialog.visible = true
-          this.globalLoading = true
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+        upload(formData, 'image')
+          .then(res => {
+            /*上传成功*/
+            this.signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            this.showSign=false;
+            this.$refs.scandialog.visible = true
+            this.globalLoading = true
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
     //文件上传
     resultImg(img) {
@@ -308,7 +326,7 @@ export default {
       //开始调阅上传
       let obj = {
         endPicture: img,
-        endNfc: nfc,        
+        endNfc: nfc,
         taskId: this.$route.params.id.split('_')[0]
       }
       registration(obj).then(res => {
@@ -321,7 +339,7 @@ export default {
     },
     endHandler() {
       finishRegistration({
-        id: this.taskData.id,        
+        id: this.taskData.id,
         signImgUrl:this.signImgUrl,
         taskId: this.$route.params.id.split('_')[0]
       }).then(res => {

+ 49 - 32
src/views/menu/rehearsalTask/components/rehearsalTaskSign.vue

@@ -165,7 +165,7 @@
           </van-col>
           <van-col :span="16">
             <!-- signUserList -->
-            
+
             <template v-for="item in signUserList">
               <imgCom
               v-if="item.signImage"
@@ -173,7 +173,7 @@
                 :list="signUserListMap"
                 :key="item.userId"
                 :height="'100'"
-               
+
                 :src="item.signImage"
               ></imgCom>
             </template>
@@ -248,8 +248,11 @@
     </van-row>
 
     <van-action-sheet v-model="show" title="签名" class="sheet">
-      <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+      <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
     </van-action-sheet>
+    <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+      <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+    </van-dialog>
   </div>
 </template>
 <script>
@@ -280,19 +283,21 @@ export default {
       activeTab:null, // 当前推优活动的Tab
       content: '', //评语
       value: 0, //评分
-      this_window: window,
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
       show: false,
       checkBoxList: [],
       taskUserList: [], //参演人员
       qsUserList: [], //缺席人员
       imgList: [
-      
+
       ], //图片数组
       signUserList: [
       ], //参演人员签名数组
       signUserListMap: [], //参演人员签名数组Map
       studyList: [], //学习资料数组
-      trainingData: {} //详情数据
+      trainingData: {}, //详情数据
+      oldSignatureSeal:""
     }
   },
   computed: {
@@ -399,15 +404,17 @@ export default {
         this.orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE');
         this.activeTab =this.$route.params.id.split('_')[2];
         this.getCheckBoxList();
-        
+
       }
     })
   },
-  mounted() {},
+  mounted() {
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
+  },
 
   methods: {
     getCheckBoxList()
-    {        
+    {
         console.log(this.orgType, 'this.orgType')
         if (this.orgType == 1) {
             //省联社
@@ -423,7 +430,7 @@ export default {
                 disabled: false
               }
             ]
-          
+
           if (data.recStatus == 5) {
             this.result = [5]
           }
@@ -431,7 +438,7 @@ export default {
           if(this.activeTab=='1' || !this.activeTab){
           //办事处
           this.checkBoxList = [
-                    {   
+                    {
                       name: '不推荐',
                       value: 7,
                       disabled: false
@@ -451,7 +458,7 @@ export default {
           else{
              //办事处
           this.checkBoxList = [
-                    {   
+                    {
                       name: '不推荐',
                       value: 8,
                       disabled: false
@@ -463,7 +470,7 @@ export default {
                     }
                   ]
           }
-        
+
           if (data.recStatus == 4) {
             this.result = [3, 4]
           } else if (data.recStatus == 3) {
@@ -506,7 +513,7 @@ export default {
               }
             ]
           }
-          
+
           if (data.recStatus == 2) {
             this.result = [1, 2]
           } else if (data.recStatus == 1) {
@@ -546,7 +553,7 @@ export default {
       else if (v[0] < this.checkBoxList[0].value && v[0]>this.checkBoxList[1].value) {
           this.result=[];
       }
-      else {       
+      else {
           this.checkBoxList[0].disabled = this.disabledCheck('false')
           this.checkBoxList[1].disabled = this.disabledCheck('false')
           if(this.checkBoxList[2])this.checkBoxList[2].disabled = this.disabledCheck('true')
@@ -621,26 +628,36 @@ export default {
     {
       this.show = false;
     },
+    confirmSignImg(){
+      this.cancelSign();
+      this.submitSign(this.oldSignatureSeal);
+    },
     //上传签名图到服务器
-    resultImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
+    resultImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
 
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
 
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          this.submitSign(imgUrl)
+        upload(formData, 'image')
+          .then(res => {
+            console.log(process.env.NODE_ENV)
+            /*上传成功*/
+            let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            this.submitSign(imgUrl)
 
-          // this.$emit("imgUrl", res.data.url);
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+            // this.$emit("imgUrl", res.data.url);
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
     tagHandler(i) {
       let str = i.name.split('.')[1]
@@ -722,7 +739,7 @@ export default {
         margin-top:3.2vw;
 }
     }
-   
+
   }
   .zl {
     display: block !important;

+ 52 - 26
src/views/menu/securityCheckRegister/add.vue

@@ -128,7 +128,7 @@
 
     </div>
     <van-action-sheet v-model="showSign" title="签名" class="sheet">
-      <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+      <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
     </van-action-sheet>
     <!--  按钮   -->
     <div v-if="enable" class="bottom-box">
@@ -167,6 +167,10 @@
         </van-tabs>
       </div>
     </van-action-sheet>
+
+    <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+      <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+    </van-dialog>
   </div>
 
   <!--  添加检查内容  -->
@@ -238,6 +242,9 @@ export default {
         path: '/securityCheckRegister'
       },
       event: null,
+      oldSignatureSeal:"",
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
     }
   },
   computed: {
@@ -272,6 +279,7 @@ export default {
   mounted() {
     this.id = this.$route.query.id;
     this.getData();
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
   },
   beforeDestroy() {
     window.openCameraCallBack = null;
@@ -631,33 +639,51 @@ export default {
     {
       this.showSign = false;
     },
+    confirmSignImg(){
+      this.cancelSign();
+      this.taskInfo.signImg = this.oldSignatureSeal;
+      registerSubmit(this.taskInfo).then(res => {
+        this.$toast('提交成功');
+        this.toPagesFcn();
+      }).catch(error => {
+        if (error === '任务已完成') {
+          this.toPagesFcn();
+        }
+      });
+    },
     //上传签名图到服务器
-    resultImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
-
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
-
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          this.taskInfo.signImg = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          // this.submitSign(imgUrl)
-          registerSubmit(this.taskInfo).then(res => {
-            this.$toast('提交成功');
-            this.toPagesFcn();
-          }).catch(error => {
-            if (error === '任务已完成') {
+    resultImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
+
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
+
+        upload(formData, 'image')
+          .then(res => {
+            console.log(process.env.NODE_ENV)
+            /*上传成功*/
+            this.taskInfo.signImg = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            // this.submitSign(imgUrl)
+            registerSubmit(this.taskInfo).then(res => {
+              this.$toast('提交成功');
               this.toPagesFcn();
-            }
-          });
-          // this.$emit("imgUrl", res.data.url);
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+            }).catch(error => {
+              if (error === '任务已完成') {
+                this.toPagesFcn();
+              }
+            });
+            // this.$emit("imgUrl", res.data.url);
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
   }
 }

+ 46 - 26
src/views/menu/training/components/personnelSignature.vue

@@ -205,8 +205,15 @@
       </van-col>
     </van-row>
     <van-action-sheet v-model="show" title="签名" class="sheet">
-      <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+      <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
     </van-action-sheet>
+
+    <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+<!--      <p class="text" style="margin-top: 10px;text-align: center">-->
+<!--        {{ this.message }}-->
+<!--      </p>-->
+      <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+    </van-dialog>
   </div>
 </template>
 <script>
@@ -216,6 +223,7 @@ import { gettrainingInfo, signtrainingInfo } from '@/api/training.js'
 import { upload } from '@/api/public'
 import imgCom from '@/components/imgCom/index.vue'
 import { base64ToBlob } from '@/utils/base64TurnImg.js'
+import { userInfo } from '@/api/public.js'
 import config from '@/config/index'
 // import VuePdf from '@/components/pdfCom/index.vue'
 export default {
@@ -228,15 +236,18 @@ export default {
   },
   data() {
     return {
-      this_window: window,
       show: false,
+      message:"是否引入个人签名?",
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
       taskUserList: [], //参与人员
       qsUserList: [], //缺席人员
       imgList: [], //图片数组
       signUserList: [], //参与人员签名数组
       signUserListMap: [], //参与人员签名数组
       studyList: [], //学习资料数组
-      trainingData: {} //详情数据
+      trainingData: {}, //详情数据
+      oldSignatureSeal:""
     }
   },
   created() {
@@ -269,7 +280,6 @@ export default {
         if (list.length > 0) {
           list.forEach(item => {
             let i = JSON.parse(item)
-            console.log(i)
             if (i.url.split('.')[1] == 'pdf') {
               i.type = 1
             } else {
@@ -280,12 +290,14 @@ export default {
         }
         if (this.trainingData.imageList) {
           this.imgList = this.trainingData.imageList.split(',') || []
-         
+
         }
       }
-    })
+    });
+  },
+  mounted() {
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
   },
-  mounted() {},
 
   methods: {
     signatureHandler() {
@@ -295,34 +307,42 @@ export default {
       this.$refs.esign.handleReset()
     },
     submitHandler() {
-      console.log(this.file)
+      //console.log(this.file)
     },
     cancelSign()
     {
       this.show = false
     },
+    confirmSignImg(){
+      this.cancelSign();
+      this.submitSign(this.oldSignatureSeal);
+    },
     //上传签名图到服务器
-    resultImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
+    resultImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
 
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
 
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          this.submitSign(imgUrl)
+        upload(formData, 'image')
+          .then(res => {
+            /*上传成功*/
+            let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            this.submitSign(imgUrl)
 
-          // this.$emit("imgUrl", res.data.url);
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+            // this.$emit("imgUrl", res.data.url);
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
-
     //提交到后端数据
     submitSign(url) {
       signtrainingInfo({
@@ -414,7 +434,7 @@ export default {
     display: flex;
     align-items: center;
     padding-left: 10px;
-    
+
     background-color: #fff;
     padding: 10px;
     flex-flow: wrap;

+ 38 - 20
src/views/menu/visitCheck/detail.vue

@@ -73,12 +73,16 @@
         <van-cell title="审批说明" :value="approveRemark"></van-cell>
       </div>
       <van-action-sheet v-model="showSign" title="签名" class="sheet">
-            <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+            <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
           </van-action-sheet>
       <div v-if="approveStatus == 0" class="flex-box">
         <van-button type="info" style="width: 48%" plain @click="refuse">不同意</van-button>
         <van-button type="info" style="width: 48%" @click="accredit">同意</van-button>
       </div>
+
+      <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+        <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+      </van-dialog>
     </div>
   </div>
 </template>
@@ -116,7 +120,10 @@ export default {
       formData:{},
       showInput:false,
       showSign:false,
-      dicts:['out_in_approve_status','out_in_type','letter_id_type']
+      dicts:['out_in_approve_status','out_in_type','letter_id_type'],
+      oldSignatureSeal:"",
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
     }
   },
   computed:{
@@ -125,6 +132,7 @@ export default {
   mounted(){
     this.visitId = this.$route.query.id;
     this.getInfo();
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
   },
   methods:{
     imgUrl,formatDate,
@@ -151,26 +159,36 @@ export default {
     {
       this.showSign=false;
     },
+    confirmSignImg(){
+      this.cancelSign();
+      this.submitApproveData(this.oldSignatureSeal);
+    },
     //上传签名图到服务器
-    resultImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
+    resultImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
 
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
 
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          // this.submitSign(imgUrl)
-          this.submitApproveData(imgUrl);
-          // this.$emit("imgUrl", res.data.url);
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+        upload(formData, 'image')
+          .then(res => {
+            console.log(process.env.NODE_ENV)
+            /*上传成功*/
+            let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            // this.submitSign(imgUrl)
+            this.submitApproveData(imgUrl);
+            // this.$emit("imgUrl", res.data.url);
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
     //页面跳转逻辑
     toPagesFcn(){
@@ -187,7 +205,7 @@ export default {
     },
     // 同意
     accredit(){
-      this.showSign=true;      
+      this.showSign=true;
     },
     submitApproveData(imgUrl)
     {

+ 48 - 26
src/views/menu/visitRecord/detail.vue

@@ -82,14 +82,17 @@
             <date-cell v-if="canRecord() && !selectedUser.arrivalTime" required title="到达时间" :max-date="maxData" :min-date='minDate' :is-row="true"  v-model="formData.arrivalTime" date-type="datetime" />
             <date-cell v-if="canRecord() && selectedUser.arrivalTime && !selectedUser.departureTime" required title="离开时间" :max-date="maxData" :min-date='minDate' :is-row="true"  v-model="formData.departureTime" date-type="datetime" />
           </div>
-          
+
           <van-action-sheet v-model="showSign" title="签名" class="sheet">
-            <writingPad ref="esign" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
+            <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
           </van-action-sheet>
           <div v-if="canRecord() &&!selectedUser.departureTime" class="big-btn-box" >
             <van-button  type="info" size="large" @click="onSubmit">确认登记</van-button>
           </div>
         </van-panel>
+        <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
+          <van-image :width="300" :height="200" :src="this_window + oldSignatureSeal" />
+        </van-dialog>
       </div>
 
     </div>
@@ -130,7 +133,10 @@ export default {
         checkImage:null,
         accompanyingPerson:null,
       },
-      dicts:['out_in_approve_status','out_in_type','letter_id_type']
+      dicts:['out_in_approve_status','out_in_type','letter_id_type'],
+      oldSignatureSeal:"",
+      confirmShow:false,
+      this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
     }
   },
   computed:{
@@ -140,6 +146,9 @@ export default {
     this.visitId = this.$route.query.id;
     this.getUserInfo();
   },
+  mounted() {
+    this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
+  },
   methods:{
     imgUrl,formatDate,
     canRecord(){
@@ -166,13 +175,13 @@ export default {
         this.$toast('请选择离开时间');
         return
       }
-      
+
       if(departureTime){
         this.signatureHandler();
       }
       else{
         this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage);
-      }      
+      }
     },
     submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl)
     {
@@ -195,7 +204,7 @@ export default {
           data.accompanyingPerson=accompanyingPerson;
         }
         if(checkImage)
-        {          
+        {
           data.checkImage=checkImage.map(v=>{return v.imgPath}).toString(',');
         }
         if(signImgUrl)
@@ -219,27 +228,40 @@ export default {
     {
       this.showSign=false;
     },
+    confirmSignImg(){
+      this.cancelSign();
+      //this.submitSign(this.oldSignatureSeal);
+      let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
+      let signImgUrl = this.oldSignatureSeal;
+      this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
+    },
     //上传签名图到服务器
-    resultImg(img) {
-      let obj = base64ToBlob(img)
-      let formData = new FormData()
+    resultImg(img,oldImgUrl) {
+      if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
+        //this.submitSign(oldImgUrl)
+        this.confirmShow =true;
+        this.oldSignatureSeal = oldImgUrl;
+      }else {
+        let obj = base64ToBlob(img)
+        let formData = new FormData()
 
-      obj.name = '签名.jpg'
-      formData.append('file', base64ToBlob(img))
+        obj.name = '签名.jpg'
+        formData.append('file', base64ToBlob(img))
 
-      upload(formData, 'image')
-        .then(res => {
-          console.log(process.env.NODE_ENV)
-          /*上传成功*/
-          let signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
-          // this.submitSign(imgUrl)
-          let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
-          this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
-          // this.$emit("imgUrl", res.data.url);
-        })
-        .catch(err => {
-          /*上传失败*/
-        })
+        upload(formData, 'image')
+          .then(res => {
+            console.log(process.env.NODE_ENV)
+            /*上传成功*/
+            let signImgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
+            // this.submitSign(imgUrl)
+            let {arrivalTime,departureTime,accompanyingPerson,checkImage} = this.formData;
+            this.submitRecordData(arrivalTime,departureTime,accompanyingPerson,checkImage,signImgUrl);
+            // this.$emit("imgUrl", res.data.url);
+          })
+          .catch(err => {
+            /*上传失败*/
+          })
+      }
     },
     getUserInfo(){
       userDetails(this.visitId).then(res=>{
@@ -266,7 +288,7 @@ export default {
         {
           this.minDate = new Date(minDate)
           // 苹果手机下 某些版本 new Date(minDate) 对格式有严格要求
-          if(!this.minDate){            
+          if(!this.minDate){
             // console.log("objStart",minDate,this.minDate)
             let objStart=minDate.replace(/-/g,"/");
             // console.log("objStart",objStart,this.minDate)
@@ -275,7 +297,7 @@ export default {
         }
         else{
           this.minDate = new Date(null);
-        }       
+        }
       })
     },
     previewFile(file){