12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134 |
- <template>
- <div style="height:100%">
- <basic-container v-show="showType == 1">
- <el-row :gutter="20" class="h-100p">
- <el-col :span="10" class="h-100p">
- <div class="h-100p flex flex-d-c">
- <p>工程节点信息</p>
- <div class="flex">
- <el-input
- placeholder="输入关键字进行过滤"
- v-model="filterText"
- @input="filterChange"
- clearable
- ></el-input>
- <!-- <el-button type="info" class="mg-l-20">导入划分</el-button> -->
- </div>
- <div class="flex1 ov-hidden">
- <el-scrollbar class="h-100p">
- <div v-loading="treeLoad">
- <el-tree
- v-show="!filterText"
- class="filter-tree"
- lazy
- :data="treeData"
- :load="loadNode"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="tree"
- :default-expanded-keys="defaultExpandedKeys"
- >
- <span
- class="custom-tree-node"
- :class="data.moreShow?'show':''"
- slot-scope="{ node, data }"
- >
- <!--@mouseover="mouseover(data)" @mouseleave="mouseout(data)"-->
- <span class="pd-r-20">
- {{ node.label }}
- <span class="normal-black">
- <el-link :underline="false">
- <i class="el-icon-sort" @click="sortpai(data,node)" v-if="node.level != 1" title="调整排序"></i>
- </el-link>
- <el-link :underline="false">
- <i class="el-icon-upload" style="margin-left:2px;" @click="syncNodeTableHandle(data,node)" title="同步元素表单"></i>
- </el-link>
- </span>
- <!-- <el-dropdown
- @click="command=>{setLeftType(command,data)}"
- @visible-change="visiblechange($event,data)"
- >
- <el-button
- type="text"
- icon="el-icon-more"
- class="normal-black"
- >
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- @click.native="setLeftType(2,data,node)"
- icon="el-icon-edit"
- >编辑节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(3,data,node)"
- icon="el-icon-document-copy"
- >复制节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="deleNode(data,node)"
- icon="el-icon-close"
- v-if="node.level !=1"
- >删除节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(4,data,node)"
- icon="iconfont hcicon-danganziliao-biaogetianxie"
- class="font-s-12"
- >元素公式</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(5,data,node)"
- icon="el-icon-coin"
- >元素设置</el-dropdown-item>
- <el-dropdown-item
- @click.native="nodeInfo(data,node)"
- icon="el-icon-help"
- >节点参数</el-dropdown-item>
- <el-dropdown-item
- @click.native="importTemplate(data,node)"
- v-if="node.level == 2"
- icon="el-icon-upload"
- >导入划分</el-dropdown-item>
- <el-dropdown-item
- v-if="data.parentId!=0"
- @click.native="sortpai(data,node)"
- icon="el-icon-sort"
- >调整排序</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown> -->
- </span>
- </span>
- </el-tree>
- <el-tree
- v-show="filterText"
- class="filter-tree"
- :data="treeData"
- @node-click="getNodeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- :filter-node-method="filterNode"
- ref="treeall"
- >
- <span
- class="custom-tree-node"
- slot-scope="{ node, data }"
- :class="data.moreShow?'show':''"
- >
- <span class="pd-r-20">
- {{ node.label }}
- <span class="normal-black">
- <el-link :underline="false">
- <i class="el-icon-sort" @click="sortpai(data,node)" v-if="node.level != 1" title="调整排序"></i>
- </el-link>
- <el-link :underline="false">
- <i class="el-icon-upload" style="margin-left:2px;" @click="syncNodeTableHandle(data,node)" title="同步元素表单"></i>
- </el-link>
- </span>
- <!-- <el-dropdown
- @click="command=>{setLeftType(command,data)}"
- @visible-change="visiblechange($event,data)"
- >
- <el-button
- type="text"
- icon="el-icon-more"
- class="normal-black"
- >
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- @click.native="setLeftType(2,data,node)"
- icon="el-icon-edit"
- >编辑节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(3,data,node)"
- icon="el-icon-document-copy"
- >复制节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="deleNode(data,node)"
- icon="el-icon-close"
- v-if="node.level !=1"
- >删除节点</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(4,data,node)"
- icon="iconfont hcicon-danganziliao-biaogetianxie"
- class="font-s-12"
- >元素公式</el-dropdown-item>
- <el-dropdown-item
- @click.native="setLeftType(5,data,node)"
- icon="el-icon-coin"
- >元素设置</el-dropdown-item>
- <el-dropdown-item
- @click.native="nodeInfo(data)"
- icon="el-icon-help"
- >节点参数</el-dropdown-item>
- <el-dropdown-item
- @click.native="importTemplate(data,node)"
- v-if="node.level == 2"
- icon="el-icon-upload"
- >导入划分</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown> -->
- </span>
- </span>
- </el-tree>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </el-col>
- <el-col :span="14" class="h-100p flex flex-d-c">
- <div class="mg-b-10">
- <el-button type="primary" size="medium" icon="el-icon-edit-outline" @click="editNodeHandle">编辑当前节点</el-button>
- <el-button type="primary" size="medium" icon="el-icon-document-copy" @click="copyNodeHandle">复制当前节点</el-button>
- <el-button type="warning" size="medium" icon="el-icon-delete" @click="delNodeHandle">删除当前节点</el-button>
- <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-s-grid" @click="eleFormulaHandle" v-if="leftType==5">表单设置</el-button>
- <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-s-grid" @click="eleHandle" v-else>元素设置</el-button>
- <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-help" @click="nodeInfoHandle">节点参数设置</el-button>
- <el-button class="el-btn-purple" type="primary" size="medium" icon="el-icon-upload" :loading="syncBtnLoad" @click="syncInfoHandle">同步节点参数</el-button>
- </div>
- <template v-if="leftType==5">
- <div class="mg-b-10">节点信息</div>
- <div>
- <el-table
- :data="tableData"
- border
- style="width: 100%"
- >
- <el-table-column
- align="center"
- prop="nodeName"
- label="当前节点"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="nodeType"
- :formatter="formatCat"
- label="节点类型"
- width="180"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="parentName"
- label="上级节点"
- ></el-table-column>
- </el-table>
- </div>
- <div class="flex jc-sb">
- <p>
- <span>当前项目信息表</span>
- <!-- <el-button
- @click="showFormElement"
- type="text"
- icon="el-icon-circle-plus-outline"
- class="text-icon mg-l-10"
- ></el-button>
- <el-button
- type="text"
- icon="el-icon-document-copy"
- class="text-icon"
- ></el-button> -->
- <el-button
- type="text"
- style="margin-left:10px;"
- icon="el-icon-edit-outline"
- class="text-icon"
- @click="editEditElementForm()"
- ></el-button>
- <el-button
- type="text"
- icon="el-icon-sort"
- class="text-icon"
- @click="privateTableSort()"
- ></el-button>
- </p>
- <div class="mg-t-10">
- </div>
- </div>
- <div style="flex: 1;position: relative;">
- <el-table
- :data="formData"
- border height="100%"
- style="width: 100%;position: absolute;"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="elementTotal"
- width="80"
- label="字段总量"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- width="100"
- label="填报率"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- width="100"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column
- label="操作"
- width="240"
- >
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="handleEdit(scope.$index, scope.row)"
- >预览</el-button>
- <el-button
- size="mini"
- type="primary"
- v-throttle='3000'
- v-show="scope.row.status==0"
- @click="hideMD(scope.row)"
- >取消隐藏</el-button>
- <el-button
- size="mini"
- type="primary"
- v-throttle='3000'
- v-show="scope.row.status==1"
- @click="hideMD(scope.row)"
- >隐藏表单</el-button>
- <el-button
- size="mini"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- <template v-if="leftType==4">
- <div style="flex: 1;position: relative;">
- <el-table
- :data="formData"
- border height="100%"
- style="width: 100%;position: absolute;"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column
- label="操作"
- width="400"
- align="center"
- >
- <template slot-scope="scope">
- <el-link
- type="primary"
- @click="Associationlist(scope)"
- >关联清表</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled='scope.row.excelId==-1'
- @click="rightClick(scope.row.pkeyId,scope.row.excelId,scope.row.id,scope.row.initTableName)"
- >编辑元素</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled='scope.row.excelId==-1'
- @click="adjustExcel(scope.row.pkeyId,scope.row.excelId)"
- >调整表单</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式</el-link>
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单</el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-col>
- </el-row>
- </basic-container>
- <el-row class="h-100p" v-show="showType == 2">
- <el-col :span="6" class="h-100p">
- <basic-container>
- <el-scrollbar class="h-100p">
- <el-tree
- class="filter-tree"
- lazy
- :data="typeTreeData"
- :load="typeTreeLoadNode"
- @node-click="getTypeTreeDetail"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- >
- </el-tree>
- </el-scrollbar>
- </basic-container>
- </el-col>
- <el-col :span="18" class="h-100p">
- <basic-container>
- <div class="flex h-100p flex-d-c">
- <div style="flex: 1;position: relative;">
- <el-table
- :data="formData"
- border height="100%"
- style="width: 100%;position: absolute;"
- >
- <el-table-column
- align="center"
- prop="tableName"
- label="表单名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="tableType"
- :formatter="formatTableType"
- label="表单类型"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="fillRate"
- label="填报率"
- ></el-table-column>
- <el-table-column
- label="是否关联清表"
- prop="isLinkTable"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.isLinkTable == 2">是</span>
- <span v-else>否</span>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="tableOwner"
- :formatter="formatOwner"
- label="所属方"
- ></el-table-column>
- <el-table-column
- label="操作"
- width="400"
- align="center"
- >
- <template slot-scope="scope">
- <el-link
- type="primary"
- @click="Associationlist(scope)"
- >关联清表</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled='scope.row.excelId==-1'
- @click="rightClick(scope.row.pkeyId,scope.row.excelId,scope.row.id,scope.row.initTableName)"
- >编辑元素</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- :disabled='scope.row.excelId==-1'
- @click="adjustExcel(scope.row.pkeyId,scope.row.excelId)"
- >调整表单</el-link>
- <el-link
- class="mg-l-10"
- type="primary"
- @click="handleEditFormula(scope.$index, scope.row)"
- >编辑元素公式</el-link>
- <el-link
- class="mg-l-10"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)"
- >删除表单</el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="mg-t-10 flex jc-sb">
- <div></div>
- <el-button size="medium" @click="showType = 1">返回WBS树</el-button>
- </div>
- </div>
- </basic-container>
- </el-col>
- </el-row>
- <!-- 编辑元素表单信息 -->
- <el-dialog
- title="编辑元素表单信息"
- :visible.sync="editElementFormTag"
- width="60%"
- :modal-append-to-body="false"
- >
- <div>
- <el-table
- :data="formDatass"
- border
- style="width: 100%"
- >
- <el-table-column
- prop="tableName"
- label="表名"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.tableName"
- placeholder="请输入表名称"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="tableType"
- label="表类型"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.tableType"
- placeholder="请选择"
- >
- <el-option
- v-for="(item,key) in tableTypelist"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="tableOwner"
- label="所属方"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.tableOwner"
- placeholder="请选择"
- >
- <el-option
- v-for="(item,key) in ownerTypeList"
- :key="key"
- :label="item.dictValue"
- :value="item.dictKey"
- >
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fillRate"
- label="填报率"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fillRate"
- placeholder="请输入填报率"
- ></el-input>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="editElementFormTag = false">取 消</el-button>
- <el-button
- type="primary"
- @click="editeditElementFormMF()"
- >确 定</el-button>
- </span>
- </el-dialog>
- <!-- 调整表单模板 -->
- <div
- v-if="excelHtml"
- class="excelHtml"
- >
- <dynamicExcel
- @remove="removeExcel"
- v-if="excelHtml"
- :pkeyId='GLExcelFrom.id'
- />
- </div>
- <!-- 私有wbs树排序弹框 -->
- <el-dialog
- title="调整排序"
- :visible="sortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting
- v-if="sortTag2"
- @bianhua='bianhua()'
- :sort='sort'
- />
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="sortTag=false,sortTag2=false">取 消</el-button>
- <el-button
- type="primary"
- @click="editSort()"
- >确 定</el-button>
- </span>
- </el-dialog>
- <!-- 元素表排序 -->
- <el-dialog
- title="调整排序"
- :visible="excelSortTag"
- width="50%"
- append-to-body
- >
- <ManualSorting
- v-if="excelSortTag2"
- @bianhua='bianhua2()'
- :sort='tableSortList'
- />
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="excelSortTag=false">取 消</el-button>
- <el-button
- type="primary"
- @click="editPrivateSort()"
- >确 定</el-button>
- </span>
- </el-dialog>
- <!-- 关联清表 -->
- <el-dialog
- title="关联清表"
- class="excelBox"
- :visible.sync="GLExcel"
- width="500px"
- modal-append-to-body
- append-to-body
- @close="GLExcelMD"
- >
- <div>
- <el-select
- style="width:400px;"
- v-model="GLExcelFrom.name"
- placeholder="请选择"
- @change="changetherr()"
- >
- <el-option
- v-for="(item,key) in GLExcelData"
- :key="key"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-scrollbar style="margin-top:20px;height:50vh;">
- <el-input
- style="width:400px;"
- v-model.trim="GLExcelFrom.search"
- placeholder="请输入需要选择的内容"
- ></el-input>
- <el-tree
- :filter-node-method="filterNode222"
- ref="tree"
- class="filter-tree"
- style="margin-top:10px;"
- :props="GLExcelProps"
- :data="exceldata"
- node-key="id"
- accordion
- show-checkbox
- @check="checkchange"
- v-loading="GLExcelLoading"
- >
- </el-tree>
- </el-scrollbar>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- style="display: flex;justify-content: center;align-items: center;"
- >
- <el-button @click="GLExcelMD()">取 消</el-button>
- <el-button
- style="margin-left:30px;"
- type="primary"
- v-throttle='2000'
- @click="saveLinkTab()"
- >确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- @closed="saveNodeLoading = false"
- >
- <el-form
- ref="nodeDetail"
- :model="nodeDetail"
- :rules="rules"
- label-width="140px"
- >
- <el-form-item
- label="节点名称"
- prop="nodeName"
- >
- <div class="flex">
- <el-input v-model="nodeDetail.nodeName"></el-input>
- <el-button class="mg-l-10" type="primary" @click="aliasShow">添加别名</el-button>
- </div>
- </el-form-item>
- <el-form-item label="上级节点">
- <el-input
- v-model="nodeDetail.parentName"
- ></el-input>
- </el-form-item>
- <el-form-item
- label="节点类型"
- prop="nodeType"
- >
- <el-select
- v-model="nodeDetail.nodeType"
- disabled
- placeholder="请选择"
- class="w-100p"
- @change="nodeTypeChange"
- >
- <el-option
- v-for="item in nodeTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="划分编号" v-if="wbsType !== 2">
- <el-input v-model="nodeDetail.partitionCode"></el-input>
- </el-form-item>
- <el-form-item label="唯一编码">
- <el-input v-model="nodeDetail.uniqueCode"></el-input>
- </el-form-item>
- <template v-if="nodeDetail.nodeType == 6">
- <el-form-item label="是否有混凝土">
- <el-radio-group
- v-model="nodeDetail.isConcrete"
- size="small"
- >
- <el-radio
- :label="0"
- border
- >无</el-radio>
- <el-radio
- :label="1"
- border
- >有</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="是否试验节点">
- <el-radio-group
- v-model="nodeDetail.isExpernode"
- size="small"
- >
- <el-radio
- :label="0"
- border
- >否</el-radio>
- <el-radio
- :label="1"
- border
- >是</el-radio>
- </el-radio-group>
- </el-form-item>
- </template>
- <el-form-item label="内业资料类型" prop="majorDataType" v-if="wbsType !== 2">
- <el-select
- v-model="nodeDetail.majorDataType"
- disabled
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in majorDataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="勾选相关联试验" prop="mixRatioTestIds" v-if="wbsType === 2 && nodeDetail.nodeType === 53">
- <div style="position: relative; height: 300px; border: 1px solid #dddfe6;">
- <el-scrollbar class="h-100p">
- <div v-loading="testTreeLoad">
- <el-tree class="filter-tree"
- :data="testTreeData"
- :props="defaultProps"
- :expand-on-click-node="false"
- highlight-current
- node-key="id"
- ref="treeall"
- show-checkbox
- :default-checked-keys="mixRatioTestIds"
- @check="TestTreeCheckChange"
- />
- </div>
- </el-scrollbar>
- </div>
- </el-form-item>
- </el-form>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="saveNode"
- :loading="saveNodeLoading"
- >确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="创建新的元素表"
- :visible.sync="eleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="eleDialog"
- :model="eleForm"
- :rules="eleRules"
- label-width="110px"
- >
- <el-form-item
- label="表名"
- prop="nodeName"
- >
- <el-input v-model="eleForm.nodeName"></el-input>
- </el-form-item>
- <el-row>
- <el-col :span="12">
- <el-form-item
- label="表类型"
- prop="tableType"
- >
- <el-select
- v-model="eleForm.tableType"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in tableTypelist"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label="所属方"
- prop="tableOwner"
- >
- <el-select
- v-model="eleForm.tableOwner"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in ownerTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="flex jc-sb">
- <div></div>
- <div>
- <el-link
- type="primary"
- @click="importVisible = true"
- >快捷导入</el-link>
- <el-link
- type="primary"
- class="mg-l-20"
- @click="downloadTmp"
- >下载导入模版</el-link>
- </div>
- </div>
- <div class="border-grey">
- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
- <el-table
- :data="eleForm.elementList"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="eName"
- label="字段名称"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eName"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.eType"
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in dataTypeList"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eLength"
- label="长度"
- width="120"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eLength"
- size="small"
- placeholder="请输入内容"
- :disabled="scope.row.eType == 4"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- <template slot-scope="scope">
- <div class="flex">
- <el-select
- v-model="scope.row.allow"
- size="small"
- placeholder="请选择"
- style="width:120px"
- >
- <el-option
- :key="1"
- label="≥"
- value="≥"
- ></el-option>
- <el-option
- :key="2"
- label="≤"
- value="≤"
- ></el-option>
- <el-option
- :key="3"
- label="±"
- value="±"
- ></el-option>
- <el-option
- :key="4"
- label="【】"
- value="【】"
- ></el-option>
- </el-select>
- <el-input
- v-model="scope.row.deviation"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.eInspectionMethod"
- size="small"
- placeholder="请输入内容"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="操作"
- width="80"
- >
- <template slot="header">
- <el-button
- @click="addEleRow(eleForm.elementList)"
- type="text"
- icon="el-icon-circle-plus-outline"
- class="text-icon"
- ></el-button>
- </template>
- <template slot-scope="scope">
- <el-button
- icon="el-icon-remove-outline"
- type="text"
- @click="delEleRow(scope.$index,eleForm.elementList)"
- class="text-icon text-icon-danger"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="eleVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="saveFormAndElementHandle"
- >保 存</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="模版导入"
- :visible.sync="importVisible"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- >
- <p>提示:必须按照系统要求的模版格式上传,否则系统识别无效 <el-link
- type="primary"
- @click="downloadTmp"
- >下载导入模版</el-link>
- </p>
- <div>
- <el-button
- size="small"
- type="primary"
- @click="fileClick2"
- >本地上传</el-button>
- <input
- @change="tmpImport"
- type="file"
- hidden
- ref="file2"
- accept=".xls, .xlsx"
- >
- </div>
- <el-table
- :data="tempList"
- border
- style="width: 100%"
- >
- <el-table-column
- align="center"
- prop="eName"
- label="字段信息"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eLength"
- label="长度"
- width="120"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="importVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="importHandle"
- >确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :title="(curEleTable.tableName?curEleTable.tableName:'')+''"
- :visible.sync="editEleVisible"
- width="80%"
- append-to-body
- :close-on-click-modal="false"
- >
- <!-- <p class="font-c-warning">编辑元素信息(请谨慎操作)</p> -->
- <el-table
- :data="editEleList"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column
- align="center"
- type="index"
- width="50"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="eName"
- label="字段信息"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eType"
- label="数据类型"
- width="120"
- :formatter="eTypeFormatter"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eLength"
- label="长度"
- width="120"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eAllowDeviation"
- label="允许偏差值"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="eInspectionMethod"
- label="检查方法和频率"
- >
- </el-table-column>
- </el-table>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="editEleVisible = false">取 消</el-button>
- <!-- <el-button
- type="primary"
- @click="saveEles"
- >确 定</el-button> -->
- </span>
- </el-dialog>
- <el-dialog
- title="元素公式"
- :visible.sync="editEleFormulaVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div class="flex mg-b-10">
- <el-input
- v-model="formulaInput"
- placeholder="请输入名称"
- size="samll" clearable @clear="searchFormulaName"
- ></el-input>
- <el-button type="info" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
- </div>
- <el-table
- :data="editEleListFilter"
- border
- style="width: 100%"
- height="400px"
- >
- <el-table-column
- align="center"
- prop="eName"
- label="字段信息"
- >
- </el-table-column>
- <el-table-column
- align="center"
- label="操作"
- width="200"
- >
- <template slot-scope="scope">
- <el-link
- :type="scope.row.isSaveFormula == 1?'warning':'primary'"
- @click="toFormulaEdit(scope.row)"
- >公式配置</el-link>
- <!-- <el-link
- class="mg-l-10"
- type="danger"
- @click="delEleRowHandle(scope.$index,editEleListFilter)"
- >删除</el-link> -->
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <el-dialog
- title="导入划分"
- :visible.sync="importTemplateVisible"
- width="800px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div v-loading="importLoading">
- <div>
- <el-link
- type="primary"
- @click="handleDownload"
- >下载导入模版</el-link>
- </div>
- <div class="mg-t-20">
- <el-button
- type="primary"
- @click="fileClick"
- >选择文件</el-button>
- <span
- v-if="upFile"
- class="mg-l-20"
- >{{upFile.name}}</span>
- <input
- @change="fileChange"
- type="file"
- hidden
- ref="file"
- accept=".xls, .xlsx"
- >
- </div>
- <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="importTemplateVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="importTemplateHandle"
- :loading="importLoading"
- >导 入</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="节点参数"
- :visible.sync="nodeInfoVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- :show-close="false"
- >
- <div>
- <el-button
- type="text"
- icon="el-icon-s-operation"
- class="right-btn"
- @click="setNodeParameters()"
- ></el-button>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="addNodeInfoTable()"
- style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
- ></i>
- </div>
- <el-table
- :data="nodeInfoTable"
- border
- style="width: 100%"
- height="400"
- >
- <el-table-column
- align="center"
- prop="name"
- label="参数名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.k"
- placeholder="请选择"
- class="w-100p"
- >
- <el-option
- v-for="item in namelist"
- :key="item.k"
- :label="item.name"
- :value="item.k"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="value"
- label="参数值设置"
- >
- <template slot-scope="scope">
- <el-input v-model="scope.row.v"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="describe"
- label="描述"
- >
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- width="120"
- align="center"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfoss(scope.$index)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="nodeInfoVisible = false">取 消</el-button>
- <el-button
- type="primary"
- @click="nodeInfoSave()"
- >保 存</el-button>
- </span>
- </el-dialog>
- <!-- 设置参数名称 -->
- <el-dialog
- title="设置参数名称"
- :visible.sync="infoNameVisible"
- width="800px"
- append-to-body
- class="jiedian"
- :close-on-click-modal="false"
- >
- <div>
- <div class="flexEnd">
- <i
- class="el-icon-circle-plus marbottom10"
- @click="setParameterName()"
- style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
- ></i>
- </div>
- <el-table
- :data="namelists"
- border
- style="width: 100%"
- height="400"
- >
- <el-table-column
- align="center"
- prop="name"
- label="参数名称"
- >
- <template slot-scope="scope">
- <el-input v-model="scope.row.name"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="key"
- label="参数值KEY"
- >
- <template slot-scope="scope">
- <el-input v-model="scope.row.k"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="describe"
- label="描述"
- >
- <template slot-scope="scope">
- <el-input v-model="scope.row.remark"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- width="120"
- align="center"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- class="text-icon-danger"
- @click="delNodeInfo(scope.$index)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="addParameterName()">保 存</el-button>
- <el-button @click="closeParameter()">关 闭</el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="别名"
- :visible.sync="aliasVisible"
- width="600px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div>
- <div class="flex">
- <el-input v-model="aliasInput" placeholder="请输入节点别名"></el-input>
- <el-button class="mg-l-20" type="primary" @click="addAlias">添加</el-button>
- </div>
- <div class="flex" style="flex-wrap:wrap">
- <div class="mg-t-10" v-for="(tag,index) in aliasArr" :key="index">
- <el-tag closable @close="delAlias(index)">
- {{tag}}
- </el-tag>
- <span v-if="index != aliasArr.length-1">、</span>
- </div>
- </div>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="aliasVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveAliasHandle">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 公式 -->
- <el-dialog title="元素公式" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
- <FormulaEdit :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :projectid="projectid" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
- </el-dialog>
- <!-- 编辑元素 -->
- <el-dialog title=" " :visible.sync="editElementVisible" fullscreen append-to-body class="full-dialog">
- <EditElement :pkeyId="editElementQuery.pkeyId" :excelId="editElementQuery.excelId" :id="editElementQuery.id" :initTableName="editElementQuery.initTableName" :pid="editElementQuery.pid" :wbsid="editElementQuery.wbsid" :nodeid="editElementQuery.nodeid" @hideDialog="editElementVisible = false" v-if="editElementVisible"></EditElement>
- </el-dialog>
- </div>
- </template>
- <script>
- import ManualSorting from '@/components/WbsTree/ManualSorting'
- import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
- import FormulaEdit from '@/views/formula/edit.vue'
- import EditElement from '@/views/manager/projectinfo/editElement/editElement.vue'
- import {
- saveFormAndElement, selectFormElements,
- importWbsTree, findWbsTreePrivateSameLevel, wbsTreePrivateSort, parameters, saveOrUpdateBatch, keymap, updateBatchNodeTableInfo2, updateStatus
- } from "@/api/manager/wbstree";
- import {
- saveElement, remove as removeElement, updateBatchElements, getTemplate,
- importWbsElement
- } from "@/api/manager/wbsformelement";
- import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById, removePrivateTreeNode, wbsTreePrivateTableSort ,privateSubmitFullName,syncNodeParam,syncNodeTable,tabTypeLazyTree} from "@/api/manager/wbsprivate";
- import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
- import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
- import { getDictionary } from "@/api/system/dict";
- import { mapGetters } from "vuex";
- import { getList, tabLazytreeAll, saveLinkTab, getExcelHtml } from '@/api/exctab/excelmodel'
- import {getStore,setStore} from '@/util/store'
- export default {
- data () {
- var checkMajorDataType = (rule, value, callback) => {
- //console.log(this.nodeDetail.nodeType)
- //console.log(this.nodeDetail.majorDataType)
- if(this.nodeDetail.nodeType == 6){
- if(!this.nodeDetail.majorDataType){
- callback(new Error('工序节点必须选择内业资料类型'));
- }
- }
- callback();
- };
- return {
- formDatass: [],
- editElementFormTag: false,
- jiedianId: '',
- //#region
- sortTag: false,
- sortTag2: false,
- sortArray: [],
- //#endregion
- //#region 关联清表
- loading: false,
- GLExcel: false,
- GLExcelFrom: {
- id: "",
- name: '',
- search: '',//搜素框舒服的值
- ids: '',
- excelId: '',
- initTableName: '',
- },
- GLExcelData: [],//
- GLExcelProps: {
- label: 'name',
- children: 'children',
- disabled: 'hasChildren',
- isLeaf: function (data) {
- let tag = false
- if (!data.hasChildren) {
- tag = true
- }
- if (data.isExistForm == 1) {
- tag = true
- }
- return tag
- },
- },
- exceldata: [],//清表模板
- GLExcelLoading:false,
- //#endregion
- //#region 调整表单
- adjustmentExcel: '',
- excelHtml: false,
- //#endregion
- //#region
- id: '',
- projectid: '',
- filterText: '',
- treeData: [],
- treeLoad: false,
- menuShow: false,
- defaultProps: {
- children: 'children',
- label: 'title',
- isLeaf: function (data) {
- //console.log(data, !data.hasChildren, data.isExistForm);
- let tag = false
- if (!data.hasChildren) {
- tag = true
- }
- if (data.isExistForm == 1) {
- tag = true
- }
- if (data.nodeType >= 6 && data.nodeType <= 13) {
- tag = true
- }
- //中间交工。开工报告、质量评定)
- if(data.majorDataType == 1 || data.majorDataType == 2 || data.majorDataType == 3){
- tag = true
- }
- return tag
- // return !data.hasChildren || (data.isExistForm == 1);
- },
- },
- leftType: 5,
- curTreeData: {},
- curTreeNode: {},
- tableData: [],
- nodeDetail: {},
- formData: [],
- editType: 1,
- dialogVisible: false,
- saveNodeLoading: false,
- nodeTypelist: [],
- majorDataTypeList: [],
- rules: {
- nodeName: [
- { required: true, message: '请输入节点名称', trigger: 'blur' },
- ],
- nodeType: [
- { required: true, message: '请选择节点类型', trigger: 'change' }
- ],
- majorDataType:[
- { validator: checkMajorDataType, trigger: 'change' }
- ]
- },
- eleVisible: false,
- tableTypelist: [],
- dataTypeList: [],
- ownerTypeList: [],
- eleForm: {
- elementList: [],
- },
- eleRules: {
- nodeName: [
- { required: true, message: '请输入表名称', trigger: 'blur' },
- ],
- tableType: [
- { required: true, message: '请选择表类型', trigger: 'change' }
- ],
- tableOwner: [
- { required: true, message: '请选择所属方', trigger: 'change' }
- ],
- },
- importVisible: false,
- tempList: [],
- curEleTable: {},
- editEleVisible: false,
- editEleList: [],
- eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
- editEleFormulaVisible: false,
- formulaInput: '',
- editEleListFilter:[],
- editEleListAll:[],
- importTemplateVisible: false,
- fileUrl: '',
- upFile: null,
- importLoading: false,
- nodeInfoVisible: false,
- nodeInfoTable: [],
- namelist: [],
- namelists: [],
- infoNameVisible: false,
- excelSortTag: false,
- excelSortTag2: false,
- tableSortList: [],
- //#endregion
- defaultExpandedKeys:[],
- expandName:this.$route.fullPath,
- aliasVisible:false,//别名
- aliasInput:'',
- aliasArr:[],
- formulaCompVisible:false,//公式弹框
- formulaCurRow:{},//当前元素
- editElementVisible:false,//编辑元素弹框
- editElementQuery:{
- pkeyId: '',
- excelId: '',
- id: '',
- initTableName:'',
- pid: '',
- wbsid: '',
- nodeid: '',
- },//传参
- syncBtnLoad:false,
- showType:1,
- typeTreeData:[],
- testTreeLoad: false,
- testTreeData: [],
- mixRatioTestIds: []
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- dialogTitle: function () {
- let text = '节点';
- if (this.leftType == 1) {
- text = '新增' + text;
- } else if (this.leftType == 2) {
- text = '编辑' + text;
- }
- return text;
- },
- },
- created () {
- this.init();
- //console.log(this.userInfo)
- },
- methods: {
- //#region
- init () {
- //this.id = this.$route.query.wbsid;
- //this.projectid = this.$route.query.pid;
- const {wbsid, pid, type} = this.$route.query;
- this.id = wbsid
- this.projectid = pid
- this.wbsType = type ? Number(type) : 1
- this.getNodeTypelist();
- this.getTableTypelist();
- this.getDataTypelist();
- this.getOwnerTypelist();
- this.defaultExpandedKeys = getStore({name:this.expandName});
- },
- loadNode (node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id
- }
- const type = this.wbsType
- getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid, {
- wbsType: type
- }).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- })
- },
- getNodeDetail (data, node) {
- let parentName = '';
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.curTreeData.parentName = parentName;
- getDetail(data.id, this.id, this.projectid).then((res) => {
- res.data.data.parentName = parentName;
- this.tableData = [res.data.data];
- this.nodeDetail = Object.assign({}, res.data.data);
- })
- this.updateNodeTable();
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- saveNode () {
- const type = this.wbsType
- this.$refs['nodeDetail'].validate((valid) => {
- if (valid) {
- const { mixRatioTestIds, nodeType } = this.nodeDetail
- if (type === 2 && nodeType === 53) {
- if (mixRatioTestIds) {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- } else {
- this.$message({
- type: "error",
- message: '请先选择节点'
- });
- return false;
- }
- } else {
- if (this.editType == 1) {
- this.addNode();
- } else if (this.editType == 2) {
- this.updateNode();
- }
- }
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- addNode () {
- this.saveNodeLoading = true;
- update(this.nodeDetail).then(() => {
- this.updateTreeNewNode();
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!"
- });
- })
- },
- updateNode () {
- update(this.nodeDetail).then(() => {
- let node = this.tableData[0];
- node.nodeName = this.nodeDetail.nodeName;
- node.nodeType = this.nodeDetail.nodeType;
- this.curTreeData.title = this.nodeDetail.nodeName;
- this.dialogVisible = false;
- this.$message({
- type: "success",
- message: "修改成功!"
- });
- })
- },
- toSplit(val) {
- return val ? String(val).split(',') : '';
- },
- setLeftType (type, data, node) {
- this.jiedianId = data.id
- if (type == 4 || type == 5) {
- this.leftType = type;
- }
- this.curTreeData = data;
- this.curTreeNode = node;
- this.$refs.tree.setCurrentKey(data.id);
- if (type == 1 || type == 2) {
- this.getMajorDataTypeList();
- this.dialogVisible = true;
- this.editType = type;
- }
- getDetail(data.id, this.id, this.projectid).then((res) => {
- let parentName = '';
- if (node.parent.data) {
- parentName = node.parent.data.title;
- }
- res.data.data.parentName = parentName;
- this.tableData = [res.data.data];
- if (type == 1) {
- this.nodeDetail = {
- parentId: res.data.data.id,
- parentName: parentName,
- projectId: res.data.data.projectId
- };
- } else {
- this.nodeDetail = Object.assign({}, res.data.data);
- this.mixRatioTestIds = this.toSplit(res.data.data.mixRatioTestIds)
- }
- this.nodeDetail.type = 1;// '1'节点 '2'表单
- this.nodeDetail.wbsId = this.id;
- this.nodeDetail.tenantId = this.userInfo.tenant_id
- })
- if (this.leftType == 4) {
- selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length) {
- this.formData = res.data.data;
- } else {
- this.formData = [];
- }
- })
- }
- //获取节点展开路径
- this.getExpandedKeys(node);
- },
- showFormElement () {
- if (!this.nodeDetail.id) {
- this.$message({
- type: "warning",
- message: "请先选择在哪个节点下创建表"
- });
- return;
- }
- this.eleVisible = true;
- },
- addEleRow (list) {
- list.push({});
- },
- delEleRow (index, list) {
- list.splice(index, 1);
- },
- saveFormAndElementHandle () {
- this.$refs['eleDialog'].validate((valid) => {
- if (valid) {
- this.eleForm.wbsId = this.id;
- this.eleForm.tenantId = this.userInfo.tenant_id;
- this.eleForm.nodeType = -1;
- this.eleForm.type = 2;// '1'节点 '2'表单
- this.eleForm.parentId = this.nodeDetail.id;
- this.eleForm.elementList.forEach((element) => {
- element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
- if (element.eType == 4) {
- element.eLength = 0;
- }
- })
- saveFormAndElement(this.eleForm).then(() => {
- //console.log(res)
- this.updateTreeNewNode();
- this.updateNodeTable();
- this.eleVisible = false;
- this.$message({
- type: "success",
- message: "新增成功!"
- });
- })
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- updateTreeNewNode () {
- getLazytree(this.id, this.nodeDetail.parentId, this.userInfo.tenant_id, this.projectid).then((res) => {
- this.$refs.tree.updateKeyChildren(this.nodeDetail.parentId, res.data.data)
- })
- },
- updateNodeTable () {
- selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then((res) => {
- if (res.data.data.length) {
- this.formData = res.data.data;
- } else {
- this.formData = [];
- }
- })
- },
- deleNode (data, node) {
- this.$confirm('此操作将删除节点【' + data.title + '】, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- removePrivateTreeNode(data.primaryKeyId).then(() => {
- this.$refs.tree.remove(node);
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- })
- }).catch(() => {
- });
- },
- importHandle () {
- },
- handleEdit (index, row) {
- this.curEleTable = row;
- selectFormElements(this.curEleTable.id).then((res) => {
- res.data.data.forEach((element) => {
- this.eleReg.exec(element.eAllowDeviation);
- // console.log(RegExp.$1)
- // console.log(RegExp.$2)
- element.allow = RegExp.$1 ? RegExp.$1 : '';
- element.deviation = RegExp.$2 ? RegExp.$2 : '';
- })
- this.editEleList = res.data.data;
- })
- this.editEleVisible = true;
- },
- handleDelete (index, row) {
- this.$confirm('是否删除 ' + row.tableName + ' ?', '删除元素表', {
- distinguishCancelAndClose: true,
- confirmButtonText: '删除',
- cancelButtonText: '取消'
- }).then(() => {
- removeTableById(row.id, this.projectid, this.id).then(() => {
- this.formData.splice(index, 1);
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- })
- })
- },
- async hideMD (row) {//隐藏按钮
- const code = await this.updateStatus(row.pkeyId, row.status)
- if (code == 200) {
- if (row.status == 0) {
- row.status = 1
- } else {
- row.status = 0
- }
- }
- },
- async updateStatus (pKeyId, status) {//隐藏功能激活
- const { data: res } = await updateStatus({ pKeyId })
- if (res.code == 200) {
- this.$message({
- type: 'success',
- message: status == 1 ? '隐藏成功' : '激活成功'
- })
- }
- return res.code
- },
- handleEditFormula (index, row) {
- this.curEleTable = row;
- selectFormElements(this.curEleTable.id).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- })
- this.editEleFormulaVisible = true;
- },
- //搜索 筛选
- searchFormulaName(){
- this.editEleListFilter = this.editEleListAll.filter((ele)=>{
- return ele.eName.indexOf(this.formulaInput) > -1;
- })
- },
- saveNewEle (row) {
- row.eAllowDeviation = (row.allow ? row.allow : '') + (row.deviation ? row.deviation : '');
- row.fId = this.curEleTable.id;
- row.initTableName = this.curEleTable.initTableName;
- if (row.eType == 4) {
- row.eLength = 0;
- }
- saveElement(row).then((res) => {
- if (res.data.data) {
- this.$set(row, 'id', res.data.data.id);
- this.$set(row, 'ekey', res.data.data.ekey);
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- }
- })
- },
- delEleRowHandle (index, list) {
- let row = list[index];
- if (row.id) {
- //有id需要请求删除
- this.$confirm('是否确认删除?', '删除元素', {
- distinguishCancelAndClose: true,
- confirmButtonText: '删除',
- cancelButtonText: '取消'
- }).then(() => {
- removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(() => {
- list.splice(index, 1);
- })
- })
- } else {
- list.splice(index, 1);
- }
- },
- saveEles () {
- for (let i = 0; i < this.editEleList.length; i++) {
- if (!this.editEleList[i].id) {
- this.$message({
- type: "warning",
- message: "请先将新增的元素点击保存"
- });
- return;
- }
- }
- if (this.editEleList.length > 0) {
- this.editEleList.forEach((element) => {
- element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
- if (element.eType == 4) {
- element.eLength = 0;
- }
- })
- updateBatchElements(this.editEleList, this.curEleTable.initTableName).then(() => {
- this.editEleVisible = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- })
- } else {
- this.editEleVisible = false;
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "保存成功!"
- });
- }
- },
- nodeTypeChange(val) {
- if (val === 53) {
- if (this.testTreeData.length > 0) {
- return;
- }
- this.testTreeLoad = true;
- getAlltree(this.projectid, this.id).then((res) => {
- this.testTreeLoad = false;
- this.testTreeData = res.data.data;
- })
- }
- },
- //根据逗号联合
- toJoin(arr) {
- return arr ? arr.join() : '';
- },
- TestTreeCheckChange(_, {checkedKeys, halfCheckedKeys}) {
- const newarr = [...checkedKeys, ...halfCheckedKeys]
- this.nodeDetail.mixRatioTestIds = this.toJoin(newarr)
- },
- filterChange () {
- //console.log(this.$refs)
- //debugger
- if (this.treeData.length > 0) {
- this.$refs.treeall.filter(this.filterText);
- return;
- }
- this.treeLoad = true;
- getAlltree(this.projectid, this.id).then((res) => {
- this.treeLoad = false;
- this.treeData = res.data.data;
- this.$nextTick(() => {
- this.$refs.treeall.filter(this.filterText);
- })
- })
- },
- importTemplate (data) {
- this.importTemplateVisible = true;
- this.curTreeData = data;
- if (!this.fileUrl) {
- getAttchFromOriginalName(1, 20, {
- originalName: 'WBS划分模板.xls'
- }).then((res) => {
- if (res.data.data.records.length) {
- this.fileUrl = res.data.data.records[0].link;
- } else {
- this.fileUrl = '';
- }
- })
- }
- },
- importTemplateHandle () {
- if (!this.upFile) {
- this.$message({
- type: "warning",
- message: "请先选择文件再进行导入"
- });
- return;
- }
- let forms = new FormData();
- forms.append('excelFile', this.upFile);
- let wbsTreeFu = {
- wbsId: this.id,
- parentId: this.curTreeData.id,
- // ancestors:'0,'+this.curTreeData.id,
- }
- let json = JSON.stringify(wbsTreeFu);
- let blob = new Blob([json], { type: 'application/json' })
- forms.append('wbsTreeFu', blob);
- this.importLoading = true;
- importWbsTree(forms).then(() => {
- //this.$router.go(0)
- let node = this.$refs.tree.getNode(this.curTreeData.id);
- node.isLeaf = false;
- this.importTemplateVisible = false;
- this.upFile = null;
- }).finally(() => {
- this.importLoading = false;
- })
- },
- handleDownload () {
- if (this.fileUrl) {
- window.open(this.fileUrl);
- } else {
- this.$message({
- type: "warning",
- message: "请先在附件管理上传【WBS划分模板.xls】文件"
- });
- }
- },
- fileClick () {
- this.$refs.file.click();
- },
- fileChange (e) {
- const file = e.target.files[0]
- if (!file) {
- // 如果用户没有选择图片,只是点了文件上传这个按钮
- return
- }
- //console.log(file)
- this.upFile = file;
- },
- editNodeInfo (index, row) {
- this.$set(row, 'isEdit', true);
- },
- saveNodeInfoHandle (index, row) {
- row.isEdit = false;
- },
- downloadTmp () {
- getTemplate().then((res) => {
- //console.log(res)
- let blob = new Blob([res.data], {
- type: 'application/vnd.ms-excel'
- });
- //console.log(blob)
- let filename = Date.parse(new Date()) + '.xls';
- if (window.navigator.msSaveOrOpenBlob) {
- // 兼容IE10
- window.navigator.msSaveBlob(blob, filename);
- } else {
- // 兼容chrome/firefox
- let aTag = document.createElement('a');
- aTag.download = Date.parse(new Date()) + '.xls';
- aTag.href = window.URL.createObjectURL(blob);
- aTag.click();
- URL.revokeObjectURL(aTag.href);
- }
- })
- },
- fileClick2 () {
- this.$refs.file2.click();
- },
- tmpImport (e) {
- const file = e.target.files[0];
- const formData = new FormData();
- formData.append('file', file);
- //console.log(file.name)
- importWbsElement(formData).then((res) => {
- res.data.data.forEach((element) => {
- element.eName = element.elementName;
- element.eLength = element.elementLength;
- element.eType = Number(element.elementType);
- element.eAllowDeviation = element.elementAllowDeviation;
- element.eInspectionMethod = element.elementInspectionMethod;
- this.eleReg.exec(element.eAllowDeviation);
- // console.log(RegExp.$1)
- // console.log(RegExp.$2)
- element.allow = RegExp.$1 ? RegExp.$1 : '';
- element.deviation = RegExp.$2 ? RegExp.$2 : '';
- })
- this.eleForm.elementList = res.data.data;
- this.importVisible = false;
- }).finally(() => {
- e.target.value = '';
- })
- },
- visiblechange (value, data) {
- this.$set(data, 'moreShow', value)
- },
- bianhua2 () {
- this.excelSortTag2 = false
- this.$nextTick(() => {
- this.excelSortTag2 = true
- })
- },
- //私有树的元素表修改排序
- privateTableSort () {
- if (!this.curTreeData.id) {
- this.$message({
- type: "warning",
- message: "请先选择需要排序的节点"
- })
- return;
- }
- this.tableSortList = this.formData.map((form, index) => {
- return {
- sort: index + 1,
- nodeName: form.tableName,
- pkeyId: form.pkeyId,
- }
- })
- this.excelSortTag = true
- this.excelSortTag2 = true
- },
- editPrivateSort () {
- wbsTreePrivateTableSort(this.tableSortList).then(() => {
- this.updateNodeTable();
- this.$message({
- type: "success",
- message: "排序成功!"
- });
- this.excelSortTag = false;
- this.excelSortTag2 = false;
- })
- },
- //解析元素数据类型
- eTypeFormatter (row) {
- let text = '';
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == row.eType) {
- text = this.dataTypeList[i].dictValue;
- break;
- }
- }
- return text;
- },
- //跳转到公式配置页面
- toFormulaEdit (row) {
- // this.$router.push({
- // path: '/formula/edit',
- // query: {
- // wbsid: this.id,
- // eleid: row.id,
- // nodeid:this.curTreeData.id,
- // projectid:this.projectid
- // }
- // });
- this.formulaCurRow = row;
- this.formulaCompVisible = true;
- },
- getNodeTypelist () {
- const type = this.wbsType
- if (this.nodeTypelist.length > 1) {
- return;
- }
- getDictionary({
- code: type === 2 ? 'trial_node_type':'wbs_node_type'
- }).then((res) => {
- res.data.data.forEach(element => {
- element.dictKey = Number(element.dictKey)
- });
- this.nodeTypelist = res.data.data;
- })
- },
- getMajorDataTypeList () {
- if (this.majorDataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: 'major_data_type'
- }).then((res) => {
- res.data.data.forEach(element => {
- element.dictKey = Number(element.dictKey)
- });
- this.majorDataTypeList = res.data.data;
- })
- },
- getTableTypelist () {
- if (this.tableTypelist.length > 1) {
- return;
- }
- getDictionary({
- code: 'table_type'
- }).then((res) => {
- res.data.data.forEach(element => {
- element.dictKey = Number(element.dictKey)
- });
- this.tableTypelist = res.data.data;
- })
- },
- getDataTypelist () {
- if (this.dataTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: 'data_type'
- }).then((res) => {
- res.data.data.forEach(element => {
- element.dictKey = Number(element.dictKey)
- });
- this.dataTypeList = res.data.data;
- })
- },
- getOwnerTypelist () {
- if (this.ownerTypeList.length > 1) {
- return;
- }
- getDictionary({
- code: 'owner_type'
- }).then((res) => {
- res.data.data.forEach(element => {
- element.dictKey = Number(element.dictKey)
- });
- this.ownerTypeList = res.data.data;
- })
- },
- formatCat (row, column, cellValue) {
- for (let i = 0; i < this.nodeTypelist.length; i++) {
- if (this.nodeTypelist[i].dictKey == cellValue) {
- return this.nodeTypelist[i].dictValue
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatTableType (row, column, cellValue) {
- for (let i = 0; i < this.tableTypelist.length; i++) {
- if (this.tableTypelist[i].dictKey == cellValue) {
- return this.tableTypelist[i].dictValue
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatOwner (row, column, cellValue) {
- for (let i = 0; i < this.ownerTypeList.length; i++) {
- if (this.ownerTypeList[i].dictKey == cellValue) {
- return this.ownerTypeList[i].dictValue
- }
- }
- return cellValue;
- //console.log(cellValue)
- },
- formatdataType (row, column, cellValue) {
- for (let i = 0; i < this.dataTypeList.length; i++) {
- if (this.dataTypeList[i].dictKey == cellValue) {
- return this.dataTypeList[i].dictValue
- }
- }
- return cellValue;
- },
- filterNode (value, data) {
- if (!value) return true;
- return data.title.indexOf(value) !== -1;
- },
- //#endregion
- //#region wbs私有树排序
- async sortpai (data) {
- console.log(data);
- await this.findWbsTreePrivateSameLevel({
- parentId: data.parentId,
- projectId: this.projectid,
- wbsId: this.id
- })
- this.sortTag = true
- this.sortTag2 = true
- },
- editSort () {
- this.wbsTreePrivateSort()
- },
- bianhua () {
- this.sortTag2 = false
- this.$nextTick(() => {
- this.sortTag2 = true
- })
- },
- async wbsTreePrivateSort () {//wbs私有树节点手动排序
- const { data: res } = await wbsTreePrivateSort(this.sort)
- console.log(res);
- if (res.code == 200) {
- this.sortTag = false
- this.sortTag2 = false
- this.getLazytreessss()
- }
- },
- async findWbsTreePrivateSameLevel (da) {//wbs私有树同级节点接口
- const { data: res } = await findWbsTreePrivateSameLevel(da)
- console.log(res);
- if (res.code == 200) {
- this.sort = res.data
- }
- },
- async getLazytreessss () {
- const { data: res } = await getLazytree(this.id, 0, this.userInfo.tenant_id, this.projectid)
- console.log(res);
- if (res.code == 200) {
- this.treeData = res.data
- }
- },
- //#endregion
- //#region 关联清表
- async getList (da) {//获取清表模板信息
- const { data: res } = await getList(da)
- console.log(res);
- if (res.code === 200 && res.msg === '操作成功') {
- this.GLExcelData = res.data.records
- }
- },
- async tabLazytreeAll () {//清表树信息
- this.GLExcelLoading = true;
- const { data: res } = await tabLazytreeAll({
- modeId: this.GLExcelFrom.name,
- name: this.GLExcelFrom.search,
- })
- this.GLExcelLoading = false;
- console.log(res);
- if (res.code === 200 && res.msg === '操作成功') {
- this.exceldata = res.data
- }
- },
- Associationlist (scope) {//关联清表点击事件
- console.log(scope.row);
- this.GLExcel = true
- this.getList({
- current: 1,
- size: 100000,
- parentId: 0,
- })
- this.GLExcelFrom.name = scope.row.modeId
- setTimeout(() => {
- this.$refs.tree.setCheckedKeys([scope.row.excelId])
- }, 2000)
- this.GLExcelFrom.id = scope.row.pkeyId
- this.GLExcelFrom.excelId = scope.row.excelId
- this.GLExcelFrom.ids = scope.row.id
- this.GLExcelFrom.initTableName = scope.row.initTableName
- },
- changetherr () {//清表类型选择框change事件
- if (this.GLExcelFrom.name != "") {
- this.GLExcelFrom.search = ''
- this.tabLazytreeAll()
- }
- },
- GLExcelMD () {//弹框关闭事件
- this.GLExcelFrom.name = ""
- this.GLExcelFrom.search = ''
- this.GLExcelFrom.id = ''
- this.exceldata = []
- this.$refs.tree.setCheckedKeys([])
- this.GLExcel = false
- },
- checkchange (data) {//节点选中回调
- if (this.$refs.tree.getCheckedNodes().length === 0) {
- this.$refs.tree.setCheckedKeys([])
- } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
- this.$refs.tree.setCheckedKeys([data.id])
- }
- },
- async saveLinkTab () {//保存按钮
- let checkNodes = this.$refs.tree.getCheckedNodes();
- if (checkNodes.length > 0) {
- let node = checkNodes[checkNodes.length - 1];
- if(node.fileType != 3){
- this.$message({
- type: "warning",
- message: "请先上传Excel表"
- });
- return;
- }
- const { data: res } = await saveLinkTab({
- exceTabId: node.id,
- tabId: this.GLExcelFrom.id,
- })
- console.log(res);
- if (res.code === 200) {
- this.$message({
- type: 'success',
- message: '关联清表成功',
- })
- this.GLExcel = false
- this.rightClick(this.GLExcelFrom.id, this.GLExcelFrom.excelId, this.GLExcelFrom.ids, this.GLExcelFrom.initTableName,)
- }
- } else {
- this.$message({
- type: 'warning',
- message: '请先设置清表',
- })
- }
- },
- filterNode222 (value, data) {
- if (!value) return true;
- return data.name.indexOf(value) !== -1;
- },
- //#endregion
- //#region 节点参数
- nodeInfo (data) {//节点参数按钮
- this.keymap()
- //console.log(data)
- this.jiedianId = data.primaryKeyId
- this.parameters(data.primaryKeyId)
- this.nodeInfoVisible = true;
- },
- addNodeInfoTable () {//添加节点参数数据
- this.nodeInfoTable.unshift({ k: '', v: '', remark: '', wbsId: this.jiedianId, type: 1 })
- },
- delNodeInfo (key) {//设置参数名称中的删除按钮
- this.namelists.splice(key, 1)
- },
- delNodeInfoss (key) {//节点参数
- this.nodeInfoTable.splice(key, 1)
- },
- setNodeParameters () {//打开设置节点参数弹框按钮
- this.infoNameVisible = true
- this.namelists = [...this.namelist]
- },
- async setParameterName () {//设置参数名称中添加节点参数按钮
- // wbsId: this.jiedianId
- this.namelists.unshift({ name: '', remark: '', k: '', type: 0, })
- },
- async nodeInfoSave () {//节点参数弹框保存按钮
- if (this.nodeInfoTable) {
- if(this.nodeInfoTable.length == 0){
- await this.saveOrUpdateBatch([{
- "wbsId": this.jiedianId,
- "type": -1,
- }])
- this.nodeInfoVisible = false
- this.$message({
- type: "success",
- message: "保存参数节点成功!"
- })
- return;
- }
- let tag = true
- this.nodeInfoTable.forEach(val => {
- if (!val.k | !val.v) {
- return tag = false
- }
- if(!val.name){
- for (let i = 0; i < this.namelist.length; i++) {
- if(this.namelist[i].k == val.k){
- val.name = this.namelist[i].name;
- return;
- }
- }
- }
- })
- if (tag) {
- await this.saveOrUpdateBatch(this.nodeInfoTable)
- this.nodeInfoVisible = false
- this.$message({
- type: "success",
- message: "设置参数节点成功!"
- })
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值!"
- })
- }
- } else {
- this.$message({
- type: "error",
- message: "请先设置参数节点!"
- })
- }
- },
- async addParameterName () {//设置参数名称中的保存按钮
- if (this.namelists.length) {
- let tag = true
- this.namelists.forEach(val => {
- if (!val.name || !val.k) {
- return tag = false
- }
- })
- if (tag) {
- await this.saveOrUpdateBatch(this.namelists) //保存设置参数
- this.infoNameVisible = false
- this.keymap()
- } else {
- this.$message({
- type: "error",
- message: "请填写所有的参数名称和参数值KEY!"
- })
- }
- } else {
- this.$message({
- type: "warning",
- message: "请先添加参数"
- })
- }
- },
- closeParameter () {//设置参数名称,关闭按钮
- this.namelists = []
- this.infoNameVisible = false
- },
- async parameters (wbsId) {//获取接待你参数列表
- const { data: res } = await parameters({ wbsId })
- console.log(res);
- if (res.code == 200) {
- this.nodeInfoTable = res.data
- }
- },
- async saveOrUpdateBatch (da) {//保存
- const { data: res } = await saveOrUpdateBatch(da)
- console.log(res);
- },
- async keymap () {//节点参数枚举
- const { data: res } = await keymap()
- console.log(res);
- if (res.code == 200) {
- this.namelist = res.data
- }
- },
- //#endregion
- //#region 调整表单
- adjustExcel (pkeyId, excelId) {//调整表单
- this.GLExcelFrom.id = pkeyId
- this.getExcelHtml(pkeyId)
- },
- async getExcelHtml (pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId })
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem('excelHtml', res.data)
- this.adjustmentExcel = res.data
- this.excelHtml = true
- }
- },
- removeExcel () {
- this.excelHtml = false
- },
- //#endregion
- //#region 编辑元素
- async rightClick (pkeyId, excelId, id, initTableName) {
- await this.getExcelHtml2(pkeyId)
- // this.$router.push({
- // path: '/project/editElement',
- // query: {
- // pkeyId: pkeyId,
- // excelId: excelId,
- // id: id,
- // initTableName,
- // pid: this.$route.query.pid,
- // wbsid: this.$route.query.wbsid,
- // nodeid:this.curTreeData.id,
- // }
- // })
- this.editElementQuery.pkeyId = pkeyId;
- this.editElementQuery.excelId = excelId;
- this.editElementQuery.id = id;
- this.editElementQuery.initTableName = initTableName;
- this.editElementQuery.pid = this.$route.query.pid;
- this.editElementQuery.wbsid = this.$route.query.wbsid;
- this.editElementQuery.nodeid = this.curTreeData.id;
- this.editElementVisible = true;
- },
- async getExcelHtml2 (pkeyId) {
- const { data: res } = await getExcelHtml({ pkeyId })
- console.log(res);
- if (res.code === 200) {
- localStorage.setItem('editElement', res.data)
- }
- },
- //#endregion
- //#region 元素表单信息
- editEditElementForm () {//标记元素
- if (this.formData.length) {
- let da = []
- this.formDatass = [...this.formData]
- this.formDatass.forEach(val => {
- da.push({
- tableType: val.tableType - 0,
- tableOwner: val.tableOwner - 0,
- pkeyId: val.pkeyId,
- tableName: val.tableName,
- fillRate: val.fillRate,
- })
- })
- this.formDatass = da
- this.editElementFormTag = true
- }
- },
- editeditElementFormMF () {//保存按钮
- let da = []
- let tag = true
- this.formDatass.forEach(val => {
- if (!val.tableName || !val.tableType || !val.tableOwner) {
- tag = false
- return
- } else {
- da.push({
- pkeyId: val.pkeyId,
- nodeName: val.tableName,
- tableType: val.tableType,
- tableOwner: val.tableOwner,
- fillRate: val.fillRate,
- })
- }
- })
- if (tag) {
- this.updateBatchNodeTableInfo2(da)
- } else {
- this.$message({
- type: 'success',
- message: '请填写完整元素表单的所有信息!',
- })
- }
- },
- async updateBatchNodeTableInfo2 (da) {//共有编辑元素
- const { data: res } = await updateBatchNodeTableInfo2(da)
- console.log(res);
- if (res.code == 200) {
- this.editElementFormTag = false
- this.updateNodeTable()
- }
- },
- //#endregion
- //获取节点展开路径
- getExpandedKeys(node){
- //console.log(node)
- let expandedKeys = [];
- while(node.parent){
- expandedKeys.push(node.data.id);
- node = node.parent;
- }
- setStore({
- name:this.expandName,
- content:expandedKeys,
- type:true//sessionStorage
- })
- //console.log(expandedKeys)
- },
- //触发节点参数
- nodeInfoHandle(){
- if(!this.curTreeData.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- this.nodeInfo(this.curTreeData)
- },
- eleFormulaHandle(){
- if(!this.curTreeData.id || !this.curTreeNode.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- this.setLeftType(4,this.curTreeData,this.curTreeNode);
- // this.showType = 2;
- },
- editNodeHandle(){
- if(!this.curTreeData.id || !this.curTreeNode.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- this.mixRatioTestIds = []
- this.nodeTypeChange(53)
- this.setLeftType(2,this.curTreeData,this.curTreeNode)
- },
- copyNodeHandle(){
- if(!this.curTreeData.id || !this.curTreeNode.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- },
- delNodeHandle(){
- if(!this.curTreeData.id || !this.curTreeNode.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- if(this.curTreeNode.level == 1){
- this.$message({
- type: "warning",
- message: "当前节点无法删除"
- })
- return;
- }
- this.deleNode(this.curTreeData,this.curTreeNode)
- },
- eleHandle(){
- if(!this.curTreeData.id || !this.curTreeNode.id){
- this.$message({
- type: "warning",
- message: "请先选择节点"
- })
- return;
- }
- this.setLeftType(5,this.curTreeData,this.curTreeNode);
- },
- syncInfoHandle(){
- this.$confirm('是否同步节点参数?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.syncBtnLoad = true;
- syncNodeParam(this.projectid).then(() => {
- this.$message({
- type: "success",
- message: "同步成功!"
- });
- }).finally(()=>{
- this.syncBtnLoad = false;
- })
- })
- },
- //显示别名弹窗
- aliasShow(){
- this.aliasVisible = true;
- if(this.nodeDetail.fullName){
- this.aliasArr = this.nodeDetail.fullName.split(',');
- }else{
- this.aliasArr = [];
- }
- this.aliasInput = '';
- },
- addAlias(){
- if(this.aliasInput){
- this.aliasArr.push(this.aliasInput);
- this.aliasInput = '';
- }
- },
- delAlias(index){
- this.aliasArr.splice(index,1);
- },
- saveAliasHandle(){
- this.nodeDetail.fullName = this.aliasArr.join(',');
- if (this.editType == 1) {
- //新增
- this.aliasVisible = false;
- } else if (this.editType == 2) {
- //编辑 私有
- privateSubmitFullName(
- this.nodeDetail.pKeyId,this.nodeDetail.fullName
- ).then(()=>{
- this.$message({
- type: 'success',
- message: '保存成功',
- })
- this.aliasVisible = false;
- })
- }
- },
- syncNodeTableHandle(data){
- this.$confirm('是否同步节点【'+data.title+'】?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let notify = this.$notify({
- title: '提示',
- message: '节点数据同步中...',
- duration: 0
- });
- syncNodeTable(data.primaryKeyId).then(()=>{
- this.updateNodeTable();
- this.$message({
- type: 'success',
- message: '同步成功',
- })
- }).catch(()=>{
- this.$message({
- type: "error",
- message: "同步失败"
- })
- }).finally(()=>{
- notify.close();
- })
- })
- },
- typeTreeLoadNode (node, resolve) {
- let pid = 0;
- if (node.level != 0) {
- pid = node.data.id
- }
- tabTypeLazyTree(pid,this.projectid).then((res) => {
- let arr = [];
- if (Array.isArray(res.data.data)) {
- arr = res.data.data;
- }
- return resolve(arr);
- })
- },
- getTypeTreeDetail(){
- },
- },
- watch: {
- 'GLExcelFrom.search' (val) {
- console.log(val);
- if (this.exceldata) {
- this.$refs.tree.filter(val);
- }
- }
- },
- components: {
- dynamicExcel,
- ManualSorting,
- FormulaEdit,
- EditElement
- },
- };
- </script>
- <style scoped lang="scss">
- .font-s-12 /deep/ .iconfont {
- font-size: 12px;
- }
- .el-popper[x-placement^="bottom"] {
- margin-top: -6px;
- }
- .right-btn {
- position: absolute;
- right: 20px;
- top: 10px;
- font-size: 20px;
- }
- .custom-tree-node {
- .normal-black {
- display: none;
- }
- &:hover {
- .normal-black {
- display: inline-block;
- }
- }
- &.show .normal-black {
- display: inline-block;
- }
- }
- .excelBox {
- /deep/.el-dialog__body {
- padding: 20px;
- }
- }
- //调整表单样式
- .excelHtml {
- position: absolute;
- z-index: 999999;
- top: 50px;
- left: 0px;
- width: 100%;
- height: 100%;
- }
- .jiedian {
- /deep/.el-dialog__body {
- padding: 10px 20px !important;
- }
- }
- .filter-tree {
- min-width: 100%;
- display: inline-block;
- }
- .full-dialog{
- /deep/ .el-dialog__body{
- padding-bottom: 0;
- padding-top: 0;
- }
- /deep/ .basic-container{
- height: calc(100vh - 60px);
- }
- }
- .my-basic-con {
- padding: 6px 6px;
- }
- </style>
|