remark_detail.html 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>标注中心</title>
  6. <script src="/bower_components/jquery/dist/jquery.min.js"></script>
  7. <link href="/dist/css/normalize.min.css" rel="stylesheet">
  8. <link href="/dist/css/animate.min.css" rel="stylesheet">
  9. <link rel="stylesheet" href="/dist/css/zz.css">
  10. <link rel="stylesheet" href="/dist/css/index.css">
  11. <script src="/dist/js/vue.min.js"></script>
  12. <script src="/dist/js/index.js"></script>
  13. <style>
  14. .add-tip {
  15. width: 24px;
  16. height: 22px;
  17. line-height: 22px;
  18. text-align: center;
  19. color: #fff;
  20. margin: 0;
  21. padding: 0;
  22. border: 1px solid #ccc;
  23. background-color: #fdfdfd;
  24. }
  25. .info-box > * {
  26. cursor: pointer;
  27. }
  28. .button-group {
  29. display: flex;
  30. flex-direction: row;
  31. align-items: center;
  32. justify-content: space-between;
  33. }
  34. .button-group .info-box {
  35. margin-left: -60px;
  36. }
  37. .edit-box .edit.two .edit-title {
  38. padding-right: 4px;
  39. }
  40. .edit-box .edit .edit-input .label > span {
  41. max-width: unset;
  42. text-align: left;
  43. padding: 0 1em;
  44. }
  45. .a-button {
  46. color: #4169e3;
  47. margin: 8px 15px;
  48. padding: 4px 10px;
  49. }
  50. .button-box.delete-box {
  51. margin-right: 22px !important;
  52. margin-left: -419px !important;
  53. }
  54. .button-box.delete-box .pass {
  55. background-color: #f56c6c !important;
  56. }
  57. .pass.success {
  58. background-color: #09bb07 !important;
  59. }
  60. .pass.default {
  61. background-color: #adadad !important;
  62. }
  63. .el-table td, .el-table th {
  64. padding: 4px 0;
  65. }
  66. .top-button-group {
  67. margin-top: 20px;
  68. }
  69. .top-button-group button {
  70. margin-bottom: 12px;
  71. }
  72. .el-radio-button--mini.info .el-radio-button__inner {
  73. color: #909399 !important;
  74. background: #f4f4f5 !important;
  75. border-color: #d3d4d6 !important;
  76. }
  77. .default .el-radio-button__orig-radio + .el-radio-button__inner {
  78. color: #409eff;
  79. background: #ecf5ff;
  80. border-color: #b3d8ff;
  81. }
  82. .success .el-radio-button__orig-radio + .el-radio-button__inner {
  83. color: #67c23a;
  84. background: #f0f9eb;
  85. border-color: #c2e7b0;
  86. }
  87. .success .el-radio-button__orig-radio:checked + .el-radio-button__inner,
  88. .default .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  89. color: #FFF;
  90. background-color: #409EFF;
  91. border-color: #409EFF;
  92. -webkit-box-shadow: -1px 0 0 0 #409EFF;
  93. box-shadow: -1px 0 0 0 #409EFF
  94. }
  95. </style>
  96. <script>
  97. function prettyPrint(obj) {
  98. var ENDLINE = "\n";
  99. var COMMA_ENDLINE = ",\n";
  100. var OBJ_BEGIN = "{";
  101. var OBJ_END = "}";
  102. var ARR_BEGIN = "[";
  103. var ARR_END = "]";
  104. var INDNET_SPACES = 4;
  105. return (function innerPrettyPrint(obj, spaces) {
  106. var type = typeof obj;
  107. if (type == "number" || type == "boolean") {
  108. return obj.toString();
  109. } else if (type == "string") {
  110. if (obj != "" && !isNaN(Number(obj))) {
  111. return Number(obj)
  112. }
  113. return '"' + obj + '"';
  114. } else {
  115. var entries = [];
  116. var thisIndent = ' '.repeat(spaces);
  117. var subIndent = thisIndent + ' '.repeat(INDNET_SPACES);
  118. var subSpaces = spaces + INDNET_SPACES;
  119. if (Object.prototype.toString.call(obj) == '[object Object]') {
  120. for (var k in obj) {
  121. entries.push('"' + k + '": ' + innerPrettyPrint(obj[k], subSpaces));
  122. }
  123. return OBJ_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + OBJ_END;
  124. } else if (Object.prototype.toString.call(obj) == '[object Array]') {
  125. obj.forEach(function (a) {
  126. entries.push(innerPrettyPrint(a, subSpaces));
  127. });
  128. return ARR_BEGIN + ENDLINE + subIndent + entries.join(COMMA_ENDLINE + subIndent) + ENDLINE + thisIndent + ARR_END;
  129. } else if (obj === null) {
  130. return "null";
  131. } else {
  132. return obj.toString();
  133. }
  134. }
  135. })(obj, 0);
  136. }
  137. </script>
  138. </head>
  139. <body>
  140. <main id="app">
  141. <div class="content" :class="{mm:showPop}">
  142. <!--文章区-->
  143. <div class="article">
  144. <div class="top-button-group">
  145. <el-radio-group v-model="activeLabel" size="mini">
  146. <el-radio-button class="default" label="原文"></el-radio-button>
  147. {{if .T.info.filetext}}
  148. <el-radio-button class="default" label="附件"></el-radio-button>
  149. {{end}}
  150. </el-radio-group>
  151. <el-radio-group v-model="activeLabel" v-for="(item, index) in otherInfo" size="mini">
  152. <el-radio-button class="success" :label="item.id">[[item.subtype]]</el-radio-button>
  153. <el-radio-button v-if="item.filetext && item.filetext.length > 10" class="success" :label="item.id + '-附件'">附件</el-radio-button>
  154. <!-- <el-radio-button class="success" :label="item.id + '-附件'">附件</el-radio-button>-->
  155. </el-radio-group>
  156. <el-radio-group v-if="moreInfo&&moreInfo.length > 0" size="mini">
  157. <el-popover
  158. placement="right-end"
  159. trigger="hover">
  160. <el-table :data="moreInfo" max-height="300">
  161. <el-table-column width="50" property="subtype" label="类型"></el-table-column>
  162. <el-table-column width="180" property="publishtime" label="发布日期"></el-table-column>
  163. <el-table-column width="220" property="title" label="标题">
  164. <template slot-scope="scope">
  165. <a href="#" @click="openLink(scope.row.href)">[[scope.row.title]]</a>
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. <el-radio-button class="info" slot="reference" style="border-color: #d3d4d6;">更多
  170. </el-radio-button>
  171. </el-popover>
  172. </el-radio-group>
  173. </div>
  174. <hr style="border: 1px;" width="100%">
  175. <br><a v-if="getPageInfo.href.length > 0" :href="getPageInfo.href" target="_blank">查看原文</a>
  176. <!--<a href="{{.T.jyhref}}" target="_blank">剑鱼链接</a>-->
  177. <h3>[[getPageInfo.title]]</h3><br>
  178. <div v-html="pageHtml"></div>
  179. </div>
  180. <!--操作区-->
  181. <div class="operation">
  182. <!--edit-box-->
  183. <div class="edit-box">
  184. <!--edit-->
  185. <div style="padding: 5px;margin-left: 20px">
  186. <label style="color: red">备注:<input type="text" id="remark" style="height: 25px;width: 300px;display: inline-block;"></label>
  187. </div>
  188. <div class="edit one" v-for="(one,oindex) in editData" :key="oindex">
  189. <!--one-->
  190. <div class="edit-title" @click="one.show = !one.show">
  191. <span>[[one.title]]</span>
  192. <div class="button-group">
  193. <div v-if="one.showCheck">
  194. <input :id="one.title" v-show="one.title == '标的信息'" @click.stop type="checkbox"
  195. v-model="one.checkAllTag">
  196. <label @click.stop v-show="one.title == '标的信息'" :for="one.title">全部标注</label>
  197. </div>
  198. <!-- &nbsp;
  199. <div v-if="one.showCheck">
  200. <input :id="one.title" @click.stop type="checkbox" v-model="one.checkType">
  201. <label @click.stop :for="one.title">是否抽取</label>
  202. </div>-->
  203. <div class="button-box">
  204. <!--v-show="one.title == '基本字段'"-->
  205. <button class="pass success" @click.stop="saveDataOne(one,'1')"
  206. style="font-size: 14px;width: auto;float:left;">通过
  207. </button>
  208. <button class="pass default" @click.stop="saveDataOne(one,'-1')"
  209. style="font-size: 14px;width: auto;float:left">取消
  210. </button>
  211. <!-- <button class="pass" @click.stop="open(one, true)" style="font-size: 14px;width: auto;float:left">保存</button>-->
  212. </div>
  213. <!--<button class="add" v-show="one.title != '基本'" @click.stop="one.content.push(getTemp(2));goMark2(500)">+</button>-->
  214. <!--<button class="add" v-show="one.title == '基本'" @click.stop="one.content[0].content.push(getTemp(3));goMark2(60)">+</button>-->
  215. <div class="info-box" @click.stop v-show="one.showCheck">
  216. <div :class="{default: one.status == '-1'}" @click="setStatus(one,'-1')"></div>
  217. <!--<div :class="{ok: one.status == '1'}" @click="one.status = '1'"></div>-->
  218. <div :class="{ok: one.status == '1'}" @click="setStatus(one,'1')"></div>
  219. <!--<div :class="{err: one.status == '0'}" @click="one.status = '0'"></div>-->
  220. <div class="add-tip" :class="{err: (one.status != '1' && one.status != '-1')}"
  221. @click="setStatus(one,'2')"></div>
  222. </div>
  223. </div>
  224. </div>
  225. <transition tag="div">
  226. <div>
  227. <div class="button-box" v-if="one.showCheck&&one.show">
  228. <button class="pass a-button" @click.stop="addChild(one, oindex)"
  229. style="font-size: 14px;width: auto;float:left;">新增[[one.title]]
  230. </button>
  231. </div>
  232. <div class="edit-content" :class="{t:one.title == '基本字段'}" v-show="one.show">
  233. <!--two-->
  234. <span v-show="one.content.length === 0">当前您还没有添加子包</span>
  235. <div class="edit two" v-for="(two,index) in one.content" :key="index">
  236. <div class="edit-title" v-if="two.title" @click="two.show = !two.show">
  237. <span>[[two.title]]</span>
  238. <div class="button-box"
  239. :style="one.title == '多包信息' ? 'margin-right: 193px' : ''">
  240. <button v-if="one.title == '多包信息'" class="pass a-button"
  241. @click.stop="addThreeChild(two,'2',one)"
  242. style="font-size: 14px;margin: 0;width: auto;float:left;">新增子包中标信息
  243. </button>
  244. <button class="pass success" @click.stop="saveDataTwo(two,'1',one)"
  245. style="font-size: 14px;width: auto;float:left;">通过
  246. </button>
  247. <button class="pass default" @click.stop="saveDataTwo(two,'-1',one)"
  248. style="font-size: 14px;width: auto;float:left">取消
  249. </button>
  250. </div>
  251. <div class="button-box delete-box">
  252. <button class="pass" @click.stop="delNewTwo(one, index, two)">删除</button>
  253. </div>
  254. </div>
  255. <transition tag="div">
  256. <div class="edit-content" v-show="two.show">
  257. <!--input-->
  258. <div class="edit-input">
  259. <div v-for="(uin, uindex) of two.uInput" class="input-box"
  260. :key="uin.title">
  261. <div class="label" v-if="uin.selectArr">
  262. <span><span v-if="allCheckFields[uin.key]">*</span>[[uin.title]]&nbsp;:&nbsp;</span>
  263. <select v-model="uin.select"
  264. @change="focusFn(uin, oindex,index,uindex, two, one)">
  265. <option disabled value="">请选择</option>
  266. <option v-for="o in uin.selectArr">[[o]]</option>
  267. </select>
  268. <div class="info-box">
  269. <div :class="{default: uin.status == '-1'}"
  270. @click="setStatus(uin,'-1', two, one)"></div>
  271. <div :class="{ok: uin.status == '1'}"
  272. @click="setStatus(uin,'1', two, one)"></div>
  273. <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
  274. <div class="add-tip" @click="setStatus(uin,'2', two, one)"
  275. :class="{err: (uin.status != '1' && uin.status != '-1')}"></div>
  276. </div>
  277. </div>
  278. <div class="label" v-else :title="uin.input">
  279. <span @click="goText(uin.title)"><span v-if="allCheckFields[uin.key]" style="color: red">*</span>[[uin.title]]&nbsp;:&nbsp;</span>
  280. <input type="text" v-model="uin.input"
  281. @focus="goText(uin.input)" @click="goText(uin.input)"
  282. @blur="focusFn(uin, oindex, index, uindex,two,one)">
  283. <div class="info-box">
  284. <div :class="{default: uin.status == '-1'}"
  285. @click="setStatus(uin,'-1', two, one)"></div>
  286. <div :class="{ok: uin.status == '1'}"
  287. @click="setStatus(uin,'1', two, one)"></div>
  288. <!--<div :class="{err: uin.status == '0'}" @click="uin.status = '0'"></div>-->
  289. <div class="add-tip" @click="setStatus(uin,'2', two, one)"
  290. :class="{err: (uin.status != '1' && uin.status != '-1')}"></div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. <!--three-->
  296. <!--<div>
  297. <div class="edit-title" v-show="one.title == '基本字段'">
  298. <span>候选人</span>
  299. <div class="info-box" >
  300. <div :class="{default: two.wstatus == '-1'}" @click="two.wstatus = '-1'"></div>
  301. <div :class="{ok: two.wstatus == '1'}" @click="two.wstatus = '1'"></div>
  302. <el-popover trigger="click" >
  303. <div style="text-align: right; margin: 0">
  304. <el-button type="success" size="mini" @click="two.wstatus = '2'">新增</el-button>
  305. <el-button type="warning" size="mini" @click="two.wstatus = '3'">修改</el-button>
  306. <el-button type="danger" size="mini" @click="two.wstatus = '4'">删除</el-button>
  307. </div>
  308. <div class="add-tip" slot="reference" :class="{err: (two.wstatus != '1' && two.wstatus != '-1')}">[[textMap[two.wstatus] || '']]</div>
  309. </el-popover>
  310. </div>
  311. </div>
  312. <div class="edit three" v-for="(three,index) in two.content" :key="index">
  313. <div class="edit-title" @click="three.show = !three.show">
  314. <span>[[three.title]]</span>
  315. </div>
  316. <div class="edit-content" v-show="three.show">
  317. <div class="edit-input">
  318. <div class="input-box" v-for="(threeUin,index) in three.uInput" :key="threeUin.title">
  319. <div class="label">
  320. <span @click="goText(threeUin.title)">[[threeUin.title]]&nbsp;:&nbsp;</span>
  321. <input type="text" v-model="threeUin.input" @focus="goText(threeUin.input)" @click="goText(threeUin.input)">
  322. <div class="info-box">
  323. <div :class="{default: threeUin.status == '-1'}" @click="threeUin.status = '-1'"></div>
  324. <div :class="{ok: threeUin.status == '1'}" @click="threeUin.status = '1'"></div>
  325. <el-popover trigger="click" >
  326. <div style="text-align: right; margin: 0">
  327. <el-button type="success" size="mini" @click="threeUin.status = '2'">新增</el-button>
  328. <el-button type="warning" size="mini" @click="threeUin.status = '3'">修改</el-button>
  329. <el-button type="danger" size="mini" @click="threeUin.status = '4'">删除</el-button>
  330. </div>
  331. <div class="add-tip" slot="reference" :class="{err: (threeUin.status != '1' && threeUin.status != '-1')}">[[textMap[threeUin.status] || '']]</div>
  332. </el-popover>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>-->
  340. </div>
  341. </transition>
  342. </div>
  343. </div>
  344. </div>
  345. </transition>
  346. </div>
  347. </div>
  348. <div class="save-box">
  349. <!-- <button class="code" @click.stop="showPop = true" style="width:100px">源码</button>&nbsp;&nbsp;-->
  350. <!-- <button class="code" @click.stop="open(1)" style="width:100px">全部验证</button> -->
  351. <button class="code" @click.stop="open(2)" style="width:100px">保存</button>
  352. <!-- <button class="code" @click.stop="open('', false)" style="width:100px">保存</button>&nbsp;&nbsp;-->
  353. <button class="code" @click.stop="openHref" style="width:100px">下一条</button>
  354. <!--<button class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>-->
  355. </div>
  356. </div>
  357. </div>
  358. <!--弹出层-->
  359. <dialog class="dialog" v-if="showPop">
  360. <span class="close" @click="showPop = false;changeText()">x</span>
  361. <div class="pop">
  362. <div class="title">源码</div>
  363. <div class="con" ref="text" contentEditable="true">
  364. <pre v-html="addStyle(editData)"></pre>
  365. </div>
  366. <button @click="showPop = false;changeText();upChange()">保&nbsp;存</button>
  367. </div>
  368. </dialog>
  369. <dialog id="com-alert" class="dialog" style="background: rgba(124, 124, 125, 0.1);z-index:9999;display: none;">
  370. <div class="pop" style="background: rgba(124, 124, 125, 0.1);">
  371. <div id="com-alert-val" class="title" style="color:red">保存成功</div>
  372. </div>
  373. </dialog>
  374. </main>
  375. </body>
  376. <script>
  377. let tid = {{ .T.tid }} // 任务id
  378. let did = {{ .T.did }} // 数据id
  379. let pid = {{ .T.pid }} // 项目id
  380. let coll = {{ .T.coll }} // 表名
  381. var allCheckFields = {{ .T.fields }} //本次需标注的所有字段
  382. var moreInfo = {{ .T.moreInfo }} // 更多关联信息
  383. var otherInfo = {{ .T.otherInfo }} //公告关联信息
  384. let purchasing_status = {{ .T.ck_purchasinglist }} //标的物标记
  385. let purchasing_all_tag = {{ .T.ck_pclistag }} // 标的物是否全部标记
  386. let package_status = {{ .T.ck_package }} //包标记
  387. let winneroder_status = {{ .T.ck_winnerorder }} //中标候选人标记
  388. // 页面数据
  389. var pageDataMap = {
  390. '原文': {
  391. title: '{{.T.info.title}}',
  392. href: '{{.T.info.href}}',
  393. // html: '{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}',
  394. html: '{{ .T.info.detail }}',
  395. },
  396. '附件': {
  397. title: '附件内容',
  398. href: '',
  399. // html:{{if .T.info.filetext}}{{.T.info.filetext}}.replace(/(\\n|\\\\n)\\s+/, '\n').replace(/(`|\\n|\\\\n)+/, '<br>'){{else}}``{{end}} }
  400. html: '{{ .T.info.filetext }}',
  401. },
  402. }
  403. //快捷键
  404. $(document).keydown(function (event) {
  405. if (!event.shiftKey) {
  406. var text = getSelectedContents();//获取选中文本
  407. if (!text.trim().length) {
  408. return
  409. }
  410. }
  411. if (event.keyCode === 82) {//项目名称快捷键r
  412. if (event.shiftKey) {
  413. app.changeBaseValue(0, '', 2) //删除对应文本
  414. } else {
  415. app.changeBaseValue(0, text, 2)//填充
  416. }
  417. } else if (event.keyCode === 81) {//省份快捷键q
  418. if (event.shiftKey) {
  419. app.changeBaseValue(1, '', 2) //删除对应文本
  420. } else {
  421. app.changeBaseValue(1, text, 2)//填充
  422. }
  423. } else if (event.keyCode === 84) {//项目编号快捷键t
  424. if (event.shiftKey) {
  425. app.changeBaseValue(2, '', 2) //删除对应文本
  426. } else {
  427. app.changeBaseValue(2, text, 2)//填充
  428. }
  429. } else if (event.keyCode === 87) {//城市快捷键w
  430. if (event.shiftKey) {
  431. app.changeBaseValue(3, '', 2) //删除对应文本
  432. } else {
  433. app.changeBaseValue(3, text, 2)//填充
  434. }
  435. } else if (event.keyCode === 69) {//区县快捷键e
  436. if (event.shiftKey) {
  437. app.changeBaseValue(5, '', 2) //删除对应文本
  438. } else {
  439. app.changeBaseValue(5, text, 2)//填充
  440. }
  441. } else if (event.keyCode === 65) {//采购单位快捷键a
  442. if (event.shiftKey) {
  443. app.changeBaseValue(6, '', 2) //删除对应文本
  444. } else {
  445. app.changeBaseValue(6, text, 2)//填充
  446. }
  447. } else if (event.keyCode === 90) {//预算快捷键z
  448. if (event.shiftKey) {
  449. app.changeBaseValue(7, '', 2) //删除对应文本
  450. } else {
  451. app.changeBaseValue(7, text, 2)//填充
  452. }
  453. } else if (event.keyCode === 83) {//代理机构快捷键s
  454. if (event.shiftKey) {
  455. app.changeBaseValue(8, '', 2) //删除对应文本
  456. } else {
  457. app.changeBaseValue(8, text, 2)//填充
  458. }
  459. } else if (event.keyCode === 88) {//中标金额快捷键x
  460. if (event.shiftKey) {
  461. app.changeBaseValue(9, '', 2) //删除对应文本
  462. } else {
  463. app.changeBaseValue(9, text, 2)//填充
  464. }
  465. } else if (event.keyCode === 68) {//中标单位快捷键d
  466. if (event.shiftKey) {
  467. app.changeBaseValue(10, '', 2) //删除对应文本
  468. } else {
  469. app.changeBaseValue(10, text, 2)//填充
  470. }
  471. }
  472. });
  473. //获取鼠标选中的文本
  474. function getSelectedContents() {
  475. var text = "";
  476. if (window.getSelection) { //chrome,firefox,opera
  477. var range = window.getSelection().getRangeAt(0);
  478. var container = document.createElement('div');
  479. container.appendChild(range.cloneContents());
  480. text = container.innerHTML;
  481. //return container.innerHTML;
  482. //return window.getSelection(); //只复制文本
  483. } else if (document.getSelection) { //其他
  484. var range = document.getSelection().getRangeAt(0);
  485. var container = document.createElement('div');
  486. container.appendChild(range.cloneContents());
  487. text = container.innerHTML;
  488. //return container.innerHTML;
  489. //return document.getSelection(); //只复制文本
  490. } else if (document.selection) { //IE特有的
  491. text = document.selection.createRange().htmlText;
  492. //return document.selection.createRange().htmlText;
  493. //return document.selection.createRange().text; //只复制文本
  494. }
  495. text = text.replace(/(\r|\n|\s+|&nbsp;|<[^>]*>|<\/[^>]*)/g, "")
  496. return text;
  497. }
  498. //记录是否点击保存
  499. var issave = false;
  500. var _id = {{ .T.did }}
  501. var nextid = {{ .T.nextid }}
  502. //基本信息
  503. var common = {{ .T.common }}
  504. var uInput = [];
  505. let k;
  506. for (k in common) {
  507. var tmp = {}
  508. tmp.title = common[k].descript
  509. tmp.input = common[k].value
  510. tmp.key = common[k].key
  511. if (common[k].key === "subtype") {
  512. tmp.select = common[k].value
  513. tmp.selectArr = {{ .T.topsubtype }}
  514. }
  515. if (common[k].key === "attach_discern") {
  516. tmp.select = common[k].value
  517. tmp.selectArr = ['识别有效', '识别无效']
  518. }
  519. if (common[k].key === "attach_ext") {
  520. tmp.select = common[k].value
  521. tmp.selectArr = ['抽取正确', '抽取错误']
  522. }
  523. if (common[k].key === "isrepeat") {
  524. tmp.select = common[k].value
  525. tmp.selectArr = ['是', '否']
  526. }
  527. tmp.status = common[k].status
  528. if (common[k].key === "bidamounttype") {
  529. tmp.select = common[k].value ? common[k].value : '金额'
  530. tmp.selectArr = ['金额', '折扣率', '单价']
  531. tmp.status = 1
  532. }
  533. uInput[k] = tmp
  534. }
  535. //时间地点
  536. var timeplace = {{ .T.timeplace }}
  537. var tpInput = [];
  538. for (k in timeplace) {
  539. var tmp = {}
  540. tmp.title = timeplace[k].descript
  541. tmp.input = timeplace[k].value
  542. tmp.key = timeplace[k].key
  543. tmp.status = timeplace[k].status
  544. tpInput[k] = tmp
  545. }
  546. //其他信息
  547. var other = {{ .T.other }}
  548. var otherInput = [];
  549. for (k in other) {
  550. var tmp = {}
  551. tmp.title = other[k].descript
  552. tmp.input = other[k].value
  553. tmp.key = other[k].key
  554. tmp.status = other[k].status
  555. if (other[k].key === "isppp" || other[k].key === "contract_guarantee" || other[k].key === "bid_guarantee") {
  556. tmp.select = other[k].value
  557. tmp.selectArr = ['是', '否']
  558. }
  559. otherInput[k] = tmp
  560. }
  561. //中标候选人
  562. var c_worder = {{ .T.worder }}
  563. var worder_new = {{ .T.worder_new }}
  564. var c_content = [];
  565. let i;
  566. for (k in c_worder) {
  567. var c_uInput = [];
  568. for (i in c_worder[k]) {
  569. var tmp = {}
  570. tmp.title = c_worder[k][i].descript
  571. tmp.input = c_worder[k][i].value || ''
  572. tmp.key = c_worder[k][i].key
  573. tmp.status = c_worder[k][i].status
  574. c_uInput[i] = tmp
  575. }
  576. var content = {};
  577. content.title = "候选人"
  578. content.show = true
  579. content.status = worder_new[k]["status"]
  580. content.uInput = c_uInput
  581. content.isnew = worder_new[k]["isnew"] || false
  582. content.content = []
  583. c_content[k] = content
  584. }
  585. //标的信息
  586. var purchasinglist = {{ .T.purchasinglist }}
  587. var pcl_new = {{ .T.pcl_new }}
  588. var pcl_content = [];
  589. for (k in purchasinglist) {
  590. var c_uInput = [];
  591. for (i in purchasinglist[k]) {
  592. var tmp = {}
  593. tmp.title = purchasinglist[k][i].descript
  594. tmp.input = purchasinglist[k][i].value
  595. tmp.key = purchasinglist[k][i].key
  596. tmp.status = purchasinglist[k][i].status
  597. c_uInput[i] = tmp
  598. }
  599. var content = {};
  600. content.title = "标的物"
  601. content.show = true
  602. content.status = pcl_new[k]["status"]
  603. content.uInput = c_uInput
  604. content.isnew = pcl_new[k]["isnew"] || false
  605. content.content = []
  606. pcl_content[k] = content
  607. }
  608. //采购意向
  609. var purchasinglist_1 = {{ .T.purchasinglist_1 }}
  610. var pcl_new_1 = {{ .T.pcl_new_1 }}
  611. var pcl_content_1 = [];
  612. for (k in purchasinglist_1) {
  613. let c_uInput = [];
  614. for (i in purchasinglist_1[k]) {
  615. let tmp = {}
  616. tmp.title = purchasinglist_1[k][i].descript
  617. tmp.input = purchasinglist_1[k][i].value
  618. tmp.key = purchasinglist_1[k][i].key
  619. tmp.status = purchasinglist_1[k][i].status
  620. c_uInput[i] = tmp
  621. }
  622. let content = {};
  623. content.title = "标的物"
  624. content.show = true
  625. content.status = pcl_new_1[k]["status"]
  626. content.uInput = c_uInput
  627. content.isnew = pcl_new_1[k]["isnew"] || false
  628. content.content = []
  629. pcl_content_1[k] = content
  630. }
  631. //var ispackage='{{.T.ispackage}}'
  632. //子包信息
  633. var packs = {{ .T.packs }}
  634. var packskey = {{ .T.packskey }}
  635. var pkg_new = {{ .T.pkg_new }}
  636. //分包抽查,若果有分包,默认ok
  637. //if(packs.length>0&&ispackage=="1"){
  638. // ck_package="1"
  639. //}
  640. var p_content = [];
  641. for (k in packs) {
  642. //子包基本信息
  643. var uInputs = [];
  644. var pack = packs[k]["pack"]
  645. for (i in pack) {
  646. var tmp = {}
  647. tmp.title = pack[i].descript
  648. tmp.input = pack[i].value
  649. tmp.key = pack[i].key
  650. tmp.status = pack[i].status
  651. if (pack[i].key === "bidamounttype") {
  652. tmp.select = pack[i].value ? pack[i].value : '金额'
  653. tmp.selectArr = ['金额', '折扣率', '单价']
  654. tmp.status = 1
  655. }
  656. uInputs[i] = tmp
  657. }
  658. //中标人信息
  659. var winnerall = packs[k]["winnerall"]
  660. for (i in winnerall) {
  661. var tmp = {}
  662. tmp.title = winnerall[i].descript
  663. tmp.input = winnerall[i].value
  664. tmp.key = winnerall[i].key
  665. tmp.status = winnerall[i].status
  666. uInputs.push(tmp)
  667. }
  668. var content = {};
  669. content.title = "子包";
  670. content.show = true;
  671. content.status = packs[k]["packstatus"];
  672. content.uInput = uInputs;
  673. content.isnew = pkg_new[k] || false
  674. content.num = packskey[k];
  675. p_content[k] = content;
  676. }
  677. var pclf = {{ .T.PurchasinglistField }}
  678. var pclfInput = []
  679. for (i in pclf) {
  680. for (key in pclf[i]) {
  681. var tempNode = {
  682. input: "",
  683. key: key,
  684. status: "2",
  685. title: pclf[i][key]
  686. }
  687. //if(key== "pclisover"){
  688. // tempNode.select= '是'
  689. // tempNode.selectArr=['是','否']
  690. //}
  691. pclfInput.push(tempNode)
  692. }
  693. }
  694. var pclf1 = {{ .T.PurchasinglistField1 }}
  695. const pclfInput1 = [];
  696. for (i in pclf1) {
  697. for (key in pclf1[i]) {
  698. const tempNode = {
  699. input: "",
  700. key: key,
  701. status: "2",
  702. title: pclf1[i][key]
  703. };
  704. //if(key== "pclisover"){
  705. // tempNode.select= '是'
  706. // tempNode.selectArr=['是','否']
  707. //}
  708. pclfInput1.push(tempNode)
  709. }
  710. }
  711. var wodf = {{ .T.WinnerorderField }}
  712. var wodfInput = []
  713. for (i in wodf) {
  714. for (key in wodf[i]) {
  715. wodfInput.push({
  716. input: "",
  717. key: key,
  718. status: "2",
  719. title: wodf[i][key]
  720. })
  721. }
  722. }
  723. var pf = {{ .T.PackageField }}
  724. var pfInput = []
  725. for (i in pf) {
  726. for (key in pf[i]) {
  727. var tempNode = {
  728. input: "",
  729. key: key,
  730. status: "2",
  731. title: pf[i][key]
  732. }
  733. if (key === "bidamounttype") {
  734. tempNode.select = '金额'
  735. tempNode.selectArr = ['金额', '折扣率', '单价']
  736. }
  737. pfInput.push(tempNode)
  738. }
  739. }
  740. var app = new Vue({
  741. el: '#app',
  742. delimiters: ["[[", "]]"],
  743. data: {
  744. activeLabel: '原文',
  745. nowLabel: ['原文'],
  746. otherInfo: otherInfo,
  747. moreInfo: moreInfo,
  748. scrollCache: {
  749. value: '',
  750. index: 0
  751. },
  752. textMap: ['', '', '增', '改', '删'],
  753. // pageHtml: `{{Html (Regexp (Regexp .T.info.detail "(\\n|\\\\n)\\s+" "\n") "(`|\\n|\\\\n)+" "<br/>")}}`,
  754. pageHtml: '{{ .T.info.detail }}',
  755. showPop: false,
  756. allCheckFields: allCheckFields,
  757. editData:[{
  758. title: '基本字段',
  759. show: true,
  760. status: "1",
  761. content: [{
  762. title: '',
  763. show: true,
  764. delete: false,
  765. //wstatus:"-1",
  766. uInput: uInput
  767. //content: c_content
  768. }]
  769. }, {
  770. title: '时间地点',
  771. show: false,
  772. status: "1",
  773. content: [{
  774. title: '',
  775. show: true,
  776. delete: false,
  777. //wstatus:"-1",
  778. uInput: tpInput
  779. }]
  780. }, {
  781. title: '标的信息',
  782. show: false,
  783. showCheck: true,
  784. key: 'purchasinglist',
  785. //checkType: {{.T.ck_pclisext}},
  786. checkAllTag: purchasing_all_tag,
  787. status: purchasing_status,
  788. content: pcl_content
  789. }, {
  790. title: '采购意向信息',
  791. show:false,
  792. showCheck: true,
  793. key: 'purchasinglist_1',
  794. // checkType: {{.T.ck_pkgisext}},
  795. status: purchasing_status,
  796. content: pcl_content_1
  797. }, {
  798. title: '多包信息',
  799. show:false,
  800. showCheck: true,
  801. key: 'package',
  802. // checkType: {{.T.ck_pkgisext}},
  803. status: package_status,
  804. content: p_content
  805. }, {
  806. title: '中标候选人信息',
  807. show: false,
  808. showCheck: true,
  809. key: 'winnerorder',
  810. // checkType: {{.T.ck_wodrisext}},
  811. status: winneroder_status,
  812. content: c_content
  813. }, {
  814. title: '其余信息',
  815. show:false,
  816. status:"1",
  817. content:[{
  818. title: '',
  819. show: true,
  820. delete: false,
  821. //wstatus:"-1",
  822. uInput: otherInput
  823. }]
  824. }],
  825. originData: []},
  826. watch: {
  827. //切换标签时更改正文内容
  828. 'activeLabel':
  829. function () {
  830. this.pageHtml = this.getPageInfo.html
  831. }},
  832. computed: {
  833. getPageInfo() {
  834. var tempData = {
  835. title: '',
  836. html: this.pageHtml,
  837. href: ''
  838. }
  839. //匹配原文或者原文附件
  840. var originData = pageDataMap[this.activeLabel]
  841. if (originData) {
  842. tempData.title = originData.title
  843. tempData.html = originData.html
  844. tempData.href = originData.href
  845. } else {//匹配原公告关联信息
  846. var tempS = this.activeLabel.split('-')
  847. var isFile = tempS.length === 2
  848. var otherData = this.otherInfo.filter(v => v.id == tempS[0])
  849. if (otherData.length > 0) {
  850. tempData.title = otherData[0].title
  851. tempData.html = otherData[0].detail
  852. tempData.href = otherData[0].href
  853. if (isFile) {
  854. tempData.title = '附件内容'
  855. tempData.html = otherData[0].filetext
  856. tempData.href = ''
  857. }
  858. }
  859. }
  860. return tempData
  861. }
  862. },
  863. mounted() {
  864. // 缓存原始数据
  865. this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
  866. },
  867. methods: {
  868. // 当前输入框数据与原始数据比较
  869. focusFn(uin, oIndex, tIndex, uIndex, two, one) {
  870. if (uin.key === "bidendtime" || uin.key === "bidopentime" || uin.key === "project_startdate" || uin.key === "project_completedate" ||
  871. uin.key === "publishtime" || uin.key === "signaturedate") {
  872. var val = uin.input
  873. if (val !== "") {
  874. var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
  875. var regExp = new RegExp(reg);
  876. if (!regExp.test(val)) {
  877. this.$message({
  878. message: uin.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
  879. type: 'warning',
  880. duration: 2000,
  881. offset: 300
  882. });
  883. return
  884. }
  885. }
  886. }
  887. var newNode = this.originData[oIndex].content[tIndex]
  888. if (newNode == null) {//新增子模块处理
  889. return
  890. }
  891. var oNode = newNode.uInput[uIndex]
  892. if (oNode == null) {//新增中标人信息处理
  893. return
  894. }
  895. var changeStatus = uin.input === oNode.input//多包中新增的中标信息报错
  896. if (uin.select) {
  897. changeStatus = uin.select === oNode.select
  898. }
  899. uin.status = changeStatus ? "1" : "2"
  900. this.setStatus(uin, uin.status, two, one);
  901. },
  902. openLink(link) {
  903. window.open(link, '_blank')
  904. },
  905. // 改变基本字段属性
  906. changeBaseValue(index, input, status) {
  907. if (this.editData[0].content[0].uInput[index].input !== input) {
  908. this.editData[0].content[0].uInput[index].input = input
  909. this.editData[0].content[0].uInput[index].status = status
  910. }
  911. },
  912. selectChange(uni, status, two, one) {
  913. //状态更新
  914. if (uni.status === '-1' || uni.status === '2') {
  915. status = "2"
  916. }
  917. this.setStatus(uni, status, two, one)
  918. },
  919. openHref() {
  920. // if (!issave) {
  921. // alert("请先保存数据!")
  922. // } else {
  923. if (nextid === "") {
  924. alert("当前已经是最后一条数据!")
  925. } else {
  926. window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
  927. }
  928. // }
  929. },
  930. // 检查一级是否需要改变状态
  931. checkOneStatus: function (config) {
  932. var tempObj = {
  933. obj: config.type ? config.one : config.two
  934. }
  935. if (config.type) {
  936. tempObj.list = config.one.content
  937. } else {
  938. tempObj.list = config.two.uInput
  939. }
  940. var statusList = [0, 0, 0, 0, 0]
  941. for (var i in tempObj.list) {
  942. var tempList = tempObj.list[i]
  943. var tempIndex = Number(tempList.status)
  944. if (tempIndex === -1) {
  945. tempIndex = 0
  946. }
  947. statusList[tempIndex] = Number(statusList[tempIndex]) + 1
  948. }
  949. if (statusList[1] > 0) {
  950. tempObj.obj.status = "1"
  951. }
  952. if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
  953. tempObj.obj.status = "2"
  954. }
  955. if (statusList[4] === tempObj.list.length) {
  956. tempObj.obj.status = "4"
  957. if (tempObj.obj.title === "标的信息" || tempObj.obj.title === "多包信息" || tempObj.obj.title === "中标候选人信息") {
  958. tempObj.obj.status = "2"
  959. }
  960. }
  961. if (statusList[3] === tempObj.list.length) {
  962. tempObj.obj.status = "2"
  963. }
  964. if (statusList[2] === tempObj.list.length) {
  965. tempObj.obj.status = "2"
  966. }
  967. if (statusList[0] === tempObj.list.length) {
  968. tempObj.obj.status = "-1"
  969. }
  970. if (!config.type) {
  971. this.checkOneStatus({
  972. one: config.one,
  973. two: config.two,
  974. type: true
  975. })
  976. }
  977. },
  978. //切换状态按钮
  979. setStatus:function (witch, s, two, one) {
  980. var key = witch.key
  981. //校验日期格式
  982. if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
  983. key === "publishtime" || key === "signaturedate") {
  984. var val = witch.input
  985. if (val !== "") {
  986. var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
  987. var regExp = new RegExp(reg);
  988. if (!regExp.test(val)) {
  989. this.$message({
  990. message: witch.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
  991. type: 'warning',
  992. duration: 2000,
  993. offset: 300
  994. });
  995. //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
  996. return
  997. }
  998. }
  999. }
  1000. if (s === '2' && !one && !two && witch.content.length === 0) {
  1001. return
  1002. }
  1003. witch.status = s;
  1004. if (two) {
  1005. this.checkOneStatus({
  1006. one: one,
  1007. two: two,
  1008. type: false
  1009. })
  1010. }
  1011. },
  1012. //二级删除
  1013. delNewTwo: function (one, index, two) {
  1014. //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
  1015. //two.show = false
  1016. if (two.isnew) {
  1017. one.content.splice(index, 1)
  1018. } else {
  1019. two.show = false
  1020. two.status = "4"
  1021. this.saveDataTwo(two, "4", one)
  1022. }
  1023. this.checkOneStatus({
  1024. one: one,
  1025. two: two,
  1026. type: true
  1027. })
  1028. },
  1029. /*add style*/
  1030. addStyle: function (data) {
  1031. return prettyPrint(data).replace(/(checkAllTag|checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
  1032. },
  1033. /*同步修改源码*/
  1034. changeText: function (boolean) {
  1035. try {
  1036. var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
  1037. if (boolean) {
  1038. this.tagvalues = tempText
  1039. } else {
  1040. this.editData = tempText
  1041. }
  1042. } catch (err) {
  1043. alert('源码修改失败')
  1044. }
  1045. },
  1046. goText: function (value) {
  1047. /*重置Html*/
  1048. this.pageHtml = this.getPageInfo.html
  1049. if (!value) {
  1050. return false
  1051. }
  1052. var rs = new RegExp('(' + value + ')', 'gi')
  1053. //选中input框值文本高亮
  1054. if (rs.test(this.pageHtml)) {
  1055. this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
  1056. /*延迟查询dom,防止dom未插入*/
  1057. var $this = this
  1058. setTimeout(function () {
  1059. $this.goMark(value)
  1060. }, 150)
  1061. } else {
  1062. /*重置Html*/
  1063. this.pageHtml = this.getPageInfo.html
  1064. }
  1065. },
  1066. goMark: function (value) {
  1067. var mLength = document.querySelectorAll('mark').length
  1068. if (this.scrollCache.value === value) {
  1069. this.scrollCache.index = (this.scrollCache.index + 1) % mLength
  1070. } else {
  1071. this.scrollCache.index = 0
  1072. }
  1073. this.scrollCache.value = value
  1074. /*滚动到第一个mark*/
  1075. var temp = document.querySelectorAll('mark')[this.scrollCache.index]
  1076. $("mark").removeClass('focus')
  1077. $(temp).addClass('focus')
  1078. document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
  1079. },
  1080. // markTag:function(n){
  1081. // $.ajax({
  1082. // url:"/markTag",
  1083. // method:"post",
  1084. // data: {tag:n,_id:_id},
  1085. // success:function(res){
  1086. // if(res){
  1087. // document.getElementById("com-alert-val").innerHtml="标记成功";
  1088. // var label1 = document.getElementById("com-alert");
  1089. // label1.style.display="block";
  1090. // setTimeout(function(){label1.style.display="none";},1000)
  1091. // }
  1092. // }
  1093. // });
  1094. // },
  1095. addChild: function (one, oindex) {
  1096. var tempNode = {}
  1097. switch (one.title) {
  1098. case "标的信息": {
  1099. tempNode = {
  1100. //content: [],
  1101. show: true,
  1102. isnew: true,
  1103. status: "2",
  1104. title: "标的物",
  1105. uInput: JSON.parse(JSON.stringify(pclfInput))
  1106. }
  1107. break
  1108. }
  1109. case "采购意向信息": {
  1110. tempNode = {
  1111. //content: [],
  1112. show: true,
  1113. isnew: true,
  1114. status: "2",
  1115. title: "标的物",
  1116. uInput: JSON.parse(JSON.stringify(pclfInput1))
  1117. }
  1118. break
  1119. }
  1120. case "多包信息": {
  1121. tempNode = {
  1122. //content: [],
  1123. show: true,
  1124. status: "2",
  1125. isnew: true,
  1126. title: "子包",
  1127. uInput: JSON.parse(JSON.stringify(pfInput))
  1128. }
  1129. break
  1130. }
  1131. case "中标候选人信息": {
  1132. tempNode = {
  1133. //content: [],
  1134. show: true,
  1135. status: "2",
  1136. isnew: true,
  1137. title: "候选人",
  1138. uInput: JSON.parse(JSON.stringify(wodfInput))
  1139. }
  1140. break
  1141. }
  1142. }
  1143. // if (one.status >= "2") {
  1144. // one.status = '2'
  1145. // }
  1146. one.content.push(tempNode)
  1147. this.checkOneStatus({
  1148. one: one,
  1149. type: true
  1150. })
  1151. this.$nextTick(() => {
  1152. var tempN = $(".edit.one").eq(oindex).find(".edit-title")
  1153. var goTop = tempN.eq(tempN.length - 1).offset().top
  1154. setTimeout(() => {
  1155. $(".operation").scrollTop($(".operation").scrollTop() + goTop)
  1156. }, 150)
  1157. })
  1158. },
  1159. // 新增子包中标信息字段
  1160. addThreeChild:function (two, n, one) {
  1161. two.uInput.push({
  1162. input: "",
  1163. key: 'winner',
  1164. status: "2",
  1165. title: '标段(包)中标单位'
  1166. })
  1167. two.uInput.push({
  1168. input: "",
  1169. key: 'bidamount',
  1170. status: "2",
  1171. title: '标段(包)中标金额'
  1172. })
  1173. two.status = "2"
  1174. this.checkOneStatus({
  1175. one: one,
  1176. two: two,
  1177. type: false
  1178. })
  1179. },
  1180. //保存
  1181. saveDataTwo:function (two, n, one) {
  1182. two.uInput.forEach(function (v) {
  1183. var key = v.key
  1184. if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
  1185. key === "publishtime" || key === "signaturedate") {
  1186. var val = v.input
  1187. if (val !== "") {
  1188. var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
  1189. var regExp = new RegExp(reg);
  1190. if (!regExp.test(val)) {
  1191. this.$message({
  1192. message: v.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
  1193. type: 'warning',
  1194. duration: 2000,
  1195. offset: 300
  1196. });
  1197. //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
  1198. return
  1199. }
  1200. }
  1201. }
  1202. if (n === "1" && v.status === "-1") {
  1203. v.status = n
  1204. } else if (n === "-1") {
  1205. v.status = n
  1206. } else if (n === "2") {
  1207. v.status = n
  1208. } else if (n === "4") {
  1209. v.status = n
  1210. }
  1211. });
  1212. two.status = n
  1213. this.checkOneStatus({
  1214. one: one,
  1215. two: two,
  1216. type: false
  1217. })
  1218. /**
  1219. two.content.forEach(function(v) {
  1220. v.uInput.forEach(function(value) {
  1221. if (value.input && value.input != '') {
  1222. value.status = n
  1223. }
  1224. })
  1225. })
  1226. */
  1227. },
  1228. saveDataOne:function (one, n) {
  1229. //保存后的样式
  1230. var _this = this
  1231. one.content.forEach(function (v) {
  1232. v.uInput.forEach(function (value) {
  1233. var key = value.key
  1234. if (n === "1") {
  1235. if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
  1236. key === "publishtime" || key === "signaturedate") {
  1237. var val = value.input
  1238. if (val !== "") {
  1239. var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
  1240. var regExp = new RegExp(reg);
  1241. if (!regExp.test(val)) {
  1242. this.$message({
  1243. message: value.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
  1244. type: 'warning',
  1245. duration: 2000,
  1246. offset: 300
  1247. });
  1248. //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
  1249. return
  1250. }
  1251. }
  1252. }
  1253. }
  1254. // 取消全部,通过时判断状态是否处于修改新增等
  1255. if (n === "1" && value.status === "-1") {
  1256. value.status = n
  1257. } else if (n === "-1") {
  1258. value.status = n
  1259. }
  1260. })
  1261. _this.checkOneStatus({
  1262. two: v,
  1263. one: one,
  1264. type: false
  1265. })
  1266. });
  1267. },
  1268. //验证保存提示
  1269. open:function (stype) {
  1270. var noTagKey = [];
  1271. console.log(allCheckFields)
  1272. this.editData.filter(function (one) {
  1273. if (one.title === "标的信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
  1274. if (allCheckFields[one.key] && one.status === "-1") {
  1275. noTagKey.push(one.title);
  1276. }
  1277. } else {
  1278. one.content.filter(function (v) {
  1279. v.uInput.filter(function (u) {
  1280. if (allCheckFields[u.key] && u.status === "-1") {
  1281. noTagKey.push(u.title);
  1282. }
  1283. })
  1284. })
  1285. }
  1286. })
  1287. if (noTagKey.length > 0) {
  1288. var fieldText = noTagKey.join(",");
  1289. fieldText = fieldText.replace(/\([^\)]*\)/g, "");
  1290. this.$alert("未标注字段:" + fieldText);
  1291. return
  1292. }
  1293. var resultStatus = false
  1294. if (stype === 1) {//全部字段验证
  1295. var checkAllKey = this.editData.filter(function (one) {
  1296. var otherOne = one.content.filter(function (v) {
  1297. return v.uInput.filter(function (u) {
  1298. return u.status === '-1'
  1299. }).length
  1300. })
  1301. if ((one.title === "标的信息" || one.title === "多包信息" || one.title === "中标候选人信息") && (one.status === "-1")) {
  1302. return true
  1303. } else {
  1304. return otherOne.length
  1305. }
  1306. })
  1307. resultStatus = !Boolean(checkAllKey.length)
  1308. } else {//部分字段验证
  1309. var otherTag = 0 //标注状态 0:没标 1:标注成功 2:标注失败
  1310. var baseTag = 0
  1311. this.editData.filter(function (one) {
  1312. //多包信息、中标候选人信息在为标注失败的前提下检测标注状态,一个失败不能保存
  1313. if (otherTag < 2) {
  1314. if (one.title === "标的信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
  1315. if (one.status === "-1") {//没标
  1316. if (otherTag !== 1) {//前一个标注成功不用记录后一个是否未标
  1317. otherTag = 0
  1318. }
  1319. } else {
  1320. if (one.content.length === 0) {//不含子包
  1321. if (one.status === '2') {
  1322. otherTag = 2 //失败
  1323. } else {
  1324. otherTag = 1 //成功
  1325. }
  1326. } else {//含子包
  1327. if (one.title === "标的信息") {
  1328. var otherOne = one.content.filter(function (v) {
  1329. if (v.status >= 1) {//子信息标注
  1330. var twoLength = v.uInput.filter(function (u) {
  1331. return u.status === '-1'
  1332. })
  1333. if (twoLength.length > 0) {
  1334. otherTag = 2
  1335. }
  1336. return true //返回此条信息被标注
  1337. }
  1338. })
  1339. if (otherTag !== 2) {
  1340. if (otherOne.length > 0) {//
  1341. otherTag = 1
  1342. } else {
  1343. otherTag = 2
  1344. }
  1345. }
  1346. } else {
  1347. var otherOne = one.content.filter(function (v) {
  1348. return v.uInput.filter(function (u) {
  1349. return u.status === '-1'
  1350. }).length
  1351. })
  1352. if (otherOne.length > 0) {//
  1353. otherTag = 2
  1354. } else {
  1355. otherTag = 1
  1356. }
  1357. }
  1358. }
  1359. }
  1360. } else {
  1361. var baseOne = one.content.filter(function (v) {
  1362. return v.uInput.filter(function (u) {
  1363. return u.status !== '-1'
  1364. }).length
  1365. })
  1366. if (baseOne.length > 0) {//基本字段
  1367. baseTag = 1
  1368. }
  1369. }
  1370. }
  1371. })
  1372. if (otherTag === 0 && baseTag === 1) {
  1373. resultStatus = true
  1374. } else if (otherTag === 1) {
  1375. resultStatus = true
  1376. }
  1377. }
  1378. if (!resultStatus) {
  1379. this.$alert("未标注完成");
  1380. return
  1381. }
  1382. // var d = JSON.stringify(this.editData);
  1383. // var _this = this
  1384. // if (JSON.stringify(this.originData) === d) {
  1385. // this.$alert("未做任何修改");
  1386. // return;
  1387. // }
  1388. this.$confirm('是否保存?', '提示', {
  1389. confirmButtonText: '确定',
  1390. cancelButtonText: '取消',
  1391. type: 'warning'
  1392. }).then(() => {
  1393. this.upChange(stype)
  1394. }).catch(() => {
  1395. });
  1396. },
  1397. //保存事件
  1398. upChange: function (stype) {
  1399. var d = JSON.stringify(this.editData);
  1400. console.log(this.editData)
  1401. let remark = $('#remark').val()
  1402. var _this = this
  1403. if (tid === "") {
  1404. $.ajax({
  1405. url: "/front/data/jyuser/mark",
  1406. method: "post",
  1407. data: {"data": d, "s_infoid": _id, "pid": pid, "s_sourceinfo": coll, "remark": remark},
  1408. success: function (res) {
  1409. if (res) {
  1410. _this.$message({
  1411. message: '保存成功',
  1412. type: 'success',
  1413. duration: 1000,
  1414. offset: 300
  1415. });
  1416. issave = true//保存成功
  1417. }
  1418. },
  1419. error: function (err) {
  1420. alert(err);
  1421. }
  1422. });
  1423. }else {
  1424. $.ajax({
  1425. url: "/front/data/user/mark",
  1426. method: "post",
  1427. data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "remark": remark},
  1428. success: function (res) {
  1429. if (res) {
  1430. _this.$message({
  1431. message: '保存成功',
  1432. type: 'success',
  1433. duration: 1000,
  1434. offset: 300
  1435. });
  1436. issave = true//保存成功
  1437. }
  1438. },
  1439. error: function (err) {
  1440. alert(err);
  1441. }
  1442. });
  1443. }
  1444. }
  1445. //保存提示
  1446. // open:function(one, type) {
  1447. // this.$confirm('是否保存?', '提示', {
  1448. // confirmButtonText: '确定',
  1449. // cancelButtonText: '取消',
  1450. // type: 'warning'
  1451. // }).then(() => {
  1452. // if (type) {
  1453. // this.saveOneData(one)
  1454. // } else {
  1455. // this.upChange()
  1456. // }
  1457. // }).catch(() => {
  1458. // });
  1459. // },
  1460. //一级保存
  1461. // saveOneData: function (one) {
  1462. // if (one.title==="标的信息"||one.title==="多包信息"||one.title==="中标候选人信息"){
  1463. // if(one.status === "-1"){
  1464. // this.$alert(one.title+" 未标注完成")
  1465. // return
  1466. // }else if (one.status !=="-1"){
  1467. // var isAlert = one.content.filter(function(v) {
  1468. // return v.uInput.filter(function (u) {
  1469. // return u.status === '-1'
  1470. // }).length
  1471. // })
  1472. // if (isAlert.length) {
  1473. // this.$alert(one.title+" 未标注完成")
  1474. // return
  1475. // }
  1476. // }
  1477. // }
  1478. // onetext = "["+ JSON.stringify(one) +"]";
  1479. // $.ajax({
  1480. // url:"/center/biaozhu",
  1481. // method:"post",
  1482. // data: {key:onetext,_id:_id},
  1483. // success:function(res){
  1484. // if(res){
  1485. // document.getElementById("com-alert-val").innerHtml="保存成功";
  1486. // var label1 = document.getElementById("com-alert");
  1487. // label1.style.display="block";
  1488. // setTimeout(function(){
  1489. // label1.style.display="none";
  1490. // },
  1491. // 1000)
  1492. // }
  1493. // },
  1494. // error:function(err){
  1495. // alert(err);
  1496. // }
  1497. // });
  1498. // },
  1499. }
  1500. })
  1501. function offset(elem) {
  1502. if (!elem) elem = this;
  1503. var x = elem.offsetLeft;
  1504. var y = elem.offsetTop;
  1505. while (elem === elem.offsetParent) {
  1506. x += elem.offsetLeft;
  1507. y += elem.offsetTop;
  1508. }
  1509. return {left: x, top: y};
  1510. }
  1511. </script>
  1512. </html>