tree.vue 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168
  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.globalFormula == 1 ? 'warning' : 'primary'"
  1189. @click="toFormulaEdit(scope.row,1)"
  1190. >全局公式</el-link
  1191. >
  1192. <el-link
  1193. class="mg-l-10"
  1194. :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
  1195. @click="toFormulaEdit(scope.row,10)"
  1196. >节点公式</el-link
  1197. >
  1198. <!-- <el-link
  1199. class="mg-l-10"
  1200. type="danger"
  1201. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  1202. >删除</el-link> -->
  1203. </template>
  1204. </el-table-column>
  1205. </el-table>
  1206. </el-dialog>
  1207. <!-- 导入划分 -->
  1208. <el-dialog
  1209. title="导入划分"
  1210. :visible.sync="importTemplateVisible"
  1211. width="800px"
  1212. append-to-body
  1213. :close-on-click-modal="false"
  1214. >
  1215. <div v-loading="importLoading">
  1216. <div>
  1217. <el-link type="primary" @click="handleDownload">下载导入模版</el-link>
  1218. </div>
  1219. <div class="mg-t-20">
  1220. <el-button type="primary" @click="fileClick">选择文件</el-button>
  1221. <span v-if="upFile" class="mg-l-20">{{ upFile.name }}</span>
  1222. <input
  1223. @change="fileChange"
  1224. type="file"
  1225. hidden
  1226. ref="file"
  1227. accept=".xls, .xlsx"
  1228. />
  1229. </div>
  1230. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1231. </div>
  1232. <span slot="footer" class="dialog-footer">
  1233. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1234. <el-button
  1235. type="primary"
  1236. @click="importTemplateHandle"
  1237. :loading="importLoading"
  1238. >导 入</el-button
  1239. >
  1240. </span>
  1241. </el-dialog>
  1242. <!-- 节点参数 -->
  1243. <el-dialog
  1244. title="节点参数"
  1245. :visible.sync="nodeInfoVisible"
  1246. width="800px"
  1247. append-to-body
  1248. class="jiedian"
  1249. :close-on-click-modal="false"
  1250. :show-close="false"
  1251. >
  1252. <div>
  1253. <el-button
  1254. type="text"
  1255. icon="el-icon-s-operation"
  1256. class="right-btn"
  1257. @click="setNodeParameters()"
  1258. ></el-button>
  1259. <div class="flexEnd">
  1260. <i
  1261. class="el-icon-circle-plus marbottom10"
  1262. @click="addNodeInfoTable()"
  1263. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1264. ></i>
  1265. </div>
  1266. <el-table :data="nodeInfoTable" border style="width: 100%" height="400">
  1267. <el-table-column align="center" prop="name" label="参数名称">
  1268. <template slot-scope="scope">
  1269. <el-select
  1270. v-model="scope.row.k"
  1271. placeholder="请选择"
  1272. class="w-100p"
  1273. >
  1274. <el-option
  1275. v-for="item in namelist"
  1276. :key="item.k"
  1277. :label="item.name"
  1278. :value="item.k"
  1279. ></el-option>
  1280. </el-select>
  1281. </template>
  1282. </el-table-column>
  1283. <el-table-column align="center" prop="value" label="参数值设置">
  1284. <template slot-scope="scope">
  1285. <el-input v-model="scope.row.v"></el-input>
  1286. </template>
  1287. </el-table-column>
  1288. <el-table-column align="center" prop="describe" label="描述">
  1289. <template slot-scope="scope">
  1290. <el-input v-model="scope.row.remark"></el-input>
  1291. </template>
  1292. </el-table-column>
  1293. <el-table-column label="操作" width="120" align="center">
  1294. <template slot-scope="scope">
  1295. <el-button
  1296. type="text"
  1297. size="small"
  1298. class="text-icon-danger"
  1299. @click="delNodeInfoss(scope.$index)"
  1300. >删除</el-button
  1301. >
  1302. </template>
  1303. </el-table-column>
  1304. </el-table>
  1305. </div>
  1306. <span slot="footer" class="dialog-footer">
  1307. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1308. <el-button type="primary" @click="nodeInfoSave()">保 存</el-button>
  1309. </span>
  1310. </el-dialog>
  1311. <!-- 设置参数名称 -->
  1312. <el-dialog
  1313. title="设置参数名称"
  1314. :visible.sync="infoNameVisible"
  1315. width="800px"
  1316. append-to-body
  1317. class="jiedian"
  1318. :close-on-click-modal="false"
  1319. >
  1320. <div>
  1321. <div class="flexEnd">
  1322. <i
  1323. class="el-icon-circle-plus marbottom10"
  1324. @click="setParameterName()"
  1325. style="font-size: 24px; color: rgb(37, 193, 99); cursor: pointer"
  1326. ></i>
  1327. </div>
  1328. <el-table :data="namelists" border style="width: 100%" height="400">
  1329. <el-table-column align="center" prop="name" label="参数名称">
  1330. <template slot-scope="scope">
  1331. <el-input v-model="scope.row.name"></el-input>
  1332. </template>
  1333. </el-table-column>
  1334. <el-table-column align="center" prop="key" label="参数值KEY">
  1335. <template slot-scope="scope">
  1336. <el-input v-model="scope.row.k"></el-input>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column align="center" prop="describe" label="描述">
  1340. <template slot-scope="scope">
  1341. <el-input v-model="scope.row.remark"></el-input>
  1342. </template>
  1343. </el-table-column>
  1344. <el-table-column label="操作" width="120" align="center">
  1345. <template slot-scope="scope">
  1346. <el-button
  1347. type="text"
  1348. size="small"
  1349. class="text-icon-danger"
  1350. @click="delNodeInfo(scope.$index)"
  1351. >删除</el-button
  1352. >
  1353. </template>
  1354. </el-table-column>
  1355. </el-table>
  1356. </div>
  1357. <span slot="footer" class="dialog-footer">
  1358. <el-button @click="addParameterName()">保 存</el-button>
  1359. <el-button @click="closeParameter()">关 闭</el-button>
  1360. </span>
  1361. </el-dialog>
  1362. <el-dialog
  1363. title="别名"
  1364. :visible.sync="aliasVisible"
  1365. width="600px"
  1366. append-to-body
  1367. :close-on-click-modal="false"
  1368. >
  1369. <div>
  1370. <div class="flex">
  1371. <el-input
  1372. v-model="aliasInput"
  1373. placeholder="请输入节点别名"
  1374. ></el-input>
  1375. <el-button class="mg-l-20" type="primary" @click="addAlias"
  1376. >添加</el-button
  1377. >
  1378. </div>
  1379. <div class="flex" style="flex-wrap: wrap">
  1380. <div class="mg-t-10" v-for="(tag, index) in aliasArr" :key="index">
  1381. <el-tag closable @close="delAlias(index)">
  1382. {{ tag }}
  1383. </el-tag>
  1384. <span v-if="index != aliasArr.length - 1">、</span>
  1385. </div>
  1386. </div>
  1387. </div>
  1388. <span slot="footer" class="dialog-footer">
  1389. <el-button @click="aliasVisible = false">取 消</el-button>
  1390. <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
  1391. </span>
  1392. </el-dialog>
  1393. <!-- 公式 -->
  1394. <el-dialog
  1395. title="元素公式"
  1396. :visible.sync="formulaCompVisible"
  1397. fullscreen
  1398. append-to-body
  1399. class="full-dialog"
  1400. >
  1401. <FormulaEdit
  1402. :nodeid="curTreeData.id"
  1403. :eleid="formulaCurRow.id"
  1404. :globaltype="formulaCurRow.globaltype"
  1405. :projectid="projectid"
  1406. @hideDialog="formulaCompVisible = false"
  1407. v-if="formulaCompVisible"
  1408. ></FormulaEdit>
  1409. </el-dialog>
  1410. <!-- 编辑元素 -->
  1411. <el-dialog
  1412. title=" "
  1413. :visible.sync="editElementVisible"
  1414. fullscreen
  1415. append-to-body
  1416. class="full-dialog"
  1417. >
  1418. <EditElement
  1419. :pkeyId="editElementQuery.pkeyId"
  1420. :excelId="editElementQuery.excelId"
  1421. :id="editElementQuery.id"
  1422. :initTableName="editElementQuery.initTableName"
  1423. :pid="editElementQuery.pid"
  1424. :wbsid="editElementQuery.wbsid"
  1425. :nodeid="editElementQuery.nodeid"
  1426. @hideDialog="editElementVisible = false"
  1427. v-if="editElementVisible"
  1428. ></EditElement>
  1429. </el-dialog>
  1430. </div>
  1431. </template>
  1432. <script>
  1433. import ManualSorting from "@/components/WbsTree/ManualSorting";
  1434. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  1435. import FormulaEdit from "@/views/formula/edit.vue";
  1436. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
  1437. import {
  1438. saveFormAndElement,
  1439. selectFormElements,
  1440. importWbsTree,
  1441. findWbsTreePrivateSameLevel,
  1442. wbsTreePrivateSort,
  1443. parameters,
  1444. saveOrUpdateBatch,
  1445. keymap,
  1446. updateBatchNodeTableInfo2,
  1447. updateStatus,
  1448. } from "@/api/manager/wbstree";
  1449. import {
  1450. saveElement,
  1451. remove as removeElement,
  1452. updateBatchElements,
  1453. getTemplate,
  1454. importWbsElement,
  1455. } from "@/api/manager/wbsformelement";
  1456. import {
  1457. getLazytree,
  1458. getDetail,
  1459. update,
  1460. findNodeTableByCondition as selectByNodeTable,
  1461. removeTableByCondition as removeTableById,
  1462. removePrivateTreeNode,
  1463. wbsTreePrivateTableSort,
  1464. privateSubmitFullName,
  1465. syncNodeParam,
  1466. syncNodeTable,
  1467. tabTypeLazyTree,
  1468. } from "@/api/manager/wbsprivate";
  1469. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  1470. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  1471. import { getDictionary } from "@/api/system/dict";
  1472. import { mapGetters } from "vuex";
  1473. import {
  1474. getList,
  1475. tabLazytreeAll,
  1476. saveLinkTab,
  1477. getExcelHtml,
  1478. } from "@/api/exctab/excelmodel";
  1479. import { getStore, setStore } from "@/util/store";
  1480. export default {
  1481. data() {
  1482. var checkMajorDataType = (rule, value, callback) => {
  1483. //console.log(this.nodeDetail.nodeType)
  1484. //console.log(this.nodeDetail.majorDataType)
  1485. if (this.nodeDetail.nodeType == 6) {
  1486. if (!this.nodeDetail.majorDataType) {
  1487. callback(new Error("工序节点必须选择内业资料类型"));
  1488. }
  1489. }
  1490. callback();
  1491. };
  1492. return {
  1493. formDatass: [],
  1494. editElementFormTag: false,
  1495. jiedianId: "",
  1496. //#region
  1497. sortTag: false,
  1498. sortTag2: false,
  1499. sortArray: [],
  1500. //#endregion
  1501. //#region 关联清表
  1502. loading: false,
  1503. GLExcel: false,
  1504. GLExcelFrom: {
  1505. id: "",
  1506. name: "",
  1507. search: "", //搜素框舒服的值
  1508. ids: "",
  1509. excelId: "",
  1510. initTableName: "",
  1511. },
  1512. GLExcelData: [], //
  1513. GLExcelProps: {
  1514. label: "name",
  1515. children: "children",
  1516. disabled: "hasChildren",
  1517. isLeaf: function (data) {
  1518. let tag = false;
  1519. if (!data.hasChildren) {
  1520. tag = true;
  1521. }
  1522. if (data.isExistForm == 1) {
  1523. tag = true;
  1524. }
  1525. return tag;
  1526. },
  1527. },
  1528. exceldata: [], //清表模板
  1529. GLExcelLoading: false,
  1530. //#endregion
  1531. //#region 调整表单
  1532. adjustmentExcel: "",
  1533. excelHtml: false,
  1534. //#endregion
  1535. //#region
  1536. id: "",
  1537. projectid: "",
  1538. filterText: "",
  1539. treeData: [],
  1540. treeLoad: false,
  1541. menuShow: false,
  1542. defaultProps: {
  1543. children: "children",
  1544. label: "title",
  1545. isLeaf: function (data) {
  1546. //console.log(data, !data.hasChildren, data.isExistForm);
  1547. let tag = false;
  1548. if (!data.hasChildren) {
  1549. tag = true;
  1550. }
  1551. if (data.isExistForm == 1) {
  1552. tag = true;
  1553. }
  1554. if (data.nodeType >= 6 && data.nodeType <= 13) {
  1555. tag = true;
  1556. }
  1557. //中间交工。开工报告、质量评定)
  1558. if (
  1559. data.majorDataType == 1 ||
  1560. data.majorDataType == 2 ||
  1561. data.majorDataType == 3
  1562. ) {
  1563. tag = true;
  1564. }
  1565. return tag;
  1566. // return !data.hasChildren || (data.isExistForm == 1);
  1567. },
  1568. },
  1569. leftType: 5,
  1570. curTreeData: {},
  1571. curTreeNode: {},
  1572. tableData: [],
  1573. nodeDetail: {},
  1574. formData: [],
  1575. editType: 1,
  1576. dialogVisible: false,
  1577. saveNodeLoading: false,
  1578. nodeTypelist: [],
  1579. majorDataTypeList: [],
  1580. rules: {
  1581. nodeName: [
  1582. { required: true, message: "请输入节点名称", trigger: "blur" },
  1583. ],
  1584. nodeType: [
  1585. { required: true, message: "请选择节点类型", trigger: "change" },
  1586. ],
  1587. majorDataType: [{ validator: checkMajorDataType, trigger: "change" }],
  1588. },
  1589. eleVisible: false,
  1590. tableTypelist: [],
  1591. dataTypeList: [],
  1592. ownerTypeList: [],
  1593. eleForm: {
  1594. elementList: [],
  1595. },
  1596. eleRules: {
  1597. nodeName: [
  1598. { required: true, message: "请输入表名称", trigger: "blur" },
  1599. ],
  1600. tableType: [
  1601. { required: true, message: "请选择表类型", trigger: "change" },
  1602. ],
  1603. tableOwner: [
  1604. { required: true, message: "请选择所属方", trigger: "change" },
  1605. ],
  1606. },
  1607. importVisible: false,
  1608. tempList: [],
  1609. curEleTable: {},
  1610. editEleVisible: false,
  1611. editEleList: [],
  1612. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  1613. editEleFormulaVisible: false,
  1614. formulaInput: "",
  1615. editEleListFilter: [],
  1616. editEleListAll: [],
  1617. importTemplateVisible: false,
  1618. fileUrl: "",
  1619. upFile: null,
  1620. importLoading: false,
  1621. nodeInfoVisible: false,
  1622. nodeInfoTable: [],
  1623. namelist: [],
  1624. namelists: [],
  1625. infoNameVisible: false,
  1626. excelSortTag: false,
  1627. excelSortTag2: false,
  1628. tableSortList: [],
  1629. //#endregion
  1630. defaultExpandedKeys: [],
  1631. expandName: this.$route.fullPath,
  1632. aliasVisible: false, //别名
  1633. aliasInput: "",
  1634. aliasArr: [],
  1635. formulaCompVisible: false, //公式弹框
  1636. formulaCurRow: {}, //当前元素
  1637. editElementVisible: false, //编辑元素弹框
  1638. editElementQuery: {
  1639. pkeyId: "",
  1640. excelId: "",
  1641. id: "",
  1642. initTableName: "",
  1643. pid: "",
  1644. wbsid: "",
  1645. nodeid: "",
  1646. }, //传参
  1647. syncBtnLoad: false,
  1648. showType: 1,
  1649. typeTreeData: [],
  1650. testTreeLoad: false,
  1651. testTreeData: [],
  1652. mixRatioTestIds: [],
  1653. };
  1654. },
  1655. computed: {
  1656. ...mapGetters(["userInfo"]),
  1657. dialogTitle: function () {
  1658. let text = "节点";
  1659. if (this.leftType == 1) {
  1660. text = "新增" + text;
  1661. } else if (this.leftType == 2) {
  1662. text = "编辑" + text;
  1663. }
  1664. return text;
  1665. },
  1666. },
  1667. created() {
  1668. this.init();
  1669. //console.log(this.userInfo)
  1670. },
  1671. methods: {
  1672. //#region
  1673. init() {
  1674. //this.id = this.$route.query.wbsid;
  1675. //this.projectid = this.$route.query.pid;
  1676. const { wbsid, pid, type } = this.$route.query;
  1677. this.id = wbsid;
  1678. this.projectid = pid;
  1679. this.wbsType = type ? Number(type) : 1;
  1680. this.getNodeTypelist();
  1681. this.getTableTypelist();
  1682. this.getDataTypelist();
  1683. this.getOwnerTypelist();
  1684. this.defaultExpandedKeys = getStore({ name: this.expandName });
  1685. },
  1686. loadNode(node, resolve) {
  1687. let pid = 0;
  1688. if (node.level != 0) {
  1689. pid = node.data.id;
  1690. }
  1691. const type = this.wbsType;
  1692. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
  1693. wbsType: type,
  1694. }).then((res) => {
  1695. let arr = [];
  1696. if (Array.isArray(res.data.data)) {
  1697. arr = res.data.data;
  1698. }
  1699. return resolve(arr);
  1700. });
  1701. },
  1702. getNodeDetail(data, node) {
  1703. console.log('getNodeDetail',data);
  1704. let parentName = "";
  1705. if (node.parent.data) {
  1706. parentName = node.parent.data.title;
  1707. }
  1708. this.curTreeData = data;
  1709. this.curTreeNode = node;
  1710. this.curTreeData.parentName = parentName;
  1711. getDetail(data.id, this.id, this.projectid).then((res) => {
  1712. res.data.data.parentName = parentName;
  1713. this.tableData = [res.data.data];
  1714. this.nodeDetail = Object.assign({}, res.data.data);
  1715. });
  1716. this.updateNodeTable();
  1717. //获取节点展开路径
  1718. this.getExpandedKeys(node);
  1719. },
  1720. saveNode() {
  1721. const type = this.wbsType;
  1722. this.$refs["nodeDetail"].validate((valid) => {
  1723. if (valid) {
  1724. const { mixRatioTestIds, nodeType } = this.nodeDetail;
  1725. if (type === 2 && nodeType === 53) {
  1726. if (mixRatioTestIds) {
  1727. if (this.editType == 1) {
  1728. this.addNode();
  1729. } else if (this.editType == 2) {
  1730. this.updateNode();
  1731. }
  1732. } else {
  1733. this.$message({
  1734. type: "error",
  1735. message: "请先选择节点",
  1736. });
  1737. return false;
  1738. }
  1739. } else {
  1740. if (this.editType == 1) {
  1741. this.addNode();
  1742. } else if (this.editType == 2) {
  1743. this.updateNode();
  1744. }
  1745. }
  1746. } else {
  1747. console.log("error submit!!");
  1748. return false;
  1749. }
  1750. });
  1751. },
  1752. addNode() {
  1753. this.saveNodeLoading = true;
  1754. update(this.nodeDetail).then(() => {
  1755. this.updateTreeNewNode();
  1756. this.dialogVisible = false;
  1757. this.$message({
  1758. type: "success",
  1759. message: "新增成功!",
  1760. });
  1761. });
  1762. },
  1763. updateNode() {
  1764. update(this.nodeDetail).then(() => {
  1765. let node = this.tableData[0];
  1766. node.nodeName = this.nodeDetail.nodeName;
  1767. node.nodeType = this.nodeDetail.nodeType;
  1768. this.curTreeData.title = this.nodeDetail.nodeName;
  1769. this.dialogVisible = false;
  1770. this.$message({
  1771. type: "success",
  1772. message: "修改成功!",
  1773. });
  1774. });
  1775. },
  1776. toSplit(val) {
  1777. return val ? String(val).split(",") : "";
  1778. },
  1779. setLeftType(type, data, node) {
  1780. this.jiedianId = data.id;
  1781. if (type == 4 || type == 5) {
  1782. this.leftType = type;
  1783. }
  1784. this.curTreeData = data;
  1785. this.curTreeNode = node;
  1786. this.$refs.tree.setCurrentKey(data.id);
  1787. if (type == 1 || type == 2) {
  1788. this.getMajorDataTypeList();
  1789. this.dialogVisible = true;
  1790. this.editType = type;
  1791. }
  1792. getDetail(data.id, this.id, this.projectid).then((res) => {
  1793. let parentName = "";
  1794. if (node.parent.data) {
  1795. parentName = node.parent.data.title;
  1796. }
  1797. res.data.data.parentName = parentName;
  1798. this.tableData = [res.data.data];
  1799. if (type == 1) {
  1800. this.nodeDetail = {
  1801. parentId: res.data.data.id,
  1802. parentName: parentName,
  1803. projectId: res.data.data.projectId,
  1804. };
  1805. } else {
  1806. this.nodeDetail = Object.assign({}, res.data.data);
  1807. this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds);
  1808. }
  1809. this.nodeDetail.type = 1; // '1'节点 '2'表单
  1810. this.nodeDetail.wbsId = this.id;
  1811. this.nodeDetail.tenantId = this.userInfo.tenant_id;
  1812. });
  1813. if (this.leftType == 4) {
  1814. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  1815. if (res.data.data.length) {
  1816. this.formData = res.data.data;
  1817. } else {
  1818. this.formData = [];
  1819. }
  1820. });
  1821. }
  1822. //获取节点展开路径
  1823. this.getExpandedKeys(node);
  1824. },
  1825. showFormElement() {
  1826. if (!this.nodeDetail.id) {
  1827. this.$message({
  1828. type: "warning",
  1829. message: "请先选择在哪个节点下创建表",
  1830. });
  1831. return;
  1832. }
  1833. this.eleVisible = true;
  1834. },
  1835. addEleRow(list) {
  1836. list.push({});
  1837. },
  1838. delEleRow(index, list) {
  1839. list.splice(index, 1);
  1840. },
  1841. saveFormAndElementHandle() {
  1842. this.$refs["eleDialog"].validate((valid) => {
  1843. if (valid) {
  1844. this.eleForm.wbsId = this.id;
  1845. this.eleForm.tenantId = this.userInfo.tenant_id;
  1846. this.eleForm.nodeType = -1;
  1847. this.eleForm.type = 2; // '1'节点 '2'表单
  1848. this.eleForm.parentId = this.nodeDetail.id;
  1849. this.eleForm.elementList.forEach((element) => {
  1850. element.eAllowDeviation =
  1851. (element.allow ? element.allow : "") +
  1852. (element.deviation ? element.deviation : "");
  1853. if (element.eType == 4) {
  1854. element.eLength = 0;
  1855. }
  1856. });
  1857. saveFormAndElement(this.eleForm).then(() => {
  1858. //console.log(res)
  1859. this.updateTreeNewNode();
  1860. this.updateNodeTable();
  1861. this.eleVisible = false;
  1862. this.$message({
  1863. type: "success",
  1864. message: "新增成功!",
  1865. });
  1866. });
  1867. } else {
  1868. console.log("error submit!!");
  1869. return false;
  1870. }
  1871. });
  1872. },
  1873. updateTreeNewNode() {
  1874. getLazytree(
  1875. this.id,
  1876. this.nodeDetail.parentId,
  1877. this.userInfo.tenant_id,
  1878. this.projectid
  1879. ).then((res) => {
  1880. this.$refs.tree.updateKeyChildren(
  1881. this.nodeDetail.parentId,
  1882. res.data.data
  1883. );
  1884. });
  1885. },
  1886. updateNodeTable() {
  1887. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then(
  1888. (res) => {
  1889. if (res.data.data.length) {
  1890. this.formData = res.data.data;
  1891. } else {
  1892. this.formData = [];
  1893. }
  1894. }
  1895. );
  1896. },
  1897. deleNode(data, node) {
  1898. this.$confirm(
  1899. "此操作将删除节点【" + data.title + "】, 是否继续?",
  1900. "提示",
  1901. {
  1902. confirmButtonText: "确定",
  1903. cancelButtonText: "取消",
  1904. type: "warning",
  1905. }
  1906. )
  1907. .then(() => {
  1908. removePrivateTreeNode(data.primaryKeyId).then(() => {
  1909. this.$refs.tree.remove(node);
  1910. this.$message({
  1911. type: "success",
  1912. message: "删除成功!",
  1913. });
  1914. });
  1915. })
  1916. .catch(() => {});
  1917. },
  1918. importHandle() {},
  1919. handleEdit(index, row) {
  1920. this.curEleTable = row;
  1921. selectFormElements(this.curEleTable.id).then((res) => {
  1922. res.data.data.forEach((element) => {
  1923. this.eleReg.exec(element.eAllowDeviation);
  1924. // console.log(RegExp.$1)
  1925. // console.log(RegExp.$2)
  1926. element.allow = RegExp.$1 ? RegExp.$1 : "";
  1927. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  1928. });
  1929. this.editEleList = res.data.data;
  1930. });
  1931. this.editEleVisible = true;
  1932. },
  1933. handleDelete(index, row) {
  1934. this.$confirm("是否删除 " + row.tableName + " ?", "删除元素表", {
  1935. distinguishCancelAndClose: true,
  1936. confirmButtonText: "删除",
  1937. cancelButtonText: "取消",
  1938. }).then(() => {
  1939. removeTableById(row.id, this.projectid, this.id).then(() => {
  1940. this.formData.splice(index, 1);
  1941. this.$message({
  1942. type: "success",
  1943. message: "删除成功!",
  1944. });
  1945. });
  1946. });
  1947. },
  1948. async hideMD(row) {
  1949. //隐藏按钮
  1950. const code = await this.updateStatus(row.pkeyId, row.status);
  1951. if (code == 200) {
  1952. if (row.status == 0) {
  1953. row.status = 1;
  1954. } else {
  1955. row.status = 0;
  1956. }
  1957. }
  1958. },
  1959. async updateStatus(pKeyId, status) {
  1960. //隐藏功能激活
  1961. const { data: res } = await updateStatus({ pKeyId });
  1962. if (res.code == 200) {
  1963. this.$message({
  1964. type: "success",
  1965. message: status == 1 ? "隐藏成功" : "激活成功",
  1966. });
  1967. }
  1968. return res.code;
  1969. },
  1970. handleEditFormula(index, row) {
  1971. this.curEleTable = row;
  1972. selectFormElements(this.curEleTable.id).then((res) => {
  1973. this.editEleListFilter = res.data.data;
  1974. this.editEleListAll = [].concat(this.editEleListFilter);
  1975. });
  1976. this.editEleFormulaVisible = true;
  1977. },
  1978. //搜索 筛选
  1979. searchFormulaName() {
  1980. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  1981. return ele.eName.indexOf(this.formulaInput) > -1;
  1982. });
  1983. },
  1984. saveNewEle(row) {
  1985. row.eAllowDeviation =
  1986. (row.allow ? row.allow : "") + (row.deviation ? row.deviation : "");
  1987. row.fId = this.curEleTable.id;
  1988. row.initTableName = this.curEleTable.initTableName;
  1989. if (row.eType == 4) {
  1990. row.eLength = 0;
  1991. }
  1992. saveElement(row).then((res) => {
  1993. if (res.data.data) {
  1994. this.$set(row, "id", res.data.data.id);
  1995. this.$set(row, "ekey", res.data.data.ekey);
  1996. this.$message({
  1997. type: "success",
  1998. message: "保存成功!",
  1999. });
  2000. }
  2001. });
  2002. },
  2003. delEleRowHandle(index, list) {
  2004. let row = list[index];
  2005. if (row.id) {
  2006. //有id需要请求删除
  2007. this.$confirm("是否确认删除?", "删除元素", {
  2008. distinguishCancelAndClose: true,
  2009. confirmButtonText: "删除",
  2010. cancelButtonText: "取消",
  2011. }).then(() => {
  2012. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(
  2013. () => {
  2014. list.splice(index, 1);
  2015. }
  2016. );
  2017. });
  2018. } else {
  2019. list.splice(index, 1);
  2020. }
  2021. },
  2022. saveEles() {
  2023. for (let i = 0; i < this.editEleList.length; i++) {
  2024. if (!this.editEleList[i].id) {
  2025. this.$message({
  2026. type: "warning",
  2027. message: "请先将新增的元素点击保存",
  2028. });
  2029. return;
  2030. }
  2031. }
  2032. if (this.editEleList.length > 0) {
  2033. this.editEleList.forEach((element) => {
  2034. element.eAllowDeviation =
  2035. (element.allow ? element.allow : "") +
  2036. (element.deviation ? element.deviation : "");
  2037. if (element.eType == 4) {
  2038. element.eLength = 0;
  2039. }
  2040. });
  2041. updateBatchElements(
  2042. this.editEleList,
  2043. this.curEleTable.initTableName
  2044. ).then(() => {
  2045. this.editEleVisible = false;
  2046. this.updateNodeTable();
  2047. this.$message({
  2048. type: "success",
  2049. message: "保存成功!",
  2050. });
  2051. });
  2052. } else {
  2053. this.editEleVisible = false;
  2054. this.updateNodeTable();
  2055. this.$message({
  2056. type: "success",
  2057. message: "保存成功!",
  2058. });
  2059. }
  2060. },
  2061. nodeTypeChange(val) {
  2062. if (val === 53) {
  2063. if (this.testTreeData.length > 0) {
  2064. return;
  2065. }
  2066. this.testTreeLoad = true;
  2067. getAlltree(this.projectid, this.id).then((res) => {
  2068. this.testTreeLoad = false;
  2069. this.testTreeData = res.data.data;
  2070. });
  2071. }
  2072. },
  2073. //根据逗号联合
  2074. toJoin(arr) {
  2075. return arr ? arr.join() : "";
  2076. },
  2077. TestTreeCheckChange(_, { checkedKeys, halfCheckedKeys }) {
  2078. const newarr = [...checkedKeys, ...halfCheckedKeys];
  2079. this.nodeDetail.mixRatioTestIds = this.toJoin(newarr);
  2080. },
  2081. filterChange() {
  2082. //console.log(this.$refs)
  2083. //debugger
  2084. if (this.treeData.length > 0) {
  2085. this.$refs.treeall.filter(this.filterText);
  2086. return;
  2087. }
  2088. this.treeLoad = true;
  2089. getAlltree(this.projectid, this.id).then((res) => {
  2090. this.treeLoad = false;
  2091. this.treeData = res.data.data;
  2092. this.$nextTick(() => {
  2093. this.$refs.treeall.filter(this.filterText);
  2094. });
  2095. });
  2096. },
  2097. importTemplate(data) {
  2098. this.importTemplateVisible = true;
  2099. this.curTreeData = data;
  2100. if (!this.fileUrl) {
  2101. getAttchFromOriginalName(1, 20, {
  2102. originalName: "WBS划分模板.xls",
  2103. }).then((res) => {
  2104. if (res.data.data.records.length) {
  2105. this.fileUrl = res.data.data.records[0].link;
  2106. } else {
  2107. this.fileUrl = "";
  2108. }
  2109. });
  2110. }
  2111. },
  2112. importTemplateHandle() {
  2113. if (!this.upFile) {
  2114. this.$message({
  2115. type: "warning",
  2116. message: "请先选择文件再进行导入",
  2117. });
  2118. return;
  2119. }
  2120. let forms = new FormData();
  2121. forms.append("excelFile", this.upFile);
  2122. let wbsTreeFu = {
  2123. wbsId: this.id,
  2124. parentId: this.curTreeData.id,
  2125. // ancestors:'0,'+this.curTreeData.id,
  2126. };
  2127. let json = JSON.stringify(wbsTreeFu);
  2128. let blob = new Blob([json], { type: "application/json" });
  2129. forms.append("wbsTreeFu", blob);
  2130. this.importLoading = true;
  2131. importWbsTree(forms)
  2132. .then(() => {
  2133. //this.$router.go(0)
  2134. let node = this.$refs.tree.getNode(this.curTreeData.id);
  2135. node.isLeaf = false;
  2136. this.importTemplateVisible = false;
  2137. this.upFile = null;
  2138. })
  2139. .finally(() => {
  2140. this.importLoading = false;
  2141. });
  2142. },
  2143. handleDownload() {
  2144. if (this.fileUrl) {
  2145. window.open(this.fileUrl);
  2146. } else {
  2147. this.$message({
  2148. type: "warning",
  2149. message: "请先在附件管理上传【WBS划分模板.xls】文件",
  2150. });
  2151. }
  2152. },
  2153. fileClick() {
  2154. this.$refs.file.click();
  2155. },
  2156. fileChange(e) {
  2157. const file = e.target.files[0];
  2158. if (!file) {
  2159. // 如果用户没有选择图片,只是点了文件上传这个按钮
  2160. return;
  2161. }
  2162. //console.log(file)
  2163. this.upFile = file;
  2164. },
  2165. editNodeInfo(index, row) {
  2166. this.$set(row, "isEdit", true);
  2167. },
  2168. saveNodeInfoHandle(index, row) {
  2169. row.isEdit = false;
  2170. },
  2171. downloadTmp() {
  2172. getTemplate().then((res) => {
  2173. //console.log(res)
  2174. let blob = new Blob([res.data], {
  2175. type: "application/vnd.ms-excel",
  2176. });
  2177. //console.log(blob)
  2178. let filename = Date.parse(new Date()) + ".xls";
  2179. if (window.navigator.msSaveOrOpenBlob) {
  2180. // 兼容IE10
  2181. window.navigator.msSaveBlob(blob, filename);
  2182. } else {
  2183. // 兼容chrome/firefox
  2184. let aTag = document.createElement("a");
  2185. aTag.download = Date.parse(new Date()) + ".xls";
  2186. aTag.href = window.URL.createObjectURL(blob);
  2187. aTag.click();
  2188. URL.revokeObjectURL(aTag.href);
  2189. }
  2190. });
  2191. },
  2192. fileClick2() {
  2193. this.$refs.file2.click();
  2194. },
  2195. tmpImport(e) {
  2196. const file = e.target.files[0];
  2197. const formData = new FormData();
  2198. formData.append("file", file);
  2199. //console.log(file.name)
  2200. importWbsElement(formData)
  2201. .then((res) => {
  2202. res.data.data.forEach((element) => {
  2203. element.eName = element.elementName;
  2204. element.eLength = element.elementLength;
  2205. element.eType = Number(element.elementType);
  2206. element.eAllowDeviation = element.elementAllowDeviation;
  2207. element.eInspectionMethod = element.elementInspectionMethod;
  2208. this.eleReg.exec(element.eAllowDeviation);
  2209. // console.log(RegExp.$1)
  2210. // console.log(RegExp.$2)
  2211. element.allow = RegExp.$1 ? RegExp.$1 : "";
  2212. element.deviation = RegExp.$2 ? RegExp.$2 : "";
  2213. });
  2214. this.eleForm.elementList = res.data.data;
  2215. this.importVisible = false;
  2216. })
  2217. .finally(() => {
  2218. e.target.value = "";
  2219. });
  2220. },
  2221. visiblechange(value, data) {
  2222. this.$set(data, "moreShow", value);
  2223. },
  2224. bianhua2() {
  2225. this.excelSortTag2 = false;
  2226. this.$nextTick(() => {
  2227. this.excelSortTag2 = true;
  2228. });
  2229. },
  2230. //私有树的元素表修改排序
  2231. privateTableSort() {
  2232. if (!this.curTreeData.id) {
  2233. this.$message({
  2234. type: "warning",
  2235. message: "请先选择需要排序的节点",
  2236. });
  2237. return;
  2238. }
  2239. this.tableSortList = this.formData.map((form, index) => {
  2240. return {
  2241. sort: index + 1,
  2242. nodeName: form.tableName,
  2243. pkeyId: form.pkeyId,
  2244. };
  2245. });
  2246. this.excelSortTag = true;
  2247. this.excelSortTag2 = true;
  2248. },
  2249. editPrivateSort() {
  2250. wbsTreePrivateTableSort(this.tableSortList).then(() => {
  2251. this.updateNodeTable();
  2252. this.$message({
  2253. type: "success",
  2254. message: "排序成功!",
  2255. });
  2256. this.excelSortTag = false;
  2257. this.excelSortTag2 = false;
  2258. });
  2259. },
  2260. //解析元素数据类型
  2261. eTypeFormatter(row) {
  2262. let text = "";
  2263. for (let i = 0; i < this.dataTypeList.length; i++) {
  2264. if (this.dataTypeList[i].dictKey == row.eType) {
  2265. text = this.dataTypeList[i].dictValue;
  2266. break;
  2267. }
  2268. }
  2269. return text;
  2270. },
  2271. //跳转到公式配置页面
  2272. toFormulaEdit(row,type) {
  2273. // this.$router.push({
  2274. // path: '/formula/edit',
  2275. // query: {
  2276. // wbsid: this.id,
  2277. // eleid: row.id,
  2278. // nodeid:this.curTreeData.id,
  2279. // projectid:this.projectid
  2280. // }
  2281. // });
  2282. this.formulaCurRow = row;
  2283. this.formulaCurRow.globaltype = type;
  2284. this.formulaCompVisible = true;
  2285. },
  2286. getNodeTypelist() {
  2287. const type = this.wbsType;
  2288. if (this.nodeTypelist.length > 1) {
  2289. return;
  2290. }
  2291. getDictionary({
  2292. code: type === 2 ? "trial_node_type" : "wbs_node_type",
  2293. }).then((res) => {
  2294. res.data.data.forEach((element) => {
  2295. element.dictKey = Number(element.dictKey);
  2296. });
  2297. this.nodeTypelist = res.data.data;
  2298. });
  2299. },
  2300. getMajorDataTypeList() {
  2301. if (this.majorDataTypeList.length > 1) {
  2302. return;
  2303. }
  2304. getDictionary({
  2305. code: "major_data_type",
  2306. }).then((res) => {
  2307. res.data.data.forEach((element) => {
  2308. element.dictKey = Number(element.dictKey);
  2309. });
  2310. this.majorDataTypeList = res.data.data;
  2311. });
  2312. },
  2313. getTableTypelist() {
  2314. if (this.tableTypelist.length > 1) {
  2315. return;
  2316. }
  2317. getDictionary({
  2318. code: "table_type",
  2319. }).then((res) => {
  2320. res.data.data.forEach((element) => {
  2321. element.dictKey = Number(element.dictKey);
  2322. });
  2323. this.tableTypelist = res.data.data;
  2324. });
  2325. },
  2326. getDataTypelist() {
  2327. if (this.dataTypeList.length > 1) {
  2328. return;
  2329. }
  2330. getDictionary({
  2331. code: "data_type",
  2332. }).then((res) => {
  2333. res.data.data.forEach((element) => {
  2334. element.dictKey = Number(element.dictKey);
  2335. });
  2336. this.dataTypeList = res.data.data;
  2337. });
  2338. },
  2339. getOwnerTypelist() {
  2340. if (this.ownerTypeList.length > 1) {
  2341. return;
  2342. }
  2343. getDictionary({
  2344. code: "owner_type",
  2345. }).then((res) => {
  2346. res.data.data.forEach((element) => {
  2347. element.dictKey = Number(element.dictKey);
  2348. });
  2349. this.ownerTypeList = res.data.data;
  2350. });
  2351. },
  2352. formatCat(row, column, cellValue) {
  2353. for (let i = 0; i < this.nodeTypelist.length; i++) {
  2354. if (this.nodeTypelist[i].dictKey == cellValue) {
  2355. return this.nodeTypelist[i].dictValue;
  2356. }
  2357. }
  2358. return cellValue;
  2359. //console.log(cellValue)
  2360. },
  2361. formatTableType(row, column, cellValue) {
  2362. for (let i = 0; i < this.tableTypelist.length; i++) {
  2363. if (this.tableTypelist[i].dictKey == cellValue) {
  2364. return this.tableTypelist[i].dictValue;
  2365. }
  2366. }
  2367. return cellValue;
  2368. //console.log(cellValue)
  2369. },
  2370. formatOwner(row, column, cellValue) {
  2371. for (let i = 0; i < this.ownerTypeList.length; i++) {
  2372. if (this.ownerTypeList[i].dictKey == cellValue) {
  2373. return this.ownerTypeList[i].dictValue;
  2374. }
  2375. }
  2376. return cellValue;
  2377. //console.log(cellValue)
  2378. },
  2379. formatdataType(row, column, cellValue) {
  2380. for (let i = 0; i < this.dataTypeList.length; i++) {
  2381. if (this.dataTypeList[i].dictKey == cellValue) {
  2382. return this.dataTypeList[i].dictValue;
  2383. }
  2384. }
  2385. return cellValue;
  2386. },
  2387. filterNode(value, data) {
  2388. if (!value) return true;
  2389. return data.title.indexOf(value) !== -1;
  2390. },
  2391. //#endregion
  2392. //#region wbs私有树排序
  2393. async sortpai(data) {
  2394. console.log(data);
  2395. await this.findWbsTreePrivateSameLevel({
  2396. parentId: data.parentId,
  2397. projectId: this.projectid,
  2398. wbsId: this.id,
  2399. });
  2400. this.sortTag = true;
  2401. this.sortTag2 = true;
  2402. },
  2403. editSort() {
  2404. this.wbsTreePrivateSort();
  2405. },
  2406. bianhua() {
  2407. this.sortTag2 = false;
  2408. this.$nextTick(() => {
  2409. this.sortTag2 = true;
  2410. });
  2411. },
  2412. async wbsTreePrivateSort() {
  2413. //wbs私有树节点手动排序
  2414. const { data: res } = await wbsTreePrivateSort(this.sort);
  2415. console.log(res);
  2416. if (res.code == 200) {
  2417. this.sortTag = false;
  2418. this.sortTag2 = false;
  2419. this.getLazytreessss();
  2420. }
  2421. },
  2422. async findWbsTreePrivateSameLevel(da) {
  2423. //wbs私有树同级节点接口
  2424. const { data: res } = await findWbsTreePrivateSameLevel(da);
  2425. console.log(res);
  2426. if (res.code == 200) {
  2427. this.sort = res.data;
  2428. }
  2429. },
  2430. async getLazytreessss() {
  2431. const { data: res } = await getLazytree(
  2432. this.id,
  2433. 0,
  2434. this.userInfo.tenant_id,
  2435. this.projectid
  2436. );
  2437. console.log(res);
  2438. if (res.code == 200) {
  2439. this.treeData = res.data;
  2440. }
  2441. },
  2442. //#endregion
  2443. //#region 关联清表
  2444. async getList(da) {
  2445. //获取清表模板信息
  2446. const { data: res } = await getList(da);
  2447. console.log(res);
  2448. if (res.code === 200 && res.msg === "操作成功") {
  2449. this.GLExcelData = res.data.records;
  2450. }
  2451. },
  2452. async tabLazytreeAll() {
  2453. //清表树信息
  2454. this.GLExcelLoading = true;
  2455. const { data: res } = await tabLazytreeAll({
  2456. modeId: this.GLExcelFrom.name,
  2457. name: this.GLExcelFrom.search,
  2458. });
  2459. this.GLExcelLoading = false;
  2460. console.log(res);
  2461. if (res.code === 200 && res.msg === "操作成功") {
  2462. this.exceldata = res.data;
  2463. }
  2464. },
  2465. Associationlist(scope) {
  2466. //关联清表点击事件
  2467. console.log(scope.row);
  2468. this.GLExcel = true;
  2469. this.getList({
  2470. current: 1,
  2471. size: 100000,
  2472. parentId: 0,
  2473. });
  2474. this.GLExcelFrom.name = scope.row.modeId;
  2475. setTimeout(() => {
  2476. this.$refs.tree.setCheckedKeys([scope.row.excelId]);
  2477. }, 2000);
  2478. this.GLExcelFrom.id = scope.row.pkeyId;
  2479. this.GLExcelFrom.excelId = scope.row.excelId;
  2480. this.GLExcelFrom.ids = scope.row.id;
  2481. this.GLExcelFrom.initTableName = scope.row.initTableName;
  2482. },
  2483. changetherr() {
  2484. //清表类型选择框change事件
  2485. if (this.GLExcelFrom.name != "") {
  2486. this.GLExcelFrom.search = "";
  2487. this.tabLazytreeAll();
  2488. }
  2489. },
  2490. GLExcelMD() {
  2491. //弹框关闭事件
  2492. this.GLExcelFrom.name = "";
  2493. this.GLExcelFrom.search = "";
  2494. this.GLExcelFrom.id = "";
  2495. this.exceldata = [];
  2496. this.$refs.tree.setCheckedKeys([]);
  2497. this.GLExcel = false;
  2498. },
  2499. checkchange(data) {
  2500. //节点选中回调
  2501. if (this.$refs.tree.getCheckedNodes().length === 0) {
  2502. this.$refs.tree.setCheckedKeys([]);
  2503. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  2504. this.$refs.tree.setCheckedKeys([data.id]);
  2505. }
  2506. },
  2507. async saveLinkTab() {
  2508. //保存按钮
  2509. let checkNodes = this.$refs.tree.getCheckedNodes();
  2510. if (checkNodes.length > 0) {
  2511. let node = checkNodes[checkNodes.length - 1];
  2512. if (node.fileType != 3) {
  2513. this.$message({
  2514. type: "warning",
  2515. message: "请先上传Excel表",
  2516. });
  2517. return;
  2518. }
  2519. const { data: res } = await saveLinkTab({
  2520. exceTabId: node.id,
  2521. tabId: this.GLExcelFrom.id,
  2522. });
  2523. console.log(res);
  2524. if (res.code === 200) {
  2525. this.$message({
  2526. type: "success",
  2527. message: "关联清表成功",
  2528. });
  2529. // selectByNodeTable刷新表单列表
  2530. this.updateNodeTable();
  2531. this.GLExcel = false;
  2532. console.log(this.GLExcelFrom,'GLExcelFrom');
  2533. this.rightClick(
  2534. this.GLExcelFrom.id,
  2535. this.GLExcelFrom.excelId,
  2536. this.GLExcelFrom.ids,
  2537. this.GLExcelFrom.initTableName
  2538. );
  2539. }
  2540. } else {
  2541. this.$message({
  2542. type: "warning",
  2543. message: "请先设置清表",
  2544. });
  2545. }
  2546. },
  2547. filterNode222(value, data) {
  2548. if (!value) return true;
  2549. return data.name.indexOf(value) !== -1;
  2550. },
  2551. //#endregion
  2552. //#region 节点参数
  2553. nodeInfo(data) {
  2554. //节点参数按钮
  2555. this.keymap();
  2556. //console.log(data)
  2557. this.jiedianId = data.primaryKeyId;
  2558. this.parameters(data.primaryKeyId);
  2559. this.nodeInfoVisible = true;
  2560. },
  2561. addNodeInfoTable() {
  2562. //添加节点参数数据
  2563. this.nodeInfoTable.unshift({
  2564. k: "",
  2565. v: "",
  2566. remark: "",
  2567. nodeId: this.jiedianId,
  2568. type: 1,
  2569. });
  2570. console.log(this.nodeInfoTable)
  2571. },
  2572. delNodeInfo(key) {
  2573. //设置参数名称中的删除按钮
  2574. this.namelists.splice(key, 1);
  2575. },
  2576. delNodeInfoss(key) {
  2577. //节点参数
  2578. this.nodeInfoTable.splice(key, 1);
  2579. },
  2580. setNodeParameters() {
  2581. //打开设置节点参数弹框按钮
  2582. this.infoNameVisible = true;
  2583. this.namelists = [...this.namelist];
  2584. },
  2585. async setParameterName() {
  2586. //设置参数名称中添加节点参数按钮
  2587. // wbsId: this.jiedianId
  2588. this.namelists.unshift({ name: "", remark: "", k: "", type: 0 });
  2589. },
  2590. async nodeInfoSave() {
  2591. //节点参数弹框保存按钮
  2592. if (this.nodeInfoTable) {
  2593. if (this.nodeInfoTable.length == 0) {
  2594. await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:[
  2595. {
  2596. nodeId: this.jiedianId,
  2597. type: -1,
  2598. },
  2599. ]});
  2600. this.nodeInfoVisible = false;
  2601. this.$message({
  2602. type: "success",
  2603. message: "保存参数节点成功!",
  2604. });
  2605. return;
  2606. }
  2607. console.log(this.namelist)
  2608. let tag = true;
  2609. this.nodeInfoTable.forEach((val) => {
  2610. if (!val.k | !val.v) {
  2611. return (tag = false);
  2612. }
  2613. if (!val.name) {
  2614. for (let i = 0; i < this.namelist.length; i++) {
  2615. if (this.namelist[i].k == val.k) {
  2616. val.name = this.namelist[i].name;
  2617. return;
  2618. }
  2619. }
  2620. }
  2621. });
  2622. if (tag) {
  2623. await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.nodeInfoTable});
  2624. this.nodeInfoVisible = false;
  2625. this.$message({
  2626. type: "success",
  2627. message: "设置参数节点成功!",
  2628. });
  2629. } else {
  2630. this.$message({
  2631. type: "error",
  2632. message: "请填写所有的参数名称和参数值!",
  2633. });
  2634. }
  2635. } else {
  2636. this.$message({
  2637. type: "error",
  2638. message: "请先设置参数节点!",
  2639. });
  2640. }
  2641. },
  2642. async addParameterName() {
  2643. //设置参数名称中的保存按钮
  2644. if (this.namelists.length) {
  2645. let tag = true;
  2646. this.namelists.forEach((val) => {
  2647. if (!val.name || !val.k) {
  2648. return (tag = false);
  2649. }
  2650. });
  2651. if (tag) {
  2652. await this.saveOrUpdateBatch({projectId:this.projectid,nodeId:this.jiedianId,wps:this.namelists}); //保存设置参数
  2653. this.infoNameVisible = false;
  2654. this.keymap();
  2655. } else {
  2656. this.$message({
  2657. type: "error",
  2658. message: "请填写所有的参数名称和参数值KEY!",
  2659. });
  2660. }
  2661. } else {
  2662. this.$message({
  2663. type: "warning",
  2664. message: "请先添加参数",
  2665. });
  2666. }
  2667. },
  2668. closeParameter() {
  2669. //设置参数名称,关闭按钮
  2670. this.namelists = [];
  2671. this.infoNameVisible = false;
  2672. },
  2673. async parameters(wbsId) {
  2674. //获取接待你参数列表
  2675. const { data: res } = await parameters({ wbsId });
  2676. console.log(res);
  2677. if (res.code == 200) {
  2678. this.nodeInfoTable = res.data;
  2679. }
  2680. },
  2681. async saveOrUpdateBatch(da) {
  2682. //保存
  2683. const { data: res } = await saveOrUpdateBatch(da);
  2684. console.log(res);
  2685. },
  2686. async keymap() {
  2687. //节点参数枚举
  2688. const { data: res } = await keymap();
  2689. console.log(res);
  2690. if (res.code == 200) {
  2691. this.namelist = res.data;
  2692. }
  2693. },
  2694. //#endregion
  2695. //#region 调整表单
  2696. adjustExcel(pkeyId, excelId) {
  2697. //调整表单
  2698. this.GLExcelFrom.id = pkeyId;
  2699. this.getExcelHtml(pkeyId);
  2700. },
  2701. async getExcelHtml(pkeyId) {
  2702. const { data: res } = await getExcelHtml({ pkeyId });
  2703. console.log(res);
  2704. if (res.code === 200) {
  2705. localStorage.setItem("excelHtml", res.data);
  2706. this.adjustmentExcel = res.data;
  2707. this.excelHtml = true;
  2708. }
  2709. },
  2710. removeExcel() {
  2711. this.excelHtml = false;
  2712. },
  2713. //#endregion
  2714. //#region 编辑元素
  2715. async rightClick(pkeyId, excelId, id, initTableName) {
  2716. await this.getExcelHtml2(pkeyId);
  2717. // this.$router.push({
  2718. // path: '/project/editElement',
  2719. // query: {
  2720. // pkeyId: pkeyId,
  2721. // excelId: excelId,
  2722. // id: id,
  2723. // initTableName,
  2724. // pid: this.$route.query.pid,
  2725. // wbsid: this.$route.query.wbsid,
  2726. // nodeid:this.curTreeData.id,
  2727. // }
  2728. // })
  2729. this.editElementQuery.pkeyId = pkeyId;
  2730. this.editElementQuery.excelId = excelId;
  2731. this.editElementQuery.id = id;
  2732. this.editElementQuery.initTableName = initTableName;
  2733. this.editElementQuery.pid = this.$route.query.pid;
  2734. this.editElementQuery.wbsid = this.$route.query.wbsid;
  2735. this.editElementQuery.nodeid = this.curTreeData.id;
  2736. this.editElementVisible = true;
  2737. },
  2738. async getExcelHtml2(pkeyId) {
  2739. const { data: res } = await getExcelHtml({ pkeyId });
  2740. console.log(res);
  2741. if (res.code === 200) {
  2742. localStorage.setItem("editElement", res.data);
  2743. }
  2744. },
  2745. //#endregion
  2746. //#region 元素表单信息
  2747. editEditElementForm() {
  2748. //标记元素
  2749. if (this.formData.length) {
  2750. let da = [];
  2751. this.formDatass = [...this.formData];
  2752. this.formDatass.forEach((val) => {
  2753. da.push({
  2754. tableType: val.tableType - 0,
  2755. tableOwner: val.tableOwner - 0,
  2756. pkeyId: val.pkeyId,
  2757. tableName: val.tableName,
  2758. fillRate: val.fillRate,
  2759. });
  2760. });
  2761. this.formDatass = da;
  2762. this.editElementFormTag = true;
  2763. }
  2764. },
  2765. editeditElementFormMF() {
  2766. //保存按钮
  2767. let da = [];
  2768. let tag = true;
  2769. this.formDatass.forEach((val) => {
  2770. if (!val.tableName || !val.tableType || !val.tableOwner) {
  2771. tag = false;
  2772. return;
  2773. } else {
  2774. da.push({
  2775. pkeyId: val.pkeyId,
  2776. nodeName: val.tableName,
  2777. tableType: val.tableType,
  2778. tableOwner: val.tableOwner,
  2779. fillRate: val.fillRate,
  2780. });
  2781. }
  2782. });
  2783. if (tag) {
  2784. this.updateBatchNodeTableInfo2(da);
  2785. } else {
  2786. this.$message({
  2787. type: "success",
  2788. message: "请填写完整元素表单的所有信息!",
  2789. });
  2790. }
  2791. },
  2792. async updateBatchNodeTableInfo2(da) {
  2793. //共有编辑元素
  2794. const { data: res } = await updateBatchNodeTableInfo2(da);
  2795. console.log(res);
  2796. if (res.code == 200) {
  2797. this.editElementFormTag = false;
  2798. this.updateNodeTable();
  2799. }
  2800. },
  2801. //#endregion
  2802. //获取节点展开路径
  2803. getExpandedKeys(node) {
  2804. //console.log(node)
  2805. let expandedKeys = [];
  2806. while (node.parent) {
  2807. expandedKeys.push(node.data.id);
  2808. node = node.parent;
  2809. }
  2810. setStore({
  2811. name: this.expandName,
  2812. content: expandedKeys,
  2813. type: true, //sessionStorage
  2814. });
  2815. //console.log(expandedKeys)
  2816. },
  2817. //触发节点参数
  2818. nodeInfoHandle() {
  2819. if (!this.curTreeData.id) {
  2820. this.$message({
  2821. type: "warning",
  2822. message: "请先选择节点",
  2823. });
  2824. return;
  2825. }
  2826. this.nodeInfo(this.curTreeData);
  2827. },
  2828. eleFormulaHandle() {
  2829. if (!this.curTreeData.id || !this.curTreeNode.id) {
  2830. this.$message({
  2831. type: "warning",
  2832. message: "请先选择节点",
  2833. });
  2834. return;
  2835. }
  2836. this.setLeftType(4, this.curTreeData, this.curTreeNode);
  2837. // this.showType = 2;
  2838. },
  2839. editNodeHandle() {
  2840. if (!this.curTreeData.id || !this.curTreeNode.id) {
  2841. this.$message({
  2842. type: "warning",
  2843. message: "请先选择节点",
  2844. });
  2845. return;
  2846. }
  2847. this.mixRatioTestIds = [];
  2848. this.nodeTypeChange(53);
  2849. this.setLeftType(2, this.curTreeData, this.curTreeNode);
  2850. },
  2851. copyNodeHandle() {
  2852. if (!this.curTreeData.id || !this.curTreeNode.id) {
  2853. this.$message({
  2854. type: "warning",
  2855. message: "请先选择节点",
  2856. });
  2857. return;
  2858. }
  2859. },
  2860. delNodeHandle() {
  2861. if (!this.curTreeData.id || !this.curTreeNode.id) {
  2862. this.$message({
  2863. type: "warning",
  2864. message: "请先选择节点",
  2865. });
  2866. return;
  2867. }
  2868. if (this.curTreeNode.level == 1) {
  2869. this.$message({
  2870. type: "warning",
  2871. message: "当前节点无法删除",
  2872. });
  2873. return;
  2874. }
  2875. this.deleNode(this.curTreeData, this.curTreeNode);
  2876. },
  2877. eleHandle() {
  2878. if (!this.curTreeData.id || !this.curTreeNode.id) {
  2879. this.$message({
  2880. type: "warning",
  2881. message: "请先选择节点",
  2882. });
  2883. return;
  2884. }
  2885. this.setLeftType(5, this.curTreeData, this.curTreeNode);
  2886. },
  2887. syncInfoHandle() {
  2888. this.$confirm("是否同步节点参数?", "提示", {
  2889. confirmButtonText: "确定",
  2890. cancelButtonText: "取消",
  2891. type: "warning",
  2892. }).then(() => {
  2893. this.syncBtnLoad = true;
  2894. syncNodeParam(this.projectid)
  2895. .then(() => {
  2896. this.$message({
  2897. type: "success",
  2898. message: "同步成功!",
  2899. });
  2900. })
  2901. .finally(() => {
  2902. this.syncBtnLoad = false;
  2903. });
  2904. });
  2905. },
  2906. //显示别名弹窗
  2907. aliasShow() {
  2908. this.aliasVisible = true;
  2909. if (this.nodeDetail.fullName) {
  2910. this.aliasArr = this.nodeDetail.fullName.split(",");
  2911. } else {
  2912. this.aliasArr = [];
  2913. }
  2914. this.aliasInput = "";
  2915. },
  2916. addAlias() {
  2917. if (this.aliasInput) {
  2918. this.aliasArr.push(this.aliasInput);
  2919. this.aliasInput = "";
  2920. }
  2921. },
  2922. delAlias(index) {
  2923. this.aliasArr.splice(index, 1);
  2924. },
  2925. saveAliasHandle() {
  2926. this.nodeDetail.fullName = this.aliasArr.join(",");
  2927. if (this.editType == 1) {
  2928. //新增
  2929. this.aliasVisible = false;
  2930. } else if (this.editType == 2) {
  2931. //编辑 私有
  2932. privateSubmitFullName(
  2933. this.nodeDetail.pKeyId,
  2934. this.nodeDetail.fullName
  2935. ).then(() => {
  2936. this.$message({
  2937. type: "success",
  2938. message: "保存成功",
  2939. });
  2940. this.aliasVisible = false;
  2941. });
  2942. }
  2943. },
  2944. syncNodeTableHandle(data) {
  2945. this.$confirm("是否同步节点【" + data.title + "】?", "提示", {
  2946. confirmButtonText: "确定",
  2947. cancelButtonText: "取消",
  2948. type: "warning",
  2949. }).then(() => {
  2950. let notify = this.$notify({
  2951. title: "提示",
  2952. message: "节点数据同步中...",
  2953. duration: 0,
  2954. });
  2955. syncNodeTable(data.primaryKeyId)
  2956. .then(() => {
  2957. this.updateNodeTable();
  2958. this.$message({
  2959. type: "success",
  2960. message: "同步成功",
  2961. });
  2962. })
  2963. .catch(() => {
  2964. this.$message({
  2965. type: "error",
  2966. message: "同步失败",
  2967. });
  2968. })
  2969. .finally(() => {
  2970. notify.close();
  2971. });
  2972. });
  2973. },
  2974. typeTreeLoadNode(node, resolve) {
  2975. let pid = 0;
  2976. if (node.level != 0) {
  2977. pid = node.data.id;
  2978. }
  2979. tabTypeLazyTree(pid, this.projectid).then((res) => {
  2980. let arr = [];
  2981. if (Array.isArray(res.data.data)) {
  2982. arr = res.data.data;
  2983. }
  2984. return resolve(arr);
  2985. });
  2986. },
  2987. getTypeTreeDetail() {},
  2988. independent(){
  2989. console.log('独立表单库');
  2990. this.$router.push({
  2991. path: '/project/independent',
  2992. query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
  2993. });
  2994. }
  2995. },
  2996. watch: {
  2997. "GLExcelFrom.search"(val) {
  2998. console.log(val);
  2999. if (this.exceldata) {
  3000. this.$refs.tree.filter(val);
  3001. }
  3002. },
  3003. },
  3004. components: {
  3005. dynamicExcel,
  3006. ManualSorting,
  3007. FormulaEdit,
  3008. EditElement,
  3009. },
  3010. };
  3011. </script>
  3012. <style scoped lang="scss">
  3013. .font-s-12 /deep/ .iconfont {
  3014. font-size: 12px;
  3015. }
  3016. .el-popper[x-placement^="bottom"] {
  3017. margin-top: -6px;
  3018. }
  3019. .right-btn {
  3020. position: absolute;
  3021. right: 20px;
  3022. top: 10px;
  3023. font-size: 20px;
  3024. }
  3025. .custom-tree-node {
  3026. .normal-black {
  3027. display: none;
  3028. }
  3029. &:hover {
  3030. .normal-black {
  3031. display: inline-block;
  3032. }
  3033. }
  3034. &.show .normal-black {
  3035. display: inline-block;
  3036. }
  3037. }
  3038. .excelBox {
  3039. /deep/.el-dialog__body {
  3040. padding: 20px;
  3041. }
  3042. }
  3043. //调整表单样式
  3044. .excelHtml {
  3045. position: absolute;
  3046. z-index: 999999;
  3047. top: 50px;
  3048. left: 0px;
  3049. width: 100%;
  3050. height: 100%;
  3051. }
  3052. .jiedian {
  3053. /deep/.el-dialog__body {
  3054. padding: 10px 20px !important;
  3055. }
  3056. }
  3057. .filter-tree {
  3058. min-width: 100%;
  3059. display: inline-block;
  3060. }
  3061. .full-dialog {
  3062. /deep/ .el-dialog__body {
  3063. padding-bottom: 0;
  3064. padding-top: 0;
  3065. }
  3066. /deep/ .basic-container {
  3067. height: calc(100vh - 60px);
  3068. }
  3069. }
  3070. .my-basic-con {
  3071. padding: 6px 6px;
  3072. }
  3073. </style>