tree.vue 94 KB

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