ZaiZai 1 سال پیش
والد
کامیت
55d7211446

+ 2 - 2
src/config/index.json

@@ -1,6 +1,6 @@
 {
-  "target1": "http://39.108.216.210:8090",
-  "target": "http://192.168.0.109:8090",
+  "target": "http://39.108.216.210:8090",
+  "target1": "http://192.168.0.109:8090",
   "dev": {
     "port": 1888
   }

+ 0 - 1
src/views/exctab/ElementIdentification/index.vue

@@ -623,7 +623,6 @@
       </el-dialog>
       <!-- 添加到元素库 -->
       <el-dialog
-
         title="保存元素表"
         class="excelBox"
         :visible.sync="eleDialog"

+ 107 - 80
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -32,7 +32,9 @@
             @change="change"
           />
         </span>
-        <span v-else-if="type.prop==='tab2'"> <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" @edit="signatureEdit"/> </span>
+        <span v-else-if="type.prop==='tab2'">
+          <electronicSignature :pkeyId1='pkeyId' :htmlData1="htmlData" :excelId="excelId" :times="timesTimeElement" @edit="signatureEdit" @timeFocus="timeElementFocus"/>
+        </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>
@@ -50,7 +52,6 @@ import promptSettings from './template/promptSettings.vue'
 import Vue from 'vue'
 import {getExcelHtml} from '@/api/exctab/excelmodel'
 import {getSignDetail} from "@/api/manager/AdjustForm";
-import {f} from "vuedraggable/dist/vuedraggable.common";
 
 export default {
   props: ['pkeyId', 'excelId'],
@@ -88,7 +89,9 @@ export default {
       },
       checkList: [],
       checkNameList: [],
-      isSignatureEdit: false
+      isSignatureEdit: false,
+      isTimeElement: false,
+      timesTimeElement: {}
     }
   },
   mounted() {
@@ -237,97 +240,119 @@ export default {
     },
 
     getInformation(name, tr, td) {//鼠标点击事件
-      console.log(name, 'name')
-      let tdEle = null;
-      //获取TD元素
-      if (event.target.nodeName == "TD") {
-        tdEle = event.target
+      if (!this.isTimeElement) {
+        let tdEle = null;
+        //获取TD元素
+        if (event.target.nodeName === "TD") {
+          tdEle = event.target
+        } else {
+          tdEle = this.getParentTD(event.target);
+        }
+        let moreObj = {};
+        if (tdEle) {
+          moreObj = this.getWidget(tdEle);
+        }
+        this.htmlData = Object.assign({
+          name,
+          tr,
+          td
+        }, moreObj)
       } else {
-        tdEle = this.getParentTD(event.target);
-      }
-      let moreObj = {};
-      if (tdEle) {
-        moreObj = this.getWidget(tdEle);
+        this.$set(this.timesTimeElement, 'colName', name)
       }
-
-      this.htmlData = Object.assign({
-        name,
-        tr,
-        td
-      }, moreObj)
-
     },
     signatureEdit(data) {
       this.isSignatureEdit = data
     },
     //excel父节点点击检测
     async parentClick(e) {
-      let target = e.target;
-      const {metaKey, ctrlKey} = e
-      let bgs = document.querySelectorAll("#parent .oldlace-bg")
-      //console.log(bgs)
-      for (let i = 0; i < bgs.length; i++) {
-        bgs[i].classList.remove("oldlace-bg");
-      }
-      //console.log(target.getAttribute('trindex'))
-      let tdEle = this.getParentTD(target);
-      this.htmlData.dqid = tdEle ? tdEle.getAttribute('dqid') : ''
-      // const {data: res} = await getSignDetail({id: this.htmlData.dqid})
-      //   console.log(res,'res');
-      if (this.htmlData.dqid) {
-        if (this.type.prop === 'tab2' && this.isSignatureEdit) {
+      if (!this.isTimeElement) {
+        let target = e.target;
+        const {metaKey, ctrlKey} = e
+        let bgs = document.querySelectorAll("#parent .oldlace-bg")
+        //console.log(bgs)
+        for (let i = 0; i < bgs.length; i++) {
+          bgs[i].classList.remove("oldlace-bg");
+        }
+        //console.log(target.getAttribute('trindex'))
+        let tdEle = this.getParentTD(target);
+        this.htmlData.dqid = tdEle ? tdEle.getAttribute('dqid') : ''
+        // const {data: res} = await getSignDetail({id: this.htmlData.dqid})
+        //   console.log(res,'res');
+        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 {
-          const {data: res} = await getSignDetail({id: this.htmlData.dqid, tabId: this.pkeyId})
-          if (res.code === 200) {
-            this.htmlData.obj = res.data
+          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) {
+            //橙色背景
+            target.classList.add("oldlace-bg");
+            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'),
+              })
+            } 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.checkNameList.forEach((ele, index) => {
+                if (this.htmlData.tr === ele.tr) {
+                  this.checkNameList.splice(index, 1)
+                }
+              })
+            }
           }
         }
       } 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]
