瀏覽代碼

表单不出来

hongchuangyanfa 2 年之前
父節點
當前提交
33067f4e09

+ 30 - 0
src/api/manager/AdjustForm.js

@@ -24,3 +24,33 @@ export const getColByTabId = (params) => {
         params
     })
 }
+
+
+  // 电签 -- 获取角色类型
+  export const getRoleType = (params) => {
+    return request({
+      url: '/api/blade-system/role/getRoleTypeInfo',
+      method: 'get',
+      params
+    })
+  }
+
+// 电签 -- 获取角色类型
+export const getRoleInfoByParentId = (params) => {
+  return request({
+    url: '/api/blade-system/role/getRoleInfoByParentId',
+    method: 'get',
+    params
+  })
+}
+
+
+// 设置文本类型
+export const saveSig = (data) => {
+  return request({
+    url: '/api/blade-manager/textdictinfo/save_sigInfo',
+    method: 'post',
+    data
+  })
+}
+

+ 1 - 1
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -36,7 +36,7 @@
             :htmlData="htmlData"
           />
         </span>
-        <span v-else-if="type.prop==='tab2'"> <electronicSignature style=" position: absolute;" /> </span>
+        <span v-else-if="type.prop==='tab2'"> <electronicSignature style=" position: absolute;" :pkeyId1='pkeyId' :htmlData1="htmlData" /> </span>
         <span v-else-if="type.prop==='tab3'"> <setFormula style=" position: absolute;"/> </span>
         <span v-else-if="type.prop==='tab4'"> <editDefault style=" position: absolute;"/> </span>
         <span v-else-if="type.prop==='tab5'"> <promptSettings style=" position: absolute;"/> </span>

+ 92 - 71
src/views/manager/projectinfo/treeTemplate/template/electronicSignature.vue

@@ -1,31 +1,12 @@
 <template>
   <div class="dianqian martop20">
-    <avue-radio v-model="radio"  :dic="dic"></avue-radio>
+    <avue-radio v-model="radio"  :dic="roleType" v-on:click="roleTypeChang()"></avue-radio>
     <div class="flexBetween martop20">
-      <avue-input v-model="form" placeholder="请输入内容" ></avue-input>
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
+      <avue-input v-model="htmlData1.name" placeholder="请点解坐标" :disabled='true' ></avue-input>
+      <el-select v-model="roleInfo" @change="selectChanged" placeholder="请选择签字岗位" style="width: 360px ">
+        <el-option v-for="item in options" :key="item.value" :value="item" :label="item.label"></el-option>
       </el-select>
-      <el-select
-        size='mini'
-        v-model="value"
-        clearable
-        placeholder="请选择"
-      >
-        <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-      <el-button size="mini">保存</el-button>
+        <el-button size="mini" v-on:click="addRoleInfo()">保存</el-button>
     </div>
 
     <table
@@ -46,66 +27,105 @@
         </tr>
       </thead>
       <tbody height='36px'>
-        <tr
-          v-for="(item,key) in setInputTable"
-          :key="key"
-        >
-          <td>{{item.id}}</td>
-          <td>{{item.id}}</td>
-          <td align="center"><span style="color:red;cursor: pointer;">删除</span></td>
+        <tr v-for="(item,key) in setsignaTable"  :key="key" >
+          <td>{{item.zb}}</td>
+          <td>{{item.signName}}</td>
+          <td align="center"><span style="color:red;cursor: pointer;" v-on:click="deleteTableSig(key)">删除</span></td>
         </tr>
       </tbody>
     </table>
-    <el-button
-      class="martop25"
-      style="float:right;"
-      type="info"
-      size="mini"
-    >保存设置</el-button>
+    <el-button class="martop25" style="float:right;" type="info" size="mini" v-on:click="saveSingInfo()">保存设置</el-button>
   </div>
 </template>
 <script>
 
