step2.blade.php 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', '合同信息')
  4. <script type="text/javascript" src="{{static_url('js/pdfjs/pdf.js')}}"></script>
  5. <script>
  6. pdfjsLib.GlobalWorkerOptions.workerSrc ="{{static_url('js/pdfjs/pdf.worker.min.js')}}";
  7. </script>
  8. <div class="w1200 m0a">
  9. <div class="right-titpos">
  10. <ul class="add-snav">
  11. <li class="active"><a href="#">合同信息</a></li>
  12. </ul>
  13. </div>
  14. <div id="app">
  15. <template>
  16. <div id="pageContent" class="pageContent_2lAGg">
  17. <div class="leftContent_2NoKi">
  18. <div class="doc-list-context">
  19. <div class="doc-list-title">合同 <span>(1份)</span></div>
  20. <div class="doc-list">
  21. <div class="doc-item">
  22. <div class="doc-img">
  23. <img src="../../assets/images/pdfpng.png"
  24. alt="">
  25. <div class="doc-page-num">[[page_count]]</div>
  26. </div>
  27. <div class="doc-name">[[Data.contract_doc_name]]</div>
  28. </div>
  29. <div class="componentsList_1OIrB">
  30. <p class="title_3vpva">控件库</p>
  31. <!--这个页面不能格式化-->
  32. <p class="tips_2oKGU">请将控件拖动到合同区域。</p>
  33. <div class="componentSign-show" @mousedown='signSeal'>
  34. <p>签署区</p><p><i class="iconfont icon-all_sign"></i></p>
  35. </div>
  36. <div class="componentSign" @mousedown='signSeal'>
  37. <p class="sealCompInfo_3v9iQ"><span class="need">*</span><span><span>甲方</span><em>(<span>签署区</span>)</em></span></p><div class="itemConentStyle_2MWEL"><div class="infoMsg_3NkPg">签署区</div><i class="iconfont icon-pm_auction_success"></i></div><div class="text_delete" @click.stop="TextDeleteIt">删除</div>
  38. </div>
  39. </div>
  40. <div style="text-align: center;margin-top: 50px">
  41. <el-button type="primary" style="width: 90px;" @click="goBack">上一步</el-button>
  42. <el-button type="primary" style="width: 90px;" @click="submitForm">保存</el-button>
  43. </div>
  44. <div style="text-align: center;margin-top: 20px">
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="pdfContent_1PW2f">
  50. <div class="pdf-header">
  51. <div class="block">
  52. <span class="demonstration">[[value1*100]]%</span>
  53. <div class="slider">
  54. <el-slider v-model="value1" :min="0.5" :max="2" :step="0.25" @change="handleChange"></el-slider>
  55. </div>
  56. </div>
  57. <div class="input">
  58. <span>Page: <input type="text" class="input-text" v-model="page_num" placeholder="1"> / [[page_count]]</span>
  59. <el-button @click="jump" type="text">跳转</el-button>
  60. <!--<span>全屏</span>-->
  61. </div>
  62. </div>
  63. <div class="pdf-container" ref="pdfBox" v-loading="!isShow"
  64. element-loading-text="拼命加载中"
  65. element-loading-spinner="el-icon-loading"
  66. element-loading-background="rgba(0, 0, 0, 0.1)">
  67. <div class="pdf-box" :style="{width: pdfWidth+'px'}">
  68. <div class="pdfPage_1yRne" :style="{width: pdfWidth+'px',height: pdfHeight+ 'px'}" v-for="page in page_count" :key="page">
  69. <canvas class="pdf-item" :id="'the-canvas'+page" ></canvas>
  70. <div @click="clearAll" class="dragLayer_3ccsq" v-bind:id="'can'+ page"></div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="taskInfoArea_3ThxW">
  76. <div class="tab-bar">
  77. <el-tabs v-model="activeName" @tab-click="handleClick">
  78. <el-tab-pane label="文本控件设置" name="2"></el-tab-pane>
  79. </el-tabs>
  80. </div>
  81. <div class="tab-context">
  82. <div class="item" v-show="activeName == 2">
  83. <div class="testSetting_8FNRp" v-show="hasChoose">
  84. <div class="item-box">
  85. <p class="titleh2_3zdht">名称</p>
  86. <el-input v-model="form_name" ref="input1" placeholder="请输入文本名称"></el-input>
  87. </div>
  88. <div class="item-box">
  89. <p class="titleh2_3zdht">文本域默认值</p>
  90. <el-input v-model="form_value" ref="input2" placeholder="请输入文本默认值"></el-input>
  91. </div>
  92. <div class="item-box">
  93. <span class="titleh2_3zdht">是否必填项</span>
  94. <el-switch v-model="form_need"></el-switch>
  95. </div>
  96. </div>
  97. <div class="testSetting_8FNRp" v-show="hasChoose2">
  98. <div class="item-box">
  99. <p class="titleh2_3zdht">名称</p>
  100. <el-input v-model="seal_name" ref="input3" placeholder="请输入签署区名称"></el-input>
  101. </div>
  102. <div class="item-box">
  103. <p class="titleh2_3zdht">填写人设置</p>
  104. <el-select v-model="role_id" placeholder="请选择填写人">
  105. <el-option v-for="item in role_idList" :key="item.role_id" :label="item.name" :value="item.role_id"></el-option>
  106. </el-select>
  107. </div>
  108. </div>
  109. <div class="emptyStyle_wctx0" v-show="!hasChoose && !hasChoose2">
  110. <p class="emptyP_2N3sX">请从控件库中将控件拖动到合同区域</p>
  111. <p class="emptyP_2N3sX">或选中已经添加到合同上的控件</p>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </template>
  118. </div>
  119. <input type="hidden" id="get_detail_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::GET_DETAIL_URL)}}">
  120. <input type="hidden" id="get_forms_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::GET_FORMS_URL)}}">
  121. <input type="hidden" id="edit_step2_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::EDIT_STEP2_URL)}}">
  122. <input type="hidden" id="edit_form_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::EDIT_FORM_URL)}}">
  123. <input type="hidden" id="delete_form_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::DELETE_FORM_URL)}}">
  124. <input type="hidden" id="index_url" value="{{yzWebUrl(\Yunshop\ShopEsign\admin\ContractController::INDEX_URL)}}">
  125. </div>
  126. <script>
  127. // 解决mousedown和click的之间的冲突 (利用事件发生时间来判断 点击事件时间短)
  128. var key = false;//设置了一个标志 false为点击事件 ture为鼠标移动事件
  129. var firstTime = 0;
  130. var lastTime = 0;
  131. var app = new Vue({
  132. el:"#app",
  133. delimiters: ['[[', ']]'],
  134. data() {
  135. return {
  136. isShow: false,
  137. role_idList: [{name: '甲方',role_id: '1'},{name: '乙方',role_id: '2'},{name: '丙方',role_id: '3'}],
  138. seal_name: '签署区',
  139. role_id: '1',
  140. id: '',
  141. hasChoose2: false,
  142. hasChoose: false,
  143. Data: {},
  144. dom: null,
  145. scrollTop: 0,
  146. activeName: "2",
  147. pdfUrl: "",// 这里是pdf文件地址,后台给的流文件请求地址也是可以的
  148. pdfDoc: null,// pdfjs 生成的对象
  149. pageNum: 1,//
  150. value1: 1,
  151. scale: 1.0,// 放大倍数
  152. page_num: 0,// 当前页数
  153. page_count: 0,// 总页数
  154. maxscale: 2,// 最大放大倍数
  155. minscale: 0.5,// 最小放大倍数
  156. pdfWidth: 0,
  157. pdfHeight: 0,
  158. right: true,
  159. left: true,
  160. code: "",
  161. form_name: "文本名称",
  162. form_value: "文本",
  163. form_need: true,
  164. pos_x: '',
  165. pos_y: '',
  166. pos_page: '',
  167. textId: '',
  168. commonStructsList: []
  169. };
  170. },
  171. created() {
  172. },
  173. beforeRouteLeave (to, from, next) {
  174. next()
  175. },
  176. mounted() {
  177. this.id = parseInt("{{$id}}");
  178. this.$nextTick(function() {
  179. this.$refs.pdfBox.addEventListener("scroll", this.handleScroll, false);
  180. this.getData();
  181. });
  182. },
  183. watch: {
  184. scale(new1, old1) {
  185. document.querySelectorAll(".mark").forEach((item) => {
  186. item.style.left = (parseInt(item.style.left) / (old1 / new1)) + "px";
  187. item.style.top = (parseInt(item.style.top) / (old1 / new1)) + "px";
  188. item.style.height = 100 * new1 + "px";
  189. item.style.width = 100 * new1 + "px";
  190. });
  191. document.querySelectorAll(".text_mark").forEach((item) => {
  192. item.style.left = (parseInt(item.style.left) / (old1 / new1)) + "px";
  193. item.style.top = (parseInt(item.style.top) / (old1 / new1)) + "px";
  194. item.style.height = 28 * new1 + "px";
  195. item.style.width = (item.offsetWidth) / (old1 / new1) + "px";
  196. });
  197. document.querySelectorAll(".text_mark2").forEach((item) => {
  198. item.style.left = (parseInt(item.style.left) / (old1 / new1)) + "px";
  199. item.style.top = (parseInt(item.style.top) / (old1 / new1)) + "px";
  200. item.style.height = 100 * new1 + "px";
  201. item.style.width = 100 * new1 + "px";
  202. });
  203. document.querySelectorAll(".text_mark3").forEach((item) => {
  204. item.style.left = (parseInt(item.style.left) / (old1 / new1)) + "px";
  205. item.style.top = (parseInt(item.style.top) / (old1 / new1)) + "px";
  206. item.style.height = 28 * new1 + "px";
  207. item.style.width = (item.offsetWidth) / (old1 / new1) + "px";
  208. });
  209. },
  210. role_id(now, before) {
  211. let str = '';
  212. if(now == '1'){
  213. str = '甲方'
  214. }else if(now == '2'){
  215. str = '乙方'
  216. }else if(now == '3'){
  217. str = '丙方'
  218. }
  219. document.querySelector(".choose2").setAttribute('role_id',this.role_id);
  220. document.querySelector(".choose2").childNodes[0].childNodes[1].childNodes[0].innerText = str;
  221. },
  222. seal_name(now,before) {
  223. document.querySelector(".choose2").childNodes[0].childNodes[1].childNodes[1].childNodes[1].innerText = now;
  224. },
  225. form_name(now, before) {
  226. document.querySelector(".choose").childNodes[0].childNodes[1].innerText = now;
  227. },
  228. form_value(now, before) {
  229. document.querySelector(".choose").childNodes[1].innerText = now;
  230. },
  231. form_need(now, before) {
  232. if(now){
  233. document.querySelector(".choose").childNodes[0].childNodes[0].style.display = "inline-block";
  234. }else {
  235. document.querySelector(".choose").childNodes[0].childNodes[0].style.display = "none";
  236. }
  237. },
  238. },
  239. methods: {
  240. goBack() {
  241. /**if (window.history.length <= 1) {
  242. this.$router.push(this.fun.getUrl('homeIndex', {}));
  243. } else {
  244. this.$router.go(-1);
  245. }*/
  246. window.history.back();
  247. },
  248. /**
  249. * px转换为mm
  250. * @param value
  251. * @returns {number}
  252. */
  253. pxConversionMm (value) {
  254. return value/2.8;
  255. },
  256. editText(type, pos_x, pos_y, dom) {
  257. if(dom) {
  258. this.pos_x = parseInt(pos_x)/this.scale;
  259. this.pos_y = parseInt(pos_y)/this.scale;
  260. this.pos_page = dom.getAttribute('page');
  261. this.textId = dom.getAttribute('textId');
  262. }
  263. let json = {};
  264. if(type == 1) {
  265. let is_require = 0;
  266. this.form_need ? is_require = 1 :is_require = 0;
  267. json = {
  268. id: this.textId,
  269. contract_id: this.id,
  270. form_type: type,
  271. form_name: this.form_name,
  272. form_value: this.form_value,
  273. is_require: is_require,
  274. pos_x: this.pos_x,
  275. pos_y: this.pos_y,
  276. pdf_pos_x: this.pxConversionMm(this.pos_x),
  277. pdf_pos_y: this.pxConversionMm(this.pos_y),
  278. width: 190,
  279. height: 28,
  280. doc_page: this.pos_page
  281. };
  282. }else {
  283. json = {
  284. id: this.textId,
  285. contract_id: this.id,
  286. form_type: type,
  287. form_name: this.seal_name,
  288. role_id: this.role_id,
  289. form_value: '',
  290. is_require: 0,
  291. pos_x: this.pos_x,
  292. pos_y: this.pos_y,
  293. width: 100,
  294. height: 100,
  295. doc_page: this.pos_page
  296. };
  297. }
  298. this.$http.post(document.getElementById("edit_form_url").value, json).then(response => {
  299. if (response.data.result === 1) {
  300. } else {
  301. this.$message.error(response.data.msg);
  302. }
  303. }).catch(err => {
  304. console.log(err);
  305. });
  306. },
  307. deleteText(dom) {
  308. this.textId = dom.getAttribute('textId');
  309. if(this.textId) {
  310. // 会引发鼠标抬起事件 延迟触发
  311. setTimeout(()=>{
  312. this.$http.post(document.getElementById("delete_form_url").value, {id: this.textId}).then(response => {
  313. if (response.data.result === 1) {
  314. } else {
  315. this.$message.error(response.data.msg);
  316. }
  317. }).catch(err => {
  318. console.log(err);
  319. });
  320. },500)
  321. }
  322. },
  323. setTemplate() {
  324. const that = this;
  325. console.log(this.commonStructsList)
  326. for (let i = 0; i < this.commonStructsList.length; i++) {
  327. if(that.commonStructsList[i].form_type == 1){
  328. let Element = document.querySelector(".componentArea").cloneNode(true);
  329. document.querySelector('#can'+ that.commonStructsList[i].doc_page).appendChild(Element);
  330. Element.style.left = that.commonStructsList[i].pos_x + "px";
  331. Element.style.top = that.commonStructsList[i].pos_y + "px";
  332. Element.style.width = that.commonStructsList[i].width + "px";
  333. Element.style.display = "flex";
  334. Element.classList.add("text_mark");
  335. Element.onmouseenter = that.TextMouseenter;
  336. Element.onmouseleave = that.TextMouseleave;
  337. Element.onclick = that.textClick;
  338. Element.onmousedown = that.moveTo;
  339. Element.setAttribute("page", that.commonStructsList[i].doc_page);
  340. Element.setAttribute('textId', that.commonStructsList[i].id);
  341. if(that.commonStructsList[i].is_require == 1){
  342. Element.childNodes[0].childNodes[0].style.display = "inline-block";
  343. }else {
  344. Element.childNodes[0].childNodes[0].style.display = "none";
  345. }
  346. Element.childNodes[0].childNodes[1].innerText = that.commonStructsList[i].form_name;
  347. Element.childNodes[1].innerText = that.commonStructsList[i].form_value;
  348. Element.childNodes[2].onblur = that.TextBlur;
  349. Element.childNodes[3].onclick = that.TextDeleteIt;
  350. Element.childNodes[4].onmousedown = that.TextWidthChange;
  351. } else if(that.commonStructsList[i].form_type == 2) {
  352. let Element = document.querySelector(".componentSign").cloneNode(true);
  353. document.querySelector('#can'+ that.commonStructsList[i].doc_page).appendChild(Element);
  354. Element.style.left = that.commonStructsList[i].pos_x + "px";
  355. Element.style.top = that.commonStructsList[i].pos_y + "px";
  356. Element.style.display = "flex";
  357. Element.classList.add("text_mark2");
  358. Element.onmouseenter = that.sealMouseenter;
  359. Element.onmouseleave = that.sealMouseleave;
  360. Element.onclick = that.sealClick;
  361. Element.onmousedown = that.sealMoveTo;
  362. Element.setAttribute("page", that.commonStructsList[i].doc_page);
  363. Element.setAttribute('textId', that.commonStructsList[i].id);
  364. Element.setAttribute('role_id',that.commonStructsList[i].role_id);
  365. Element.childNodes[0].childNodes[1].childNodes[1].childNodes[1].innerText = that.commonStructsList[i].form_name;
  366. if(that.commonStructsList[i].role_id == '1'){
  367. Element.childNodes[0].childNodes[1].childNodes[0].innerText = '甲方';
  368. }else if(that.commonStructsList[i].role_id == '2'){
  369. Element.childNodes[0].childNodes[1].childNodes[0].innerText = '乙方';
  370. }else if(that.commonStructsList[i].role_id == '3'){
  371. Element.childNodes[0].childNodes[1].childNodes[0].innerText = '丙方';
  372. }
  373. Element.childNodes[2].onclick = that.sealDeleteIt;
  374. }
  375. }
  376. let variable_data = [];
  377. if(this.Data.variable_data){
  378. variable_data = this.Data.variable_data;
  379. }
  380. console.log(variable_data)
  381. for (let i = 0; i < variable_data.length; i++) {
  382. if(variable_data[i].doc_page){
  383. let Element = document.querySelector(".variable-item").cloneNode(true);
  384. document.querySelector('#can'+ variable_data[i].doc_page).appendChild(Element);
  385. Element.style.left = variable_data[i].pos_x + "px";
  386. Element.style.top = variable_data[i].pos_y + "px";
  387. Element.style.position='absolute';
  388. Element.classList.add("text_mark3");
  389. Element.childNodes[0].innerText = variable_data[i].var_text;
  390. Element.onmouseenter = that.VariableMouseenter;
  391. Element.onmouseleave = that.VariableMouseleave;
  392. Element.onmousedown = that.VariableMoveTo;
  393. Element.childNodes[1].onclick = that.TextDeleteIt;
  394. Element.setAttribute("page", variable_data[i].doc_page);
  395. Element.setAttribute("data-name", variable_data[i].var_name);
  396. }
  397. }
  398. },
  399. TextBlur(e) {
  400. e.currentTarget.value=e.currentTarget.value.replace(/\s+/g,'');
  401. if(e.currentTarget.parentNode.childNodes[0].childNodes[0].style.display == "inline-block" && e.currentTarget.value == '') {
  402. e.currentTarget.parentNode.classList.add("needFill");
  403. e.currentTarget.parentNode.childNodes[3].style.display = "flex";
  404. }else {
  405. e.currentTarget.parentNode.classList.remove("needFill");
  406. e.currentTarget.parentNode.childNodes[3].style.display = "none";
  407. }
  408. },
  409. submitForm() {
  410. let form_info = [];
  411. // 文本域
  412. document.querySelectorAll(".text_mark").forEach((item) => {
  413. let is_require = 0;
  414. if (item.childNodes[0].childNodes[0].style.display == 'none'){
  415. is_require = 0
  416. } else {
  417. is_require = 1
  418. }
  419. let json = {
  420. id: item.getAttribute('textId'),
  421. contract_id: this.id,
  422. form_type: 1,
  423. form_name: item.childNodes[0].childNodes[1].innerText,
  424. form_value: item.childNodes[1].innerText,
  425. is_require: is_require,
  426. pos_x: parseInt(item.style.left)/this.scale,
  427. pos_y: parseInt(item.style.top)/this.scale,
  428. pdf_pos_x: this.pxConversionMm(parseInt(item.style.left)/this.scale),
  429. pdf_pos_y: this.pxConversionMm(parseInt(item.style.top)/this.scale),
  430. width: parseInt(item.offsetWidth)/this.scale,
  431. height: 28,
  432. doc_page: item.getAttribute("page")
  433. };
  434. form_info.push(json);
  435. });
  436. // 签署区
  437. document.querySelectorAll(".text_mark2").forEach((item) => {
  438. let json = {
  439. id: item.getAttribute('textId'),
  440. contract_id: this.id,
  441. form_type: 2,
  442. form_name: item.childNodes[0].childNodes[1].childNodes[1].childNodes[1].innerText,
  443. role_id: item.getAttribute('role_id'),
  444. form_value: '',
  445. is_require: 0,
  446. pos_x: parseInt(item.style.left)/this.scale,
  447. pos_y: parseInt(item.style.top)/this.scale,
  448. width: 100,
  449. height: 100,
  450. doc_page: item.getAttribute("page")
  451. };
  452. form_info.push(json);
  453. });
  454. let variable_data = [];
  455. document.querySelectorAll(".text_mark3").forEach((item) => {
  456. let json = {
  457. var_name: item.getAttribute('data-name'),
  458. var_value: '',
  459. var_text:item.childNodes[0].innerText,
  460. pos_x: parseInt(item.style.left)/this.scale,
  461. pos_y: parseInt(item.style.top)/this.scale,
  462. pdf_pos_x: this.pxConversionMm(parseInt(item.style.left)/this.scale),
  463. pdf_pos_y: this.pxConversionMm(parseInt(item.style.top)/this.scale),
  464. doc_page: item.getAttribute("page")
  465. };
  466. if(json.doc_page){
  467. variable_data.push(json);
  468. }else{
  469. console.log(json);
  470. }
  471. });
  472. this.$http.post(document.getElementById("edit_step2_url").value, {id: this.id, pdfWidth: this.pdfWidth, pdfHeight: this.pdfHeight, form_info: form_info,variable_data: variable_data}).then(response => {
  473. if (response.data.result === 1) {
  474. window.location.href = document.getElementById("index_url").value;
  475. //this.$router.push(this.fun.getUrl("template_manage"));
  476. } else {
  477. this.$message.error(response.data.msg);
  478. }
  479. }).catch(err => {
  480. console.log(err);
  481. });
  482. },
  483. // 获取模版
  484. getData() {
  485. //this._loadFile("http://localhost:82/addons/yun_shop/static/yun-sign/template_wrapper.pdf");
  486. this.$http.post(document.getElementById("get_detail_url").value, {id: this.id}, "loading").then(response => {
  487. if (response.data.result === 1) {
  488. this.Data = response.data.data;
  489. this.pdfUrl = this.Data.contract_doc_remote_url;
  490. // this.pdfUrl = "/static/test.pdf";
  491. this._loadFile(this.pdfUrl);
  492. } else {
  493. // this.$router.go(-1);
  494. this.$message.error(response.msg);
  495. }
  496. }).catch(err => {
  497. console.log(err);
  498. });
  499. },
  500. // 获取模板所有文本域信息
  501. getTextData() {
  502. this.$http.post(document.getElementById("get_forms_url").value, {id: this.id}).then(response => {
  503. this.isShow = true;
  504. if (response.data.result === 1) {
  505. this.commonStructsList = response.data.data;
  506. this.setTemplate();
  507. } else {
  508. this.$message.error(response.msg);
  509. }
  510. }).catch(err => {
  511. this.isShow = true;
  512. console.log(err);
  513. });
  514. },
  515. getSidebarWidth(){
  516. let sidebarWidth = 0;
  517. let sidebarEle = document.querySelectorAll(".sidebar");
  518. sidebarWidth = sidebarEle[0].clientWidth + sidebarEle[1].clientWidth;
  519. return sidebarWidth;
  520. },
  521. signSeal(e) {
  522. let dom = document.querySelector(".componentSign").cloneNode(true);
  523. let sidebarWidth = this.getSidebarWidth();
  524. // dom.style.left = (this.getPos(e).x - 100 - sidebarWidth) + "px";
  525. // dom.style.top = (this.getPos(e).y - 65) + "px";
  526. // dom.className = "componentArea text_mark";
  527. document.onmousemove = e => {
  528. document.querySelector("#pageContent").appendChild(dom);
  529. let scrollTop = document.documentElement.scrollTop||document.body.scrollTop
  530. dom.style.display = 'flex';
  531. dom.style.left = (this.getPos(e).x - parseInt(dom.clientWidth / 2) - sidebarWidth) + "px";
  532. dom.style.top = (this.getPos(e).y - 100 + scrollTop) + "px";
  533. //console.log('top:'+dom.style.top+'left:'+dom.style.left)
  534. dom.className = "componentSign text_mark2";
  535. };
  536. // 鼠标抬开
  537. document.onmouseup = e => {
  538. let scrollTop = document.documentElement.scrollTop||document.body.scrollTop
  539. let left = (this.getPos(e).x + this.$refs.pdfBox.scrollLeft - parseInt(dom.clientWidth / 2) - document.querySelector(".pdf-box").offsetLeft - sidebarWidth);
  540. let top = (this.getPos(e).y + this.scrollTop - parseInt(dom.clientHeight / 2) - 160 + scrollTop);
  541. //限制区域
  542. if (left < 0) {
  543. document.onmousemove = null;
  544. document.onmouseup = null;
  545. document.querySelector("#pageContent").removeChild(dom);
  546. this.$message.error("请拖拽到合同区域");
  547. return;
  548. } else if (left > document.querySelector(".pdf-box").clientWidth - (100 * this.scale)) {
  549. document.onmousemove = null;
  550. document.onmouseup = null;
  551. document.querySelector("#pageContent").removeChild(dom);
  552. this.$message.error("控件位置超出了合同区域");
  553. return;
  554. }
  555. if (top < 0) {
  556. document.onmousemove = null;
  557. document.onmouseup = null;
  558. document.querySelector("#pageContent").removeChild(dom);
  559. this.$message.error("请拖拽到合同区域");
  560. return;
  561. } else if (top > document.querySelector(".pdf-box").clientHeight - (100 * this.scale)) {
  562. document.onmousemove = null;
  563. document.onmouseup = null;
  564. document.querySelector("#pageContent").removeChild(dom);
  565. this.$message.error("控件位置超出了合同区域");
  566. return;
  567. }
  568. let index = 0;
  569. if(top > this.pdfHeight*this.page_num){
  570. top = top - this.pdfHeight*this.page_num;
  571. index = this.page_num+1;
  572. }else {
  573. top = top - this.pdfHeight*(this.page_num-1);
  574. index = this.page_num;
  575. }
  576. // margin
  577. top = 10 + top - (index -1)*10;
  578. dom.style.left = left + "px";
  579. dom.style.top = top + "px";
  580. dom.style.height = 100 * this.scale + "px";
  581. dom.style.width = 100 * this.scale + "px";
  582. document.querySelector("#pageContent").removeChild(dom);
  583. document.querySelector('#can'+ index).appendChild(dom);
  584. document.onmousemove = null;
  585. document.onmouseup = null;
  586. dom.onclick = this.sealClick;
  587. dom.onmousedown = this.sealMoveTo;
  588. dom.onmouseenter = this.sealMouseenter;
  589. dom.onmouseleave = this.sealMouseleave;
  590. dom.childNodes[2].onclick = this.sealDeleteIt;
  591. dom.setAttribute("page", index);
  592. dom.setAttribute('role_id', 1);
  593. };
  594. },
  595. sealDeleteIt(e) {
  596. this.hasChoose2 = false;
  597. this.hasChoose = false;
  598. this.deleteText(e.currentTarget.parentNode);
  599. e.currentTarget.parentNode.parentNode.removeChild(e.currentTarget.parentNode);
  600. e.stopPropagation();
  601. e.preventDefault();
  602. return false;
  603. },
  604. sealClick(e) {
  605. this.$refs.input3.blur();
  606. const that = this;
  607. for (let i = 0; i < document.querySelectorAll('.text_mark').length; i++) {
  608. document.querySelectorAll(".text_mark")[i].childNodes[0].style.display = "none";
  609. document.querySelectorAll(".text_mark")[i].childNodes[3].style.display = "none";
  610. document.querySelectorAll(".text_mark")[i].onmouseleave = that.TextMouseleave;
  611. document.querySelectorAll(".text_mark")[i].classList.remove("choose");
  612. }
  613. for (let i = 0; i < document.querySelectorAll('.text_mark2').length; i++) {
  614. document.querySelectorAll(".text_mark2")[i].childNodes[0].style.display = "none";
  615. document.querySelectorAll(".text_mark2")[i].childNodes[2].style.display = "none";
  616. document.querySelectorAll(".text_mark2")[i].onmouseleave = that.sealMouseleave;
  617. document.querySelectorAll(".text_mark2")[i].classList.remove("choose2");
  618. }
  619. e.currentTarget.childNodes[0].style.display = "flex";
  620. e.currentTarget.childNodes[2].style.display = "block";
  621. e.currentTarget.classList.add("choose2");
  622. e.currentTarget.onmouseleave = null;
  623. this.seal_name = document.querySelector(".choose2").childNodes[0].childNodes[1].childNodes[1].childNodes[1].innerText;
  624. if(document.querySelector(".choose2").childNodes[0].childNodes[1].childNodes[0].innerText == '甲方'){
  625. this.role_id = '1';
  626. }else if(document.querySelector(".choose2").childNodes[0].childNodes[1].childNodes[0].innerText == '乙方'){
  627. this.role_id = '2';
  628. }else {
  629. this.role_id = '3';
  630. }
  631. this.hasChoose2 = true;
  632. this.hasChoose = false;
  633. if(key){
  634. // console.log('click');
  635. key = false;
  636. // this.editText(2, e.currentTarget.style.left, e.currentTarget.style.top, e.currentTarget);
  637. }
  638. e.stopPropagation();
  639. e.preventDefault();
  640. return false;
  641. },
  642. sealMouseenter(e) {
  643. e.currentTarget.childNodes[0].style.display = "flex";
  644. e.currentTarget.childNodes[2].style.display = "block";
  645. },
  646. sealMouseleave(e) {
  647. e.currentTarget.childNodes[0].style.display = "none";
  648. e.currentTarget.childNodes[2].style.display = "none";
  649. },
  650. sealMoveTo(e) {
  651. firstTime = new Date().getTime();
  652. // console.log('mouseDown');
  653. let that = this;
  654. let odiv = e.currentTarget; //获取目标元素
  655. //算出鼠标相对元素的位置
  656. let disX = e.clientX - odiv.offsetLeft;
  657. let disY = e.clientY - odiv.offsetTop;
  658. this.sealClick(e);
  659. document.onmousemove = e => {
  660. let left = e.clientX - disX;
  661. let top = e.clientY - disY;
  662. //限制区域
  663. if (left <= 0) {
  664. left = 0;
  665. } else if (left >= document.querySelector(".pdf-box").clientWidth - odiv.clientWidth) {
  666. left = document.querySelector(".pdf-box").clientWidth - odiv.clientWidth;
  667. }
  668. if (top <= 0) {
  669. top = 0;
  670. } else if (top >= this.pdfHeight - odiv.clientHeight) {
  671. top = this.pdfHeight - odiv.clientHeight;
  672. }
  673. //移动当前元素
  674. odiv.style.left = left + "px";
  675. odiv.style.top = top + "px";
  676. };
  677. document.onmouseup = e => {
  678. //鼠标抬起后 记录时间 超过400ms就是移动事件
  679. lastTime = new Date().getTime();
  680. if( (lastTime - firstTime) < 400){
  681. key = true;
  682. }else {
  683. // console.log('mouseUp');
  684. // that.editText(2, odiv.style.left, odiv.style.top, odiv);
  685. }
  686. document.onmousemove = null;
  687. document.onmouseup = null;
  688. };
  689. },
  690. clearAll() {
  691. const that = this;
  692. for (let i = 0; i < document.querySelectorAll('.text_mark').length; i++) {
  693. document.querySelectorAll(".text_mark")[i].childNodes[0].style.display = "none";
  694. document.querySelectorAll(".text_mark")[i].childNodes[3].style.display = "none";
  695. document.querySelectorAll(".text_mark")[i].childNodes[4].style.display = "none";
  696. document.querySelectorAll(".text_mark")[i].onmouseleave = that.TextMouseleave;
  697. document.querySelectorAll(".text_mark")[i].classList.remove("choose");
  698. }
  699. for (let i = 0; i < document.querySelectorAll('.text_mark2').length; i++) {
  700. document.querySelectorAll(".text_mark2")[i].childNodes[0].style.display = "none";
  701. document.querySelectorAll(".text_mark2")[i].childNodes[2].style.display = "none";
  702. document.querySelectorAll(".text_mark2")[i].onmouseleave = that.sealMouseleave;
  703. document.querySelectorAll(".text_mark2")[i].classList.remove("choose2");
  704. }
  705. this.hasChoose = false;
  706. this.hasChoose2 = false;
  707. },
  708. signText(e) {
  709. let dom = e.currentTarget.cloneNode(true);
  710. let sidebarWidth = 0;
  711. if (document.querySelector("#app").clientWidth > 1026) {
  712. sidebarWidth = document.querySelector(".el-scrollbar__view").clientWidth;
  713. }
  714. // dom.style.left = (this.getPos(e).x - 100 - sidebarWidth) + "px";
  715. // dom.style.top = (this.getPos(e).y - 65) + "px";
  716. // dom.className = "componentArea text_mark";
  717. document.onmousemove = e => {
  718. document.querySelector("#pageContent").appendChild(dom);
  719. dom.style.left = (this.getPos(e).x - parseInt(dom.clientWidth / 2) - sidebarWidth) + "px";
  720. dom.style.top = (this.getPos(e).y - 65) + "px";
  721. dom.className = "componentArea text_mark";
  722. };
  723. // 鼠标抬开
  724. document.onmouseup = e => {
  725. let left = (this.getPos(e).x + this.$refs.pdfBox.scrollLeft - parseInt(dom.clientWidth / 2) - document.querySelector(".pdf-box").offsetLeft - sidebarWidth);
  726. let top = (this.getPos(e).y + this.scrollTop - parseInt(dom.clientHeight / 2) - 112);
  727. //限制区域
  728. if (left < 0) {
  729. document.onmousemove = null;
  730. document.onmouseup = null;
  731. document.querySelector("#pageContent").removeChild(dom);
  732. this.$message.error("请拖拽到合同区域");
  733. return;
  734. } else if (left > document.querySelector(".pdf-box").clientWidth - (dom.clientWidth * this.scale)) {
  735. document.onmousemove = null;
  736. document.onmouseup = null;
  737. document.querySelector("#pageContent").removeChild(dom);
  738. this.$message.error("控件位置超出了合同区域");
  739. return;
  740. }
  741. if (top < 0) {
  742. document.onmousemove = null;
  743. document.onmouseup = null;
  744. document.querySelector("#pageContent").removeChild(dom);
  745. this.$message.error("请拖拽到合同区域");
  746. return;
  747. } else if (top > document.querySelector(".pdf-box").clientHeight - (28 * this.scale)) {
  748. document.onmousemove = null;
  749. document.onmouseup = null;
  750. document.querySelector("#pageContent").removeChild(dom);
  751. this.$message.error("控件位置超出了合同区域");
  752. return;
  753. }
  754. let index = 0;
  755. if(top > this.pdfHeight*this.page_num){
  756. top = top - this.pdfHeight*this.page_num;
  757. index = this.page_num+1;
  758. }else {
  759. top = top - this.pdfHeight*(this.page_num-1);
  760. index = this.page_num;
  761. }
  762. // margin
  763. top = 10 + top - (index -1)*10;
  764. dom.style.left = left + "px";
  765. dom.style.top = top + "px";
  766. dom.style.height = 28 * this.scale + "px";
  767. dom.style.width = dom.clientWidth * this.scale + "px";
  768. document.querySelector("#pageContent").removeChild(dom);
  769. document.querySelector('#can'+ index).appendChild(dom);
  770. document.onmousemove = null;
  771. document.onmouseup = null;
  772. dom.childNodes[1].innerText = '文本';
  773. dom.onclick = this.textClick;
  774. dom.onmousedown = this.moveTo;
  775. dom.onmouseenter = this.TextMouseenter;
  776. dom.onmouseleave = this.TextMouseleave;
  777. dom.childNodes[3].onclick = this.TextDeleteIt;
  778. dom.childNodes[4].onmousedown = this.TextWidthChange;
  779. dom.setAttribute("page", index);
  780. };
  781. },
  782. TextWidthChange(e) {
  783. let odivParent = e.currentTarget.parentNode; //获取目标父元素
  784. let dx= e.clientX;//当你第一次单击的时候,存储x轴的坐标。
  785. let dw= odivParent.offsetWidth;//存储默认的div的宽度。
  786. document.onmousemove = e => {
  787. odivParent.style.width=dw+(e.clientX-dx)+'px';
  788. if(odivParent.offsetWidth <= 100){//当盒子缩小到一定范围内的时候,让他保持一个固定值,不再继续改变
  789. odivParent.style.width='100px';
  790. }
  791. if(odivParent.offsetWidth + odivParent.offsetLeft >= this.pdfWidth){
  792. odivParent.style.width = this.pdfWidth - odivParent.offsetLeft + 'px';
  793. }
  794. };
  795. document.onmouseup = e => {
  796. document.onmousemove = null;
  797. document.onmouseup = null;
  798. };
  799. e.stopPropagation();
  800. e.preventDefault();
  801. return false;
  802. },
  803. TextDeleteIt(e) {
  804. this.hasChoose2 = false;
  805. this.hasChoose = false;
  806. this.deleteText(e.currentTarget.parentNode);
  807. e.currentTarget.parentNode.parentNode.removeChild(e.currentTarget.parentNode);
  808. e.stopPropagation();
  809. e.preventDefault();
  810. return false;
  811. },
  812. textClick(e) {
  813. this.$refs.input1.blur();
  814. this.$refs.input2.blur();
  815. const that = this;
  816. for (let i = 0; i < document.querySelectorAll('.text_mark').length; i++) {
  817. document.querySelectorAll(".text_mark")[i].childNodes[0].style.display = "none";
  818. document.querySelectorAll(".text_mark")[i].childNodes[3].style.display = "none";
  819. document.querySelectorAll(".text_mark")[i].childNodes[4].style.display = "none";
  820. document.querySelectorAll(".text_mark")[i].onmouseleave = that.TextMouseleave;
  821. document.querySelectorAll(".text_mark")[i].classList.remove("choose");
  822. }
  823. for (let i = 0; i < document.querySelectorAll('.text_mark2').length; i++) {
  824. document.querySelectorAll(".text_mark2")[i].childNodes[0].style.display = "none";
  825. document.querySelectorAll(".text_mark2")[i].childNodes[2].style.display = "none";
  826. document.querySelectorAll(".text_mark2")[i].onmouseleave = that.sealMouseleave;
  827. document.querySelectorAll(".text_mark2")[i].classList.remove("choose2");
  828. }
  829. e.currentTarget.childNodes[0].style.display = "flex";
  830. e.currentTarget.childNodes[3].style.display = "block";
  831. e.currentTarget.childNodes[4].style.display = "block";
  832. e.currentTarget.classList.add("choose");
  833. e.currentTarget.onmouseleave = null;
  834. this.form_name = document.querySelector(".choose").childNodes[0].childNodes[1].innerText;
  835. this.form_value = document.querySelector(".choose").childNodes[1].innerText;
  836. if (document.querySelector(".choose").childNodes[0].childNodes[0].style.display == 'none'){
  837. this.form_need = false
  838. } else {
  839. this.form_need = true
  840. }
  841. this.hasChoose = true;
  842. this.hasChoose2 = false;
  843. if(key){
  844. // console.log('click');
  845. key = false;
  846. // this.editText(1, e.currentTarget.style.left, e.currentTarget.style.top, e.currentTarget);
  847. }
  848. e.stopPropagation();
  849. e.preventDefault();
  850. return false;
  851. },
  852. TextMouseenter(e) {
  853. e.currentTarget.childNodes[0].style.display = "flex";
  854. e.currentTarget.childNodes[3].style.display = "block";
  855. },
  856. TextMouseleave(e) {
  857. e.currentTarget.childNodes[0].style.display = "none";
  858. e.currentTarget.childNodes[3].style.display = "none";
  859. },
  860. moveTo(e) {
  861. firstTime = new Date().getTime();
  862. // console.log('mouseDown');
  863. let that = this;
  864. let odiv = e.currentTarget; //获取目标元素
  865. //算出鼠标相对元素的位置
  866. let disX = e.clientX - odiv.offsetLeft;
  867. let disY = e.clientY - odiv.offsetTop;
  868. this.textClick(e);
  869. document.onmousemove = e => {
  870. let left = e.clientX - disX;
  871. let top = e.clientY - disY;
  872. //限制区域
  873. if (left <= 0) {
  874. left = 0;
  875. } else if (left >= document.querySelector(".pdf-box").clientWidth - odiv.clientWidth) {
  876. left = document.querySelector(".pdf-box").clientWidth - odiv.clientWidth;
  877. }
  878. if (top <= 0) {
  879. top = 0;
  880. } else if (top >= this.pdfHeight - odiv.clientHeight) {
  881. top = this.pdfHeight - odiv.clientHeight;
  882. }
  883. //移动当前元素
  884. odiv.style.left = left + "px";
  885. odiv.style.top = top + "px";
  886. };
  887. document.onmouseup = e => {
  888. //鼠标抬起后 记录时间 超过400ms就是移动事件
  889. lastTime = new Date().getTime();
  890. if( (lastTime - firstTime) < 400){
  891. key = true;
  892. }else {
  893. // console.log('mouseUp');
  894. // that.editText(1, odiv.style.left, odiv.style.top, odiv);
  895. }
  896. document.onmousemove = null;
  897. document.onmouseup = null;
  898. };
  899. },
  900. getPos(ev) {
  901. return { x: ev.clientX, y: ev.clientY };
  902. },
  903. toGetReal() {
  904. this.$router.push({
  905. path: "/accredited_institution",
  906. query: { productId: this.$route.query.productId, order_sn: this.$route.query.order_sn }
  907. });
  908. },
  909. // tab点击事件
  910. handleClick(tab, event) {
  911. // console.log(this.activeName,"activeName")
  912. },
  913. handleChange(val) {
  914. this.scale = val;
  915. this.queueRenderPage(this.pageNum);
  916. },
  917. handleScroll(el) {
  918. this.scrollTop = this.$refs.pdfBox.scrollTop;
  919. let _pdfs = document.querySelectorAll(".pdfPage_1yRne");
  920. let arr = [];
  921. _pdfs.forEach((item, index) => {
  922. if (this.scrollTop >= item.offsetTop) {
  923. arr.push(index);
  924. }
  925. });
  926. this.page_num = Math.max.apply(null, arr) + 1;
  927. },
  928. jump() {
  929. let that = this;
  930. let index = this.page_num - 1;
  931. if (index > this.page_count) {
  932. this.$message.error("请输入有效范围内的数字");
  933. return;
  934. }
  935. // 用 class="pdfPage_1yRne" 添加锚点
  936. let jump = document.querySelectorAll(".pdfPage_1yRne");
  937. let total = jump[index].offsetTop;
  938. // console.log('纵坐标', total)
  939. let distance = this.scrollTop;
  940. //平滑滚动,时长500ms,每10ms一跳,共50跳
  941. let step = total / 30 >> 0;
  942. if (total > distance) {
  943. smoothDown();
  944. } else {
  945. let newTotal = distance - total;
  946. step = newTotal / 30 >> 0;
  947. smoothUp();
  948. }
  949. function smoothDown() {
  950. if (distance < total) {
  951. distance += step;
  952. that.$refs.pdfBox.scrollTop = distance;
  953. setTimeout(smoothDown, 10);
  954. } else {
  955. that.$refs.pdfBox.scrollTop = total;
  956. }
  957. }
  958. function smoothUp() {
  959. if (distance > total) {
  960. distance -= step;
  961. that.$refs.pdfBox.scrollTop = distance;
  962. setTimeout(smoothUp, 10);
  963. } else {
  964. that.$refs.pdfBox.scrollTop = total;
  965. }
  966. }
  967. },
  968. _renderPage(num) {
  969. this.pdfDoc.getPage(num).then((page) => {
  970. let canvas = document.getElementById("the-canvas" + num);
  971. let ctx = canvas.getContext("2d");
  972. let viewport = page.getViewport(this.scale);
  973. // alert(vm.canvas.height)
  974. this.pdfHeight = canvas.height = viewport.height;
  975. this.pdfWidth = canvas.width = viewport.width;
  976. // Render PDF page into canvas context
  977. let renderContext = {
  978. canvasContext: ctx,
  979. viewport: viewport
  980. };
  981. page.render(renderContext);
  982. if (this.page_count > num) {
  983. this._renderPage(num + 1);
  984. }
  985. });
  986. this.page_num = this.pageNum;
  987. },
  988. _loadFile(url) {
  989. const CMAP_URL = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/cmaps/';
  990. pdfjsLib.getDocument({url:url,cMapUrl: CMAP_URL,cMapPacked: true}).then((pdf) => {
  991. this.pdfDoc = pdf;
  992. this.page_count = this.pdfDoc.numPages;
  993. this.$nextTick(() => {
  994. this._renderPage(1);
  995. this.getTextData();
  996. });
  997. this.pageNum = 1;
  998. });
  999. },
  1000. queueRenderPage(num) {
  1001. this._renderPage(num);
  1002. },
  1003. downpdf() {//下载pdf
  1004. window.open(this.pdfUrl);
  1005. }
  1006. }
  1007. })
  1008. function formcheck(){
  1009. }
  1010. </script>
  1011. <style>
  1012. @charset "UTF-8";
  1013. .pageContent_2lAGg {
  1014. display: flex;
  1015. /*max-width: 1200px;*/
  1016. height: 93vh;
  1017. /*margin: 10px auto 0 auto;*/
  1018. user-select: none;
  1019. /*firefox浏览器*/
  1020. -moz-user-select: none;
  1021. /*safari、chrome浏览器*/
  1022. -webkit-user-select: none;
  1023. /*Safari中不支持该属性值,只能使用none或者text,或者是在html的标签属性中使用*/
  1024. }
  1025. .pageContent_2lAGg .sign-img {
  1026. position: absolute;
  1027. cursor: move;
  1028. z-index: 7;
  1029. background-repeat: no-repeat;
  1030. background-size: cover;
  1031. background-image: url("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1584116150977&di=8c196ff505f980e30039a8794ead2dad&imgtype=0&src=http%3A%2F%2Fbpic.588ku.com%2Felement_origin_min_pic%2F20%2F16%2F01%2F3156adf74e970a9.jpg");
  1032. }
  1033. .pageContent_2lAGg .componentSign {
  1034. display: none;
  1035. flex-direction: row;
  1036. justify-content: space-between;
  1037. align-items: center;
  1038. width: 100px;
  1039. height: 100px;
  1040. padding: 0 10px;
  1041. border: 1px dashed rgba(0, 0, 0, 0.3);
  1042. background: rgba(255, 255, 255, 0.85);
  1043. font-size: 12px;
  1044. cursor: grab;
  1045. position: absolute;
  1046. top: 95px;
  1047. left: 56px;
  1048. }
  1049. .pageContent_2lAGg .sealCompInfo_3v9iQ {
  1050. min-width: 100%;
  1051. line-height: 1;
  1052. position: absolute;
  1053. height: 20px;
  1054. top: -21px;
  1055. left: -1px;
  1056. padding: 4px 8px;
  1057. white-space: nowrap;
  1058. text-align: center;
  1059. cursor: grab;
  1060. color: #fff;
  1061. font-size: 12px;
  1062. background: rgba(92, 162, 232, 0.6);
  1063. z-index: 10;
  1064. display: none;
  1065. }
  1066. .pageContent_2lAGg .sealCompInfo_3v9iQ .need {
  1067. font-size: 16px;
  1068. margin-top: 2px;
  1069. margin-right: 4px;
  1070. display: inline-block;
  1071. }
  1072. .pageContent_2lAGg .itemConentStyle_2MWEL {
  1073. position: absolute;
  1074. top: 0;
  1075. left: 0;
  1076. bottom: 0;
  1077. right: 0;
  1078. }
  1079. .pageContent_2lAGg .infoMsg_3NkPg {
  1080. position: absolute;
  1081. top: 41px;
  1082. width: 100%;
  1083. text-align: center;
  1084. }
  1085. .pageContent_2lAGg .componentSign-show {
  1086. display: flex;
  1087. flex-direction: row;
  1088. justify-content: space-between;
  1089. align-items: center;
  1090. width: 190px;
  1091. height: 28px;
  1092. padding: 0 10px;
  1093. border: 1px dashed rgba(0, 0, 0, 0.3);
  1094. background: rgba(255, 255, 255, 0.85);
  1095. font-size: 12px;
  1096. cursor: grab;
  1097. position: absolute;
  1098. top: 55px;
  1099. left: 12px;
  1100. }
  1101. .pageContent_2lAGg .componentSign-show p {
  1102. margin: 0;
  1103. }
  1104. .pageContent_2lAGg .componentVariable-text {
  1105. font-size: 12px;
  1106. cursor: grab;
  1107. position: absolute;
  1108. top: 95px;
  1109. left: 12px;
  1110. }
  1111. .pageContent_2lAGg .componentVariable-text .title_3vpva{
  1112. padding-left:0;
  1113. margin-bottom:0;
  1114. }
  1115. .pageContent_2lAGg .componentVariable-text .tips_2oKGU{
  1116. margin-left:0;
  1117. }
  1118. .pageContent_2lAGg .componentVariable {
  1119. padding: 0;
  1120. font-size: 12px;
  1121. margin-top: 100px;
  1122. display: flex;
  1123. flex-wrap: wrap;
  1124. justify-content: space-between;
  1125. }
  1126. .pageContent_2lAGg .variable-item{
  1127. cursor: pointer;
  1128. width:92px;
  1129. height:28px;
  1130. line-height:28px;
  1131. text-align:center;
  1132. border: 1px dashed rgba(0, 0, 0, 0.3);
  1133. background: rgba(255, 255, 255, 0.85);
  1134. cursor: grab;
  1135. /* margin-left:10px; */
  1136. margin-bottom:10px;
  1137. position:relative;
  1138. display:inline-block;
  1139. font-size:12px;
  1140. }
  1141. .pageContent_2lAGg .variable-item p {
  1142. overflow: hidden;
  1143. text-overflow:ellipsis;
  1144. white-space: nowrap;
  1145. }
  1146. .pageContent_2lAGg .variable-item .sealCompInfo_text {
  1147. display: none;
  1148. }
  1149. .pageContent_2lAGg .text_mark3{
  1150. display: flex;
  1151. }
  1152. .pageContent_2lAGg .text_mark3 p {
  1153. width: 100%;
  1154. text-align: center;
  1155. align-self: center;
  1156. justify-items: center;
  1157. margin: 0;
  1158. overflow: hidden;
  1159. text-overflow:ellipsis;
  1160. white-space: nowrap;
  1161. }
  1162. .pageContent_2lAGg .text_mark3 .sealCompInfo_text {
  1163. position: absolute;
  1164. line-height: 1;
  1165. left: -2px;
  1166. text-align: left;
  1167. top: -22px;
  1168. min-width: 100%;
  1169. height: 20px;
  1170. padding: 4px 8px;
  1171. white-space: nowrap;
  1172. cursor: grab;
  1173. color: #fff;
  1174. font-size: 12px;
  1175. background: rgba(92, 162, 232, 0.6);
  1176. z-index: 10;
  1177. display: block;
  1178. }
  1179. .pageContent_2lAGg .variable_delete {
  1180. width: 100%;
  1181. line-height: 18px;
  1182. position: absolute;
  1183. bottom: -18px;
  1184. left: 0;
  1185. text-align: center;
  1186. color: #fff;
  1187. padding: 1px 0;
  1188. font-size: 12px;
  1189. background-color: rgba(10, 10, 10, 0.6);
  1190. cursor: pointer;
  1191. display: none;
  1192. }
  1193. .pageContent_2lAGg .delete {
  1194. width: 100%;
  1195. position: absolute;
  1196. bottom: -15px;
  1197. text-align: center;
  1198. color: #fff;
  1199. font-size: 15px;
  1200. background-color: rgba(10, 10, 10, 0.6);
  1201. cursor: pointer;
  1202. display: none;
  1203. }
  1204. .pageContent_2lAGg .componentArea {
  1205. display: flex;
  1206. flex-direction: row;
  1207. justify-content: space-between;
  1208. align-items: center;
  1209. width: 190px;
  1210. height: 28px;
  1211. padding: 0 10px;
  1212. border: 1px dashed rgba(0, 0, 0, 0.3);
  1213. background: rgba(255, 255, 255, 0.85);
  1214. font-size: 12px;
  1215. cursor: grab;
  1216. position: absolute;
  1217. top: 55px;
  1218. left: 12px;
  1219. }
  1220. .pageContent_2lAGg .itemConentStyle {
  1221. position: absolute;
  1222. height: 20px;
  1223. top: -21px;
  1224. left: -1px;
  1225. padding: 4px 8px;
  1226. white-space: nowrap;
  1227. text-align: center;
  1228. cursor: grab;
  1229. color: #fff;
  1230. font-size: 12px;
  1231. background: rgba(92, 162, 232, 0.6);
  1232. z-index: 10;
  1233. display: none;
  1234. }
  1235. .pageContent_2lAGg .itemConentStyle .need {
  1236. font-size: 16px;
  1237. margin-top: 2px;
  1238. margin-right: 4px;
  1239. display: inline-block;
  1240. }
  1241. .pageContent_2lAGg .text_delete {
  1242. width: 100%;
  1243. line-height: 16px;
  1244. position: absolute;
  1245. bottom: -22px;
  1246. left: 0;
  1247. text-align: center;
  1248. color: #fff;
  1249. padding: 3px 0;
  1250. font-size: 12px;
  1251. background-color: rgba(10, 10, 10, 0.6);
  1252. cursor: pointer;
  1253. display: none;
  1254. }
  1255. .pageContent_2lAGg .move-icon {
  1256. display: none;
  1257. position: absolute;
  1258. top: 50%;
  1259. right: -8px;
  1260. z-index: 10;
  1261. width: 14px;
  1262. height: 14px;
  1263. margin-top: -7px;
  1264. cursor: col-resize;
  1265. }
  1266. .pageContent_2lAGg .move-icon img {
  1267. width: 100%;
  1268. height: 100%;
  1269. }
  1270. .pageContent_2lAGg .icon-pm_auction_success {
  1271. color: #409EFF;
  1272. display: none;
  1273. }
  1274. .pageContent_2lAGg .choose {
  1275. border: 1px solid #409EFF;
  1276. }
  1277. .pageContent_2lAGg .choose .icon-pm_auction_success {
  1278. display: inline-block;
  1279. }
  1280. .pageContent_2lAGg .choose2 {
  1281. border: 1px solid #409EFF;
  1282. }
  1283. .pageContent_2lAGg .choose2 .icon-pm_auction_success {
  1284. display: inline-block;
  1285. position: absolute;
  1286. right: 0;
  1287. }
  1288. .leftContent_2NoKi {
  1289. display: flex;
  1290. flex-direction: column;
  1291. flex: 0 0 240px;
  1292. width: 240px;
  1293. height: 100%;
  1294. }
  1295. .leftContent_2NoKi .doc-list-title {
  1296. font-size: 14px;
  1297. font-weight: 800;
  1298. color: #333;
  1299. line-height: 40px;
  1300. height: 40px;
  1301. width: 100%;
  1302. border-bottom: 1px solid #eaeaea;
  1303. }
  1304. .leftContent_2NoKi .doc-list-title span {
  1305. color: #777;
  1306. font-size: 12px;
  1307. line-height: 40px;
  1308. font-weight: normal;
  1309. }
  1310. .leftContent_2NoKi .doc-list-context {
  1311. height: 100%;
  1312. width: 240px;
  1313. display: inline-block;
  1314. padding: 0 15px;
  1315. }
  1316. .leftContent_2NoKi .doc-list {
  1317. overflow-y: auto;
  1318. width: 100%;
  1319. height: calc(100% - 51px);
  1320. padding-top: 10px;
  1321. }
  1322. .leftContent_2NoKi .doc-list::-webkit-scrollbar {
  1323. display: none;
  1324. }
  1325. .leftContent_2NoKi .doc-item {
  1326. margin: 0;
  1327. padding: 20px 45px 0 45px;
  1328. cursor: pointer;
  1329. }
  1330. .leftContent_2NoKi .doc-img {
  1331. border: 1px solid #333;
  1332. position: relative;
  1333. width: 121px;
  1334. height: 161px;
  1335. margin-bottom: 5px;
  1336. }
  1337. .leftContent_2NoKi .doc-img img {
  1338. width: 100%;
  1339. height: 100%;
  1340. }
  1341. .leftContent_2NoKi .doc-page-num {
  1342. z-index: 100;
  1343. position: absolute;
  1344. bottom: 0;
  1345. right: 0;
  1346. width: 20px;
  1347. height: 20px;
  1348. line-height: 20px;
  1349. font-size: 12px;
  1350. text-align: center;
  1351. background-color: #333333;
  1352. color: #fff;
  1353. }
  1354. .leftContent_2NoKi .doc-name {
  1355. color: #333;
  1356. font-size: 12px;
  1357. line-height: 20px;
  1358. word-break: break-all;
  1359. }
  1360. .leftContent_2NoKi .componentsList_1OIrB {
  1361. display: flex;
  1362. flex-direction: column;
  1363. align-items: flex-start;
  1364. width: 100%;
  1365. margin-top: 50px;
  1366. position: relative;
  1367. }
  1368. .leftContent_2NoKi .title_3vpva {
  1369. font-size: 14px;
  1370. font-weight: 500;
  1371. line-height: 22px;
  1372. padding-left: 16px;
  1373. margin-bottom: 4px;
  1374. }
  1375. .leftContent_2NoKi .tips_2oKGU {
  1376. margin: 0 14px;
  1377. font-size: 12px;
  1378. line-height: 20px;
  1379. color: #999;
  1380. vertical-align: baseline;
  1381. }
  1382. .pdfContent_1PW2f {
  1383. flex: 1;
  1384. display: flex;
  1385. flex-direction: column;
  1386. height: 100%;
  1387. overflow: auto;
  1388. background: #f5f5f5;
  1389. }
  1390. .pdfContent_1PW2f .pdf-header {
  1391. /*position: fixed;*/
  1392. top: 55px;
  1393. left: 240px;
  1394. right: 240px;
  1395. height: 40px;
  1396. border-bottom: 1px solid #eee;
  1397. background-color: #fff;
  1398. z-index: 100;
  1399. text-align: center;
  1400. display: flex;
  1401. }
  1402. .pdfContent_1PW2f .pdf-header .block {
  1403. flex: 1;
  1404. display: flex;
  1405. }
  1406. .pdfContent_1PW2f .pdf-header .block .demonstration, .pdfContent_1PW2f .pdf-header .block .slider {
  1407. flex: 0 0 150px;
  1408. line-height: 40px;
  1409. width: 150px;
  1410. text-align: right;
  1411. }
  1412. .pdfContent_1PW2f .pdf-header .block .demonstration {
  1413. flex: 1;
  1414. margin-right: 20px;
  1415. }
  1416. .pdfContent_1PW2f .pdf-header .input {
  1417. flex: 1;
  1418. text-align: left;
  1419. line-height: 40px;
  1420. margin-left: 20px;
  1421. }
  1422. .pdfContent_1PW2f .pdf-header .input .input-text {
  1423. border: none;
  1424. outline: none;
  1425. border-bottom: 1px solid #e4e7ed;
  1426. margin-left: 10px;
  1427. height: 25px;
  1428. width: 25px;
  1429. text-align: center;
  1430. }
  1431. .pdfContent_1PW2f .pdf-container {
  1432. display: inline-block;
  1433. overflow: auto;
  1434. height: 100%;
  1435. width: 100%;
  1436. }
  1437. .pdfContent_1PW2f .pdf-container .pdf-box {
  1438. position: relative;
  1439. overflow: auto;
  1440. margin: 0 auto;
  1441. }
  1442. .pdfContent_1PW2f .pdf-container .pdf-box .sign-img {
  1443. z-index: 4;
  1444. }
  1445. .pdfContent_1PW2f .pdfPage_1yRne {
  1446. position: relative;
  1447. margin: 10px 0;
  1448. }
  1449. .pdfContent_1PW2f .dragLayer_3ccsq {
  1450. position: absolute;
  1451. left: 0;
  1452. top: 0;
  1453. right: 0;
  1454. bottom: 0;
  1455. }
  1456. .taskInfoArea_3ThxW {
  1457. display: flex;
  1458. flex-direction: column;
  1459. flex: 0 0 240px;
  1460. width: 240px;
  1461. height: 100%;
  1462. }
  1463. .taskInfoArea_3ThxW .tab-bar {
  1464. width: 100%;
  1465. padding: 0 15px;
  1466. height: 40px;
  1467. font-size: 14px;
  1468. line-height: 38px;
  1469. display: flex;
  1470. border-bottom: 1px solid #eaeaea;
  1471. color: #999;
  1472. overflow: hidden;
  1473. justify-content: space-around;
  1474. }
  1475. .taskInfoArea_3ThxW .tab-context {
  1476. padding: 0 15px;
  1477. height: calc(100% - 51px);
  1478. overflow-y: auto;
  1479. overflow-x: hidden;
  1480. text-align: center;
  1481. font-weight: bold;
  1482. }
  1483. .taskInfoArea_3ThxW .real .gray {
  1484. color: #999999;
  1485. font-weight: normal;
  1486. margin: 10px 0;
  1487. display: block;
  1488. }
  1489. .taskInfoArea_3ThxW .item {
  1490. margin-top: 25px;
  1491. }
  1492. .taskInfoArea_3ThxW .title {
  1493. margin: 10px 0;
  1494. }
  1495. .taskInfoArea_3ThxW .seal-wrapper-item {
  1496. padding: 20px 10px;
  1497. margin: 0 auto;
  1498. height: 140px;
  1499. width: 120px;
  1500. cursor: move;
  1501. border: 1px dotted #e1e1e1;
  1502. }
  1503. .taskInfoArea_3ThxW .finish-img {
  1504. width: 100px;
  1505. height: 100px;
  1506. }
  1507. .taskInfoArea_3ThxW .item-box {
  1508. width: 100%;
  1509. margin-bottom: 20px;
  1510. }
  1511. .taskInfoArea_3ThxW .testSetting_8FNRp {
  1512. width: 100%;
  1513. display: flex;
  1514. flex-direction: column;
  1515. justify-content: flex-start;
  1516. align-items: flex-start;
  1517. text-align: left;
  1518. }
  1519. .taskInfoArea_3ThxW .titleh2_3zdht {
  1520. margin-bottom: 5px;
  1521. font-size: 12px;
  1522. font-weight: 500;
  1523. line-height: 22px;
  1524. color: #333;
  1525. }
  1526. .taskInfoArea_3ThxW .emptyStyle_wctx0 {
  1527. display: flex;
  1528. flex-direction: column;
  1529. justify-content: flex-start;
  1530. align-items: center;
  1531. width: 100%;
  1532. margin-top: 200px;
  1533. }
  1534. .taskInfoArea_3ThxW .emptyP_2N3sX {
  1535. width: 196px;
  1536. font-size: 12px;
  1537. color: #333;
  1538. line-height: 22px;
  1539. font-weight: 500;
  1540. text-align: center;
  1541. }
  1542. </style>
  1543. @endsection