tree.vue 91 KB

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