-      }
-      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 target = e.target;
         let tdEle = this.getParentTD(target);
+        let target1
         if (tdEle) {
-          //橙色背景
-          target.classList.add("oldlace-bg");
-          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'),
-            })
-          } 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.checkNameList.forEach((ele, index) => {
-              if (this.htmlData.tr === ele.tr) {
-                this.checkNameList.splice(index, 1)
-              }
-            })
-          }
+          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')
+        } catch {}
+        this.$set(this.timesTimeElement, 'keyname', keyname)
+        console.log(this.timesTimeElement)
       }
     },
     getParentTD(ele) {
@@ -418,8 +443,10 @@ export default {
 
       return {};
     },
-
-
+    //是否为时间元素选择模式
+    timeElementFocus(val) {
+      this.isTimeElement = val
+    },
   },
   components: {
     setInputTPT,

+ 56 - 3
src/views/manager/projectinfo/treeTemplate/template/electronicSignature.vue

@@ -40,6 +40,23 @@
           </el-select>
         </el-col>
       </el-row>
+      <el-row :span="24" v-if="signType==2">
+        <el-col :span="3.3" style="line-height: 40px">签字时间:</el-col>
+        <el-col :span="18">
+          <div style="height: 40px; display: flex; align-items: center">
+            <el-checkbox v-model="timesTimeElement.timeState" :true-label="1" :false-label="2">是否需要获取签字时间</el-checkbox>
+          </div>
+        </el-col>
+      </el-row>
+
+      <el-row :span="24" v-if="signType==2">
+        <el-col :span="3.3" style="line-height: 40px">时间元素:</el-col>
+        <el-col :span="18">
+          <el-input v-model="timesTimeElement.timeName" placeholder="请点击后,在左边选择元素" @focus="timeElementFocus">
+            <el-button slot="append" @click="timeElementFinish">完成</el-button>
+          </el-input>
+        </el-col>
+      </el-row>
 
       <el-row :span="24" v-if="signType==6">
         <el-col :span="3.3" style="line-height: 40px">
@@ -139,10 +156,14 @@ import {
 import {findPfxType, getPriwbsPdf} from "../../../../../api/certificate/list";
 
 export default {
-  props: ['pkeyId1', 'htmlData1', 'excelId'],
+  props: ['pkeyId1', 'htmlData1', 'excelId', 'times'],
   data() {
     return {
       radio: '',
+      isTimeSigning: false,
+      timesTimeElement: {
+        timeState: 2,
+      },
       roleType: [],
       options: [],
       roleInfo: '',
@@ -171,7 +192,6 @@ export default {
       isEditLoaing: false,
       sigRoleName: '',
       saveLoaing: false
-
     }
   },
   watch: {
@@ -230,6 +250,15 @@ export default {
           })
         }
       }
+    },
+    'times': {
+      handler(obj) {
+        this.timesTimeElement = {
+          timeName: obj.colName,
+          timeColKey: obj.keyname
+        }
+      },
+      deep: true
     }
   },
   methods: {
@@ -358,6 +387,12 @@ export default {
       data.pyzbx = this.pyzbx;
       data.pyzby = this.pyzby;
 
+      //签字时间
+      const times = this.timesTimeElement
+      data.timeState = times.timeState || 2;
+      data.timeName = times.timeName;
+      data.timeColKey = times.timeColKey;
+
       try {
         this.setsignaTable.forEach(val => {
           if (val.colName == this.htmlData1.name) { // 位置只能添加一个
@@ -428,6 +463,12 @@ export default {
               }
             })
           }
+          //签字时间
+          this.timesTimeElement = {
+            timeState: obj.timeState || 2,
+            timeName: obj.timeName,
+            timeColKey: obj.timeColKey
+          }
         } else {
           this.radio = ''
           this.roleInfo = ''
@@ -435,6 +476,12 @@ export default {
           this.signType = ''
           this.pyzbx = 0
           this.pyzby = 0
+          //签字时间
+          this.timesTimeElement = {
+            timeState: 2,
+            timeName: '',
+            timeColKey: ''
+          }
         }
       }
       console.log(this.htmlData1, ' this.htmlData1111');
@@ -548,7 +595,13 @@ export default {
           ele.show = false
         })
       }
-    }
+    },
+    timeElementFocus() {
+      this.$emit('timeFocus', true)
+    },
+    timeElementFinish() {
+      this.$emit('timeFocus', false)
+    },
   },
   created() {
     this.getRoleType();  //获取文本类型接口