electronicSignature.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div>
  3. <div class="dianqian">
  4. <el-row :span="24">
  5. <el-col :span="3.3" style="line-height: 40px">
  6. 元素坐标:
  7. </el-col>
  8. <el-col :span="18">
  9. <avue-input v-model="htmlData1.name" placeholder="请点解坐标" :disabled='true' ></avue-input>
  10. </el-col>
  11. </el-row>
  12. <el-row :span="24">
  13. <el-col :span="3.3">
  14. 所属方:
  15. </el-col>
  16. <el-col :span="18">
  17. <avue-radio v-model="radio" :dic="roleType" v-on:click="roleTypeChang()"></avue-radio>
  18. </el-col>
  19. </el-row>
  20. <el-row :span="24">
  21. <el-col :span="3.3" style="line-height: 40px">
  22. 签字角色:
  23. </el-col>
  24. <el-col :span="18">
  25. <el-select v-model="roleInfo" @change="selectChanged" placeholder="请选择签字岗位" >
  26. <el-option v-for="item in options" :key="item.value" :value="item" :label="item.label"></el-option>
  27. </el-select>
  28. </el-col>
  29. </el-row>
  30. <el-row :span="24">
  31. <el-col :span="3.3" style="line-height: 40px">
  32. 偏移位X:
  33. </el-col>
  34. <el-col :span="18">
  35. <avue-input v-model="pyzbx" placeholder="偏移位x" type="number"></avue-input>
  36. </el-col>
  37. </el-row>
  38. <el-row :span="24">
  39. <el-col :span="3.3" style="line-height: 40px">
  40. 偏移位Y:
  41. </el-col>
  42. <el-col :span="18">
  43. <avue-input v-model="pyzby" placeholder="偏移位y" type="number"></avue-input>
  44. </el-col>
  45. </el-row>
  46. <el-row :span="24" style="text-align: center">
  47. <el-button type="primary"
  48. size="small"
  49. icon="el-icon-circle-plus-outline"
  50. @click="addRoleInfo()">添加列表</el-button> &nbsp;&nbsp;
  51. </el-row>
  52. </div>
  53. <div
  54. style="border: 1px dotted rgb(187, 187, 187);box-sizing: border-box;padding: 0px 15px;"
  55. class="martop20 marbottom10"
  56. >
  57. <table @click
  58. class="table martop20"
  59. width='100%'
  60. border='1px '
  61. bordercolor="#E5E5E5"
  62. cellpadding='2px'
  63. >
  64. <thead
  65. cellpadding='2px'
  66. height='40px'
  67. >
  68. <tr>
  69. <th width='30%'>元素位置</th>
  70. <th width='30%'>签字岗位</th>
  71. <th width='10%'>偏移x</th>
  72. <th width='10%'>偏移y</th>
  73. <th width='20%'>操作</th>
  74. </tr>
  75. </thead>
  76. <tbody height='36px'>
  77. <tr v-for="(item,key) in setsignaTable" :key="key" v-on:click="">
  78. <td>{{item.colName}}</td>
  79. <td>{{item.sigRoleName}}</td>
  80. <td>{{item.pyzbx}}</td>
  81. <td>{{item.pyzby}}</td>
  82. <td align="center"><span style="color:red;cursor: pointer;" v-on:click="deleteTableSig(key)">删除</span></td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. <el-button type="primary"
  87. size="small"
  88. class="martop25"
  89. style="float:right;"
  90. icon="el-icon-circle-plus-outline"
  91. @click="saveSingInfo()">保存入库</el-button> &nbsp;&nbsp;
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import {getRoleInfoByParentId, getRoleType, getSigList, saveSig} from "../../../../../api/manager/AdjustForm";
  97. export default {
  98. props: ['pkeyId1', 'htmlData1'],
  99. data () {
  100. return {
  101. radio: '',
  102. roleType:[],
  103. options: [],
  104. roleInfo: '',
  105. pyzbx: 0.0,
  106. pyzby: 0.0 ,
  107. setsignaTable:[]
  108. }
  109. },
  110. methods: {
  111. async getRoleType () {//获取角色类型
  112. const { data: res } = await getRoleType()
  113. if (res.code === 200) {
  114. this.roleType = res.data
  115. }
  116. },
  117. // 单选按钮改变事件
  118. async roleTypeChang(){
  119. setTimeout(async () => {
  120. console.log(this.radio);
  121. const {data: res} = await getRoleInfoByParentId({ParentId: this.radio})
  122. if (res.code === 200) {
  123. this.options = res.data
  124. }
  125. }, 200);
  126. },
  127. async addRoleInfo(){
  128. // 坐标位置
  129. if(this.htmlData1.name ===''){
  130. this.$message({
  131. type: "error",
  132. message: "请选坐标位置"
  133. });
  134. return;
  135. }
  136. // 签字岗位
  137. if(this.roleInfo ===''){
  138. this.$message({
  139. type: "error",
  140. message: "请选择签字岗位"
  141. });
  142. return;
  143. }
  144. var isadd = true;
  145. // 集合中添加数据
  146. var data = {};
  147. data.colKey="__"+this.htmlData1.tr+"_"+this.htmlData1.td;
  148. data.tabId = this.pkeyId1;
  149. data.colName= this.htmlData1.name;
  150. data.sigRoleId = this.roleInfo.value;
  151. data.sigRoleName = this.roleInfo.label;
  152. data.pyzbx = this.pyzbx;
  153. data.pyzby = this.pyzby;
  154. this.setsignaTable.forEach(val => {
  155. if(val.colName === this.htmlData1.name && val.sigRoleId === this.roleInfo.value){
  156. this.$message({
  157. type: "success",
  158. message: "数据已添加列表中"
  159. });
  160. isadd = false;
  161. return;
  162. }
  163. })
  164. if(isadd){
  165. this.setsignaTable.push(data);
  166. }
  167. },
  168. deleteTableSig (key) {//删除数据
  169. this.setsignaTable.splice(key,1);
  170. },
  171. async saveSingInfo() {
  172. const {data: res} = await saveSig({dataInfo: this.setsignaTable})
  173. if (res.code === 200) {
  174. this.$message({
  175. type: "success",
  176. message: "操作成功"
  177. });
  178. }
  179. },
  180. async getSingInfo() {
  181. const {data: res} = await getSigList(
  182. {
  183. current: 0,
  184. size: 100,
  185. tabId: this.pkeyId1,
  186. }
  187. )
  188. if (res.code === 200) {
  189. this.setsignaTable = res.data.records;
  190. }
  191. }
  192. },
  193. created () {
  194. this.getRoleType(); //获取文本类型接口
  195. this.getSingInfo();
  196. this.setsignaTable=[];
  197. },
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .table {
  202. margin-top: 20px;
  203. border-radius: 5px;
  204. color: #101010;
  205. font-size: 14px;
  206. }
  207. .dianqian{
  208. width: 90%;
  209. height: 100%;
  210. }
  211. </style>