+import {getRoleInfoByParentId, getRoleType, saveSig} from "../../../../../api/manager/AdjustForm";
+
 export default {
+  props: ['pkeyId1', 'htmlData1'],
   data () {
     return {
-      radio: '施工',//
-      dic:[{
-        label:'施工',
-        value:3
-      },{
-        label:'监理',
-        value:6
-      },{
-        label:'专家',
-        value:9
-      },{
-        label:'业主',
-        value:12
+      radio: '',
+      roleType:[],
+      options: [],
+      roleInfo: '',
+      setsignaTable:[]
+    }
+  },
+  methods: {
+    async getRoleType () {//获取角色类型
+      const { data: res } = await getRoleType()
+      if (res.code === 200) {
+        this.roleType = res.data
+      }
+    },
+    // 单选按钮改变事件
+    async roleTypeChang(){
+      setTimeout(async () => {
+        console.log(this.radio);
+        const {data: res} = await getRoleInfoByParentId({ParentId: this.radio})
+        if (res.code === 200) {
+          this.options = res.data
+        }
+      }, 200);
+    },
+    async addRoleInfo(){
+      // 坐标位置
+      if(this.htmlData1.name ===''){
+        this.$message({
+          type: "error",
+          message: "请选坐标位置"
+        });
+        return;
+      }
+      // 签字岗位
+      if(this.roleInfo ===''){
+        this.$message({
+          type: "error",
+          message: "请选择签字岗位"
+        });
+        return;
+      }
+      var isadd = true;
+      // 集合中添加数据
+      var data = {};
+      data.trTd=this.htmlData1.tr+"_"+this.htmlData1.td;
+      data.tabId = this.pkeyId1;
+      data.zb= this.htmlData1.name;
+      data.sigRoleId = this.roleInfo.value;
+      data.signName = this.roleInfo.label;
+      this.setsignaTable.forEach(val => {
+        if(val.zb === this.htmlData1.name && val.sigRoleId === this.roleInfo.value){
+          this.$message({
+            type: "success",
+            message: "数据已添加列表中"
+          });
+          isadd = false;
+          return;
+        }
+      })
+      if(isadd){
+        this.setsignaTable.push(data);
       }
 
-      ],
-
-      options: [{
-        value: '选项1',
-        label: '黄金糕'
-      }, {
-        value: '选项2',
-        label: '双皮奶'
-      }, {
-        value: '选项3',
-        label: '蚵仔煎'
-      }, {
-        value: '选项4',
-        label: '龙须面'
-      }, {
-        value: '选项5',
-        label: '北京烤鸭'
-      }],
-      value: '',
-      setInputTable: [{}],
+    },
+    deleteTableSig (key) {//删除数据
+        this.setsignaTable.splice(key,1);
+     // this.setInputTable.splice(key, 1)
+    },
+    async saveSingInfo() {
+      const {data: res} = await saveSig({dataInfo: this.setsignaTable})
+      if (res.code === 200) {
+        this.$message({
+          type: "success",
+          message: "操作成功"
+        });
+      }
     }
-  }
+  },
+  created () {
+    this.getRoleType()  //获取文本类型接口
+  },
 }
 </script>
 <style lang="scss" scoped>
@@ -115,4 +135,5 @@ export default {
     font-size: 14px;
   }
 }
+
 </style>

+ 1 - 1
src/views/manager/projectinfo/treeTemplate/template/setInputTPT.vue

@@ -35,7 +35,7 @@
     <div
       style="border: 1px dotted rgb(187, 187, 187);box-sizing: border-box;padding: 0px 15px;"
       class="martop20 marbottom10"
-      v-show="from.type=='select'|from.type=='radio'|from.type=='checkbox'"
+      v-show="from.type=='select'||from.type=='radio'||from.type=='checkbox'"
     >
       <table
         class="table"

+ 1 - 1
vue.config.js

@@ -27,7 +27,7 @@ module.exports = {
             '/api': {
                 //本地服务接口地址
                 // target: 'http://192.168.3.64',
-                //  target: 'http://47.110.251.215:8090',
+                 // target: 'http://47.110.251.215:8090',
                 // target: 'http://192.168.31.121',
                 target: 'http://192.168.0.100',
                 // target: 'http://192.168.31.96',