tree.vue 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834
  1. <template>
  2. <div style="height: 100%;">
  3. <basic-container v-show="showType == 1" >
  4. <el-row class="titlerow">
  5. <el-col >
  6. <div style="position:relative" >
  7. <span style="float: left; margin-top: 15px;color: white;">{{projectName }}</span>
  8. <!-- 同步按钮 -->
  9. <el-button
  10. size="medium"
  11. icon="el-icon-arrow-down"
  12. style="margin-right:10px"
  13. @click="showSyncbtn"
  14. v-show="!isshowSyncbtn"
  15. >数据同步</el-button >
  16. <el-button
  17. size="medium"
  18. icon="el-icon-arrow-up"
  19. style="margin-right:10px"
  20. @click="showSyncbtn"
  21. v-show="isshowSyncbtn"
  22. >数据同步</el-button >
  23. <!-- <el-select v-model="menuvalue" placeholder="数据同步" class="selectBtn" v-if="isshowSyncbtn">
  24. <el-option
  25. v-for="item in menuoptions"
  26. :key="item.value"
  27. :label="item.label"
  28. :value="item.value">
  29. <span style="float: left">{{ item.label }}</span>
  30. </el-option>
  31. </el-select> -->
  32. <ul
  33. v-show="isshowSyncbtn"
  34. class="contextmenu selectBtn"
  35. >
  36. <li v-for="item in menuoptions" :key="item" @click="menuClick($event,item,data)" v-loading="item.load">
  37. {{item.label}}
  38. </li>
  39. </ul>
  40. <el-button
  41. size="medium"
  42. icon="el-icon-s-grid"
  43. @click="eleFormulaHandle"
  44. v-if="leftType == 5"
  45. >表单设置</el-button
  46. >
  47. <el-button
  48. size="medium"
  49. icon="el-icon-s-grid"
  50. @click="eleHandle"
  51. v-else
  52. >元素设置</el-button
  53. >
  54. <!-- <el-button
  55. class="el-btn-purple"
  56. type="primary"
  57. size="medium"
  58. icon="el-icon-upload"
  59. :loading="syncBtnLoad"
  60. @click="syncInfoHandle"
  61. >同步节点参数</el-button
  62. > -->
  63. <el-button
  64. size="medium"
  65. icon="el-icon-help"
  66. @click="nodeInfoHandle"
  67. >节点参数设置</el-button
  68. >
  69. <el-button
  70. style="margin-top:10px"
  71. size="medium"
  72. icon="el-icon-price-tag"
  73. @click="independent"
  74. >独立表单库</el-button
  75. >
  76. <el-button
  77. style="margin-top:10px"
  78. size="medium"
  79. icon="el-icon-time"
  80. @click="archiveTimeClick"
  81. >归档文件时间设置</el-button
  82. >
  83. <!-- <el-button
  84. :loading="syncElectricLoad"
  85. style="margin-top:10px"
  86. class="el-btn-purple"
  87. type="primary"
  88. size="medium"
  89. icon="el-icon-upload"
  90. @click="syncElectric"
  91. >同步电签默认信息</el-button
  92. > -->
  93. </div>
  94. </el-col>
  95. </el-row>
  96. <el-row :gutter="20" class="h-100p" style="padding:10px">
  97. <el-col :span="10" class="h-100p">
  98. <div class="h-100p flex flex-d-c">
  99. <p style="margin-top:2px">工程节点信息</p>
  100. <div class="flex">
  101. <el-input
  102. placeholder="输入关键字进行过滤"
  103. v-model="filterText"
  104. @input="filterChange"
  105. clearable
  106. ></el-input>
  107. <!-- <el-button type="info" class="mg-l-20">导入划分</el-button> -->
  108. </div>
  109. <div class="flex1 ov-hidden">
  110. <el-scrollbar class="h-100p">
  111. <div v-loading="treeLoad">
  112. <el-tree
  113. v-show="!filterText"
  114. class="filter-tree"
  115. lazy
  116. :data="treeData"
  117. :load="loadNode"
  118. @node-click="getNodeDetail"
  119. :props="defaultProps"
  120. :expand-on-click-node="false"
  121. highlight-current
  122. node-key="id"
  123. ref="tree"
  124. :default-expanded-keys="defaultExpandedKeys"
  125. >
  126. <span
  127. class="custom-tree-node "
  128. :class="data.moreShow ? 'show' : ''"
  129. slot-scope="{ node, data }"
  130. @mouseleave="mouseout(data)"
  131. >
  132. <div class="pd-r-20 " >
  133. {{ node.label }}
  134. <div class="normal-black ">
  135. <div >
  136. <el-link :underline="false">
  137. <i
  138. class="el-icon-menu "
  139. @click="showMenu($event,data, node)"
  140. v-if="node.level != 1"
  141. ></i>
  142. </el-link>
  143. <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
  144. <ul
  145. v-show="menuvisible"
  146. :style="{ left: menuleft + 'px', top: menutop + 'px' }"
  147. class="contextmenu"
  148. >
  149. <li v-for="item in menusData" :key="item" @click="menuClick($event,item,data)">
  150. <i :class="item.icon"></i>
  151. <el-tooltip class="item" effect="light" :content="item.content" placement="right-start">
  152. <span>{{item.label}}</span>
  153. </el-tooltip>
  154. </li>
  155. </ul>
  156. </div>
  157. </div>
  158. </div>
  159. </span>
  160. </el-tree>
  161. <el-tree
  162. v-show="filterText"
  163. class="filter-tree"
  164. :data="treeData"
  165. @node-click="getNodeDetail"
  166. :props="defaultProps"
  167. :expand-on-click-node="false"
  168. highlight-current
  169. node-key="id"
  170. :filter-node-method="filterNode"
  171. ref="treeall"
  172. >
  173. <span
  174. class="custom-tree-node "
  175. :class="data.moreShow ? 'show' : ''"
  176. slot-scope="{ node, data }"
  177. @mouseleave="mouseout(data)"
  178. >
  179. <div class="pd-r-20 " >
  180. {{ node.label }}
  181. <div class="normal-black ">
  182. <div >
  183. <el-link :underline="false">
  184. <i
  185. class="el-icon-menu "
  186. @click="showMenu($event,data, node)"
  187. v-if="node.level != 1"
  188. ></i>
  189. </el-link>
  190. <!-- 因右键自定义菜单事件需要获取当前点击的位置,所以此处绑定动态样式来控制菜单实时跟踪鼠标右键点击位置 -->
  191. <ul
  192. v-show="menuvisible"
  193. :style="{ left: menuleft + 'px', top: menutop + 'px' }"
  194. class="contextmenu"
  195. >
  196. <li v-for="item in menusData" :key="item" @click="menuClick($event,item,data)">
  197. <i :class="item.icon"></i>{{item.label}}
  198. </li>
  199. </ul>
  200. </div>
  201. </div>
  202. </div>
  203. </span>
  204. </el-tree>
  205. </div>
  206. </el-scrollbar>
  207. </div>
  208. </div>
  209. </el-col>
  210. <el-col :span="14" class="h-100p flex flex-d-c">
  211. <template v-if="leftType == 5">
  212. <div class="mg-b-10">节点信息</div>
  213. <div>
  214. <el-table :data="tableData" border style="width: 100%">
  215. <el-table-column
  216. align="center"
  217. prop="nodeName"
  218. label="当前节点"
  219. ></el-table-column>
  220. <el-table-column
  221. align="center"
  222. prop="nodeType"
  223. :formatter="formatCat"
  224. label="节点类型"
  225. width="180"
  226. ></el-table-column>
  227. <el-table-column
  228. align="center"
  229. prop="parentName"
  230. label="上级节点"
  231. ></el-table-column>
  232. </el-table>
  233. </div>
  234. <div class="flex jc-sb">
  235. <p>
  236. <span>当前项目信息表</span>
  237. <!-- <el-button
  238. @click="showFormElement"
  239. type="text"
  240. icon="el-icon-circle-plus-outline"
  241. class="text-icon mg-l-10"
  242. ></el-button>
  243. <el-button
  244. type="text"
  245. icon="el-icon-document-copy"
  246. class="text-icon"
  247. ></el-button> -->
  248. <el-button
  249. type="text"
  250. style="margin-left: 10px"
  251. icon="el-icon-edit-outline"
  252. class="text-icon"
  253. @click="editEditElementForm()"
  254. ></el-button>
  255. <el-button
  256. type="text"
  257. icon="el-icon-sort"
  258. class="text-icon"
  259. @click="privateTableSort()"
  260. ></el-button>
  261. </p>
  262. <div class="mg-t-10"></div>
  263. </div>
  264. <div style="flex: 1; position: relative">
  265. <el-table
  266. :data="formData"
  267. border
  268. height="100%"
  269. style="width: 100%; position: absolute"
  270. >
  271. <el-table-column
  272. align="center"
  273. prop="tableName"
  274. label="表单名称"
  275. ></el-table-column>
  276. <el-table-column
  277. align="center"
  278. prop="elementTotal"
  279. width="80"
  280. label="字段总量"
  281. ></el-table-column>
  282. <el-table-column
  283. align="center"
  284. prop="fillRate"
  285. width="100"
  286. label="填报率"
  287. ></el-table-column>
  288. <el-table-column
  289. align="center"
  290. prop="tableType"
  291. :formatter="formatTableType"
  292. width="100"
  293. label="表单类型"
  294. ></el-table-column>
  295. <el-table-column
  296. align="center"
  297. prop="tableOwner"
  298. :formatter="formatOwner"
  299. label="所属方"
  300. ></el-table-column>
  301. <el-table-column label="操作" width="240">
  302. <template slot-scope="scope">
  303. <el-button
  304. size="mini"
  305. @click="handleEdit(scope.$index, scope.row)"
  306. >预览</el-button
  307. >
  308. <el-button
  309. size="mini"
  310. type="primary"
  311. v-throttle="3000"
  312. v-show="scope.row.status == 0"
  313. @click="hideMD(scope.row)"
  314. >取消隐藏</el-button
  315. >
  316. <el-button
  317. size="mini"
  318. type="primary"
  319. v-throttle="3000"
  320. v-show="scope.row.status == 1"
  321. @click="hideMD(scope.row)"
  322. >隐藏表单</el-button
  323. >
  324. <el-button
  325. size="mini"
  326. type="danger"
  327. @click="handleDelete(scope.$index, scope.row)"
  328. >删除</el-button
  329. >
  330. </template>
  331. </el-table-column>
  332. </el-table>
  333. </div>
  334. </template>
  335. <template v-if="leftType == 4">
  336. <div style="flex: 1; position: relative">
  337. <el-table
  338. :data="formData"
  339. border
  340. height="100%"
  341. style="width: 100%; position: absolute"
  342. >
  343. <el-table-column
  344. align="center"
  345. prop="tableName"
  346. label="表单名称"
  347. ></el-table-column>
  348. <el-table-column
  349. align="center"
  350. prop="tableType"
  351. :formatter="formatTableType"
  352. label="表单类型"
  353. ></el-table-column>
  354. <el-table-column
  355. align="center"
  356. prop="fillRate"
  357. label="填报率"
  358. ></el-table-column>
  359. <el-table-column
  360. label="是否关联清表"
  361. prop="isLinkTable"
  362. align="center"
  363. >
  364. <template slot-scope="scope">
  365. <span v-if="scope.row.isLinkTable == 2">是</span>
  366. <span v-else>否</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column
  370. align="center"
  371. prop="tableOwner"
  372. :formatter="formatOwner"
  373. label="所属方"
  374. ></el-table-column>
  375. <el-table-column label="操作" width="450" align="center">
  376. <template slot-scope="scope">
  377. <el-link type="primary" @click="Associationlist(scope)"
  378. >关联清表</el-link
  379. >
  380. <el-link
  381. class="mg-l-10"
  382. type="primary"
  383. :disabled="scope.row.excelId == -1||scope.row.excelId == null"
  384. @click="
  385. rightClick(
  386. scope.row.pkeyId,
  387. scope.row.excelId,
  388. scope.row.id,
  389. scope.row.initTableName,
  390. scope.row.initTableId
  391. )
  392. "
  393. >编辑元素</el-link
  394. >
  395. <el-link
  396. class="mg-l-10"
  397. type="primary"
  398. :disabled="scope.row.excelId == -1||scope.row.excelId == null"
  399. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  400. >调整表单</el-link
  401. >
  402. <el-link
  403. class="mg-l-10"
  404. type="primary"
  405. @click="handleEditFormula(scope.$index, scope.row)"
  406. >编辑元素公式.</el-link
  407. >
  408. <el-button
  409. class="mg-l-10"
  410. type="text"
  411. :loading="handlesyncLoad"
  412. @click="handlesync(scope.$index, scope.row)"
  413. >表单同步</el-button>
  414. <el-link
  415. class="mg-l-10"
  416. type="danger"
  417. @click="handleDelete(scope.$index, scope.row)"
  418. >删除表单</el-link
  419. >
  420. </template>
  421. </el-table-column>
  422. </el-table>
  423. </div>
  424. </template>
  425. </el-col>
  426. </el-row>
  427. </basic-container>
  428. <el-row class="h-100p" v-show="showType == 2">
  429. <el-col :span="6" class="h-100p">
  430. <basic-container>
  431. <el-scrollbar class="h-100p">
  432. <el-tree
  433. class="filter-tree"
  434. lazy
  435. :data="typeTreeData"
  436. :load="typeTreeLoadNode"
  437. @node-click="getTypeTreeDetail"
  438. :props="defaultProps"
  439. :expand-on-click-node="false"
  440. highlight-current
  441. node-key="id"
  442. >
  443. </el-tree>
  444. </el-scrollbar>
  445. </basic-container>
  446. </el-col>
  447. <el-col :span="18" class="h-100p">
  448. <basic-container>
  449. <div class="flex h-100p flex-d-c">
  450. <div style="flex: 1; position: relative">
  451. <el-table
  452. :data="formData"
  453. border
  454. height="100%"
  455. style="width: 100%; position: absolute"
  456. >
  457. <el-table-column
  458. align="center"
  459. prop="tableName"
  460. label="表单名称"
  461. ></el-table-column>
  462. <el-table-column
  463. align="center"
  464. prop="tableType"
  465. :formatter="formatTableType"
  466. label="表单类型"
  467. ></el-table-column>
  468. <el-table-column
  469. align="center"
  470. prop="fillRate"
  471. label="填报率"
  472. ></el-table-column>
  473. <el-table-column
  474. label="是否关联清表"
  475. prop="isLinkTable"
  476. align="center"
  477. >
  478. <template slot-scope="scope">
  479. <span v-if="scope.row.isLinkTable == 2">是</span>
  480. <span v-else>否</span>
  481. </template>
  482. </el-table-column>
  483. <el-table-column
  484. align="center"
  485. prop="tableOwner"
  486. :formatter="formatOwner"
  487. label="所属方"
  488. ></el-table-column>
  489. <el-table-column label="操作" align="center">
  490. <template slot-scope="scope">
  491. <el-link type="primary" @click="Associationlist(scope)"
  492. >关联清表</el-link
  493. >
  494. <el-link
  495. class="mg-l-10"
  496. type="primary"
  497. :disabled="scope.row.excelId == -1||scope.row.excelId == null"
  498. @click="
  499. rightClick(
  500. scope.row.pkeyId,
  501. scope.row.excelId,
  502. scope.row.id,
  503. scope.row.initTableName,
  504. scope.row.initTableId
  505. )
  506. "
  507. >编辑元素</el-link
  508. >
  509. <el-link
  510. class="mg-l-10"
  511. type="primary"
  512. :disabled="scope.row.excelId == -1||scope.row.excelId == null"
  513. @click="adjustExcel(scope.row.pkeyId, scope.row.excelId)"
  514. >调整表单</el-link
  515. >
  516. <el-link
  517. class="mg-l-10"
  518. type="primary"
  519. @click="handleEditFormula(scope.$index, scope.row)"
  520. >编辑元素公式</el-link
  521. >
  522. <el-link
  523. class="mg-l-10"
  524. type="danger"
  525. @click="handleDelete(scope.$index, scope.row)"
  526. >删除表单</el-link
  527. >
  528. </template>
  529. </el-table-column>
  530. </el-table>
  531. </div>
  532. <div class="mg-t-10 flex jc-sb">
  533. <div></div>
  534. <el-button size="medium" @click="showType = 1"
  535. >返回WBS树</el-button
  536. >
  537. </div>
  538. </div>
  539. </basic-container>
  540. </el-col>
  541. </el-row>
  542. <!-- 编辑元素表单信息 -->
  543. <el-dialog
  544. title="编辑元素表单信息"
  545. :visible.sync="editElementFormTag"
  546. width="60%"
  547. :modal-append-to-body="false"
  548. >
  549. <div>
  550. <el-table :data="formDatass" border style="width: 100%">
  551. <el-table-column prop="tableName" label="表名">
  552. <template slot-scope="scope">
  553. <el-input
  554. v-model="scope.row.tableName"
  555. placeholder="请输入表名称"
  556. ></el-input>
  557. </template>
  558. </el-table-column>
  559. <el-table-column prop="tableType" label="表类型">
  560. <template slot-scope="scope">
  561. <el-select v-model="scope.row.tableType" placeholder="请选择">
  562. <el-option
  563. v-for="(item, key) in tableTypelist"
  564. :key="key"
  565. :label="item.dictValue"
  566. :value="item.dictKey"
  567. >
  568. </el-option>
  569. </el-select>
  570. </template>
  571. </el-table-column>
  572. <el-table-column prop="tableOwner" label="所属方">
  573. <template slot-scope="scope">
  574. <el-select v-model="scope.row.tableOwner" placeholder="请选择">
  575. <el-option
  576. v-for="(item, key) in ownerTypeList"
  577. :key="key"
  578. :label="item.dictValue"
  579. :value="item.dictKey"
  580. >
  581. </el-option>
  582. </el-select>
  583. </template>
  584. </el-table-column>
  585. <el-table-column prop="fillRate" label="填报率">
  586. <template slot-scope="scope">
  587. <el-input
  588. v-model="scope.row.fillRate"
  589. placeholder="请输入填报率"
  590. ></el-input>
  591. </template>
  592. </el-table-column>
  593. </el-table>
  594. </div>
  595. <span slot="footer" class="dialog-footer">
  596. <el-button @click="editElementFormTag = false">取 消</el-button>
  597. <el-button type="primary" @click="editeditElementFormMF()" :loading="editeditElementFormMFLoading"
  598. >确 定</el-button
  599. >
  600. </span>
  601. </el-dialog>
  602. <!-- 调整表单模板 -->
  603. <div v-if="excelHtml" class="excelHtml">
  604. <dynamicExcel
  605. @remove="removeExcel"
  606. v-if="excelHtml"
  607. :pkeyId="GLExcelFrom.id"
  608. />
  609. </div>
  610. <!-- 私有wbs树排序弹框 -->
  611. <!-- <el-dialog
  612. title="调整排序"
  613. :visible.sync="sortTag"
  614. width="50%"
  615. append-to-body
  616. >
  617. <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
  618. <span slot="footer" class="dialog-footer">
  619. <el-button @click="(sortTag = false), (sortTag2 = false)"
  620. >取 消</el-button
  621. >
  622. <el-button type="primary" @click="editSort()">确 定</el-button>
  623. </span>
  624. </el-dialog> -->
  625. <el-dialog
  626. title="调整排序"
  627. :visible.sync="sortTag"
  628. width="50%"
  629. append-to-body
  630. >
  631. <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
  632. <span slot="footer" class="dialog-footer">
  633. <el-button @click="(sortTag = false), (sortTag2 = false)"
  634. >取 消</el-button
  635. >
  636. <el-button type="primary" @click="editSort()" v-loading="sureSortload">确 定</el-button>
  637. </span>
  638. </el-dialog>
  639. <!-- 元素表排序 -->
  640. <el-dialog
  641. title="调整排序"
  642. :visible="excelSortTag"
  643. width="50%"
  644. append-to-body
  645. >
  646. <ManualSorting
  647. v-if="excelSortTag2"
  648. @bianhua="bianhua2()"
  649. :sort="tableSortList"
  650. />
  651. <span slot="footer" class="dialog-footer">
  652. <el-button @click="excelSortTag = false">取 消</el-button>
  653. <el-button type="primary" @click="editPrivateSort()" v-loading="surePrivateSortload">确 定</el-button>
  654. </span>
  655. </el-dialog>
  656. <!-- 关联清表 -->
  657. <el-dialog
  658. title="关联清表"
  659. class="excelBox"
  660. :visible.sync="GLExcel"
  661. width="500px"
  662. modal-append-to-body
  663. append-to-body
  664. @close="GLExcelMD"
  665. >
  666. <div>
  667. <el-select
  668. style="width: 400px"
  669. v-model="GLExcelFrom.name"
  670. placeholder="请选择"
  671. @change="changetherr()"
  672. >
  673. <el-option
  674. v-for="(item, key) in GLExcelData"
  675. :key="key"
  676. :label="item.name"
  677. :value="item.id"
  678. >
  679. </el-option>
  680. </el-select>
  681. <el-scrollbar style="margin-top: 20px; height: 50vh">
  682. <el-input
  683. style="width: 400px"
  684. v-model.trim="GLExcelFrom.search"
  685. placeholder="请输入需要选择的内容"
  686. ></el-input>
  687. <el-tree
  688. :filter-node-method="filterNode222"
  689. ref="tree"
  690. class="filter-tree"
  691. style="margin-top: 10px"
  692. :props="GLExcelProps"
  693. :data="exceldata"
  694. node-key="id"
  695. accordion
  696. show-checkbox
  697. @check="checkchange"
  698. v-loading="GLExcelLoading"
  699. >
  700. </el-tree>
  701. </el-scrollbar>
  702. </div>
  703. <span
  704. slot="footer"
  705. class="dialog-footer"
  706. style="display: flex; justify-content: center; align-items: center"
  707. >
  708. <el-button @click="GLExcelMD()">取 消</el-button>
  709. <el-button
  710. style="margin-left: 30px"
  711. type="primary"
  712. v-throttle="2000"
  713. @click="saveLinkTab()"
  714. >确 定</el-button
  715. >
  716. </span>
  717. </el-dialog>
  718. <!-- 节点详情 -->
  719. <el-dialog
  720. :title="dialogTitle"
  721. :visible.sync="dialogVisible"
  722. width="50%"
  723. append-to-body
  724. :close-on-click-modal="false"
  725. @closed="saveNodeLoading = false"
  726. >
  727. <el-form
  728. ref="nodeDetail"
  729. :model="nodeDetail"
  730. :rules="rules"
  731. label-width="140px"
  732. >
  733. <el-form-item label="节点名称" prop="nodeName">
  734. <div class="flex">
  735. <el-input v-model="nodeDetail.nodeName"></el-input>
  736. <el-button class="mg-l-10" type="primary" @click="aliasShow"
  737. >添加别名</el-button
  738. >
  739. </div>
  740. </el-form-item>
  741. <el-form-item label="上级节点">
  742. <el-input v-model="nodeDetail.parentName" disabled></el-input>
  743. </el-form-item>
  744. <el-form-item label="节点类型" prop="nodeType">
  745. <el-select
  746. v-model="nodeDetail.nodeType"
  747. placeholder="请选择"
  748. class="w-100p"
  749. @change="nodeTypeChange"
  750. >
  751. <el-option
  752. v-for="item in nodeTypelist"
  753. :key="item.id"
  754. :label="item.dictValue"
  755. :value="item.dictKey"
  756. ></el-option>
  757. </el-select>
  758. </el-form-item>
  759. <el-form-item label="划分编号" v-if="wbsType !== 2&&wbsType !== 5">
  760. <el-input v-model="nodeDetail.partitionCode"></el-input>
  761. </el-form-item>
  762. <el-form-item label="唯一编码" v-if="wbsType !== 5">
  763. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  764. </el-form-item>
  765. <template v-if="nodeDetail.nodeType == 6">
  766. <el-form-item label="是否有混凝土">
  767. <el-radio-group v-model="nodeDetail.isConcrete" size="small">
  768. <el-radio :label="0" border>无</el-radio>
  769. <el-radio :label="1" border>有</el-radio>
  770. </el-radio-group>
  771. </el-form-item>
  772. <el-form-item label="是否试验节点">
  773. <el-radio-group v-model="nodeDetail.isExpernode" size="small">
  774. <el-radio :label="0" border>否</el-radio>
  775. <el-radio :label="1" border>是</el-radio>
  776. </el-radio-group>
  777. </el-form-item>
  778. </template>
  779. <el-form-item
  780. label="内业资料类型"
  781. prop="majorDataType"
  782. v-if="wbsType !== 2&&wbsType !== 5"
  783. >
  784. <el-select
  785. v-model="nodeDetail.majorDataType"
  786. placeholder="请选择"
  787. class="w-100p"
  788. >
  789. <el-option
  790. v-for="item in majorDataTypeList"
  791. :key="item.id"
  792. :label="item.dictValue"
  793. :value="item.dictKey"
  794. ></el-option>
  795. </el-select>
  796. </el-form-item>
  797. <el-form-item
  798. label="勾选相关联试验"
  799. prop="mixRatioTestIds"
  800. v-if="wbsType === 2 && nodeDetail.nodeType === 53"
  801. >
  802. <div
  803. style="position: relative; height: 300px; border: 1px solid #dddfe6"
  804. >
  805. <el-scrollbar class="h-100p">
  806. <div v-loading="testTreeLoad">
  807. <el-tree
  808. class="filter-tree"
  809. :data="testTreeData"
  810. :props="defaultProps"
  811. :expand-on-click-node="false"
  812. highlight-current
  813. node-key="id"
  814. ref="treeall"
  815. show-checkbox
  816. :default-checked-keys="mixRatioTestIds"
  817. @check="TestTreeCheckChange"
  818. />
  819. </div>
  820. </el-scrollbar>
  821. </div>
  822. </el-form-item>
  823. </el-form>
  824. <span slot="footer" class="dialog-footer">
  825. <el-button @click="dialogVisible = false">取 消</el-button>
  826. <el-button type="primary" @click="saveNode" :loading="saveNodeLoading"
  827. >确 定</el-button
  828. >
  829. </span>
  830. </el-dialog>
  831. <!-- 创建新的元素表 -->
  832. <el-dialog
  833. title="创建新的元素表"
  834. :visible.sync="eleVisible"
  835. width="80%"
  836. append-to-body
  837. :close-on-click-modal="false"
  838. >
  839. <el-form
  840. ref="eleDialog"
  841. :model="eleForm"
  842. :rules="eleRules"
  843. label-width="110px"
  844. >
  845. <el-form-item label="表名" prop="nodeName">
  846. <el-input v-model="eleForm.nodeName"></el-input>
  847. </el-form-item>
  848. <el-row>
  849. <el-col :span="12">
  850. <el-form-item label="表类型" prop="tableType">
  851. <el-select
  852. v-model="eleForm.tableType"
  853. placeholder="请选择"
  854. class="w-100p"
  855. >
  856. <el-option
  857. v-for="item in tableTypelist"
  858. :key="item.id"
  859. :label="item.dictValue"
  860. :value="item.dictKey"
  861. ></el-option>
  862. </el-select>
  863. </el-form-item>
  864. </el-col>
  865. <el-col :span="12">
  866. <el-form-item label="所属方" prop="tableOwner">
  867. <el-select
  868. v-model="eleForm.tableOwner"
  869. placeholder="请选择"
  870. class="w-100p"
  871. >
  872. <el-option
  873. v-for="item in ownerTypeList"
  874. :key="item.id"
  875. :label="item.dictValue"
  876. :value="item.dictKey"
  877. ></el-option>
  878. </el-select>
  879. </el-form-item>
  880. </el-col>
  881. </el-row>
  882. </el-form>
  883. <div class="flex jc-sb">
  884. <div></div>
  885. <div>
  886. <el-link type="primary" @click="importVisible = true"
  887. >快捷导入</el-link
  888. >
  889. <el-link type="primary" class="mg-l-20" @click="downloadTmp"
  890. >下载导入模版</el-link
  891. >
  892. </div>
  893. </div>
  894. <div class="border-grey">
  895. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  896. <el-table
  897. :data="eleForm.elementList"
  898. border
  899. style="width: 100%"
  900. height="400px"
  901. >
  902. <el-table-column
  903. align="center"
  904. type="index"
  905. width="50"
  906. ></el-table-column>
  907. <el-table-column align="center" prop="eName" label="字段名称">
  908. <template slot-scope="scope">
  909. <el-input
  910. v-model="scope.row.eName"
  911. size="small"
  912. placeholder="请输入内容"
  913. ></el-input>
  914. </template>
  915. </el-table-column>
  916. <el-table-column
  917. align="center"
  918. prop="eType"
  919. label="数据类型"
  920. width="120"
  921. >
  922. <template slot-scope="scope">
  923. <el-select
  924. v-model="scope.row.eType"
  925. size="small"
  926. placeholder="请选择"
  927. >
  928. <el-option
  929. v-for="item in dataTypeList"
  930. :key="item.id"
  931. :label="item.dictValue"
  932. :value="item.dictKey"
  933. ></el-option>
  934. </el-select>
  935. </template>
  936. </el-table-column>
  937. <el-table-column
  938. align="center"
  939. prop="eLength"
  940. label="长度"
  941. width="120"
  942. >
  943. <template slot-scope="scope">
  944. <el-input
  945. v-model="scope.row.eLength"
  946. size="small"
  947. placeholder="请输入内容"
  948. :disabled="scope.row.eType == 4"
  949. ></el-input>
  950. </template>
  951. </el-table-column>
  952. <el-table-column
  953. align="center"
  954. prop="eAllowDeviation"
  955. label="允许偏差值"
  956. >
  957. <template slot-scope="scope">
  958. <div class="flex">
  959. <el-select
  960. v-model="scope.row.allow"
  961. size="small"
  962. placeholder="请选择"
  963. style="width: 120px"
  964. >
  965. <el-option :key="1" label="≥" value="≥"></el-option>
  966. <el-option :key="2" label="≤" value="≤"></el-option>
  967. <el-option :key="3" label="±" value="±"></el-option>
  968. <el-option :key="4" label="【】" value="【】"></el-option>
  969. </el-select>
  970. <el-input
  971. v-model="scope.row.deviation"
  972. size="small"
  973. placeholder="请输入内容"
  974. ></el-input>
  975. </div>
  976. </template>
  977. </el-table-column>
  978. <el-table-column
  979. align="center"
  980. prop="eInspectionMethod"
  981. label="检查方法和频率"
  982. >
  983. <template slot-scope="scope">
  984. <el-input
  985. v-model="scope.row.eInspectionMethod"
  986. size="small"
  987. placeholder="请输入内容"
  988. ></el-input>
  989. </template>
  990. </el-table-column>
  991. <el-table-column align="center" label="操作" width="80">
  992. <template slot="header">
  993. <el-button
  994. @click="addEleRow(eleForm.elementList)"
  995. type="text"
  996. icon="el-icon-circle-plus-outline"
  997. class="text-icon"
  998. ></el-button>
  999. </template>
  1000. <template slot-scope="scope">
  1001. <el-button
  1002. icon="el-icon-remove-outline"
  1003. type="text"
  1004. @click="delEleRow(scope.$index, eleForm.elementList)"
  1005. class="text-icon text-icon-danger"
  1006. ></el-button>
  1007. </template>
  1008. </el-table-column>
  1009. </el-table>
  1010. </div>
  1011. <span slot="footer" class="dialog-footer">
  1012. <el-button @click="eleVisible = false">取 消</el-button>
  1013. <el-button type="primary" @click="saveFormAndElementHandle"
  1014. >保 存</el-button
  1015. >
  1016. </span>
  1017. </el-dialog>
  1018. <!-- 模板导入 -->
  1019. <el-dialog
  1020. title="模版导入"
  1021. :visible.sync="importVisible"
  1022. width="50%"
  1023. append-to-body
  1024. :close-on-click-modal="false"
  1025. >
  1026. <p>
  1027. 提示:必须按照系统要求的模版格式上传,否则系统识别无效
  1028. <el-link type="primary" @click="downloadTmp">下载导入模版</el-link>
  1029. </p>
  1030. <div>
  1031. <el-button size="small" type="primary" @click="fileClick2"
  1032. >本地上传</el-button
  1033. >
  1034. <input
  1035. @change="tmpImport"
  1036. type="file"
  1037. hidden
  1038. ref="file2"
  1039. accept=".xls, .xlsx"
  1040. />
  1041. </div>
  1042. <el-table :data="tempList" border style="width: 100%">
  1043. <el-table-column align="center" prop="eName" label="字段信息">
  1044. </el-table-column>
  1045. <el-table-column
  1046. align="center"
  1047. prop="eType"
  1048. label="数据类型"
  1049. width="120"
  1050. >
  1051. </el-table-column>
  1052. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1053. </el-table-column>
  1054. <el-table-column
  1055. align="center"
  1056. prop="eAllowDeviation"
  1057. label="允许偏差值"
  1058. >
  1059. </el-table-column>
  1060. <el-table-column
  1061. align="center"
  1062. prop="eInspectionMethod"
  1063. label="检查方法和频率"
  1064. >
  1065. </el-table-column>
  1066. </el-table>
  1067. <span slot="footer" class="dialog-footer">
  1068. <el-button @click="importVisible = false">取 消</el-button>
  1069. <el-button type="primary" @click="importHandle">确 定</el-button>
  1070. </span>
  1071. </el-dialog>
  1072. <!-- 编辑元素 -->
  1073. <el-dialog
  1074. :title="(curEleTable.tableName ? curEleTable.tableName : '') + ''"
  1075. :visible.sync="editEleVisible"
  1076. width="80%"
  1077. append-to-body
  1078. :close-on-click-modal="false"
  1079. >
  1080. <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
  1081. <el-table :data="editEleList" border style="width: 100%" height="400px">
  1082. <el-table-column
  1083. align="center"
  1084. type="index"
  1085. width="50"
  1086. ></el-table-column>
  1087. <el-table-column align="center" prop="eName" label="字段信息">
  1088. </el-table-column>
  1089. <el-table-column
  1090. align="center"
  1091. prop="eType"
  1092. label="数据类型"
  1093. width="120"
  1094. :formatter="eTypeFormatter"
  1095. >
  1096. </el-table-column>
  1097. <el-table-column align="center" prop="eLength" label="长度" width="120">
  1098. </el-table-column>
  1099. <el-table-column
  1100. align="center"
  1101. prop="eAllowDeviation"
  1102. label="允许偏差值"
  1103. >
  1104. </el-table-column>
  1105. <el-table-column
  1106. align="center"
  1107. prop="eInspectionMethod"
  1108. label="检查方法和频率"
  1109. >
  1110. </el-table-column>
  1111. </el-table>
  1112. <span slot="footer" class="dialog-footer">
  1113. <el-button @click="editEleVisible = false">取 消</el-button>
  1114. <!-- <el-button
  1115. type="primary"
  1116. @click="saveEles"
  1117. >确 定</el-button> -->
  1118. </span>
  1119. </el-dialog>
  1120. <!-- 元素公式 -->
  1121. <el-dialog
  1122. :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素公式..'"
  1123. :visible.sync="editEleFormulaVisible"
  1124. width="800px"
  1125. append-to-body
  1126. :close-on-click-modal="false"
  1127. >
  1128. <div class="flex mg-b-10">
  1129. <el-input
  1130. v-model="formulaInput"
  1131. placeholder="请输入名称"
  1132. size="samll"
  1133. clearable
  1134. @clear="searchFormulaName"
  1135. ></el-input>
  1136. <el-button type="info" class="mg-l-10" @click="searchFormulaName"
  1137. >搜索</el-button
  1138. >
  1139. </div>
  1140. <el-table
  1141. :data="editEleListFilter"
  1142. border
  1143. style="width: 100%"
  1144. height="400px"
  1145. >
  1146. <el-table-column align="center" prop="eName" label="字段信息">
  1147. </el-table-column>
  1148. <el-table-column align="center" label="操作" width="200">
  1149. <template slot-scope="scope">
  1150. <el-link
  1151. :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
  1152. @click="toFormulaEdit(scope.row,10)"
  1153. >全局公式</el-link
  1154. >
  1155. <el-link
  1156. class="mg-l-10"
  1157. :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
  1158. @click="toFormulaEdit(scope.row,20)"
  1159. >节点公式</el-link
  1160. >
  1161. <!-- <el-link
  1162. class="mg-l-10"
  1163. type="danger"
  1164. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1165. >删除</el-link> -->
  1166. </template>
  1167. </el-table-column>
  1168. </el-table>
  1169. </el-dialog>
  1170. <!-- 导入划分 -->
  1171. <el-dialog
  1172. title="导入划分"
  1173. :visible.sync="importTemplateVisible"
  1174. width="800px"
  1175. append-to-body
  1176. :close-on-click-modal="false"
  1177. >
  1178. <div v-loading="importLoading">
  1179. <div>
  1180. <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
  1181. </div>
  1182. <div class="mg-t-20">
  1183. <el-button type="primary" @click="fileClick">选择文件</el-button>
  1184. <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
  1185. <input
  1186. @change="fileChange"
  1187. type="file"
  1188. hidden
  1189. ref="file"
  1190. accept=".xls, .xlsx"
  1191. />
  1192. </div>
  1193. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1194. </div>
  1195. <span slot="footer" class="dialog-footer">
  1196. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1197. <el-button
  1198. type="primary"
  1199. @click="importTemplateHandle"
  1200. :loading="importLoading"
  1201. >导 入</el-button
  1202. >
  1203. </span>
  1204. </el-dialog>
  1205. <!-- 节点参数 -->
  1206. <el-dialog
  1207. title="节点参数"
  1208. :visible.sync="nodeInfoVisible"
  1209. width="800px"
  1210. append-to-body
  1211. class="jiedian"
  1212. :close-on-click-modal="false"
  1213. :show-close="false"
  1214. @close="closenodeInfoVisible"
  1215. >
  1216. <div>
  1217. <el-button
  1218. type="text"
  1219. icon="el-icon-s-operation"
  1220. class="right-btn"
  1221. @click="setNodeParameters()"
  1222. ></el-button>
  1223. <div class="flexEnd">
  1224. <i
  1225. class="el-icon-circle-plus marbottom10"
  1226. @click="addNodeInfoTable()"
  1227. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1228. ></i>
  1229. <i
  1230. class="el-icon-refresh-right marbottom10"
  1231. @click="refreshnfoTable()"
  1232. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1233. ></i>
  1234. </div>
  1235. <el-table :data="nodeInfoTable" border style="width: 100%" height="400" v-loading="nodeInfoTableLoad">
  1236. <el-table-column align="center" prop="name" label="参数名称">
  1237. <template slot-scope="scope">
  1238. <el-select
  1239. v-model="scope.row.k"
  1240. placeholder="请选择"
  1241. class="w-100p"
  1242. >
  1243. <el-option
  1244. v-for="item in namelist"
  1245. :key="item.k"
  1246. :label="item.name"
  1247. :value="item.k"
  1248. ></el-option>
  1249. </el-select>
  1250. </template>
  1251. </el-table-column>
  1252. <el-table-column align="center" prop="value" label="参数值设置">
  1253. <template slot-scope="scope">
  1254. <el-input v-model="scope.row.v"></el-input>
  1255. </template>
  1256. </el-table-column>
  1257. <el-table-column align="center" prop="describe" label="描述">
  1258. <template slot-scope="scope">
  1259. <el-input v-model="scope.row.remark"></el-input>
  1260. </template>
  1261. </el-table-column>
  1262. <el-table-column label="操作" width="120" align="center">
  1263. <template slot-scope="scope">
  1264. <el-button
  1265. type="text"
  1266. size="small"
  1267. class="text-icon-primary"
  1268. @click="linkEle(scope.row)"
  1269. >关联元素</el-button>
  1270. <el-button
  1271. type="text"
  1272. size="small"
  1273. class="text-icon-danger"
  1274. @click="delNodeInfoss(scope.$index,scope.row)"
  1275. >删除</el-button
  1276. >
  1277. </template>
  1278. </el-table-column>
  1279. </el-table>
  1280. </div>
  1281. <span slot="footer" class="dialog-footer">
  1282. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1283. <el-button type="primary" @click="nodeInfoSave()" :loading="nodeInfoSaveload">保 存</el-button>
  1284. </span>
  1285. </el-dialog>
  1286. <!-- 设置参数名称 -->
  1287. <el-dialog
  1288. title="设置参数名称"
  1289. :visible.sync="infoNameVisible"
  1290. width="800px"
  1291. append-to-body
  1292. class="jiedian"
  1293. :close-on-click-modal="false"
  1294. >
  1295. <div>
  1296. <div class="flexEnd">
  1297. <i
  1298. class="el-icon-circle-plus marbottom10"
  1299. @click="setParameterName()"
  1300. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1301. ></i>
  1302. </div>
  1303. <el-table :data="namelists" border style="width: 100%" height="400">
  1304. <el-table-column align="center" prop="name" label="参数名称">
  1305. <template slot-scope="scope">
  1306. <el-input v-model="scope.row.name"></el-input>
  1307. </template>
  1308. </el-table-column>
  1309. <el-table-column align="center" prop="key" label="参数值KEY">
  1310. <template slot-scope="scope">
  1311. <el-input v-model="scope.row.k"></el-input>
  1312. </template>
  1313. </el-table-column>
  1314. <el-table-column align="center" prop="describe" label="描述">
  1315. <template slot-scope="scope">
  1316. <el-input v-model="scope.row.remark"></el-input>
  1317. </template>
  1318. </el-table-column>
  1319. <el-table-column label="操作" width="120" align="center">
  1320. <template slot-scope="scope">
  1321. <el-button
  1322. type="text"
  1323. size="small"
  1324. class="text-icon-danger"
  1325. @click="delNodeInfo(scope.$index,scope.row)"
  1326. >删除</el-button
  1327. >
  1328. </template>
  1329. </el-table-column>
  1330. </el-table>
  1331. </div>
  1332. <span slot="footer" class="dialog-footer">
  1333. <el-button @click="addParameterName()">保 存</el-button>
  1334. <el-button @click="closeParameter()">关 闭</el-button>
  1335. </span>
  1336. </el-dialog>
  1337. <el-dialog
  1338. title="别名"
  1339. :visible.sync="aliasVisible"
  1340. width="600px"
  1341. append-to-body
  1342. :close-on-click-modal="false"
  1343. >
  1344. <div>
  1345. <div class="flex">
  1346. <el-input
  1347. v-model="aliasInput"
  1348. placeholder="请输入节点别名"
  1349. ></el-input>
  1350. <el-button class="mg-l-20" type="primary" @click="addAlias"
  1351. >添加</el-button
  1352. >
  1353. </div>
  1354. <div class="flex" style="flex-wrap: wrap">
  1355. <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
  1356. <el-tag closable @close="delAlias(index)">
  1357. {{ tag }}
  1358. </el-tag>
  1359. <span v-if="index != aliasArr.length - 1">、</span>
  1360. </div>
  1361. </div>
  1362. </div>
  1363. <span slot="footer" class="dialog-footer">
  1364. <el-button @click="aliasVisible = false">取 消</el-button>
  1365. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1366. </span>
  1367. </el-dialog>
  1368. <!-- 节点公式 -->
  1369. <el-dialog
  1370. :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素公式2'"
  1371. :visible.sync="formulaCompVisible"
  1372. fullscreen
  1373. append-to-body
  1374. class="full-dialog"
  1375. @close="closeformulaComp"
  1376. >
  1377. <FormulaEdit
  1378. :fromcurNode="curTreeData"
  1379. :projectid="projectid"
  1380. :wbsid="id"
  1381. :nodeid="curTreeData.id"
  1382. :eleid="formulaCurRow.id"
  1383. :globaltype="formulaCurRow.globaltype"
  1384. :iswbstype="0"
  1385. @hideDialog="formulaCompVisible = false"
  1386. v-if="formulaCompVisible"
  1387. ></FormulaEdit>
  1388. </el-dialog>
  1389. <!-- 全局公式 -->
  1390. <el-dialog title="" :visible.sync="formulaCompVisible1" fullscreen append-to-body class="full-dialog" @close="closeformulaComp1">
  1391. <FormulaEditone :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :elementType="formulaCurRow.elementType" :projectid="projectid" :tableType="istableType"
  1392. :globaltype="formulaCurRow.globaltype" @hideDialog="formulaCompVisible1 = false" :fromcurNode="curEleTable" :iswbstype="0"
  1393. v-if="formulaCompVisible1">
  1394. </FormulaEditone>
  1395. </el-dialog>
  1396. <!-- 编辑元素 -->
  1397. <el-dialog
  1398. title=" "
  1399. :visible.sync="editElementVisible"
  1400. fullscreen
  1401. append-to-body
  1402. class="full-dialog"
  1403. >
  1404. <EditElement
  1405. :editElementQuery="curTreeData"
  1406. :pkeyId="editElementQuery.pkeyId"
  1407. :excelId="editElementQuery.excelId"
  1408. :id="editElementQuery.id"
  1409. :initTableName="editElementQuery.initTableName"
  1410. :pid="editElementQuery.pid"
  1411. :wbsid="editElementQuery.wbsid"
  1412. :initTableId="editElementQuery.initTableId"
  1413. :nodeid="editElementQuery.nodeid"
  1414. @hideDialog="editElementVisible = false"
  1415. v-if="editElementVisible"
  1416. ></EditElement>
  1417. </el-dialog>
  1418. <el-dialog
  1419. title="节点参数设置-关联元素"
  1420. :visible.sync="linkEleVisible"
  1421. width="800px"
  1422. append-to-body
  1423. class="jiedian"
  1424. :close-on-click-modal="false"
  1425. >
  1426. <div>
  1427. <el-table
  1428. :data="linkEleTableList"
  1429. border
  1430. style="width: 100%"
  1431. height="400"
  1432. >
  1433. <el-table-column
  1434. align="center"
  1435. prop="tableName"
  1436. label="元素表名"
  1437. >
  1438. </el-table-column>
  1439. <el-table-column
  1440. align="center"
  1441. prop="elementName"
  1442. label="关联元素字段"
  1443. >
  1444. </el-table-column>
  1445. <el-table-column
  1446. label="操作"
  1447. width="160"
  1448. align="center"
  1449. >
  1450. <template slot-scope="scope">
  1451. <el-button v-if="!scope.row.mappingId"
  1452. type="text"
  1453. size="small"
  1454. class="text-icon-primary"
  1455. @click="tolinkEle(scope.row)"
  1456. >选择元素</el-button>
  1457. <el-button v-if="!!scope.row.mappingId"
  1458. type="text"
  1459. size="small"
  1460. class="text-icon-danger"
  1461. @click="delLink(scope.row)"
  1462. >删除关联</el-button>
  1463. </template>
  1464. </el-table-column>
  1465. </el-table>
  1466. </div>
  1467. <span
  1468. slot="footer"
  1469. class="dialog-footer"
  1470. >
  1471. <!-- <el-button @click="saveLinks">保 存</el-button> -->
  1472. <el-button @click="linkEleVisible = false">关 闭</el-button>
  1473. </span>
  1474. </el-dialog>
  1475. <el-dialog
  1476. title="选择关联元素"
  1477. :visible.sync="linkCheckVisible"
  1478. width="600px"
  1479. append-to-body
  1480. class="jiedian"
  1481. :close-on-click-modal="false"
  1482. >
  1483. <div>
  1484. <div class="flex mg-b-20">
  1485. <el-input v-model="linkEleKey" placeholder="请输入元素关键字搜索"></el-input>
  1486. <el-link class="mg-l-20" :underline="false">
  1487. <i class="el-icon-search" style="font-size:20px" @click="searchEle"></i>
  1488. </el-link>
  1489. </div>
  1490. <el-table
  1491. :data="linkEleList"
  1492. border
  1493. style="width: 100%"
  1494. height="400"
  1495. >
  1496. <el-table-column
  1497. align="center"
  1498. prop="eName"
  1499. label="元素名"
  1500. >
  1501. </el-table-column>
  1502. <el-table-column
  1503. label="操作"
  1504. width="55">
  1505. <template slot-scope="scope">
  1506. <el-checkbox v-model="scope.row.checked" @change="value => linkEleCheck(value,scope.$index)"></el-checkbox>
  1507. </template>
  1508. </el-table-column>
  1509. </el-table>
  1510. </div>
  1511. <span
  1512. slot="footer"
  1513. class="dialog-footer"
  1514. >
  1515. <el-button @click="saveLinkEle">保 存</el-button>
  1516. <el-button @click="linkCheckVisible = false">关 闭</el-button>
  1517. </span>
  1518. </el-dialog>
  1519. </div>
  1520. </template>
  1521. <script>
  1522. import ManualSorting from "@/components/WbsTree/ManualSorting";
  1523. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  1524. import FormulaEdit from "@/views/formula/edit.vue";
  1525. import FormulaEditone from '@/views/formula/edit1.vue'
  1526. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
  1527. import {
  1528. saveFormAndElement,
  1529. selectFormElements,
  1530. importWbsTree,
  1531. findWbsTreePrivateSameLevel,
  1532. wbsTreePrivateSort,
  1533. parameters,
  1534. saveOrUpdateBatch,
  1535. keymap,
  1536. updateBatchNodeTableInfo2,
  1537. updateStatus,
  1538. getParamElements,
  1539. specifiedParamElements,
  1540. delParamElements, selectPrivateFormElements,syncCurrentFormInProject
  1541. } from "@/api/manager/wbstree";
  1542. import {
  1543. saveElement,
  1544. remove as removeElement,
  1545. updateBatchElements,
  1546. getTemplate,
  1547. importWbsElement,
  1548. } from "@/api/manager/wbsformelement";
  1549. import {
  1550. getLazytree,
  1551. getDetail,
  1552. update,
  1553. findNodeTableByCondition as selectByNodeTable,
  1554. removeTableByCondition as removeTableById,
  1555. removePrivateTreeNode,
  1556. wbsTreePrivateTableSort,
  1557. privateSubmitFullName,
  1558. syncNodeParam,
  1559. syncProjecteVisa,
  1560. syncNodeTable,
  1561. syncNodeinfo,
  1562. tabTypeLazyTree,
  1563. syncContractTabSort
  1564. } from "@/api/manager/wbsprivate";
  1565. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  1566. import { findProjectTreeTrial as getAlltreeTrial } from "@/api/manager/projectinfo";
  1567. import {refrehPram} from "@/api/manager/wbstree"
  1568. import {getTableElments} from "@/api/manager/wbstree";
  1569. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  1570. import { getDictionary } from "@/api/system/dict";
  1571. import { mapGetters } from "vuex";
  1572. import {
  1573. getList,
  1574. tabLazytreeAll,
  1575. saveLinkTab,
  1576. getExcelHtml,
  1577. } from "@/api/exctab/excelmodel";
  1578. import { getStore, setStore } from "@/util/store";
  1579. import { log } from '@antv/g2plot/lib/utils';
  1580. export default {
  1581. data() {
  1582. var checkMajorDataType = (rule, value, callback) => {
  1583. //console.log(this.nodeDetail.nodeType)
  1584. //console.log(this.nodeDetail.majorDataType)
  1585. if (this.nodeDetail.nodeType == 6) {
  1586. if (!this.nodeDetail.majorDataType) {
  1587. callback(new Error("工序节点必须选择内业资料类型"));
  1588. }
  1589. }
  1590. callback();
  1591. };
  1592. return {
  1593. fromcurNode:{},
  1594. formDatass: [],
  1595. editElementFormTag: false,
  1596. editeditElementFormMFLoading:false,
  1597. jiedianId: "",
  1598. //#region
  1599. sortTag: false,
  1600. sortTag2: false,
  1601. sureSortload:false,
  1602. surePrivateSortload:false,
  1603. sort:[],
  1604. //#endregion
  1605. //#region 关联清表
  1606. loading: false,
  1607. GLExcel: false,
  1608. GLExcelFrom: {
  1609. id: "",
  1610. name: "",
  1611. search: "", //搜素框舒服的值
  1612. ids: "",
  1613. excelId: "",
  1614. initTableName: "",
  1615. initTableId:""
  1616. },
  1617. GLExcelData: [], //
  1618. GLExcelProps: {
  1619. label: "name",
  1620. children: "children",
  1621. disabled: "hasChildren",
  1622. isLeaf: function (data) {
  1623. let tag = false;
  1624. if (!data.hasChildren) {
  1625. tag = true;
  1626. }
  1627. if (data.isExistForm == 1) {
  1628. tag = true;
  1629. }
  1630. return tag;
  1631. },
  1632. },
  1633. exceldata: [], //清表模板
  1634. GLExcelLoading: false,
  1635. //#endregion
  1636. //#region 调整表单
  1637. adjustmentExcel: "",
  1638. excelHtml: false,
  1639. //#endregion
  1640. //#region
  1641. id: "",
  1642. projectid: "",
  1643. filterText: "",
  1644. treeData: [],
  1645. treeLoad: false,
  1646. menuShow: false,
  1647. defaultProps: {
  1648. children: "children",
  1649. label: "title",
  1650. isLeaf: function (data) {
  1651. //console.log(data, !data.hasChildren, data.isExistForm);
  1652. let tag = false;
  1653. if (!data.hasChildren) {
  1654. tag = true;
  1655. }
  1656. if (data.isExistForm == 1) {
  1657. tag = true;
  1658. }
  1659. if (data.nodeType >= 6 && data.nodeType <= 13) {
  1660. tag = true;
  1661. }
  1662. //中间交工。开工报告、质量评定)
  1663. if (
  1664. data.majorDataType == 1 ||
  1665. data.majorDataType == 2 ||
  1666. data.majorDataType == 3
  1667. ) {
  1668. tag = true;
  1669. }
  1670. return tag;
  1671. // return !data.hasChildren || (data.isExistForm == 1);
  1672. },
  1673. },
  1674. leftType: 5,
  1675. curTreeData: {},
  1676. curTreeNode: {},
  1677. tableData: [],
  1678. nodeDetail: {},
  1679. formData: [],
  1680. editType: 1,
  1681. dialogVisible: false,
  1682. saveNodeLoading: false,
  1683. nodeTypelist: [],
  1684. majorDataTypeList: [],
  1685. rules: {
  1686. nodeName: [
  1687. { required: true, message: "请输入节点名称", trigger: "blur" },
  1688. ],
  1689. nodeType: [
  1690. { required: true, message: "请选择节点类型", trigger: "change" },
  1691. ],
  1692. majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
  1693. },
  1694. eleVisible: false,
  1695. tableTypelist: [],
  1696. dataTypeList: [],
  1697. ownerTypeList: [],
  1698. eleForm: {
  1699. elementList: [],
  1700. },
  1701. eleRules: {
  1702. nodeName: [
  1703. { required: true, message: "请输入表名称", trigger: "blur" },
  1704. ],
  1705. tableType: [
  1706. { required: true, message: "请选择表类型", trigger: "change" },
  1707. ],
  1708. tableOwner: [
  1709. { required: true, message: "请选择所属方", trigger: "change" },
  1710. ],
  1711. },
  1712. importVisible: false,
  1713. tempList: [],
  1714. curEleTable: {},
  1715. istableType:true,
  1716. editEleVisible: false,
  1717. editEleList: [],
  1718. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  1719. editEleFormulaVisible: false,
  1720. formulaInput: "",
  1721. editEleListFilter: [],
  1722. editEleListAll: [],
  1723. importTemplateVisible: false,
  1724. fileUrl: "",
  1725. upFile: null,
  1726. importLoading: false,
  1727. nodeInfoVisible: false,
  1728. nodeInfoTable: [],
  1729. nodeInfoTableLoad:false,
  1730. namelist: [],
  1731. namelists: [],
  1732. delids:[],
  1733. infoNameVisible: false,
  1734. excelSortTag: false,
  1735. excelSortTag2: false,
  1736. tableSortList: [],
  1737. //#endregion
  1738. defaultExpandedKeys: [],
  1739. expandName: this.$route.fullPath,
  1740. aliasVisible: false, //别名
  1741. aliasInput: "",
  1742. aliasArr: [],
  1743. formulaCompVisible: false, //公式弹框
  1744. formulaCompVisible1:false,
  1745. formulaCurRow: {}, //当前元素
  1746. editElementVisible: false, //编辑元素弹框
  1747. editElementQuery: {
  1748. pkeyId: "",
  1749. excelId: "",
  1750. id: "",
  1751. initTableName: "",
  1752. initTableId:"",
  1753. pid: "",
  1754. wbsid: "",
  1755. nodeid: ""
  1756. }, //传参
  1757. syncBtnLoad: false,
  1758. syncElectricLoad:false,
  1759. showType: 1,
  1760. typeTreeData: [],
  1761. testTreeLoad: false,
  1762. testTreeData: [],
  1763. mixRatioTestIds: [],
  1764. //节点参数,关联元素
  1765. curParam:{},//当前节点参数
  1766. linkEleVisible:false,
  1767. linkEleTableList:[],//元素表数组
  1768. curLinkEleTable:{},//当前元素表
  1769. linkCheckVisible:false,//关联弹框
  1770. linkEleList:[],//元素数组
  1771. linkEleKey:'',//搜索关键字
  1772. menusData:[
  1773. // {icon: 'el-icon-s-promotion', label: '新增节点', key: "add"},
  1774. {icon: 'el-icon-s-promotion', label: '编辑节点', key: "edit",content:'编辑节点'},
  1775. {icon: 'el-icon-upload', label: '同步新增元素表单', key: "sync1",content:'同步新增元素表单'},
  1776. {icon: 'el-icon-upload', label: '同步元素表单排序到合同段', key: "sync3",content:'同步元素表单排序到合同段'},
  1777. {icon: 'el-icon-s-promotion', label: '同步节点基础信息及表单URL', key: "sync2",content:'同步节点的基础信息、类型名称、表单url等信息'},
  1778. {icon: 'el-icon-sort', label: '调整排序', key: "sort",content:'调整排序'},
  1779. {icon: 'el-icon-s-promotion', label: '删除节点', key: "del",content:'删除节点'},
  1780. ],//树组件操作菜单
  1781. menuvisible:false,
  1782. menuleft:20,
  1783. menutop:0,
  1784. //同步菜单按钮
  1785. menuoptions:[
  1786. {
  1787. value: 'jdSync',
  1788. label: '节点参数同步',
  1789. load:false,
  1790. }, {
  1791. value: 'dqSync',
  1792. label: '电签同步',
  1793. load:false,
  1794. },
  1795. {
  1796. value: 'gsSync',
  1797. label: '公式同步',
  1798. load:false,
  1799. },
  1800. ],
  1801. menuvalue: '',
  1802. isshowSyncbtn:false,
  1803. projectName:'',
  1804. nodeInfoSaveload:false,
  1805. handlesyncLoad:false//表单同步
  1806. };
  1807. },
  1808. computed: {
  1809. ...mapGetters(["userInfo"]),
  1810. // dialogTitle: function () {
  1811. // let text = "节点";
  1812. // if (this.leftType == 1) {
  1813. // text = "新增" + text;
  1814. // } else if (this.leftType == 2) {
  1815. // text = "编辑" + text;
  1816. // }
  1817. // return text;
  1818. // },
  1819. },
  1820. created() {
  1821. this.init();
  1822. //console.log(this.userInfo)
  1823. },
  1824. methods: {
  1825. //#region
  1826. init() {
  1827. //this.id = this.$route.query.wbsid;
  1828. //this.projectid = this.$route.query.pid;
  1829. const { wbsid, pid, type } = this.$route.query;
  1830. this.id = wbsid;
  1831. this.projectid = pid;
  1832. this.wbsType = type ? Number(type) : 1;
  1833. this.getNodeTypelist();
  1834. this.getTableTypelist();
  1835. this.getDataTypelist();
  1836. this.getOwnerTypelist();
  1837. this.defaultExpandedKeys = getStore({ name: this.expandName });
  1838. this.projectName=this.$route.query.projectName
  1839. },
  1840. loadNode(node, resolve) {
  1841. let pid = 0;
  1842. if (node.level != 0) {
  1843. pid = node.data.id;
  1844. }
  1845. const type = this.wbsType;
  1846. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  1847. wbsType: type,
  1848. }).then((res) => {
  1849. let arr = [];
  1850. if (Array.isArray(res.data.data)) {
  1851. arr = res.data.data;
  1852. }
  1853. return resolve(arr);
  1854. });
  1855. },
  1856. getNodeDetail(data, node) {
  1857. console.log('getNodeDetail',data);
  1858. let parentName = "";
  1859. if (node.parent.data) {
  1860. parentName = node.parent.data.title;
  1861. }
  1862. this.curTreeData = data;
  1863. this.curTreeNode = node;
  1864. this.curTreeData.parentName = parentName;
  1865. getDetail(data.id, this.id, this.projectid).then((res) => {
  1866. res.data.data.parentName = parentName;
  1867. this.tableData = [res.data.data];
  1868. this.nodeDetail = Object.assign({}, res.data.data);
  1869. });
  1870. this.updateNodeTable();
  1871. this.nodeTypeChange(53)
  1872. //获取节点展开路径
  1873. this.getExpandedKeys(node);
  1874. },
  1875. saveNode() {
  1876. const type = this.wbsType;
  1877. this.$refs["nodeDetail"].validate((valid) => {
  1878. if (valid) {
  1879. const { mixRatioTestIds, nodeType } = this.nodeDetail;
  1880. if (type === 2 && nodeType === 53) {
  1881. if (mixRatioTestIds) {
  1882. if (this.editType == 1) {
  1883. this.addNode();
  1884. } else if (this.editType == 2) {
  1885. this.updateNode();
  1886. }
  1887. } else {
  1888. this.$message({
  1889. type: "error",
  1890. message: "请先选择节点",
  1891. });
  1892. return false;
  1893. }
  1894. } else {
  1895. if (this.editType == 1) {
  1896. this.addNode();
  1897. } else if (this.editType == 2) {
  1898. this.updateNode();
  1899. }
  1900. }
  1901. } else {
  1902. console.log("error submit!!");
  1903. return false;
  1904. }
  1905. });
  1906. },
  1907. addNode() {
  1908. this.saveNodeLoading = true;
  1909. update(this.nodeDetail).then(() => {
  1910. this.updateTreeNewNode();
  1911. this.dialogVisible = false;
  1912. this.$message({
  1913. type: "success",
  1914. message: "新增成功!",
  1915. });
  1916. });
  1917. },
  1918. updateNode() {
  1919. update(this.nodeDetail).then(() => {
  1920. let node = this.tableData[0];
  1921. node.nodeName = this.nodeDetail.nodeName;
  1922. node.nodeType = this.nodeDetail.nodeType;
  1923. this.curTreeData.title = this.nodeDetail.nodeName;
  1924. this.dialogVisible = false;
  1925. this.$message({
  1926. type: "success",
  1927. message: "修改成功!",
  1928. });
  1929. });
  1930. },
  1931. toSplit(val) {
  1932. return val ? String(val).split(",") : "";
  1933. },
  1934. setLeftType(type, data, node) {
  1935. this.jiedianId = data.id;
  1936. if (type == 4 || type == 5) {
  1937. this.leftType = type;
  1938. }
  1939. this.curTreeData = data;
  1940. this.curTreeNode = node;
  1941. this.$refs.tree.setCurrentKey(data.id);
  1942. if (type == 1 || type == 2) {
  1943. this.getMajorDataTypeList();
  1944. this.dialogVisible = true;
  1945. this.editType = type;
  1946. }
  1947. getDetail(data.id, this.id, this.projectid).then((res) => {
  1948. let parentName = "";
  1949. if (node.parent.data) {
  1950. parentName = node.parent.data.title;
  1951. }
  1952. res.data.data.parentName = parentName;
  1953. this.tableData = [res.data.data];
  1954. if (type == 1) {
  1955. this.nodeDetail = {
  1956. parentId: res.data.data.id,
  1957. parentName: parentName,
  1958. projectId: res.data.data.projectId,
  1959. };
  1960. } else {
  1961. this.nodeDetail = Object.assign({}, res.data.data);
  1962. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
  1963. }
  1964. this.nodeDetail.type = 1; // '1'节点 '2'表单
  1965. this.nodeDetail.wbsId = this.id;
  1966. this.nodeDetail.tenantId = this.userInfo.tenant_id;
  1967. });
  1968. if (this.leftType == 4) {
  1969. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  1970. if (res.data.data.length) {
  1971. this.formData = res.data.data;
  1972. this.formData.forEach((ele)=>{
  1973. ele.handlesyncLoad=false
  1974. })
  1975. } else {
  1976. this.formData = [];
  1977. }
  1978. });
  1979. }
  1980. //获取节点展开路径
  1981. this.getExpandedKeys(node);
  1982. },
  1983. showFormElement() {
  1984. if (!this.nodeDetail.id) {
  1985. this.$message({
  1986. type: "warning",
  1987. message: "请先选择在哪个节点下创建表",
  1988. });
  1989. return;
  1990. }
  1991. this.eleVisible = true;
  1992. },
  1993. addEleRow(list) {
  1994. list.push({});
  1995. },
  1996. delEleRow(index, list) {
  1997. list.splice(index, 1);
  1998. },
  1999. saveFormAndElementHandle() {
  2000. this.$refs["eleDialog"].validate((valid) => {
  2001. if (valid) {
  2002. this.eleForm.wbsId = this.id;
  2003. this.eleForm.tenantId = this.userInfo.tenant_id;
  2004. this.eleForm.nodeType = -1;
  2005. this.eleForm.type = 2; // '1'节点 '2'表单
  2006. this.eleForm.parentId = this.nodeDetail.id;
  2007. this.eleForm.elementList.forEach((element) => {
  2008. element.eAllowDeviation =
  2009. (element.allow ? element.allow : "") +
  2010. (element.deviation ? element.deviation : "");
  2011. if (element.eType == 4) {
  2012. element.eLength = 0;
  2013. }
  2014. });
  2015. saveFormAndElement(this.eleForm).then(() => {
  2016. //console.log(res)
  2017. this.updateTreeNewNode();
  2018. this.updateNodeTable();
  2019. this.eleVisible = false;
  2020. this.$message({
  2021. type: "success",
  2022. message: "新增成功!",
  2023. });
  2024. });
  2025. } else {
  2026. console.log("error submit!!");
  2027. return false;
  2028. }
  2029. });
  2030. },
  2031. updateTreeNewNode() {
  2032. getLazytree(
  2033. this.id,
  2034. this.nodeDetail.parentId,
  2035. this.userInfo.tenant_id,
  2036. this.projectid
  2037. ).then((res) => {
  2038. this.$refs.tree.updateKeyChildren(
  2039. this.nodeDetail.parentId,
  2040. res.data.data
  2041. );
  2042. });
  2043. },
  2044. updateNodeTable() {
  2045. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then(
  2046. (res) => {
  2047. if (res.data.data&&res.data.data.length) {
  2048. this.formData = res.data.data;
  2049. } else {
  2050. this.formData = [];
  2051. }
  2052. }
  2053. );
  2054. },
  2055. deleNode(data, node) {
  2056. this.$confirm(
  2057. "此操作将删除节点【" + data.title + "】, 是否继续?",
  2058. "提示",
  2059. {
  2060. confirmButtonText: "确定",
  2061. cancelButtonText: "取消",
  2062. type: "warning",
  2063. }
  2064. )
  2065. .then(() => {
  2066. removePrivateTreeNode(data.primaryKeyId).then(() => {
  2067. this.$refs.tree.remove(node);
  2068. this.$message({
  2069. type: "success",
  2070. message: "删除成功!",
  2071. });
  2072. });
  2073. })
  2074. .catch(() => {});
  2075. },
  2076. importHandle() {},
  2077. handleEdit(index, row) {
  2078. this.curEleTable = row;
  2079. selectPrivateFormElements(this.curEleTable.initTableId).then((res) => {
  2080. res.data.data.forEach((element) => {
  2081. this.eleReg.exec(element.eAllowDeviation);
  2082. element.allow = RegExp.$1 ? RegExp.$1 : "";
  2083. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  2084. });
  2085. this.editEleList = res.data.data;
  2086. });
  2087. this.editEleVisible = true;
  2088. },
  2089. handleDelete(index, row) {
  2090. this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
  2091. distinguishCancelAndClose: true,
  2092. confirmButtonText: "删除",
  2093. cancelButtonText: "取消",
  2094. }).then(() => {
  2095. removeTableById(row.id, this.projectid, this.id).then(() => {
  2096. this.formData.splice(index, 1);
  2097. this.$message({
  2098. type: "success",
  2099. message: "删除成功!",
  2100. });
  2101. });
  2102. });
  2103. },
  2104. async hideMD(row) {
  2105. //隐藏按钮
  2106. const code = await this.updateStatus(row.pkeyId, row.status);
  2107. if (code == 200) {
  2108. if (row.status == 0) {
  2109. row.status = 1;
  2110. } else {
  2111. row.status = 0;
  2112. }
  2113. }
  2114. },
  2115. async updateStatus(pKeyId, status) {
  2116. //隐藏功能激活
  2117. const { data: res } = await updateStatus({ pKeyId });
  2118. if (res.code == 200) {
  2119. this.$message({
  2120. type: "success",
  2121. message: status == 1 ? "隐藏成功" : "激活成功",
  2122. });
  2123. }
  2124. return res.code;
  2125. },
  2126. handleEditFormula(index, row) {
  2127. this.curEleTable = row;
  2128. selectFormElements(this.curEleTable.pkeyId,{type:0}).then((res) => {
  2129. this.editEleListFilter = res.data.data;
  2130. this.editEleListAll = [].concat(this.editEleListFilter);
  2131. });
  2132. this.editEleFormulaVisible = true;
  2133. },
  2134. //表单同步
  2135. handlesync(index, row){
  2136. this.handlesyncLoad=true
  2137. syncCurrentFormInProject({pKeyId:row.pkeyId}).then((res)=>{
  2138. if(res.data.code==200){
  2139. this.$message.success('操作成功');
  2140. }
  2141. }).finally(()=>{
  2142. this.handlesyncLoad=false
  2143. })
  2144. },
  2145. //搜索 筛选
  2146. searchFormulaName() {
  2147. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  2148. return ele.eName.indexOf(this.formulaInput) > -1;
  2149. });
  2150. },
  2151. saveNewEle(row) {
  2152. row.eAllowDeviation =
  2153. (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
  2154. row.fId = this.curEleTable.initTableId;
  2155. row.initTableName = this.curEleTable.initTableName;
  2156. if (row.eType == 4) {
  2157. row.eLength = 0;
  2158. }
  2159. saveElement(row).then((res) => {
  2160. if (res.data.data) {
  2161. this.$set(row, "id", res.data.data.id);
  2162. this.$set(row, "ekey", res.data.data.ekey);
  2163. this.$message({
  2164. type: "success",
  2165. message: "保存成功!",
  2166. });
  2167. }
  2168. });
  2169. },
  2170. delEleRowHandle(index, list) {
  2171. let row = list[index];
  2172. if (row.id) {
  2173. //有id需要请求删除
  2174. this.$confirm("是否确认删除?", "删除元素", {
  2175. distinguishCancelAndClose: true,
  2176. confirmButtonText: "删除",
  2177. cancelButtonText: "取消",
  2178. }).then(() => {
  2179. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
  2180. () => {
  2181. list.splice(index, 1);
  2182. }
  2183. );
  2184. });
  2185. } else {
  2186. list.splice(index, 1);
  2187. }
  2188. },
  2189. saveEles() {
  2190. for (let i = 0; i < this.editEleList.length; i++) {
  2191. if (!this.editEleList[i].id) {
  2192. this.$message({
  2193. type: "warning",
  2194. message: "请先将新增的元素点击保存",
  2195. });
  2196. return;
  2197. }
  2198. }
  2199. if (this.editEleList.length > 0) {
  2200. this.editEleList.forEach((element) => {
  2201. element.eAllowDeviation =
  2202. (element.allow ? element.allow : "") +
  2203. (element.deviation ? element.deviation : "");
  2204. if (element.eType == 4) {
  2205. element.eLength = 0;
  2206. }
  2207. });
  2208. updateBatchElements(
  2209. this.editEleList,
  2210. this.curEleTable.initTableName
  2211. ).then(() => {
  2212. this.editEleVisible = false;
  2213. this.updateNodeTable();
  2214. this.$message({
  2215. type: "success",
  2216. message: "保存成功!",
  2217. });
  2218. });
  2219. } else {
  2220. this.editEleVisible = false;
  2221. this.updateNodeTable();
  2222. this.$message({
  2223. type: "success",
  2224. message: "保存成功!",
  2225. });
  2226. }
  2227. },
  2228. nodeTypeChange(val) {
  2229. console.log(333333333);
  2230. if (val === 53) {
  2231. // if (this.testTreeData.length > 0) {
  2232. // return;
  2233. // }
  2234. this.testTreeLoad = true;
  2235. // getAlltreeTrial(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
  2236. // this.testTreeLoad = false;
  2237. // console.log(res.data.data,'data');
  2238. // let trialdata=res.data.data
  2239. // if(trialdata&&trialdata.allTree){
  2240. // this.testTreeData = trialdata.allTree[0];
  2241. // if(trialdata.allStatusIds.length>0){
  2242. // //设置勾选相关联试验全选
  2243. // this.mixRatioTestIds =trialdata.allStatusIds[0];
  2244. // }
  2245. // }
  2246. // });
  2247. getAlltree(this.projectid, this.id, this.curTreeData.primaryKeyId).then((res) => {
  2248. this.testTreeLoad = false;
  2249. console.log(res.data.data,'data');
  2250. this.testTreeData=res.data.data
  2251. });
  2252. }
  2253. },
  2254. //根据逗号联合
  2255. toJoin(arr) {
  2256. return arr ? arr.join() : "";
  2257. },
  2258. TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
  2259. // const newarr = [...checkedKeys, ...halfCheckedKeys];
  2260. const newarr = [...checkedKeys]
  2261. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
  2262. },
  2263. filterChange() {
  2264. if (this.treeData.length > 0) {
  2265. this.$refs.treeall.filter(this.filterText);
  2266. return;
  2267. }
  2268. this.treeLoad = true;
  2269. getAlltree(this.projectid, this.id).then((res) => {
  2270. this.treeLoad = false;
  2271. this.treeData = res.data.data;
  2272. console.log(res.data.data,'res.data.data');
  2273. this.$nextTick(() => {
  2274. this.$refs.treeall.filter(this.filterText);
  2275. });
  2276. });
  2277. },
  2278. importTemplate(data) {
  2279. this.importTemplateVisible = true;
  2280. this.curTreeData = data;
  2281. if (!this.fileUrl) {
  2282. getAttchFromOriginalName(1, 20, {
  2283. originalName: "WBS划分模板.xls",
  2284. }).then((res) => {
  2285. if (res.data.data.records.length) {
  2286. this.fileUrl = res.data.data.records[0].link;
  2287. } else {
  2288. this.fileUrl = "";
  2289. }
  2290. });
  2291. }
  2292. },
  2293. importTemplateHandle() {
  2294. if (!this.upFile) {
  2295. this.$message({
  2296. type: "warning",
  2297. message: "请先选择文件再进行导入",
  2298. });
  2299. return;
  2300. }
  2301. let forms = new FormData();
  2302. forms.append("excelFile", this.upFile);
  2303. let wbsTreeFu = {
  2304. wbsId: this.id,
  2305. parentId: this.curTreeData.id,
  2306. // ancestors:'0,'+this.curTreeData.id,
  2307. };
  2308. let json = JSON.stringify(wbsTreeFu);
  2309. let blob = new Blob([json], { type: "application/json" });
  2310. forms.append("wbsTreeFu", blob);
  2311. this.importLoading = true;
  2312. importWbsTree(forms)
  2313. .then(() => {
  2314. //this.$router.go(0)
  2315. let node = this.$refs.tree.getNode(this.curTreeData.id);
  2316. node.isLeaf = false;
  2317. this.importTemplateVisible = false;
  2318. this.upFile = null;
  2319. })
  2320. .finally(() => {
  2321. this.importLoading = false;
  2322. });
  2323. },
  2324. handleDownload() {
  2325. if (this.fileUrl) {
  2326. window.open(this.fileUrl);
  2327. } else {
  2328. this.$message({
  2329. type: "warning",
  2330. message: "请先在附件管理上传【WBS划分模板.xls】文件",
  2331. });
  2332. }
  2333. },
  2334. fileClick() {
  2335. this.$refs.file.click();
  2336. },
  2337. fileChange(e) {
  2338. const file = e.target.files[0];
  2339. if (!file) {
  2340. // 如果用户没有选择图片,只是点了文件上传这个按钮
  2341. return;
  2342. }
  2343. //console.log(file)
  2344. this.upFile = file;
  2345. },
  2346. editNodeInfo(index, row) {
  2347. this.$set(row, "isEdit", true);
  2348. },
  2349. saveNodeInfoHandle(index, row) {
  2350. row.isEdit = false;
  2351. },
  2352. downloadTmp() {
  2353. getTemplate().then((res) => {
  2354. //console.log(res)
  2355. let blob = new Blob([res.data], {
  2356. type: "application/vnd.ms-excel",
  2357. });
  2358. //console.log(blob)
  2359. let filename = Date.parse(new Date()) + ".xls";
  2360. if (window.navigator.msSaveOrOpenBlob) {
  2361. // 兼容IE10
  2362. window.navigator.msSaveBlob(blob, filename);
  2363. } else {
  2364. // 兼容chrome/firefox
  2365. let aTag = document.createElement("a");
  2366. aTag.download = Date.parse(new Date()) + ".xls";
  2367. aTag.href = window.URL.createObjectURL(blob);
  2368. aTag.click();
  2369. URL.revokeObjectURL(aTag.href);
  2370. }
  2371. });
  2372. },
  2373. fileClick2() {
  2374. this.$refs.file2.click();
  2375. },
  2376. tmpImport(e) {
  2377. const file = e.target.files[0];
  2378. const formData = new FormData();
  2379. formData.append("file", file);
  2380. //console.log(file.name)
  2381. importWbsElement(formData)
  2382. .then((res) => {
  2383. res.data.data.forEach((element) => {
  2384. element.eName = element.elementName;
  2385. element.eLength = element.elementLength;
  2386. element.eType = Number(element.elementType);
  2387. element.eAllowDeviation = element.elementAllowDeviation;
  2388. element.eInspectionMethod = element.elementInspectionMethod;
  2389. this.eleReg.exec(element.eAllowDeviation);
  2390. // console.log(RegExp.$1)
  2391. // console.log(RegExp.$2)
  2392. element.allow = RegExp.$1 ? RegExp.$1 : "";
  2393. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  2394. });
  2395. this.eleForm.elementList = res.data.data;
  2396. this.importVisible = false;
  2397. })
  2398. .finally(() => {
  2399. e.target.value = "";
  2400. });
  2401. },
  2402. visiblechange(value, data) {
  2403. this.$set(data, "moreShow", value);
  2404. },
  2405. bianhua2() {
  2406. this.excelSortTag2 = false;
  2407. this.$nextTick(() => {
  2408. this.excelSortTag2 = true;
  2409. });
  2410. },
  2411. //私有树的元素表修改排序
  2412. privateTableSort() {
  2413. if (!this.curTreeData.id) {
  2414. this.$message({
  2415. type: "warning",
  2416. message: "请先选择需要排序的节点",
  2417. });
  2418. return;
  2419. }
  2420. this.tableSortList = this.formData.map((form, index) => {
  2421. return {
  2422. sort: index + 1,
  2423. nodeName: form.tableName,
  2424. pkeyId: form.pkeyId,
  2425. };
  2426. });
  2427. this.excelSortTag = true;
  2428. this.excelSortTag2 = true;
  2429. },
  2430. editPrivateSort() {
  2431. this.surePrivateSortload=true
  2432. wbsTreePrivateTableSort(this.tableSortList).then(() => {
  2433. this.$message({
  2434. type: "success",
  2435. message: "排序成功!",
  2436. });
  2437. this.updateNodeTable();
  2438. this.surePrivateSortload=false
  2439. this.excelSortTag = false;
  2440. this.excelSortTag2 = false;
  2441. });
  2442. },
  2443. //解析元素数据类型
  2444. eTypeFormatter(row) {
  2445. let text = "";
  2446. for (let i = 0; i < this.dataTypeList.length; i++) {
  2447. if (this.dataTypeList[i].dictKey == row.eType) {
  2448. text = this.dataTypeList[i].dictValue;
  2449. break;
  2450. }
  2451. }
  2452. return text;
  2453. },
  2454. //跳转到公式配置页面
  2455. toFormulaEdit(row,type) {
  2456. // this.$router.push({
  2457. // path: '/formula/edit',
  2458. // query: {
  2459. // wbsid: this.id,
  2460. // eleid: row.id,
  2461. // nodeid:this.curTreeData.id,
  2462. // projectid:this.projectid
  2463. // }
  2464. // });
  2465. this.formulaCurRow = row;
  2466. this.formulaCurRow.globaltype = type;
  2467. if(type===10){
  2468. this.formulaCompVisible1 = true;
  2469. this.formulaCurRow.elementType = false;
  2470. this.istableType=true;
  2471. }else{
  2472. this.formulaCompVisible = true;
  2473. }
  2474. },
  2475. //关闭公式弹窗
  2476. closeformulaComp(){
  2477. console.log('关闭');
  2478. selectFormElements( this.curEleTable.pkeyId,{type:0}).then((res) => {
  2479. this.editEleListFilter = res.data.data;
  2480. this.editEleListAll = [].concat(this.editEleListFilter);
  2481. })
  2482. },
  2483. //关闭公式弹窗
  2484. closeformulaComp1(){
  2485. console.log('关闭');
  2486. selectFormElements( this.curEleTable.pkeyId,{type:0}).then((res) => {
  2487. this.editEleListFilter = res.data.data;
  2488. this.editEleListAll = [].concat(this.editEleListFilter);
  2489. })
  2490. },
  2491. getNodeTypelist() {
  2492. const type = this.wbsType;
  2493. if (this.nodeTypelist.length > 1) {
  2494. return;
  2495. }
  2496. let code=''
  2497. if(type===5){
  2498. code='lar_node_type'//征拆
  2499. }else if(type===2){
  2500. code='trial_node_type'//试验
  2501. }else{
  2502. code='wbs_node_type'//质检
  2503. }
  2504. getDictionary({
  2505. code
  2506. // code: type === 2 ? "trial_node_type" : "wbs_node_type",
  2507. }).then((res) => {
  2508. res.data.data.forEach((element) => {
  2509. element.dictKey = Number(element.dictKey);
  2510. });
  2511. this.nodeTypelist = res.data.data;
  2512. });
  2513. },
  2514. getMajorDataTypeList() {
  2515. if (this.majorDataTypeList.length > 1) {
  2516. return;
  2517. }
  2518. getDictionary({
  2519. code: "major_data_type",
  2520. }).then((res) => {
  2521. res.data.data.forEach((element) => {
  2522. element.dictKey = Number(element.dictKey);
  2523. });
  2524. this.majorDataTypeList = res.data.data;
  2525. });
  2526. },
  2527. getTableTypelist() {
  2528. const type = this.wbsType
  2529. if (this.tableTypelist.length > 1) {
  2530. return;
  2531. }
  2532. let code=''
  2533. if(type===5){
  2534. code='table_type'//征拆
  2535. }else if(type===2){
  2536. code='trial_table_type'//试验
  2537. }else{
  2538. code='table_type'//质检
  2539. }
  2540. getDictionary({
  2541. // code: "table_type",
  2542. // code: type === 2 ? "trial_table_type" : "table_type",
  2543. code
  2544. }).then((res) => {
  2545. res.data.data.forEach((element) => {
  2546. element.dictKey = Number(element.dictKey);
  2547. });
  2548. this.tableTypelist = res.data.data;
  2549. });
  2550. },
  2551. getDataTypelist() {
  2552. if (this.dataTypeList.length > 1) {
  2553. return;
  2554. }
  2555. getDictionary({
  2556. code: "data_type",
  2557. }).then((res) => {
  2558. res.data.data.forEach((element) => {
  2559. element.dictKey = Number(element.dictKey);
  2560. });
  2561. this.dataTypeList = res.data.data;
  2562. });
  2563. },
  2564. getOwnerTypelist() {
  2565. if (this.ownerTypeList.length > 1) {
  2566. return;
  2567. }
  2568. getDictionary({
  2569. code: "owner_type",
  2570. }).then((res) => {
  2571. res.data.data.forEach((element) => {
  2572. element.dictKey = Number(element.dictKey);
  2573. });
  2574. this.ownerTypeList = res.data.data;
  2575. });
  2576. },
  2577. formatCat(row, column, cellValue) {
  2578. for (let i = 0; i < this.nodeTypelist.length; i++) {
  2579. if (this.nodeTypelist[i].dictKey == cellValue) {
  2580. return this.nodeTypelist[i].dictValue;
  2581. }
  2582. }
  2583. return cellValue;
  2584. //console.log(cellValue)
  2585. },
  2586. formatTableType(row, column, cellValue) {
  2587. for (let i = 0; i < this.tableTypelist.length; i++) {
  2588. if (this.tableTypelist[i].dictKey == cellValue) {
  2589. return this.tableTypelist[i].dictValue;
  2590. }
  2591. }
  2592. return cellValue;
  2593. //console.log(cellValue)
  2594. },
  2595. formatOwner(row, column, cellValue) {
  2596. for (let i = 0; i < this.ownerTypeList.length; i++) {
  2597. if (this.ownerTypeList[i].dictKey == cellValue) {
  2598. return this.ownerTypeList[i].dictValue;
  2599. }
  2600. }
  2601. return cellValue;
  2602. //console.log(cellValue)
  2603. },
  2604. formatdataType(row, column, cellValue) {
  2605. for (let i = 0; i < this.dataTypeList.length; i++) {
  2606. if (this.dataTypeList[i].dictKey == cellValue) {
  2607. return this.dataTypeList[i].dictValue;
  2608. }
  2609. }
  2610. return cellValue;
  2611. },
  2612. // filterNode(value, data) {
  2613. // if (!value) return true;
  2614. // return data.title.indexOf(value) !== -1;
  2615. // },
  2616. getReturnNode(node,_array,value){
  2617. let isPass = node.data && node.data.title && node.data.title.indexOf(value) !== -1;
  2618. isPass?_array.push(isPass):'';
  2619. if(!isPass && node.level!=1 && node.parent){
  2620. this.getReturnNode(node.parent,_array,value);
  2621. }
  2622. },
  2623. filterNode(value,data,node) {
  2624. if(!value){
  2625. return true;
  2626. }
  2627. let level = node.level;
  2628. let _array = [];//这里使用数组存储 只是为了存储值。
  2629. this.getReturnNode(node,_array,value);
  2630. let result = false;
  2631. _array.forEach((item)=>{
  2632. result = result || item;
  2633. });
  2634. return result;
  2635. },
  2636. //#endregion
  2637. //#region wbs私有树排序
  2638. async sortpai(data) {
  2639. console.log(data);
  2640. await this.findWbsTreePrivateSameLevel({
  2641. parentId: data.parentId,
  2642. projectId: this.projectid,
  2643. wbsId: this.id,
  2644. });
  2645. this.sortTag = true;
  2646. this.sortTag2 = true;
  2647. },
  2648. editSort() {
  2649. this.wbsTreePrivateSort();
  2650. },
  2651. bianhua() {
  2652. this.sortTag2 = false;
  2653. this.$nextTick(() => {
  2654. this.sortTag2 = true;
  2655. });
  2656. },
  2657. async wbsTreePrivateSort() {
  2658. this.sureSortload=true
  2659. //wbs私有树节点手动排序
  2660. const { data: res } = await wbsTreePrivateSort(this.sort);
  2661. console.log(res);
  2662. if (res.code == 200) {
  2663. this.sortTag = false;
  2664. this.sortTag2 = false;
  2665. this.$message({
  2666. type: "success",
  2667. message: "排序成功!",
  2668. });
  2669. this.sureSortload=false
  2670. this.getLazytreessss();
  2671. }
  2672. },
  2673. async findWbsTreePrivateSameLevel(da) {
  2674. //wbs私有树同级节点接口
  2675. const { data: res } = await findWbsTreePrivateSameLevel(da);
  2676. if (res.code == 200) {
  2677. this.sort = res.data;
  2678. }
  2679. },
  2680. async getLazytreessss() {
  2681. const type=this.wbsType
  2682. const { data: res } = await getLazytree(
  2683. this.id,
  2684. 0,
  2685. this.userInfo.tenant_id,
  2686. this.projectid,
  2687. { wbsType: type,}
  2688. );
  2689. console.log(res);
  2690. if (res.code == 200) {
  2691. this.treeData = res.data;
  2692. }
  2693. },
  2694. //#endregion
  2695. //#region 关联清表
  2696. async getList(da) {
  2697. //获取清表模板信息
  2698. const { data: res } = await getList(da);
  2699. console.log(res);
  2700. if (res.code === 200 && res.msg === "操作成功") {
  2701. this.GLExcelData = res.data.records;
  2702. }
  2703. },
  2704. async tabLazytreeAll() {
  2705. //清表树信息
  2706. this.GLExcelLoading = true;
  2707. const { data: res } = await tabLazytreeAll({
  2708. modeId: this.GLExcelFrom.name,
  2709. name: this.GLExcelFrom.search,
  2710. });
  2711. this.GLExcelLoading = false;
  2712. console.log(res);
  2713. if (res.code === 200 && res.msg === "操作成功") {
  2714. this.exceldata = res.data;
  2715. }
  2716. },
  2717. Associationlist(scope) {
  2718. //关联清表点击事件
  2719. console.log(scope.row);
  2720. this.GLExcel = true;
  2721. this.getList({
  2722. current: 1,
  2723. size: 100000,
  2724. parentId: 0,
  2725. });
  2726. this.GLExcelFrom.name = scope.row.modeId;
  2727. setTimeout(() => {
  2728. this.$refs.tree.setCheckedKeys([scope.row.excelId]);
  2729. }, 2000);
  2730. this.GLExcelFrom.initTableId = scope.row.initTableId;
  2731. this.GLExcelFrom.id = scope.row.pkeyId;
  2732. this.GLExcelFrom.excelId = scope.row.excelId;
  2733. this.GLExcelFrom.ids = scope.row.id;
  2734. this.GLExcelFrom.initTableName = scope.row.initTableName;
  2735. console.log(this.GLExcelFrom,'this.GLExcelFrom');
  2736. },
  2737. changetherr() {
  2738. //清表类型选择框change事件
  2739. if (this.GLExcelFrom.name != "") {
  2740. this.GLExcelFrom.search = "";
  2741. this.tabLazytreeAll();
  2742. }
  2743. },
  2744. GLExcelMD() {
  2745. //弹框关闭事件
  2746. this.GLExcelFrom.name = "";
  2747. this.GLExcelFrom.search = "";
  2748. this.GLExcelFrom.id = "";
  2749. this.exceldata = [];
  2750. this.$refs.tree.setCheckedKeys([]);
  2751. this.GLExcel = false;
  2752. },
  2753. checkchange(data) {
  2754. //节点选中回调
  2755. if (this.$refs.tree.getCheckedNodes().length === 0) {
  2756. this.$refs.tree.setCheckedKeys([]);
  2757. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  2758. this.$refs.tree.setCheckedKeys([data.id]);
  2759. }
  2760. },
  2761. async saveLinkTab() {
  2762. //保存按钮
  2763. let checkNodes = this.$refs.tree.getCheckedNodes();
  2764. if (checkNodes.length > 0) {
  2765. let node = checkNodes[checkNodes.length - 1];
  2766. if (node.fileType != 3) {
  2767. this.$message({
  2768. type: "warning",
  2769. message: "请先上传Excel表",
  2770. });
  2771. return;
  2772. }
  2773. const { data: res } = await saveLinkTab({
  2774. exceTabId: node.id,
  2775. tabId: this.GLExcelFrom.id,
  2776. });
  2777. console.log(res);
  2778. if (res.code === 200) {
  2779. this.$message({
  2780. type: "success",
  2781. message: "关联清表成功",
  2782. });
  2783. // selectByNodeTable刷新表单列表
  2784. this.updateNodeTable();
  2785. this.GLExcel = false;
  2786. console.log(this.GLExcelFrom,'GLExcelFrom');
  2787. this.rightClick(
  2788. this.GLExcelFrom.id,
  2789. this.GLExcelFrom.excelId,
  2790. this.GLExcelFrom.ids,
  2791. this.GLExcelFrom.initTableName,
  2792. this.GLExcelFrom.initTableId
  2793. );
  2794. }
  2795. } else {
  2796. this.$message({
  2797. type: "warning",
  2798. message: "请先设置清表",
  2799. });
  2800. }
  2801. },
  2802. getReturnNode2(node,_array,value){
  2803. let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1;
  2804. isPass?_array.push(isPass):'';
  2805. if(!isPass && node.level!=1 && node.parent){
  2806. this.getReturnNode2(node.parent,_array,value);
  2807. }
  2808. },
  2809. filterNode222(value,data,node) {
  2810. if(!value){
  2811. return true;
  2812. }
  2813. let level = node.level;
  2814. let _array = [];//这里使用数组存储 只是为了存储值。
  2815. this.getReturnNode2(node,_array,value);
  2816. let result = false;
  2817. _array.forEach((item)=>{
  2818. result = result || item;
  2819. });
  2820. return result;
  2821. },
  2822. //#endregion
  2823. //#region 节点参数
  2824. nodeInfo(data) {
  2825. //节点参数按钮
  2826. this.keymap();
  2827. //console.log(data)
  2828. this.jiedianId = data.primaryKeyId;
  2829. this.parameters(data.primaryKeyId);
  2830. this.nodeInfoVisible = true;
  2831. },
  2832. closenodeInfoVisible(){
  2833. this.nodeInfoTable=[]
  2834. this.nodeInfoVisible = false;
  2835. },
  2836. addNodeInfoTable() {
  2837. //添加节点参数数据
  2838. this.nodeInfoTable.unshift({
  2839. k: "",
  2840. v: "",
  2841. remark: "",
  2842. nodeId: this.jiedianId,
  2843. type: 1,
  2844. });
  2845. console.log(this.nodeInfoTable)
  2846. },
  2847. refreshnfoTable(){
  2848. //刷新表格
  2849. let prams={
  2850. nodeId: this.jiedianId,
  2851. type: 1,
  2852. projectId: this.projectid
  2853. }
  2854. this.nodeInfoTableLoad=true
  2855. refrehPram(prams).then((res)=>{
  2856. this.nodeInfoTableLoad=false;
  2857. if(res.data.code==200){
  2858. this.$message.success('刷新成功');
  2859. }
  2860. })
  2861. },
  2862. delNodeInfo(key,obj) {
  2863. this.delids.push(obj.id)
  2864. //设置参数名称中的删除按钮
  2865. this.namelists.splice(key, 1);
  2866. },
  2867. delNodeInfoss(key,obj) {
  2868. this.delids.push(obj.id)
  2869. //节点参数
  2870. this.nodeInfoTable.splice(key, 1);
  2871. },
  2872. setNodeParameters() {
  2873. //打开设置节点参数弹框按钮
  2874. this.infoNameVisible = true;
  2875. this.namelists = [...this.namelist];
  2876. },
  2877. async setParameterName() {
  2878. //设置参数名称中添加节点参数按钮
  2879. // wbsId: this.jiedianId
  2880. this.namelists.unshift({ name: "", remark: "", k: "", type: 0 ,nodeId:this.jiedianId});
  2881. },
  2882. async nodeInfoSave() {
  2883. //节点参数弹框保存按钮
  2884. if (this.nodeInfoTable) {
  2885. // if (this.nodeInfoTable.length == 0) {
  2886. // await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,type:1,delIds:this.delids,wps:[
  2887. // {
  2888. // nodeId: this.jiedianId,
  2889. // type: -1,
  2890. // },
  2891. // ]});
  2892. // this.nodeInfoVisible = false;
  2893. // this.delIds=[];
  2894. // this.$message({
  2895. // type: "success",
  2896. // message: "保存参数节点成功!",
  2897. // });
  2898. // return;
  2899. // }
  2900. console.log(this.namelist)
  2901. let tag = true;
  2902. this.nodeInfoTable.forEach((val) => {
  2903. if (!val.k | !val.v) {
  2904. return (tag = false);
  2905. }
  2906. if (!val.name) {
  2907. for (let i = 0; i < this.namelist.length; i++) {
  2908. if (this.namelist[i].k == val.k) {
  2909. val.name = this.namelist[i].name;
  2910. return;
  2911. }
  2912. }
  2913. }
  2914. });
  2915. if (tag) {
  2916. this.nodeInfoSaveload=true
  2917. await this.saveOrUpdateBatch({scopeType:10,projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable,type:1,delIds:this.delids});
  2918. this.delIds=[];
  2919. this.$message({
  2920. type: "success",
  2921. message: "设置参数节点成功!",
  2922. });
  2923. this.nodeInfoSaveload=false
  2924. this.parameters(this.jiedianId)
  2925. // this.nodeInfoVisible = false;
  2926. } else {
  2927. this.$message({
  2928. type: "error",
  2929. message: "请填写所有的参数名称和参数值!",
  2930. });
  2931. }
  2932. } else {
  2933. this.$message({
  2934. type: "error",
  2935. message: "请先设置参数节点!",
  2936. });
  2937. }
  2938. },
  2939. async addParameterName() {
  2940. //设置参数名称中的保存按钮
  2941. if (this.namelists.length) {
  2942. let tag = true;
  2943. this.namelists.forEach((val) => {
  2944. if (!val.name || !val.k) {
  2945. return (tag = false);
  2946. }
  2947. });
  2948. if (tag) {
  2949. await this.saveOrUpdateBatch({scopeType:10,projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists,type:0,delIds:this.delids}); //保存设置参数
  2950. this.infoNameVisible = false;
  2951. this.delIds=[];
  2952. this.keymap();
  2953. } else {
  2954. this.$message({
  2955. type: "error",
  2956. message: "请填写所有的参数名称和参数值KEY!",
  2957. });
  2958. }
  2959. } else {
  2960. this.$message({
  2961. type: "warning",
  2962. message: "请先添加参数",
  2963. });
  2964. }
  2965. },
  2966. closeParameter() {
  2967. //设置参数名称,关闭按钮
  2968. this.namelists = [];
  2969. this.infoNameVisible = false;
  2970. },
  2971. async parameters(wbsId) {
  2972. //获取接待你参数列表
  2973. const { data: res } = await parameters({ wbsId });
  2974. console.log(res);
  2975. if (res.code == 200) {
  2976. if( Array.isArray(res.data)){
  2977. this.nodeInfoTable = res.data
  2978. }
  2979. }
  2980. },
  2981. async saveOrUpdateBatch(da) {
  2982. //保存
  2983. const { data: res } = await saveOrUpdateBatch(da);
  2984. this.delids=[];
  2985. console.log(res);
  2986. },
  2987. async keymap() {
  2988. //节点参数枚举
  2989. const { data: res } = await keymap();
  2990. console.log(res);
  2991. if (res.code == 200) {
  2992. this.namelist = res.data;
  2993. }
  2994. },
  2995. //#endregion
  2996. //#region 调整表单
  2997. adjustExcel(pkeyId, excelId) {
  2998. //调整表单
  2999. this.GLExcelFrom.id = pkeyId;
  3000. this.getExcelHtml(pkeyId);
  3001. },
  3002. async getExcelHtml(pkeyId) {
  3003. const { data: res } = await getExcelHtml({ pkeyId });
  3004. console.log(res);
  3005. if (res.code === 200) {
  3006. localStorage.setItem("excelHtml", res.data);
  3007. this.adjustmentExcel = res.data;
  3008. this.excelHtml = true;
  3009. }
  3010. },
  3011. removeExcel() {
  3012. this.excelHtml = false;
  3013. },
  3014. //#endregion
  3015. //#region 编辑元素
  3016. async rightClick(pkeyId, excelId, id, initTableName,initTableId) {
  3017. await this.getExcelHtml2(pkeyId);
  3018. this.editElementQuery.pkeyId = pkeyId;
  3019. this.editElementQuery.excelId = excelId;
  3020. this.editElementQuery.id = id;
  3021. this.editElementQuery.initTableName = initTableName;
  3022. this.editElementQuery.initTableId = initTableId;
  3023. this.editElementQuery.pid = this.$route.query.pid;
  3024. this.editElementQuery.wbsid = this.$route.query.wbsid;
  3025. this.editElementQuery.nodeid = this.curTreeData.id;
  3026. this.editElementVisible = true;
  3027. },
  3028. async getExcelHtml2(pkeyId) {
  3029. const { data: res } = await getExcelHtml({ pkeyId });
  3030. console.log(res);
  3031. if (res.code === 200) {
  3032. localStorage.setItem("editElement", res.data);
  3033. }
  3034. },
  3035. //#endregion
  3036. //#region 元素表单信息
  3037. editEditElementForm() {
  3038. //标记元素
  3039. if (this.formData.length) {
  3040. let da = [];
  3041. this.formDatass = [...this.formData];
  3042. this.formDatass.forEach((val) => {
  3043. da.push({
  3044. tableType: val.tableType - 0,
  3045. tableOwner: val.tableOwner - 0,
  3046. pkeyId: val.pkeyId,
  3047. tableName: val.tableName,
  3048. fillRate: val.fillRate,
  3049. });
  3050. });
  3051. this.formDatass = da;
  3052. this.editElementFormTag = true;
  3053. }
  3054. },
  3055. editeditElementFormMF() {
  3056. //保存按钮
  3057. let da = [];
  3058. let tag = true;
  3059. this.formDatass.forEach((val) => {
  3060. if (!val.tableName || !val.tableType || !val.tableOwner) {
  3061. tag = false;
  3062. return;
  3063. } else {
  3064. da.push({
  3065. pkeyId: val.pkeyId,
  3066. nodeName: val.tableName,
  3067. tableType: val.tableType,
  3068. tableOwner: val.tableOwner,
  3069. fillRate: val.fillRate,
  3070. });
  3071. }
  3072. });
  3073. if (tag) {
  3074. this.updateBatchNodeTableInfo2(da);
  3075. } else {
  3076. this.$message({
  3077. type: "success",
  3078. message: "请填写完整元素表单的所有信息!",
  3079. });
  3080. }
  3081. },
  3082. async updateBatchNodeTableInfo2(da) {
  3083. this.editeditElementFormMFLoading=true
  3084. //共有编辑元素
  3085. const { data: res } = await updateBatchNodeTableInfo2(da);
  3086. if (res.code == 200) {
  3087. this.editElementFormTag = false;
  3088. this.updateNodeTable();
  3089. this.editeditElementFormMFLoading=false
  3090. }
  3091. this.editeditElementFormMFLoading=false
  3092. },
  3093. //#endregion
  3094. //获取节点展开路径
  3095. getExpandedKeys(node) {
  3096. //console.log(node)
  3097. let expandedKeys = [];
  3098. while (node.parent) {
  3099. expandedKeys.push(node.data.id);
  3100. node = node.parent;
  3101. }
  3102. setStore({
  3103. name: this.expandName,
  3104. content: expandedKeys,
  3105. type: true, //sessionStorage
  3106. });
  3107. //console.log(expandedKeys)
  3108. },
  3109. //触发节点参数
  3110. nodeInfoHandle() {
  3111. if (!this.curTreeData.id) {
  3112. this.$message({
  3113. type: "warning",
  3114. message: "请先选择节点",
  3115. });
  3116. return;
  3117. }
  3118. this.nodeInfo(this.curTreeData);
  3119. },
  3120. eleFormulaHandle() {
  3121. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3122. this.$message({
  3123. type: "warning",
  3124. message: "请先选择节点",
  3125. });
  3126. return;
  3127. }
  3128. this.setLeftType(4, this.curTreeData, this.curTreeNode);
  3129. // this.showType = 2;
  3130. },
  3131. editNodeHandle() {
  3132. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3133. this.$message({
  3134. type: "warning",
  3135. message: "请先选择节点",
  3136. });
  3137. return;
  3138. }
  3139. this.mixRatioTestIds = [];
  3140. this.nodeTypeChange(53);
  3141. this.dialogTitle='编辑节点'
  3142. this.setLeftType(2, this.curTreeData, this.curTreeNode);
  3143. },
  3144. addNodeHandle() {
  3145. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3146. this.$message({
  3147. type: "warning",
  3148. message: "请先选择节点",
  3149. });
  3150. return;
  3151. }
  3152. this.mixRatioTestIds = [];
  3153. this.nodeTypeChange(53);
  3154. this.dialogTitle='新增节点'
  3155. this.setLeftType(1, this.curTreeData, this.curTreeNode);
  3156. },
  3157. copyNodeHandle() {
  3158. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3159. this.$message({
  3160. type: "warning",
  3161. message: "请先选择节点",
  3162. });
  3163. return;
  3164. }
  3165. },
  3166. delNodeHandle() {
  3167. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3168. this.$message({
  3169. type: "warning",
  3170. message: "请先选择节点",
  3171. });
  3172. return;
  3173. }
  3174. if (this.curTreeNode.level == 1) {
  3175. this.$message({
  3176. type: "warning",
  3177. message: "当前节点无法删除",
  3178. });
  3179. return;
  3180. }
  3181. this.deleNode(this.curTreeData, this.curTreeNode);
  3182. },
  3183. eleHandle() {
  3184. if (!this.curTreeData.id || !this.curTreeNode.id) {
  3185. this.$message({
  3186. type: "warning",
  3187. message: "请先选择节点",
  3188. });
  3189. return;
  3190. }
  3191. this.setLeftType(5, this.curTreeData, this.curTreeNode);
  3192. },
  3193. syncInfoHandle(item) {
  3194. if(this.curTreeData.primaryKeyId){
  3195. this.$confirm("是否同步节点参数?", "提示", {
  3196. confirmButtonText: "确定",
  3197. cancelButtonText: "取消",
  3198. type: "warning",
  3199. }).then(() => {
  3200. this.syncBtnLoad = true;
  3201. this.menuoptions.forEach((ele)=>{
  3202. if(item.value==ele.value){
  3203. ele.load=true
  3204. }
  3205. })
  3206. syncNodeParam(this.projectid,this.curTreeData.primaryKeyId)
  3207. .then(() => {
  3208. this.$message({
  3209. type: "success",
  3210. message: "同步成功!",
  3211. });
  3212. })
  3213. .finally(() => {
  3214. this.syncBtnLoad = false;
  3215. this.menuoptions.forEach((ele)=>{
  3216. if(item.value==ele.value){
  3217. ele.load=false
  3218. }
  3219. })
  3220. });
  3221. });
  3222. }else{
  3223. this.$message.warning('请先选择左侧节点')
  3224. }
  3225. },
  3226. //显示别名弹窗
  3227. aliasShow() {
  3228. this.aliasVisible = true;
  3229. if (this.nodeDetail.fullName) {
  3230. this.aliasArr = this.nodeDetail.fullName.split(",");
  3231. } else {
  3232. this.aliasArr = [];
  3233. }
  3234. this.aliasInput = "";
  3235. },
  3236. addAlias() {
  3237. if (this.aliasInput) {
  3238. this.aliasArr.push(this.aliasInput);
  3239. this.aliasInput = "";
  3240. }
  3241. },
  3242. delAlias(index) {
  3243. this.aliasArr.splice(index, 1);
  3244. },
  3245. saveAliasHandle() {
  3246. this.nodeDetail.fullName = this.aliasArr.join(",");
  3247. if (this.editType == 1) {
  3248. //新增
  3249. this.aliasVisible = false;
  3250. } else if (this.editType == 2) {
  3251. //编辑 私有
  3252. privateSubmitFullName(
  3253. this.nodeDetail.pKeyId,
  3254. this.nodeDetail.fullName
  3255. ).then(() => {
  3256. this.$message({
  3257. type: "success",
  3258. message: "保存成功",
  3259. });
  3260. this.aliasVisible = false;
  3261. });
  3262. }
  3263. },
  3264. syncNodeTableHandle(data) {
  3265. this.$confirm("是否同步节点【" + data.title + "】?", "提示", {
  3266. confirmButtonText: "确定",
  3267. cancelButtonText: "取消",
  3268. type: "warning",
  3269. }).then(() => {
  3270. let notify = this.$notify({
  3271. title: "提示",
  3272. message: "节点数据同步中...",
  3273. duration: 0,
  3274. });
  3275. syncNodeTable(data.primaryKeyId)
  3276. .then(() => {
  3277. this.updateNodeTable();
  3278. this.$message({
  3279. type: "success",
  3280. message: "同步成功",
  3281. });
  3282. })
  3283. .catch(() => {
  3284. this.$message({
  3285. type: "error",
  3286. message: "同步失败",
  3287. });
  3288. })
  3289. .finally(() => {
  3290. notify.close();
  3291. });
  3292. });
  3293. },
  3294. syncProjectHandle (data) {
  3295. this.$confirm("是否同步节点【" + data.title + "】到合同段?", "提示", {
  3296. confirmButtonText: "确定",
  3297. cancelButtonText: "取消",
  3298. type: "warning",
  3299. }).then(() => {
  3300. let notify = this.$notify({
  3301. title: "提示",
  3302. message: "节点数据同步中...",
  3303. duration: 0,
  3304. });
  3305. syncNodeinfo(data.primaryKeyId)
  3306. .then(() => {
  3307. this.updateNodeTable();
  3308. this.$message({
  3309. type: "success",
  3310. message: "同步成功",
  3311. });
  3312. })
  3313. .catch(() => {
  3314. this.$message({
  3315. type: "error",
  3316. message: "同步失败",
  3317. });
  3318. })
  3319. .finally(() => {
  3320. notify.close();
  3321. });
  3322. });
  3323. },
  3324. //同步元素表单排序到合同段
  3325. syncSortHandle (data) {
  3326. this.$confirm("同步元素表单排序到合同段", "提示", {
  3327. confirmButtonText: "确定",
  3328. cancelButtonText: "取消",
  3329. type: "warning",
  3330. }).then(() => {
  3331. let notify = this.$notify({
  3332. title: "提示",
  3333. message: "节点数据同步中...",
  3334. duration: 0,
  3335. });
  3336. syncContractTabSort(data.primaryKeyId)
  3337. .then(() => {
  3338. this.updateNodeTable();
  3339. this.$message({
  3340. type: "success",
  3341. message: "同步成功",
  3342. });
  3343. })
  3344. .catch(() => {
  3345. this.$message({
  3346. type: "error",
  3347. message: "同步失败",
  3348. });
  3349. })
  3350. .finally(() => {
  3351. notify.close();
  3352. });
  3353. });
  3354. },
  3355. typeTreeLoadNode(node, resolve) {
  3356. let pid = 0;
  3357. if (node.level != 0) {
  3358. pid = node.data.id;
  3359. }
  3360. tabTypeLazyTree(pid, this.projectid).then((res) => {
  3361. let arr = [];
  3362. if (Array.isArray(res.data.data)) {
  3363. arr = res.data.data;
  3364. }
  3365. return resolve(arr);
  3366. });
  3367. },
  3368. getTypeTreeDetail() {},
  3369. independent(){
  3370. this.$router.push({
  3371. path: '/project/independent',
  3372. query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
  3373. });
  3374. },
  3375. archiveTimeClick(){
  3376. this.$router.push({
  3377. path: '/project/archiveTime',
  3378. query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
  3379. });
  3380. },
  3381. syncElectric(item){
  3382. if(this.curTreeData.primaryKeyId){
  3383. console.log('同步电签默认信息');
  3384. this.$confirm("是否同步电签默认信息?", "提示", {
  3385. confirmButtonText: "确定",
  3386. cancelButtonText: "取消",
  3387. type: "warning",
  3388. }).then(() => {
  3389. this.syncElectricLoad = true;
  3390. this.menuoptions.forEach((ele)=>{
  3391. if(item.value==ele.value){
  3392. ele.load=true
  3393. }
  3394. })
  3395. syncProjecteVisa(this.projectid,this.curTreeData.primaryKeyId)
  3396. .then(() => {
  3397. this.$message({
  3398. type: "success",
  3399. message: "同步成功!",
  3400. });
  3401. })
  3402. .finally(() => {
  3403. this.syncElectricLoad = false;
  3404. this.menuoptions.forEach((ele)=>{
  3405. if(item.value==ele.value){
  3406. ele.load=false
  3407. }
  3408. })
  3409. });
  3410. });
  3411. }else{
  3412. this.$message.warning('请先选择左侧节点')
  3413. }
  3414. },
  3415. //节点参数 关联元素
  3416. linkEle(row){
  3417. console.log(row,'row');
  3418. if(!row.id){
  3419. this.$message.warning('请先保存数据,再点击关联元素')
  3420. }else{
  3421. this.linkEleVisible = true;
  3422. this.curParam = row;
  3423. getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:row.id,scopeType:10}).then((res) => {
  3424. if (res.data.data.length) {
  3425. this.linkEleTableList = res.data.data;
  3426. } else {
  3427. this.linkEleTableList = [];
  3428. }
  3429. })
  3430. }
  3431. },
  3432. //关联元素弹框
  3433. tolinkEle(row){
  3434. this.curLinkEleTable = row;
  3435. this.linkCheckVisible = true;
  3436. selectFormElements(row.id,{type:3,nodeId:this.curTreeData.primaryKeyId}).then((res) => {
  3437. res.data.data.forEach((ele)=>{
  3438. ele.checked = false;
  3439. ele.show = true;
  3440. })
  3441. this.linkEleList = res.data.data;
  3442. this.linkEleListAll = [].concat(this.linkEleList);
  3443. })
  3444. },
  3445. //删除关联
  3446. delLink(data){
  3447. this.$confirm('删除关联, 是否继续?', '提示', {
  3448. confirmButtonText: '确定',
  3449. cancelButtonText: '取消',
  3450. type: 'warning'
  3451. }).then(() => {
  3452. console.log(data)
  3453. delParamElements(data).then(() => {
  3454. this.$message({
  3455. type: "success",
  3456. message: "删除成功!"
  3457. });
  3458. getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
  3459. if (res.data.data.length) {
  3460. this.linkEleTableList = res.data.data;
  3461. } else {
  3462. this.linkEleTableList = [];
  3463. } })
  3464. })
  3465. }).catch(() => {
  3466. });
  3467. },
  3468. //筛选元素
  3469. searchEle(){
  3470. this.linkEleList = this.linkEleListAll.filter((ele)=>{
  3471. return ele.eName.indexOf(this.linkEleKey) > -1;
  3472. })
  3473. },
  3474. linkEleCheck(value,index){
  3475. //console.log(value)
  3476. if(value){
  3477. this.linkEleList.forEach((ele,i)=>{
  3478. if(i != index){
  3479. ele.checked = false;
  3480. }
  3481. })
  3482. }
  3483. },
  3484. //关联元素
  3485. saveLinkEle(){
  3486. let target={}
  3487. this.linkEleList.forEach(e=>{
  3488. if(e.checked==true){
  3489. target={elementId:e.id,paramId:this.curParam.id};
  3490. }
  3491. })
  3492. specifiedParamElements(target).then(data=>{
  3493. this.linkCheckVisible = false;
  3494. getParamElements({nodeId:this.curTreeData.id,projectId:this.projectid,paramId:this.curParam.id,scopeType:10}).then((res) => {
  3495. if (res.data.data.length) {
  3496. this.linkEleTableList = res.data.data;
  3497. } else {
  3498. this.linkEleTableList = [];
  3499. }})
  3500. })
  3501. },
  3502. //树形控件菜单相关方法
  3503. mouseout(){
  3504. this.menuvisible=false
  3505. },
  3506. //展示菜单
  3507. showMenu(e,data,node){
  3508. e.preventDefault();
  3509. console.log(e,'e');
  3510. var x = e.pageX; //这个应该是相对于整个浏览器页面的x坐标,左上角为坐标原点(0,0)
  3511. var y = e.pageY; //这个应该是相对于整个浏览器页面的y坐标,左上角为坐标原点(0,0)
  3512. this.menutop = y;
  3513. this.menuleft = x;
  3514. this.menuvisible=true
  3515. },
  3516. menuClick(e,item,data){
  3517. e.preventDefault();
  3518. if(item.key==='sort'){
  3519. this.sortpai(data)
  3520. }else if(item.key==='sync1'){
  3521. this.syncNodeTableHandle(data)
  3522. }else if(item.key==='sync2'){
  3523. this.syncProjectHandle(data)
  3524. }//
  3525. else if(item.key==='sync3'){
  3526. this.syncSortHandle(data)
  3527. }
  3528. else if(item.key==='add'){
  3529. this.addNodeHandle()
  3530. }
  3531. else if(item.key==='edit'){
  3532. this.editNodeHandle()
  3533. }
  3534. else if(item.key==='del'){
  3535. this.delNodeHandle()
  3536. }else if(item.value==='jdSync'){
  3537. this.syncInfoHandle(item)
  3538. }else if(item.value==='gsSync'){
  3539. this.$message({
  3540. type: "info",
  3541. message: "暂无相关接口!"
  3542. });
  3543. }else if(item.value==='dqSync'){
  3544. this.syncElectric(item)
  3545. }
  3546. },
  3547. //展示数据同步下拉框
  3548. showSyncbtn(){
  3549. this.isshowSyncbtn=!this.isshowSyncbtn
  3550. }
  3551. },
  3552. watch: {
  3553. "GLExcelFrom.search"(val) {
  3554. console.log(val);
  3555. if (this.exceldata) {
  3556. this.$refs.tree.filter(val);
  3557. }
  3558. },
  3559. },
  3560. components: {
  3561. dynamicExcel,
  3562. ManualSorting,
  3563. FormulaEdit,
  3564. EditElement,
  3565. FormulaEditone
  3566. },
  3567. };
  3568. </script>
  3569. <style scoped lang="scss">
  3570. .font-s-12 /deep/ .iconfont {
  3571. font-size: 12px;
  3572. }
  3573. .el-popper[x-placement^="bottom"] {
  3574. margin-top: -6px;
  3575. }
  3576. .right-btn {
  3577. position: absolute;
  3578. right: 20px;
  3579. top: 10px;
  3580. font-size: 20px;
  3581. }
  3582. .custom-tree-node {
  3583. .normal-black {
  3584. display: none;
  3585. }
  3586. &:hover {
  3587. .normal-black {
  3588. display: inline-block;
  3589. }
  3590. }
  3591. &.show .normal-black {
  3592. display: inline-block;
  3593. }
  3594. }
  3595. .excelBox {
  3596. /deep/.el-dialog__body {
  3597. padding: 20px;
  3598. }
  3599. }
  3600. //调整表单样式
  3601. .excelHtml {
  3602. position: absolute;
  3603. z-index: 999999;
  3604. top: 50px;
  3605. left: 0px;
  3606. width: 100%;
  3607. height: 100%;
  3608. }
  3609. .jiedian {
  3610. /deep/.el-dialog__body {
  3611. padding: 10px 20px !important;
  3612. }
  3613. }
  3614. .filter-tree {
  3615. min-width: 100%;
  3616. display: inline-block;
  3617. }
  3618. .full-dialog {
  3619. /deep/ .el-dialog__body {
  3620. padding-bottom: 0;
  3621. padding-top: 0;
  3622. }
  3623. /deep/ .basic-container {
  3624. height: calc(100vh - 60px);
  3625. }
  3626. }
  3627. .my-basic-con {
  3628. padding: 6px 6px;
  3629. }
  3630. // 树形控件菜单样式
  3631. .contextmenu {
  3632. margin: 0;
  3633. background: #fff;
  3634. z-index: 1000;
  3635. position: fixed; //关键样式设置固定定位
  3636. list-style-type: none;
  3637. padding: 5px 0;
  3638. border-radius: 4px;
  3639. font-size: 12px;
  3640. font-weight: 400;
  3641. color: #333;
  3642. box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  3643. }
  3644. .contextmenu li {
  3645. margin: 0;
  3646. padding: 7px 16px;
  3647. cursor: pointer;
  3648. }
  3649. .contextmenu li:hover {
  3650. background: #eee;
  3651. }
  3652. .selectBtn{
  3653. position:absolute;
  3654. top:50px;
  3655. right: 408px;
  3656. z-index:1000;
  3657. width:140px;
  3658. text-align: left;
  3659. }
  3660. .titlerow{
  3661. // float: right;
  3662. background-color:rgba(31, 34, 41, 0.8);
  3663. // width:104%;
  3664. padding-left:10px;
  3665. padding-right:10px;
  3666. text-align:right;
  3667. margin-top: -20px;
  3668. margin-left: -20px;
  3669. margin-right: -20px;
  3670. }
  3671. </style>