ZaiZai 1 жил өмнө
parent
commit
85bed6b7c2

+ 180 - 140
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -20,7 +20,7 @@
       @click="parentClick($event)"
     >
       <div style="width:60%;height: 100%;overflow: scroll;" class='parent' id='parent'></div>
-      <div class="excelRight" style="width:30%;margin-left:4%;height: 100%;overflow: scroll;" >
+      <div class="excelRight" style="width:30%;margin-left:4%;height: 100%;overflow: scroll;">
         <span v-if="type.prop==='tab1'">
           <setInputTPT
             v-if="type.prop==='tab1'"
@@ -32,10 +32,10 @@
             @change="change"
           />
         </span>
-        <span v-else-if="type.prop==='tab2'"> <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" /> </span>
-        <span v-else-if="type.prop==='tab3'"> <setFormula :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
-        <span v-else-if="type.prop==='tab4'"> <editDefault :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
-        <span v-else-if="type.prop==='tab5'"> <promptSettings :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
+        <span v-else-if="type.prop==='tab2'"> <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" @edit="signatureEdit"/> </span>
+        <span v-else-if="type.prop==='tab3'"> <setFormula :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
+        <span v-else-if="type.prop==='tab4'"> <editDefault :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
+        <span v-else-if="type.prop==='tab5'"> <promptSettings :pkeyId1='pkeyId' :htmlData1="htmlData"/> </span>
       </div>
     </div>
   </div>
@@ -48,11 +48,13 @@ import setFormula from './template/setFormula.vue'
 import editDefault from './template/editDefault.vue'
 import promptSettings from './template/promptSettings.vue'
 import Vue from 'vue'
-import {getExcelHtml } from '@/api/exctab/excelmodel'
+import {getExcelHtml} from '@/api/exctab/excelmodel'
 import {getSignDetail} from "@/api/manager/AdjustForm";
+import {f} from "vuedraggable/dist/vuedraggable.common";
+
 export default {
-  props: ['pkeyId','excelId'],
-  data () {
+  props: ['pkeyId', 'excelId'],
+  data() {
     return {
       setUptype: 0,//右侧显示的类型1
       htmlData: {
@@ -60,8 +62,8 @@ export default {
         tr: '',
         td: ''
       },
-      type:{},
-      option:{
+      type: {},
+      option: {
         column: [{
           label: '设置输入框',
           prop: 'tab1',
@@ -84,106 +86,141 @@ export default {
         }
         ]
       },
-      checkList:[],
-      checkNameList:[],
+      checkList: [],
+      checkNameList: [],
+      isSignatureEdit: false
     }
   },
-  mounted () {
+  mounted() {
     this.cop()
     this.type = this.option.column[0];
     console.log(111);
   },
 
 
-
   methods: {
-    change(){
-      this.checkList=[]
-      this.checkNameList=[]
+    change() {
+      this.checkList = []
+      this.checkNameList = []
     },
-    GoBack () {//返回上一级
+    GoBack() {//返回上一级
       this.$emit('remove')
     },
     handleChange(column) {
       this.type = column;
+      this.isSignatureEdit = false
     },
-    async getExcelHtml (pkeyId) {
-      const { data: res } = await getExcelHtml({ pkeyId })
+    async getExcelHtml(pkeyId) {
+      const {data: res} = await getExcelHtml({pkeyId})
       console.log(res);
       if (res.code === 200) {
         localStorage.setItem('excelHtml', res.data)
         this.copss();
       }
     },
-    async cop () {
+    async cop() {
       let _that = this
       var MyComponent = await Vue.extend({
         template: localStorage.getItem('excelHtml'),
-        data () {
+        data() {
           return {
             formData: {},
             getTokenHeader: {},
-            dap_site_data:{}
+            dap_site_data: {}
           }
         },
         methods: {
-          contextmenuClick(tr, td, x1, x2, y1, y2, event) {},
-          getInformation (name, tr, td) {//鼠标右键事件
+          contextmenuClick(tr, td, x1, x2, y1, y2, event) {
+          },
+          getInformation(name, tr, td) {//鼠标右键事件
             _that.getInformation(name, tr, td)
           },
-          formUploadSuccess(){},
-          formUploadExceed(){},
-          formUploadLoading(){},
-          delTableFormFile(){},
-          formUploadError(){},
-          uploadprogress(){},
-          formRemoteMethod(){},
-          getRegularExpression(){},
-          checkboxGroupChange(){},
-          formRemoteChange(){},
-          dateKeydown(){},
-          keyupShiftUp() {},
-          keyupShiftDown() {},
-          keyupShiftLeft() {},
-          keyupShiftRight() {},
-          inputLeftClick() {},
+          formUploadSuccess() {
+          },
+          formUploadExceed() {
+          },
+          formUploadLoading() {
+          },
+          delTableFormFile() {
+          },
+          formUploadError() {
+          },
+          uploadprogress() {
+          },
+          formRemoteMethod() {
+          },
+          getRegularExpression() {
+          },
+          checkboxGroupChange() {
+          },
+          formRemoteChange() {
+          },
+          dateKeydown() {
+          },
+          keyupShiftUp() {
+          },
+          keyupShiftDown() {
+          },
+          keyupShiftLeft() {
+          },
+          keyupShiftRight() {
+          },
+          inputLeftClick() {
+          },
         }
       })
       var component = new MyComponent().$mount()
       document.getElementById('parent').appendChild(component.$el);
     },
-    async copss () {
+    async copss() {
       let _that = this
       var MyComponent = await Vue.extend({
         template: localStorage.getItem('excelHtml'),
-        data () {
+        data() {
           return {
             formData: {},
             getTokenHeader: {},
-            dap_site_data:{}
+            dap_site_data: {}
           }
         },
         methods: {
-          contextmenuClick(tr, td, x1, x2, y1, y2, event) {},
-          getInformation (name, tr, td) {//鼠标右键事件
+          contextmenuClick(tr, td, x1, x2, y1, y2, event) {
+          },
+          getInformation(name, tr, td) {//鼠标右键事件
             _that.getInformation(name, tr, td)
           },
-          formUploadSuccess(){},
-          formUploadExceed(){},
-          formUploadLoading(){},
-          delTableFormFile(){},
-          formUploadError(){},
-          uploadprogress(){},
-          getRegularExpression(){},
-          formRemoteMethod(){},
-          checkboxGroupChange(){},
-          formRemoteChange(){},
-          dateKeydown(){},
-          keyupShiftUp() {},
-          keyupShiftDown() {},
-          keyupShiftLeft() {},
-          keyupShiftRight() {},
-          inputLeftClick() {},
+          formUploadSuccess() {
+          },
+          formUploadExceed() {
+          },
+          formUploadLoading() {
+          },
+          delTableFormFile() {
+          },
+          formUploadError() {
+          },
+          uploadprogress() {
+          },
+          getRegularExpression() {
+          },
+          formRemoteMethod() {
+          },
+          checkboxGroupChange() {
+          },
+          formRemoteChange() {
+          },
+          dateKeydown() {
+          },
+          keyupShiftUp() {
+          },
+          keyupShiftDown() {
+          },
+          keyupShiftLeft() {
+          },
+          keyupShiftRight() {
+          },
+          inputLeftClick() {
+          },
         }
       })
       var component = new MyComponent().$mount()
@@ -194,22 +231,22 @@ export default {
       ></div>`
       document.getElementById('parent').appendChild(component.$el);
     },
-    domss () {
+    domss() {
       this.copss()
-     
+
     },
 
-    getInformation (name, tr, td) {//鼠标点击事件
-      console.log(name,'name')
+    getInformation(name, tr, td) {//鼠标点击事件
+      console.log(name, 'name')
       let tdEle = null;
       //获取TD元素
-      if(event.target.nodeName == "TD"){
+      if (event.target.nodeName == "TD") {
         tdEle = event.target
-      }else{
+      } else {
         tdEle = this.getParentTD(event.target);
       }
       let moreObj = {};
-      if(tdEle){
+      if (tdEle) {
         moreObj = this.getWidget(tdEle);
       }
 
@@ -217,15 +254,16 @@ export default {
         name,
         tr,
         td
-      },moreObj)
-    
-    },
+      }, moreObj)
 
+    },
+    signatureEdit(data) {
+      this.isSignatureEdit = data
+    },
     //excel父节点点击检测
-   async parentClick(e){
+    async parentClick(e) {
       let target = e.target;
-      const{metaKey,ctrlKey}=e
-      console.log(target,'target')
+      const {metaKey, ctrlKey} = e
       let bgs = document.querySelectorAll("#parent .oldlace-bg")
       //console.log(bgs)
       for (let i = 0; i < bgs.length; i++) {
@@ -233,148 +271,150 @@ export default {
       }
       //console.log(target.getAttribute('trindex'))
       let tdEle = this.getParentTD(target);
-      console.log(tdEle.getAttribute('dqid'),'dianqianid');
-      this.htmlData.dqid=tdEle.getAttribute('dqid')
+      this.htmlData.dqid = tdEle ? tdEle.getAttribute('dqid') : ''
       // const {data: res} = await getSignDetail({id: this.htmlData.dqid})
       //   console.log(res,'res');
-      if( this.htmlData.dqid){
-              const {data: res} = await getSignDetail({id: this.htmlData.dqid,tabId:this.pkeyId})
-             if(res.code===200){
-              console.log(res,'res');
-              this.htmlData.obj=res.data
-             }
-      }else{
-        this.htmlData.obj=null
+      if (this.htmlData.dqid) {
+        if (this.type.prop === 'tab2' && this.isSignatureEdit) {
+          this.htmlData.obj = null
+        } else {
+          const {data: res} = await getSignDetail({id: this.htmlData.dqid, tabId: this.pkeyId})
+          if (res.code === 200) {
+            this.htmlData.obj = res.data
+          }
+        }
+      } else {
+        this.htmlData.obj = null
       }
       let target1
-        if(tdEle){
-          let mydiv=tdEle.getElementsByTagName('div')
-          target1=mydiv[0]
-        }else{
-          tdEle=target
-          let mydiv=tdEle.getElementsByTagName('div')
-          target=mydiv[0]
-
-        }
-     
-        this.htmlData.keyname=target.getAttribute('keyname')||target1.getAttribute('keyname')
-      if(target.getAttribute('trindex') !== null && target.getAttribute('tdindex')||target1.getAttribute('trindex') !== null && target1.getAttribute('tdindex')){
+      if (tdEle) {
+        let mydiv = tdEle.getElementsByTagName('div')
+        target1 = mydiv[0]
+      } else {
+        tdEle = target
+        let mydiv = tdEle.getElementsByTagName('div')
+        target = mydiv[0]
+      }
+      let keyname = ''
+      try {
+        keyname = target.getAttribute('keyname') || target1.getAttribute('keyname')
+        // eslint-disable-next-line no-empty
+      } catch { }
+      console.log('keyname', keyname)
+      this.htmlData.keyname = keyname
+      if (target.getAttribute('trindex') !== null && target.getAttribute('tdindex') || target1.getAttribute('trindex') !== null && target1.getAttribute('tdindex')) {
         let tdEle = this.getParentTD(target);
-        if(tdEle){
+        if (tdEle) {
           //橙色背景
           target.classList.add("oldlace-bg");
-          if(metaKey||ctrlKey){
+          if (metaKey || ctrlKey) {
             target.classList.add("select-td");
             this.checkNameList.push(this.htmlData)
             this.checkList.push({
-              tr:target.getAttribute('trindex')||target1.getAttribute('trindex'),
-              td:target.getAttribute('tdindex')||target1.getAttribute('tdindex'),
+              tr: target.getAttribute('trindex') || target1.getAttribute('trindex'),
+              td: target.getAttribute('tdindex') || target1.getAttribute('tdindex'),
             })
-          }else{
+          } else {
             target.classList.remove("select-td");
-            this.checkList.forEach((ele,index)=>{
-              if(ele.tr===target.getAttribute('trindex')||ele.tr===target1.getAttribute('trindex')){
-                this.checkList.splice(index,1)
+            this.checkList.forEach((ele, index) => {
+              if (ele.tr === target.getAttribute('trindex') || ele.tr === target1.getAttribute('trindex')) {
+                this.checkList.splice(index, 1)
               }
             })
-            this.checkNameList.forEach((ele,index)=>{
-              if(this.htmlData.tr===ele.tr){
-                this.checkNameList.splice(index,1)
+            this.checkNameList.forEach((ele, index) => {
+              if (this.htmlData.tr === ele.tr) {
+                this.checkNameList.splice(index, 1)
               }
             })
-          
           }
         }
       }
     },
-
-    getParentTD(ele){
+    getParentTD(ele) {
       let targetParent = ele.parentNode;
       while (targetParent.nodeName !== "TD") {
-          if(targetParent.id == 'parent'){
-            return null;
-          }
-          targetParent = targetParent.parentNode;
+        if (targetParent.id == 'parent') {
+          return null;
+        }
+        targetParent = targetParent.parentNode;
       }
       return targetParent;
     },
 
 
     //获取控件信息
-    getWidget(tdEle){
+    getWidget(tdEle) {
       let selectElement = tdEle.querySelectorAll('.el-select');
-      let isMultiple =false
-      if(selectElement.length){
-  
-     // 遍历每个元素,检查是否包含 is-multiple 类名
-     selectElement.forEach(element => {
+      let isMultiple = false
+      if (selectElement.length) {
+
+        // 遍历每个元素,检查是否包含 is-multiple 类名
+        selectElement.forEach(element => {
           if (element.classList.contains('is-multiple')) {
             isMultiple = true;
           }
-      });
-        if(isMultiple){
+        });
+        if (isMultiple) {
           let options = selectElement[0].__vue__.options;
           let selectDatas = [];
           for (let i = 0; i < options.length; i++) {
             selectDatas.push({
-              dictValue:options[i].label
+              dictValue: options[i].label
             });
           }
           return {
-            type:'selectBox',
+            type: 'selectBox',
             selectDatas
           }
         }
       }
       let checkLabels = tdEle.querySelectorAll('.el-checkbox-group span.el-checkbox__label');
       //console.log(checkLabels)
-      if(checkLabels.length > 0){
+      if (checkLabels.length > 0) {
         let checkLabelDatas = [];
         for (let i = 0; i < checkLabels.length; i++) {
           //console.dir(checkLabels[i])
           checkLabelDatas.push({
-            dictValue:checkLabels[i].innerText
+            dictValue: checkLabels[i].innerText
           });
         }
         return {
-          type:'checkbox',
+          type: 'checkbox',
           checkLabelDatas
         }
       }
 
       let radioLabels = tdEle.querySelectorAll('.el-radio .el-radio__label');
-      if(radioLabels.length > 0){
+      if (radioLabels.length > 0) {
         let radioDatas = [];
         for (let i = 0; i < radioLabels.length; i++) {
           radioDatas.push({
-            dictValue:radioLabels[i].innerText
+            dictValue: radioLabels[i].innerText
           });
         }
         return {
-          type:'radio',
+          type: 'radio',
           radioDatas
         }
       }
 
       let elSelect = tdEle.querySelectorAll('.el-select');
       //console.dir(elSelect[0])
-      if(elSelect.length){
+      if (elSelect.length) {
         let options = elSelect[0].__vue__.options;
         let selectDatas = [];
         for (let i = 0; i < options.length; i++) {
           selectDatas.push({
-            dictValue:options[i].label
+            dictValue: options[i].label
           });
         }
         return {
-          type:'select',
+          type: 'select',
           selectDatas
         }
-        
+
       }
 
-  
-    
 
       return {};
     },
@@ -452,11 +492,11 @@ export default {
   height: 100%;
 }
 
-.excelBox{
-  /deep/ .oldlace-bg{
+.excelBox {
+  /deep/ .oldlace-bg {
     background-color: oldlace;
   }
-  /deep/ .select-td{
+  /deep/ .select-td {
     border-width: 4px;
     border-color: #E6A23C;
     border-style: solid;

+ 268 - 291
src/views/manager/projectinfo/treeTemplate/template/electronicSignature.vue

@@ -6,7 +6,7 @@
           元素坐标:
         </el-col>
         <el-col :span="18">
-          <avue-input v-model="htmlData1.name" placeholder="请点击坐标" :disabled='true' ></avue-input>
+          <avue-input v-model="htmlData1.name" placeholder="请点击坐标" :disabled='true'></avue-input>
         </el-col>
       </el-row>
 
@@ -15,8 +15,8 @@
           证书类型:
         </el-col>
         <el-col :span="18">
-            <el-select v-model="signType" placeholder="请选择证书类型" @change="signTypeChang()">
-            <el-option  v-for="item in seloptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
+          <el-select v-model="signType" placeholder="请选择证书类型" @change="signTypeChang()">
+            <el-option v-for="item in seloptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
           </el-select>
         </el-col>
       </el-row>
@@ -26,7 +26,7 @@
           所属方:
         </el-col>
         <el-col :span="18">
-          <avue-radio v-model="radio"  :dic="roleType" v-on:click="roleTypeChang()"></avue-radio>
+          <avue-radio v-model="radio" :dic="roleType" v-on:click="roleTypeChang()"></avue-radio>
         </el-col>
       </el-row>
 
@@ -35,8 +35,8 @@
           签字角色:
         </el-col>
         <el-col :span="18">
-          <el-select v-model="roleInfo"  placeholder="请选择签字岗位" filterable  @change="changeRole">
-            <el-option v-for="item in options" :key="item" :value="item" :label="item.label" ></el-option>
+          <el-select v-model="roleInfo" placeholder="请选择签字岗位" filterable @change="changeRole">
+            <el-option v-for="item in options" :key="item" :value="item" :label="item.label"></el-option>
           </el-select>
         </el-col>
       </el-row>
@@ -47,7 +47,8 @@
         </el-col>
         <el-col :span="18">
           <el-select v-model="signInfo" placeholder="请选择签章类型" @change="signInfoChang">
-            <el-option v-for="item in options" :key="item.dictKey" :value="item.dictKey" :label="item.dictValue"></el-option>
+            <el-option v-for="item in options" :key="item.dictKey" :value="item.dictKey"
+                       :label="item.dictValue"></el-option>
           </el-select>
         </el-col>
       </el-row>
@@ -58,7 +59,8 @@
         </el-col>
         <el-col :span="16">
 
-            <avue-input v-model="pyzbx" placeholder="横坐标,负代表左移,正代表右移,偏移量50大概等于一厘米"  type="number"></avue-input>
+          <avue-input v-model="pyzbx" placeholder="横坐标,负代表左移,正代表右移,偏移量50大概等于一厘米"
+                      type="number"></avue-input>
 
         </el-col>
       </el-row>
@@ -69,7 +71,8 @@
         </el-col>
         <el-col :span="16">
 
-            <avue-input v-model="pyzby" placeholder="纵坐标,负代表下移,正代表上移,偏移量50大概等于一厘米"  type="number"></avue-input>
+          <avue-input v-model="pyzby" placeholder="纵坐标,负代表下移,正代表上移,偏移量50大概等于一厘米"
+                      type="number"></avue-input>
 
         </el-col>
       </el-row>
@@ -78,21 +81,16 @@
         <el-button type="warning"
                    size="small"
                    icon="el-icon-view"
-                   @click="previewClick()">预览</el-button> &nbsp;&nbsp;
+                   @click="previewClick()">预览
+        </el-button> &nbsp;&nbsp;
         <el-button type="primary"
                    size="small"
                    icon="el-icon-circle-plus-outline"
-                   @click="addRoleInfo()">添加列表</el-button> &nbsp;&nbsp;
-
+                   @click="addRoleInfo()">添加列表
+        </el-button> &nbsp;&nbsp;
       </el-row>
-
-
     </div>
-
-    <div
-      style="border: 1px dotted rgb(187, 187, 187);box-sizing: border-box;padding: 0px 15px;"
-      class="martop20 marbottom10"
-    >
+    <div style="border: 1px dotted rgb(187, 187, 187);box-sizing: border-box;padding: 0px 15px;" class="martop20 marbottom10">
       <table @click
              class="table martop20 copyTable"
              width='100%'
@@ -100,10 +98,7 @@
              bordercolor="#E5E5E5"
              cellpadding='2px'
       >
-        <thead
-          cellpadding='2px'
-          height='40px'
-        >
+        <thead cellpadding='2px' height='40px'>
         <tr>
           <th width='30%'>元素位置</th>
           <th width='30%'>签字岗位</th>
@@ -113,55 +108,51 @@
         </tr>
         </thead>
         <tbody height='36px'>
-        <tr v-for="(item,key) in setsignaTable"  :key="key" v-on:click="">
-          <td>{{item.colName}}</td>
-          <td>{{item.sigRoleName}}</td>
-          <td>{{item.pyzbx}}</td>
-          <td>{{item.pyzby}}</td>
+        <tr v-for="(item,key) in setsignaTable" :key="key" v-on:click="">
+          <td>{{ item.colName }}</td>
+          <td>{{ item.sigRoleName }}</td>
+          <td>{{ item.pyzbx }}</td>
+          <td>{{ item.pyzby }}</td>
           <td align="center">
             <span style="color:#409EFF;;cursor: pointer;margin-right: 5px;" @click="editClick(item)" v-if="item.show===false">编辑</span>
             <span style="color:green;;cursor: pointer;margin-right: 5px;" @click="saveClick(item)" v-else v-loading="isEditLoaing">保存</span>
-
             <span style="color:red;cursor: pointer;" v-on:click="deleteTableSig(key,item.id,item)">删除</span>
-
           </td>
         </tr>
         </tbody>
       </table>
-
-      <el-button type="primary"
-                 size="small"
-                 class="martop25"
-                 style="float:right;"
-                 icon="el-icon-circle-plus-outline"
-                 :loading="saveLoaing"
-                 @click="saveSingInfo()">保存入库</el-button> &nbsp;&nbsp;
+      <el-button type="primary" size="small" class="martop25" style="float:right;" icon="el-icon-circle-plus-outline" :loading="saveLoaing" @click="saveSingInfo()">保存入库</el-button> &nbsp;&nbsp;
     </div>
   </div>
 </template>
 
-
 <script>
-
-import {getRoleInfoByParentId, getRoleType, getSigList, saveSig,remove,updateDetail,getSignDetail} from "../../../../../api/manager/AdjustForm";
+import {
+  getRoleInfoByParentId,
+  getRoleType,
+  getSigList,
+  saveSig,
+  remove,
+  updateDetail,
+  getSignDetail
+} from "../../../../../api/manager/AdjustForm";
 import {findPfxType, getPriwbsPdf} from "../../../../../api/certificate/list";
 
-
 export default {
-  props: ['pkeyId1', 'htmlData1','excelId'],
-  data () {
+  props: ['pkeyId1', 'htmlData1', 'excelId'],
+  data() {
     return {
       radio: '',
-      roleType:[],
+      roleType: [],
       options: [],
       roleInfo: '',
       signInfo: '',
-      signInfoarr:[],
+      signInfoarr: [],
       signType: '2', // 证书类型
       pyzbx: 0.0,
-      pyzby: 0.0 ,
-      setsignaTable:[],
-      seloptions : [
+      pyzby: 0.0,
+      setsignaTable: [],
+      seloptions: [
         {
           value: '2',
           label: '个人证书',
@@ -171,95 +162,89 @@ export default {
           label: '企业证书',
         }
       ],
-      isCansave:false,
-      colKey:'',
-      colName:'',
-      signId:'',
-      isDeleted:'',
-      parentRoleId:'',
-      isEditLoaing:false,
-      sigRoleName:'',
-      saveLoaing:false
+      isCansave: false,
+      colKey: '',
+      colName: '',
+      signId: '',
+      isDeleted: '',
+      parentRoleId: '',
+      isEditLoaing: false,
+      sigRoleName: '',
+      saveLoaing: false
 
     }
   },
   watch: {
     'htmlData1': {
       handler(val) {
-       setTimeout(async() => {
-        if(val.obj){
-          let obj=val.obj
-          console.log(obj,'obj');
-          this.signType=obj.type.toString()
-          this.pyzbx=obj.pyzbx
-          this.pyzby=obj.pyzby
-          this.sigRoleId=obj.sigRoleId
-          this.colKey=obj.colKey
-
-          this.colName=obj.colName
-          this.signId=obj.id
-          this.isDeleted=obj.isDeleted
-          if(obj.type==2){
-            this.radio=obj.parentRoleId
-             await this.roleTypeChang()
-
-          }else{
-            this.radio=''
-            await this.signTypeChang()
-            this.signInfo=obj.sigRoleId
-            this.options.forEach((ele)=>{
-                if(ele.dictKey=== this.signInfo){
-                    this.sigRoleName=ele.dictValue
+        setTimeout(async () => {
+          if (val.obj) {
+            let obj = val.obj
+            this.signType = obj.type.toString()
+            this.pyzbx = obj.pyzbx
+            this.pyzby = obj.pyzby
+            this.sigRoleId = obj.sigRoleId
+            this.colKey = val.keyname
+
+            this.colName = obj.colName
+            this.signId = obj.id
+            this.isDeleted = obj.isDeleted
+            if (obj.type == 2) {
+              this.radio = obj.parentRoleId
+              await this.roleTypeChang()
+
+            } else {
+              this.radio = ''
+              await this.signTypeChang()
+              this.signInfo = obj.sigRoleId
+              this.options.forEach((ele) => {
+                if (ele.dictKey === this.signInfo) {
+                  this.sigRoleName = ele.dictValue
                 }
-             })
-
+              })
+            }
+          } else {
+            let isEdit = this.setsignaTable.some(element => element.show === true);
+            if (!isEdit) {
+              this.radio = ''
+              this.roleInfo = ''
+              this.signInfo = ''
+              this.signType = '2'
+              this.pyzbx = 0
+              this.pyzby = 0
+            }
+            this.colKey = val.keyname
           }
-        }else{
-        let isEdit= this.setsignaTable.some(element => element.show === true);
-        if(!isEdit){
-          this.radio=''
-          this.roleInfo=''
-          this.signInfo=''
-          this.signType='2'
-          this.pyzbx=0
-          this.pyzby=0
-        }
-
-          this.colKey=val.keyname
-        }
-       }, 1000);
-
-
+        }, 1000);
         // todo
       },
       deep: true
     },
-    'options':{
-      handler(val){
-        if(this.sigRoleId&&val.length>0&&this.radio.length>1){
-          this.options.forEach((ele)=>{
-            if(ele.value===this.sigRoleId){
-              this.roleInfo=ele
+    'options': {
+      handler(val) {
+        if (this.sigRoleId && val.length > 0 && this.radio.length > 1) {
+          this.options.forEach((ele) => {
+            if (ele.value === this.sigRoleId) {
+              this.roleInfo = ele
             }
           })
         }
-
       }
     }
   },
   methods: {
-    async getRoleType () {//获取角色类型
-      const { data: res } = await getRoleType()
+    async getRoleType() {//获取角色类型
+      const {data: res} = await getRoleType()
       if (res.code === 200) {
         this.roleType = res.data
       }
     },
 
     // 签证类型
-    async signTypeChang(){
+    async signTypeChang() {
       setTimeout(async () => {
-        if(this.signType==6){
-          const {data: res} = await findPfxType({ typeOrStatus: 'pfx_type'})
+        if (this.signType == 6) {
+          const {data: res} = await findPfxType({typeOrStatus: 'pfx_type'})
           if (res.code === 200) {
             this.options = res.data
           }
@@ -268,32 +253,32 @@ export default {
     },
 
     // 单选按钮改变事件
-    async roleTypeChang(){
+    async roleTypeChang() {
       setTimeout(async () => {
-          const {data: res} = await getRoleInfoByParentId({ParentId: this.radio})
-          if (res.code === 200) {
-            this.options = res.data
-          }
+        const {data: res} = await getRoleInfoByParentId({ParentId: this.radio})
+        if (res.code === 200) {
+          this.options = res.data
+        }
       }, 200);
     },
     //签章类型改变e
-    signInfoChang(e){
-      console.log(e,'e');
-    this.signInfoarr=  this.options.filter(item=>{
-        if(item.dictKey===e){
+    signInfoChang(e) {
+      console.log(e, 'e');
+      this.signInfoarr = this.options.filter(item => {
+        if (item.dictKey === e) {
           return item
         }
       })
-      this.options.forEach((ele)=>{
-                if(ele.dictKey=== this.signInfo){
-                    this.sigRoleName=ele.dictValue
-                }
-       })
+      this.options.forEach((ele) => {
+        if (ele.dictKey === this.signInfo) {
+          this.sigRoleName = ele.dictValue
+        }
+      })
     },
     //角色改变
-    changeRole(e){
-      this.sigRoleName=e.label
-      this.sigRoleId=e.value
+    changeRole(e) {
+      this.sigRoleName = e.label
+      this.sigRoleId = e.value
 
     },
     //预览
@@ -311,35 +296,35 @@ export default {
         }
       })
     },
-    async addRoleInfo(){
+    async addRoleInfo() {
       var isadd = true;
       // 集合中添加数据
       var data = {};
 
       // 坐标位置
-      if(this.htmlData1.name ===''){
+      if (this.htmlData1.name === '') {
         this.$message({
           type: "error",
           message: "请选坐标位置"
         });
         return;
-      }else if(this.htmlData1.name === '警告' ){
+      } else if (this.htmlData1.name === '警告') {
         this.$message({
-            type: "warning",
-            message: "警告框不能配置电签"
-          });
-          return;
+          type: "warning",
+          message: "警告框不能配置电签"
+        });
+        return;
       }
       // 证书类型
-      if(this.signType===''){
+      if (this.signType === '') {
         this.$message({
-            type: "error",
-            message: "请选择证书类型"
-          });
-          return;
+          type: "error",
+          message: "请选择证书类型"
+        });
+        return;
       }
-      if (this.signType==2){
-        if(this.roleInfo ==='') {
+      if (this.signType == 2) {
+        if (this.roleInfo === '') {
           this.$message({
             type: "error",
             message: "请选择签字岗位"
@@ -348,9 +333,9 @@ export default {
         }
         data.sigRoleId = this.roleInfo.value;
         data.sigRoleName = this.roleInfo.label;
-        data.type=2;
-      }else if(this.signType==6){
-        if(this.signInfo ===''){
+        data.type = 2;
+      } else if (this.signType == 6) {
+        if (this.signInfo === '') {
           this.$message({
             type: "error",
             message: "请选择签章类型"
@@ -359,15 +344,15 @@ export default {
         }
         // data.sigRoleId = this.signInfo.dictKey;
         // data.sigRoleName = this.signInfo.dictValue;
-         data.sigRoleId = this.signInfoarr[0].dictKey;
+        data.sigRoleId = this.signInfoarr[0].dictKey;
         data.sigRoleName = this.signInfoarr[0].dictValue;
-        data.type=6;
+        data.type = 6;
       }
-      console.log(this.htmlData1,'this.htmlData11111');
-      data.colKey="__"+this.htmlData1.tr+"_"+this.htmlData1.td;
+      console.log(this.htmlData1, 'this.htmlData11111');
+      data.colKey = "__" + this.htmlData1.tr + "_" + this.htmlData1.td;
 
       data.tabId = this.pkeyId1;
-      data.colName= this.htmlData1.name;
+      data.colName = this.htmlData1.name;
 
 
       data.pyzbx = this.pyzbx;
@@ -375,7 +360,7 @@ export default {
 
       try {
         this.setsignaTable.forEach(val => {
-          if(val.colName == this.htmlData1.name){ // 位置只能添加一个
+          if (val.colName == this.htmlData1.name) { // 位置只能添加一个
             this.$message({
               type: "error",
               message: "位置只能配置一个电签"
@@ -384,7 +369,7 @@ export default {
             throw new Error('位置只能配置一个电签')
           }
 
-          if(val.colName === this.htmlData1.name && val.sigRoleId === this.roleInfo.value){
+          if (val.colName === this.htmlData1.name && val.sigRoleId === this.roleInfo.value) {
             this.$message({
               type: "error",
               message: "数据已添加列表中"
@@ -393,155 +378,147 @@ export default {
             throw new Error('位置只能配置一个电签');
           }
         })
-        if(isadd){
-          data.show=false
-          data.colKey=this.htmlData1.keyname
+        if (isadd) {
+          data.show = false
+          data.colKey = this.htmlData1.keyname
           this.setsignaTable.push(data);
         }
-      }catch (e){
+      } catch (e) {
         throw e;
       }
     },
-    async editClick (item){
-      console.log(item,'item');
+    async editClick(item) {
+      console.log(item, 'item');
 
-      this.setsignaTable.forEach((ele)=>{
-        ele.show=false
+      this.setsignaTable.forEach((ele) => {
+        ele.show = false
       })
-      item.show=true
-      console.log(this.htmlData1,'htmlData1');
-      const {data: res} = await getSignDetail({id: item.id,tabId:this.pkeyId1})
-        if(res.code===200){
-              console.log(res,'res');
-              this.htmlData1.obj=res.data
-              let obj=this.htmlData1.obj
-              console.log(obj,'opbj');
-            if(obj){
-                console.log(obj,'obj');
-                this.htmlData1.name=obj.colName;
-                this.signType=obj.type.toString()
-                this.pyzbx=obj.pyzbx
-                this.pyzby=obj.pyzby
-                this.sigRoleId=obj.sigRoleId
-                this.sigRoleName=obj.sigRoleName
-                this.colKey=obj.colKey
-
-
-                this.colName=obj.colName
-                this.signId=obj.id
-                this.isDeleted=obj.isDeleted
-
-                if(obj.type==2){
-                  this.radio=obj.parentRoleId
-                  await this.roleTypeChang()
-
-                }else{
-                  this.radio=''
-                  await this.signTypeChang()
-                  this.signInfo=obj.sigRoleId
-                  this.options.forEach((ele)=>{
-                    if(ele.dictKey=== this.signInfo){
-                        this.sigRoleName=ele.dictValue
-                    }
-                  })
-
-
-                }
-            }else{
-              this.radio=''
-              this.roleInfo=''
-              this.signInfo=''
-              this.signType=''
-              this.pyzbx=0
-              this.pyzby=0
-            }
-
-       }
-       console.log( this.htmlData1,' this.htmlData1111');
-
+      item.show = true
+      console.log(this.htmlData1, 'htmlData1');
+      const {data: res} = await getSignDetail({id: item.id, tabId: this.pkeyId1})
+      if (res.code === 200) {
+        console.log(res, 'res');
+        this.htmlData1.obj = res.data
+        let obj = this.htmlData1.obj
+        console.log(obj, 'opbj');
+        if (obj) {
+          console.log(obj, 'obj');
+          this.htmlData1.name = obj.colName;
+          this.signType = obj.type.toString()
+          this.pyzbx = obj.pyzbx
+          this.pyzby = obj.pyzby
+          this.sigRoleId = obj.sigRoleId
+          this.sigRoleName = obj.sigRoleName
+          this.colKey = obj.colKey
+          this.colName = obj.colName
+          this.signId = obj.id
+          this.isDeleted = obj.isDeleted
+
+          if (obj.type == 2) {
+            this.radio = obj.parentRoleId
+            await this.roleTypeChang()
+
+          } else {
+            this.radio = ''
+            await this.signTypeChang()
+            this.signInfo = obj.sigRoleId
+            this.options.forEach((ele) => {
+              if (ele.dictKey === this.signInfo) {
+                this.sigRoleName = ele.dictValue
+              }
+            })
+          }
+        } else {
+          this.radio = ''
+          this.roleInfo = ''
+          this.signInfo = ''
+          this.signType = ''
+          this.pyzbx = 0
+          this.pyzby = 0
+        }
+      }
+      console.log(this.htmlData1, ' this.htmlData1111');
+      this.$emit('edit', true)
     },
-    saveClick(item){
+    saveClick(item) {
       console.log('保存');
       this.editRoleInfo(item)
-
-
     },
-   async editRoleInfo(){
-      let obj={}
-      obj.colKey=this.colKey
-      obj.colName=this.colName
-      obj.sigRoleName=this.sigRoleName
-      obj.tabId=this.pkeyId1
-      obj.excelId=this.excelId
-      obj.type=this.signType
-      obj.pyzbx=this.pyzbx
-      obj.pyzby=this.pyzby
-      obj.id=this.signId
-      obj.isDeleted=this.isDeleted
-      if(this.signType==2){
-        obj.parentRoleId=this.radio
-        obj.sigRoleId=this.sigRoleId
-
-      }else{
-        obj.sigRoleId=this.signInfo
+    async editRoleInfo() {
+      let obj = {}
+      obj.colKey = this.colKey
+      obj.colName = this.colName
+      obj.sigRoleName = this.sigRoleName
+      obj.tabId = this.pkeyId1
+      obj.excelId = this.excelId
+      obj.type = this.signType
+      obj.pyzbx = this.pyzbx
+      obj.pyzby = this.pyzby
+      obj.id = this.signId
+      obj.isDeleted = this.isDeleted
+      if (this.signType == 2) {
+        obj.parentRoleId = this.radio
+        obj.sigRoleId = this.sigRoleId
+
+      } else {
+        obj.sigRoleId = this.signInfo
       }
-        let arr=this.setsignaTable
-        arr.forEach((ele)=>{
-          if(obj.id==ele.id){
-            ele.colKey=this.colKey
-            ele.excelId=obj.excelId
-            ele.pyzbx=obj.pyzbx
-            ele.pyzby=obj.pyzby
-            ele.sigRoleId=obj.sigRoleId
-            ele.sigRoleName=obj.sigRoleName
-            ele.type=obj.type
-            ele.tabId=obj.tabId
-            ele.show=false
-            ele.colName=this.htmlData1.name
-
-          }
-        })
-        this.$nextTick(()=>{
-          this.setsignaTable=arr
-        })
-        this.$forceUpdate()
-        console.log(this.setsignaTable,'this.setsignaTable');
-        // this.saveSingInfo()
-
+      let arr = this.setsignaTable
+      arr.forEach((ele) => {
+        if (obj.id == ele.id) {
+          ele.colKey = this.colKey
+          ele.excelId = obj.excelId
+          ele.pyzbx = obj.pyzbx
+          ele.pyzby = obj.pyzby
+          ele.sigRoleId = obj.sigRoleId
+          ele.sigRoleName = obj.sigRoleName
+          ele.type = obj.type
+          ele.tabId = obj.tabId
+          ele.show = false
+          ele.colName = this.htmlData1.name
 
+        }
+      })
+      this.$nextTick(() => {
+        this.setsignaTable = arr
+      })
+      this.$forceUpdate()
+      console.log(this.setsignaTable, 'this.setsignaTable');
+      // this.saveSingInfo()
+      this.$emit('edit', false)
     },
-   async deleteTableSig (key,id,item) {//删除数据
-   console.log(item,'item');
-        this.setsignaTable.splice(key,1);
-        this.isCansave=true
-        // this.saveSingInfo();
-        // const {data: res} = await saveSig({dataInfo: this.setsignaTable,tabId:this.pkeyId1})
-        if(id){
-            const {data: res} = await remove(id,this.pkeyId1)
-            if (res.code === 200) {
-              //console.log(this.$parent)
-              this.isCansave=false
-              this.$parent.getExcelHtml(this.pkeyId1);
-              this.getSingInfo()
-              this.$message({
-                type: "success",
-                message: "操作成功"
-              });
-            }
+    async deleteTableSig(key, id, item) {//删除数据
+      console.log(item, 'item');
+      this.setsignaTable.splice(key, 1);
+      this.isCansave = true
+      // this.saveSingInfo();
+      // const {data: res} = await saveSig({dataInfo: this.setsignaTable,tabId:this.pkeyId1})
+      if (id) {
+        const {data: res} = await remove(id, this.pkeyId1)
+        if (res.code === 200) {
+          //console.log(this.$parent)
+          this.isCansave = false
+          this.$parent.getExcelHtml(this.pkeyId1);
+          this.getSingInfo()
+          this.$message({
+            type: "success",
+            message: "操作成功"
+          });
         }
-
+      }
+      this.$emit('edit', false)
     },
     async saveSingInfo() {
-      console.log(this.setsignaTable,'this.setsignaTable');
-      if(this.setsignaTable.length===0){
+      console.log(this.setsignaTable, 'this.setsignaTable');
+      if (this.setsignaTable.length === 0) {
         this.$message.warning('请先选择数据')
         return
       }
-      this.saveLoaing=true
+      this.saveLoaing = true
       setTimeout(() => {
-        this.saveLoaing=false
+        this.saveLoaing = false
       }, 1500);
-      const {data: res} = await saveSig({dataInfo: this.setsignaTable,tabId:this.pkeyId1})
+      const {data: res} = await saveSig({dataInfo: this.setsignaTable, tabId: this.pkeyId1})
 
       if (res.code === 200) {
         //console.log(this.$parent)
@@ -555,29 +532,29 @@ export default {
 
     },
     async getSingInfo() {
-      console.log(this.excelId,'this.excelId1111111');
+      console.log(this.excelId, 'this.excelId1111111');
       const {data: res} = await getSigList(
         {
           current: 0,
           size: 100,
           tabId: this.pkeyId1,
-          type:2,
-          excelId:this.excelId
+          type: 2,
+          excelId: this.excelId
         }
       )
       if (res.code === 200) {
         this.setsignaTable = res.data.records;
-        this.setsignaTable.forEach((ele)=>{
-          ele.show=false
+        this.setsignaTable.forEach((ele) => {
+          ele.show = false
         })
       }
     }
   },
-  created () {
+  created() {
     this.getRoleType();  //获取文本类型接口
     this.getSingInfo();
-    this.setsignaTable=[];
-    console.log(this.htmlData1,'html1');
+    this.setsignaTable = [];
+    console.log(this.htmlData1, 'html1');
 
   },
 
@@ -593,12 +570,12 @@ export default {
   color: #101010;
   font-size: 14px;
 }
-.dianqian{
+.dianqian {
   width: 90%;
   height: 100%;
 }
-.copyTable td{
-  user-select:initial !important;
+.copyTable td {
+  user-select: initial !important;
 }
 
 </style>