12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180 |
- <template>
- <!-- 年度计划编制((机焦-主产品)) -->
- <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
- <div class="outElectricity">
- <div class="box">
- <div class="box-top">
- <el-form
- style="overflow: hidden;"
- :style="filterForm.show ? null : { height: '0px' }"
- size="mini"
- label-width="75px"
- >
- <el-row>
- <el-col :span="5">
- <!-- <el-form-item label="工序">
- <el-select
- filterable clearable
- v-model="filterForm.data.networkid"
- multiple
- collapse-tags
- placeholder="机焦厂"
- style="width: 100%;"
- disabled
- @change="connn()"
- >
- <el-option
- v-for="item of nameObj.networkid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item> -->
- </el-col>
- <el-col :span="6">
- <el-form-item label="年份">
- <zj-timegran-date
- v-model="filterForm.data.yearmonth"
- style="width: 100%;"
- :timegranId="'YEAR'"
- :oneFoo="getTableData"
- :custom="1"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- </el-col>
- <el-col :span="5">
- </el-col>
- </el-row>
- </el-form>
- <div class="box-top-gjl">
- <el-form size="mini" label-width="75px">
- <el-row>
- <el-col :span="16">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- @click="but_add"
- :loading="loading"
- >新增</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- @click="but_copy"
- :loading="loading"
- v-if="butPrivilege.PUT && !isCheck"
- >复制</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-edit-outline"
- @click="but_edit_plural()"
- :loading="loading"
- v-if="butPrivilege.PUT && !isCheck"
- >修改</el-button>
- <el-button
- class="button"
- type="danger"
- size="mini"
- icon="el-icon-delete"
- v-if="butPrivilege.PUT && !isCheck"
- @click="but_del_plural()"
- :loading="loading"
- >删除</el-button>
- <!-- 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据 -->
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-view"
- @click="upState()"
- :loading="loading"
- v-if="butPrivilege.CHECK && isCheck"
- >审核</el-button>
- <el-button
- class="button"
- size="mini"
- icon="el-icon-refresh"
- @click="upState('1')"
- :loading="loading"
- v-if="butPrivilege.UNDOCHECK && isCheck"
- >撤销审核</el-button>
- </el-col>
- <el-col :span="8">
- <div style="float:right; text-align: right;">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-search"
- v-if="butPrivilege.QUERY"
- @click="getTableData(1)"
- >查询</el-button>
- <el-button
- size="mini"
- :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
- :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
- @click="filterForm.show = !filterForm.show;
- $nextTick(() => {
- singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
- }
- );"
- >{{ filterForm.show ? '收起' : '展开' }}</el-button>
- </div>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </div>
- <div class="box-bottom">
- <el-form
- size="mini"
- ref="dialog_form_arr"
- label-width="0px"
- :model="tableFormDataObj"
- >
- <el-table stripe
- id="singleTable"
- ref="singleTable"
- :data="tableData"
- v-loading="tableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- @selection-change="handleSelectionChange"
- show-summary
- :summary-method="getSummaries"
- :span-method="arraySpanMethod"
- :row-class-name="tableRowClassName"
- @cell-click="cellClick"
- >
- <el-table-column
- type="selection"
- width="40"
- align="center"
- :selectable='checkboxT'
- fixed="left"
- class-name="cnspicuous"
- ></el-table-column>
- <el-table-column
- sortable
- prop="index"
- type="index"
- label="序号"
- fixed="left"
- width="50px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="yearmonth"
- label="月份"
- fixed="left"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- fixed="left"
- prop="unit"
- label="计量单位"
- width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.unitid.obj[scope.row.unit] ? nameObj.unitid.obj[scope.row.unit] : scope.row.unit }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- prop="avgTime"
- label="平均结焦时间"
- fixed="left"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column> -->
- <el-table-column
- prop="total"
- label="合计产量"
- fixed="left"
- width="160px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <span v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'">{{ rowSum(scope.row) }}</span>
- <span v-else>{{ scope.row.total }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="成品焦">
- <!-- <el-table-column
- label="产生数量"
- prop="weight"
- rowsPan="3"
- fixed="left"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight"
- style="width: 100%;"
- v-model="itemform['成品焦']"
- v-if="!isNaN(Number(itemform['成品焦']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight" :key="index">{{item['成品焦']}}</span>
- </template></el-table-column> -->
- <el-table-column
- prop="weight1"
- label="高炉用量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1"
- style="width: 100%;"
- v-model="itemform['成品焦']"
- v-if="!isNaN(Number(itemform['成品焦']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight1" :key="index">{{item['成品焦']}}</span>
- </template></el-table-column>
- <el-table-column
- prop="weight2"
- label="外销数量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight2"
- style="width: 100%;"
- v-model="itemform['成品焦']"
- v-if="!isNaN(Number(itemform['成品焦']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['成品焦']}}</span>
- </template></el-table-column>
- <el-table-column
- label="生产合计"
- prop="subtotal"
- fixed="left"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <template
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- ><span
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['成品焦']))"
- :key="key">{{ Number(itemform['成品焦']) + Number(tableData[scope.row.index].weight2[key]['成品焦']) }}</span>
- </template>
- <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['成品焦']}}</span>
- </template></el-table-column>
- </el-table-column>
- <el-table-column
- label="小粒焦">
- <el-table-column
- prop="weight1"
- label="高炉用量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1"
- style="width: 100%;"
- v-model="itemform['小粒焦']"
- v-if="!isNaN(Number(itemform['小粒焦']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight1" :key="index">{{item['小粒焦']}}</span>
- </template></el-table-column>
- <el-table-column
- prop="weight2"
- label="外销数量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight2"
- style="width: 100%;"
- v-model="itemform['小粒焦']"
- v-if="!isNaN(Number(itemform['小粒焦']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['小粒焦']}}</span>
- </template></el-table-column>
- <el-table-column
- label="生产合计"
- prop="subtotal"
- fixed="left"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <template
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- ><span
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['小粒焦']))"
- :key="key">{{ Number(itemform['小粒焦']) + Number(tableData[scope.row.index].weight2[key]['小粒焦']) }}</span>
- </template>
- <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['小粒焦']}}</span>
- </template></el-table-column>
- </el-table-column>
- <el-table-column
- label="焦粉"
- ><el-table-column
- prop="weight1"
- label="烧结用量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1"
- style="width: 100%;"
- v-model="itemform['焦粉']"
- v-if="!isNaN(Number(itemform['焦粉']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight1" :key="index">{{item['焦粉']}}</span>
- </template></el-table-column>
- <el-table-column
- prop="weight2"
- label="外销数量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight2"
- style="width: 100%;"
- v-model="itemform['焦粉']"
- v-if="!isNaN(Number(itemform['焦粉']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['焦粉']}}</span>
- </template></el-table-column>
- <el-table-column
- label="生产合计"
- prop="subtotal"
- fixed="left"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <template
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- ><span
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['焦粉']))"
- :key="key">{{ Number(itemform['焦粉']) + Number(tableData[scope.row.index].weight2[key]['焦粉']) }}</span>
- </template>
- <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['焦粉']}}</span>
- </template></el-table-column>
- </el-table-column>
- <el-table-column
- label="除尘焦粉"
- >
- <el-table-column
- prop="weight1"
- label="高炉用量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1"
- style="width: 100%;"
- v-model="itemform['除尘焦粉']"
- v-if="!isNaN(Number(itemform['除尘焦粉']))"
- refcous="true"
- :rules="tableFormRules.weight"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight1" :key="index">{{item['除尘焦粉']}}</span>
- </template></el-table-column>
- <el-table-column
- prop="weight2"
- label="外销数量"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.weight'"
- ><el-input clearable
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight2"
- style="width: 100%;"
- v-model="itemform['除尘焦粉']"
- v-if="!isNaN(Number(itemform['除尘焦粉']))"
- refcous="true"
- oninput="this.value = this.value.replace(/[^\d.]/g,'');"
- :rules="tableFormRules.weight"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- :key="key"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else v-for="(item, index) in tableData[scope.row.index].weight2" :key="index">{{item['除尘焦粉']}}</span>
- </template></el-table-column>
- <el-table-column
- label="生产合计"
- prop="subtotal"
- fixed="left"
- width="120px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <template
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- ><span
- v-for="(itemform, key) in tableFormDataObj[scope.row.seq].weight1" v-if="!isNaN(Number(itemform['除尘焦粉']))"
- :key="key">{{ Number(itemform['除尘焦粉']) + Number(tableData[scope.row.index].weight2[key]['除尘焦粉']) }}</span>
- </template>
- <span v-else v-for="(item, index) in tableData[scope.row.index].subtotal" :key="index">{{item['除尘焦粉']}}</span>
- </template></el-table-column>
- </el-table-column>
- <el-table-column
- prop="cjsj"
- label="创建时间"
- width="220px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="cjr"
- label="创建人"
- width="160px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="xgsj"
- label="修改时间"
- width="220px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- prop="xgr"
- label="修改人"
- width="160px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="memo"
- label="备注"
- width="350px"
- :show-overflow-tooltip="true"
- ><template slot-scope="scope">
- <el-form-item
- v-if="!isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :prop="scope.row.seq + '.memo'"
- :rules="tableFormRules.memo"
- ><el-input clearable
- style="width: 100%;"
- v-model="tableFormDataObj[scope.row.seq].memo"
- refcous="true"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- @change="chnageSecondVal(scope.row.seq, tableFormDataObj[scope.row.seq].secondVal, scope.$index)"
- ></el-input>
- <template slot="error" slot-scope="scope">
- <p class="error" :title="scope.error">{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else>{{ scope.row.memo }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="id"
- label="ID"
- width="140px"
- v-if="filterForm.data.show"
- ></el-table-column>
- </el-table>
- </el-form>
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize"
- :current-page.sync="pageNum"
- @size-change="tableSizeChange"
- @current-change="getTableData()"
- style="text-align: right;margin-top: 10px;"
- ></el-pagination>
- </div>
- </div>
- <el-dialog
- title="年计划编制-机焦厂(主产品) 新增"
- :visible.sync="dialog.editorBox.show"
- width="600px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <div>
- <el-form
- :model="dialog.editorBox.form.data"
- ref="dialog_form"
- size="mini"
- label-width="95px"
- :rules="dialog.editorBox.form.rules"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item
- label="产品名称"
- prop="productid"
- >
- <el-select
- placeholder=""
- prop="productid"
- v-model="dialog.editorBox.form.data.productid"
- style="width: 100%;"
- :rules="dialog.editorBox.form.productid"
- >
- <el-option
- v-for="item in nameObj.productid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label="月份"
- prop="yearmonth"
- >
- <zj-timegran-date
- v-model="dialog.editorBox.form.data.yearmonth"
- style="width: 100%;"
- :timegranId="'MONTH'"
- :defaultOffset="-1"
- :rules="dialog.editorBox.form.yearmonth"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <!-- <el-col :span="12">
- <el-form-item
- label="平均结焦时间"
- prop="unit"
- >
- <el-time-picker
- clearable
- v-model="dialog.editorBox.form.data.avgTime"
- style="width: 100%;"
- :rules="dialog.editorBox.form.avgTime"
- placeholder="选择消耗时长">
- </el-time-picker>
- </el-form-item>
- </el-col> -->
- <!-- <el-col :span="12">
- <el-form-item
- label="产生数量"
- prop="weight"
- >
- <el-input
- clearable
- v-model="dialog.editorBox.form.data.weight"
- style="width: 100%;"
- :rules="dialog.editorBox.form.weight"
- >
- </el-input>
- </el-form-item>
- </el-col> -->
- <el-col :span="12">
- <el-form-item
- label="烧结用量"
- prop="weight1"
- v-if="dialog.editorBox.form.data.productid === '焦粉'"
- >
- <el-input
- clearable
- v-model="dialog.editorBox.form.data.weight1"
- style="width: 100%;"
- :rules="dialog.editorBox.form.weight1"
- >
- </el-input>
- </el-form-item>
- <el-form-item
- label="高炉用量"
- prop="weight1"
- v-else
- >
- <el-input
- clearable
- v-model="dialog.editorBox.form.data.weight1"
- style="width: 100%;"
- :rules="dialog.editorBox.form.weight1"
- >
- </el-input>
- </el-form-item>
- </el-col>
- <!-- </el-row>
- <el-row> -->
- <el-col :span="12">
- <el-form-item
- label="外销数量"
- prop="weight2"
- >
- <el-input
- clearable
- v-model="dialog.editorBox.form.data.weight2"
- style="width: 100%;"
- :rules="dialog.editorBox.form.weight2"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item
- label="备注"
- prop="meno"
- >
- <el-input
- clearable
- v-model="dialog.editorBox.form.data.memo"
- style="width: 100%;"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button
- :loading="loading"
- @click="dialog.editorBox.show = false"
- >取 消</el-button>
- <el-button
- type="primary"
- @click="dataSave"
- :loading="loading"
- >保 存</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialog.editorBox2.show"
- width="400px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <div>
- <el-form
- :model="dialog.editorBox2.form.data"
- ref="dialog_form2"
- size="mini"
- label-width="300px"
- :rules="dialog.editorBox2.form.rules"
- >
- <el-row>
- <el-col>
- <el-col :span="12">
- <el-form-item
- label="月份"
- prop="memo"
- label-width="60px"
- >
- <zj-timegran-date
- v-model="dialog.editorBox2.form.data.yearmonth"
- style="width: 150%;"
- :timegranId="'MONTH'"
- :defaultOffset="-1"
- :rules="dialog.editorBox.form.yearmonth"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button
- :loading="loading"
- @click="dialog.editorBox2.show = false"
- >取 消</el-button>
- <el-button
- type="primary"
- @click="but_copy_plural"
- :loading="loading"
- >保 存</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { zCheckNumber1 } from '@/utils/validator.js'
- import timegranDate from '@/components/zg/timegranDate.vue'
- import {formatDate, commonSummaries, getCookie} from '@/utils/util.js';
- export default {
- name: 'outElectricity',
- components: {
- 'zj-timegran-date': timegranDate
- },
- data () {
- let setDate = new Date();
- setDate.setDate(15);
- setDate.setMonth((setDate.getMonth() - 1));
- return {
- rowIndex: '',
- columnId: '',
- focusTarget: null,
- seqArr: [],
- editSetFlag: '',
- isCheck: false, // 是否为审核人
- filterForm: {
- show: true,
- data: {
- clock: '',
- clockc: '',
- workprocid: [],
- location: [],
- networkid: [],
- state: '',
- itemname: '',
- searchtype: '0',
- measureid: '',
- line: '',
- unit: '',
- yearmonth: '',
- weight: '',
- weight1: '',
- weight2: '',
- productid: '',
- avgTime: '',
- cjr: '',
- xgr: '',
- xgsj: '',
- memo: '',
- cp: '',
- parentid: 'JJZ',
- cjsj: '',
- jzsj: '',
- zt: '',
- show: false
- },
- rules: {
- },
- disabled: {
- networkid: false
- }
- },
- pageNum: 1,
- pageSize: 100,
- total: 0,
- singleTableHeight: 100,
- tableData: [
- ],
- originalData: [],
- loading: false,
- tableLoading: false,
- multipleSelection: [],
- tableFormDataObj: {},
- tableFormRules: {
- mintvalue: [
- // { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- mendvalue: [
- // { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- weight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- weight1: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- weight2: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- wastage: [
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- secondVal: [
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- memo: [
- ]
- },
- nameObj: {
- state: {
- obj: {
- '0': {
- name: '未编辑',
- color: '#7a7a7a'
- },
- '1': {
- name: '已编辑',
- color: 'rgb(28, 111, 217)'
- },
- '2': {
- name: '已审核',
- color: 'red'
- },
- '3': {
- name: '已接收',
- color: 'red'
- }
- },
- arr: [
- {
- id: '0',
- name: '未编辑'
- },
- {
- id: '1',
- name: '已编辑'
- },
- {
- id: '2',
- name: '已审核'
- },
- {
- name: '已接收',
- color: 'red'
- }
- ]
- },
- type: {
- obj: {
- '0': '否',
- '1': '是'
- },
- arr: [
- {
- id: '0',
- name: '否'
- },
- {
- id: '1',
- name: '是'
- }
- ]
- },
- unitid: {
- obj: {
- 't': {
- id: 't',
- name: '吨'
- }
- },
- arr: [
- {
- id: 't',
- name: '吨'
- }
- ]
- },
- workprocid: {
- obj: {
- 'AT3009': {
- id: 'AT3009',
- name: '粗苯'
- },
- 'AT3010': {
- id: 'AT3010',
- name: '硫铵'
- }
- },
- arr: [{
- id: 'AT3009',
- name: '粗苯'
- },
- {
- id: 'AT3010',
- name: '硫铵'
- }]
- },
- productid: {
- obj: {
- '成品焦': {
- id: '成品焦',
- name: '成品焦'
- },
- '小粒焦': {
- id: '小粒焦',
- name: '小粒焦'
- },
- '焦粉': {
- id: '焦粉',
- name: '焦粉'
- },
- '除尘焦粉': {
- id: '除尘焦粉',
- name: '除尘焦粉'
- }
- },
- arr: [{
- id: '成品焦',
- name: '成品焦'
- },
- {
- id: '小粒焦',
- name: '小粒焦'
- },
- {
- id: '焦粉',
- name: '焦粉'
- },
- {
- id: '除尘焦粉',
- name: '除尘焦粉'
- }]
- },
- location: {
- obj: {},
- arr: [],
- showDataArr: []
- },
- locateid: {
- obj: {},
- arr: []
- },
- networkid: {
- obj: {},
- arr: []
- },
- userId: {
- obj: {},
- arr: []
- }
- },
- dialog: {
- fRow: null,
- editorBox: {
- show: false,
- type: '',
- form: {
- default: {
- workprocid: ''
- },
- data: {
- unitid: '',
- line: '',
- yearmonth: '',
- weight: '',
- weight1: '',
- weight2: '',
- productid: '',
- memo: ''
- },
- rules: {
- weight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- weight1: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- weight2: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- productid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
- yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }],
- unitid: [{ required: true, message: '该项不能为空', trigger: 'change' }],
- line: [{ required: true, message: '该项不能为空', trigger: 'change' }]
- }
- }
- },
- editorBox2: {
- show: false,
- type: '',
- form: {
- data: {
- yearmonth: ''
- },
- rules: {
- yearmonth: [{ required: true, message: '该项不能为空', trigger: 'change' }]
- }
- }
- }
- },
- butPrivilege: {
- QUERY: false,
- PUT: false,
- CHECK: false,
- UNDOCHECK: false
- },
- loginName: getCookie('loginName')
- }
- },
- created () {
- // 获取按钮权限
- this.activeMenu = window.localStorage.getItem('activeMenu');
- for (let key in this.butPrivilege) {
- this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
- }
- },
- mounted () {
- let that = this;
- window.PEDataObj = {
- // 将数据绑定到window上,供main页面使用
- vm: that,
- // tableArr:用于导出成Excel的表格的信息
- tableArr: [
- {
- name: '',
- id: 'singleTable'
- }
- ]
- };
- that.$nextTick(() => {
- // 立即获取的height有一定偏差,通过setTimeout延迟来解决
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
- }, 1);
- });
- // 接收路由参数
- if (that.$route.query.networkid) {
- that.filterForm.disabled.networkid = true;
- that.filterForm.data.networkid = that.$route.query.networkid.split(',');
- }
- // 当有审核与取消审核权限时,默认其为审核人,审核人无法修改数据
- if (that.butPrivilege.CHECK || that.butPrivilege.UNDOCHECK) {
- that.isCheck = true;
- }
- // 管理员在这里录入数据
- if (that.loginName === 'admin' && that.filterForm.disabled.networkid) {
- that.isCheck = false;
- }
- // that.getLocation();
- that.getLocateIdData();
- that.getNetworkIdData();
- // that.getTableData();
- that.getUnitIdData();
- },
- methods: {
- // 计算树区域高度
- getRoleHeight (dom) {
- return window.innerHeight - dom.offsetTop;
- },
- detailMessage (row) {
- // console.log(row.date)// 此时就能拿到整行的信息
- },
- // 自定义的表格合计方法:只给指定列进行合计
- getSummaries (param) {
- const prop = ['apportvalue', 'realvalue', 'wastage', 'total']; // 合计列绑定的prop
- const {columns, data} = param;
- const sums = commonSummaries(param, prop);
- let that = this;
- // js中有两种不同的数据类型,一个是基本类型,一个是引用类型,其中Object是引用类型
- // 浅拷贝复制的是引用,深拷贝复制的是实体,简单的说,就是如果b复制a,现在修改b,如果a跟着改变,这种就是浅拷贝如果a不变,就是深拷贝
- // 拷贝值 JSON.parse(JSON.stringify(row))
- columns.forEach((column, index) => {
- if (index === 1) {
- sums[index] = '合计';
- return;
- };
- let priductIdTotal = 0;
- let priductIdTotal1 = 0;
- let priductIdTotal2 = 0;
- let priductIdTotal3 = 0;
- let weiItem = 0;
- switch (column.property) {
- case 'subtotal':
- priductIdTotal = 0;
- priductIdTotal1 = 0;
- priductIdTotal2 = 0;
- priductIdTotal3 = 0;
- for (let i = 0; i < this.tableData.length; i++) {
- this.tableData[i].subtotal.forEach((item, key) => {
- weiItem = (isNaN(item['成品焦']) ? 0 : item['成品焦']);
- priductIdTotal += Number(weiItem);
- });
- that.tableData[i].subtotal.forEach((item, key) => {
- weiItem = (isNaN(item['小粒焦']) ? 0 : item['小粒焦']);
- priductIdTotal1 += Number(weiItem);
- });
- that.tableData[i].subtotal.forEach((item, key) => {
- weiItem = (isNaN(item['焦粉']) ? 0 : item['焦粉']);
- priductIdTotal2 += Number(weiItem);
- });
- that.tableData[i].subtotal.forEach((item, key) => {
- weiItem = (isNaN(item['除尘焦粉']) ? 0 : item['除尘焦粉']);
- priductIdTotal3 += Number(weiItem);
- });
- };
- sums[index] = (index % 16 === 0) ? priductIdTotal3 : (
- (index % 13 === 0) ? priductIdTotal2 : (index % 10 === 0) ? priductIdTotal1 : priductIdTotal);
- break;
- case 'weight1':
- priductIdTotal = 0;
- priductIdTotal1 = 0;
- priductIdTotal2 = 0;
- priductIdTotal3 = 0;
- for (let i = 0; i < that.tableData.length; i++) {
- that.tableData[i].weight1.forEach((item, key) => {
- weiItem = (isNaN(item['成品焦']) ? 0 : item['成品焦']);
- priductIdTotal += Number(weiItem);
- });
- that.tableData[i].weight1.forEach((item, key) => {
- weiItem = (isNaN(item['小粒焦']) ? 0 : item['小粒焦']);
- priductIdTotal1 += Number(weiItem);
- });
- that.tableData[i].weight1.forEach((item, key) => {
- weiItem = (isNaN(item['焦粉']) ? 0 : item['焦粉']);
- priductIdTotal2 += Number(weiItem);
- });
- that.tableData[i].weight1.forEach((item, key) => {
- weiItem = (isNaN(item['除尘焦粉']) ? 0 : item['除尘焦粉']);
- priductIdTotal3 += Number(weiItem);
- });
- };
- sums[index] = (index % 14 === 0) ? priductIdTotal3 : (
- (index % 11 === 0) ? priductIdTotal2 : (index % 8 === 0) ? priductIdTotal1 : priductIdTotal);
- break;
- case 'weight2':
- priductIdTotal = 0;
- priductIdTotal1 = 0;
- priductIdTotal2 = 0;
- priductIdTotal3 = 0;
- for (let i = 0; i < that.tableData.length; i++) {
- that.tableData[i].weight2.forEach((item, key) => {
- weiItem = (isNaN(item['成品焦']) ? 0 : item['成品焦']);
- priductIdTotal += Number(weiItem);
- });
- that.tableData[i].weight2.forEach((item, key) => {
- weiItem = (isNaN(item['小粒焦']) ? 0 : item['小粒焦']);
- priductIdTotal1 += Number(weiItem);
- });
- that.tableData[i].weight2.forEach((item, key) => {
- weiItem = (isNaN(item['焦粉']) ? 0 : item['焦粉']);
- priductIdTotal2 += Number(weiItem);
- });
- that.tableData[i].weight2.forEach((item, key) => {
- weiItem = (isNaN(item['除尘焦粉']) ? 0 : item['除尘焦粉']);
- priductIdTotal3 += Number(weiItem);
- });
- };
- sums[index] = (index % 15 === 0) ? priductIdTotal3 : (
- (index % 12 === 0) ? priductIdTotal2 : (index % 9 === 0) ? priductIdTotal1 : priductIdTotal);
- break;
- default:
- break;
- }
- });
- return sums;
- // return commonSummaries(param, prop);
- },
- // 获取工序列表
- // getNodeData () {
- // let that = this
- // let url = 'pass/ems/v1/trmworkprocs/getIdAndName?issettle=1';
- // that.axios.get(url)
- // .then(function (res) {
- // if (res.code === '0') {
- // let arr = [];
- // let obj = {};
- // for (let item of res.data) {
- // arr.push({
- // id: item.id,
- // name: item.name
- // })
- // obj[item.id] = item.name;
- // }
- // that.nameObj.workprocid.arr = arr;
- // that.nameObj.workprocid.obj = obj;
- // that.connn();
- // } else {
- // that.$message.error(res.message);
- // }
- // });
- // },
- getUnitIdData () {
- let that = this
- let url = 'pass/ems/v1/trmunits/getIdAndName';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- if (item.name === '吨') {
- that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
- }
- }
- that.nameObj.unitid.arr = arr;
- that.nameObj.unitid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取站所
- getNetworkIdData () {
- let that = this
- let url = 'pass/ems/v1/trmstations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.networkid.arr = arr;
- that.nameObj.networkid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 复制
- but_copy_plural () {
- let that = this;
- let SubmitData = [];
- for (let key in that.tableFormDataObj) {
- let memoArr = that.tableFormDataObj[key].memo.split(';');
- for (let i = 0; i < that.tableFormDataObj[key].weight1.length; i++) {
- for (let keyname in that.tableFormDataObj[key].weight1[i]) {
- SubmitData.push({
- // weight: that.tableFormDataObj[key].weight[i][keyname],
- weight1: that.tableFormDataObj[key].weight1[i][keyname],
- weight2: that.tableFormDataObj[key].weight2[i][keyname],
- memo: memoArr[i],
- unit: that.tableFormDataObj[key].unit,
- parentid: that.filterForm.data.parentid,
- productid: that.tableFormDataObj[key].productid[i][i],
- yearmonth: that.dialog.editorBox2.form.data.yearmonth
- });
- };
- };
- }
- that.$refs['dialog_form2'].validate((valid) => {
- if (valid) {
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '复制成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox2.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- this.$message.error('至少选择一条数据');
- }
- });
- },
- connn () {
- let that = this;
- if (!that.filterForm.data.networkid || that.filterForm.data.networkid.length === 0) {
- that.nameObj.location.showDataArr = that.nameObj.workprocid.arr;
- } else {
- let url = 'pass/ems/v1/trmelectricitylocations/getWorkprocs?workshop=' + that.filterForm.data.networkid.toString();
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- }
- that.nameObj.location.showDataArr = arr;
- } else {
- that.$message.error(res.message);
- }
- });
- }
- },
- // 获取位置
- getLocateIdData () {
- let that = this
- let url = 'pass/ems/v1/trmlocations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.locateid.arr = arr;
- that.nameObj.locateid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取表格中的数据
- getTableData (pageNum) {
- let that = this,
- params = {},
- pData = {
- yearmonth: that.filterForm.data.yearmonth,
- workprocid: that.filterForm.data.workprocid.toString(),
- location: that.filterForm.data.location.toString(),
- networkid: that.filterForm.data.networkid.toString(),
- itemname: that.filterForm.data.itemname,
- zt: that.filterForm.data.zt,
- measureid: that.filterForm.data.measureid,
- exactsearch: that.filterForm.data.searchtype,
- parentid: that.filterForm.data.parentid,
- parentNum: that.nameObj.productid.arr.length
- };
- for (let key in pData) {
- if (pData[key]) {
- params[key] = pData[key];
- }
- }
- that.pageNum = pageNum || that.pageNum;
- that.tableLoading = true;
- // console.log(pData);
- // let url = 'pass/ems/v1/trmtransfereactvalues/getDateEditForPage/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- // if (that.isCheck) {
- // url = 'pass/ems/v1/trmtransfereactvalues/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- // }
- let url = 'pass/ems/v1/emsprodplanyears/getList/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let index = 0;
- let chirItem = res.data.list[0];
- for (let e in chirItem) {
- let item = chirItem[e];
- // let weightArr = [];
- let subtotalArr = [];
- let weightArr1 = [];
- let weightArr2 = [];
- let noArr = [];
- let memoArr = [];
- let sumRow = 0;
- let sum = 0;
- let indexArr = [];
- let productidArr = [];
- let memoLong = '';
- for (let i = 0; i < chirItem[e].length; i++) {
- // weightArr.push({
- // [item[i].productid]: item[i].weight
- // });
- weightArr1.push({
- [item[i].productid]: item[i].weight1
- });
- weightArr2.push({
- [item[i].productid]: item[i].weight2
- });
- productidArr.push({
- [i]: item[i].productid
- });
- memoArr.push({
- [i]: item[i].memo
- });
- noArr.push({
- [i]: item[i].no
- });
- if (item[i].memo !== null && item[i].memo !== '') {
- memoLong = memoLong + item[i].memo + ';';
- };
- indexArr.push({
- [i]: [i]
- });
- subtotalArr.push({
- [item[i].productid]: item[i].weight1 + item[i].weight2
- });
- // sum += item[i].weight + item[i].weight1 + item[i].weight2;
- sum += item[i].weight1 + item[i].weight2;
- };
- arr.push({
- seq: index,
- unit: item[chirItem[e].length - 1].unit,
- line: item[chirItem[e].length - 1].line,
- yearmonth: item[chirItem[e].length - 1].yearmonth,
- cjr: item[chirItem[e].length - 1].cjr,
- cjsj: item[chirItem[e].length - 1].cjsj,
- jzsj: item[chirItem[e].length - 1].jzsj,
- xgr: item[chirItem[e].length - 1].xgr,
- xgsj: item[chirItem[e].length - 1].xgsj,
- cp: item[chirItem[e].length - 1].cp,
- zt: item[chirItem[e].length - 1].zt,
- parentid: item[chirItem[e].length - 1].parentid,
- no: noArr,
- id: item[chirItem[e].length - 1].id,
- total: sum,
- // weight: weightArr,
- subtotal: subtotalArr,
- weight1: weightArr1,
- weight2: weightArr2,
- productid: productidArr,
- memo: memoLong
- });
- index = index + 1;
- }
- // console.log(arr);
- that.total = res.data.total;
- that.tableData = JSON.parse(JSON.stringify(arr));
- that.originalData = JSON.parse(JSON.stringify(arr));
- that.getAdds();
- } else {
- that.$message.error(res.message);
- }
- that.$nextTick(() => {
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
- }, 1);
- });
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- // 获取表格中的数据
- getTableDataEdit () {
- let that = this,
- params = {},
- pData = {
- yearmonth: that.filterForm.data.yearmonth,
- workprocid: that.filterForm.data.workprocid.toString(),
- location: that.filterForm.data.location.toString(),
- networkid: that.filterForm.data.networkid.toString(),
- itemname: that.filterForm.data.itemname,
- exactsearch: that.filterForm.data.searchtype,
- parentid: that.filterForm.data.parentid
- };
- for (let key in pData) {
- if (pData[key]) {
- params[key] = pData[key];
- }
- }
- that.tableLoading = true;
- let url = 'pass/ems/v1/emsprodplanyears/getDateEditForPage/?pageNum=1&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let i = 0; i < res.data.list.length; i++) {
- let item = res.data.list[i];
- arr.push({
- seq: i,
- unit: item.unit,
- line: item.line,
- yearmonth: item.yearmonth,
- // weight: item.weight,
- weight1: item.weight1,
- weight2: item.weight2,
- productid: item.productid,
- cjr: item.cjr,
- cjsj: item.cjsj,
- jzsj: item.jzsj,
- xgr: item.xgr,
- xgsj: item.xgsj,
- cp: item.cp,
- sysl: item.sysl,
- zt: item.zt,
- wxsy: item.wxsy
- });
- }
- that.total = res.data.total;
- that.tableData = arr;
- that.getAdds();
- } else {
- that.$message.error(res.message);
- }
- that.$nextTick(() => {
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
- }, 1);
- });
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- // 合并相同的用电地点
- arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
- let that = this;
- let tableData = this.$refs.singleTable.tableData
- let c1 = row.workprocid;
- let c2 = row.location;
- let c3 = row.workshop;
- let c4 = row.clock;
- let c5 = row.clocke;
- let rowsPan = 1;
- // let adds = this.$refs.singleTable.tableData[rowIndex].realvalue;
- if (column['property'] === 'workprocid' || column['property'] === 'adds') {
- if (rowIndex > 0 && c1 === tableData[rowIndex - 1].workprocid && c2 === tableData[rowIndex - 1].location &&
- c3 === tableData[rowIndex - 1].workshop && c4 === tableData[rowIndex - 1].clock && c5 === tableData[rowIndex - 1].clocke) {
- return {
- rowspan: 0,
- colspan: 0
- };
- };
- while (tableData[rowIndex + rowsPan] && c1 === tableData[rowIndex + rowsPan].workprocid && c2 === tableData[rowIndex + rowsPan].location &&
- c3 === tableData[rowIndex + rowsPan].workshop && c4 === tableData[rowIndex + rowsPan].clock && c5 === tableData[rowIndex + rowsPan].clocke) {
- rowsPan += 1
- }
- return {
- rowspan: rowsPan,
- colspan: 1
- };
- }
- },
- // 改变表格显示条数
- tableSizeChange (val) {
- let that = this;
- that.pageSize = val;
- that.getTableData(1);
- },
- // 重置搜索
- tableDataCancel () {
- let that = this;
- for (let key in that.filterForm.data) {
- if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
- if (that.filterForm.data[key] instanceof Array) {
- that.filterForm.data[key] = [];
- } else {
- that.filterForm.data[key] = '';
- }
- }
- }
- that.getTableData(1);
- },
- // 键盘事件
- keyDown (event1, disabledFlag) {
- let tdTarget = event1.target;
- let _this = this;
- while (tdTarget.tagName !== 'TD') {
- tdTarget = tdTarget.parentElement;
- }
- // 如果按下键盘下键或者回车键
- if (event.keyCode === 40 || event.keyCode === 13) {
- let index = parseInt(this.rowIndex);
- // index++;
- if (index !== this.seqArr[this.seqArr.length - 1]) {
- for (let i = 0; i < this.seqArr.length; i++) {
- if (index === this.seqArr[i]) {
- index = this.seqArr[i + 1];
- break;
- }
- }
- }
- this.editSetFlag = index + this.columnId;
- let id = '#' + this.editSetFlag;
- this.$nextTick(() => {
- $(id).click();
- });
- } else if (event.keyCode === 38) { // 键盘上键
- let index = parseInt(this.rowIndex);
- if (index !== this.seqArr[0]) {
- for (let i = 0; i < this.seqArr.length; i++) {
- if (index === this.seqArr[i]) {
- index = this.seqArr[i - 1];
- break;
- }
- }
- }
- this.editSetFlag = index + this.columnId;
- let id = '#' + this.editSetFlag;
- this.$nextTick(() => {
- $(id).click();
- });
- } else if (event.keyCode === 37) { // 键盘左键
- $(tdTarget).prevAll().find('input:text').last().click();
- } else if (event.keyCode === 39) { // 键盘右键
- $(tdTarget).nextAll().find('input').eq(0).click();
- }
- },
- // 只允许对未接收的数据进行操作
- checkboxT (row, index) {
- if (row.zt === '2' && !this.isCheck) {
- return false;
- } else {
- return true;
- }
- },
- // 选择的值发生改变
- handleSelectionChange (val) {
- // console.log('我要改数据了');
- let that = this;
- let tableFormDataObj = {};
- let valTwo = JSON.parse(JSON.stringify(val));
- let arr = [];
- for (let item of val) {
- arr.push(item.seq);
- }
- this.seqArr = arr.sort(sortNumber);
- for (let item of that.tableData) {
- item.isSelection = false;
- }
- let arrcha = [...JSON.parse(JSON.stringify(that.originalData))].filter(x => [...val].every(y => y.id !== x.id));
- for (let item of arrcha) {
- // 取消选择时赋初始值
- for (let weiIndex in that.tableData[item.seq].weight1) {
- for (let weiKey in that.tableData[item.seq].weight1[weiIndex]) {
- // that.tableData[item.seq].weight[weiIndex][weiKey] = that.originalData[item.seq].weight[weiIndex][weiKey];
- that.tableData[item.seq].weight1[weiIndex][weiKey] = that.originalData[item.seq].weight1[weiIndex][weiKey];
- that.tableData[item.seq].weight2[weiIndex][weiKey] = that.originalData[item.seq].weight2[weiIndex][weiKey];
- }
- }
- // that.tableData[item.seq].weight = JSON.parse(JSON.stringify(that.originalData[item.seq]));
- // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
- };
- for (let item of val) {
- let obj = {};
- let xId = item.seq;
- if (that.tableFormDataObj[xId]) {
- // 如果已存在该数据则使用该数据
- tableFormDataObj[xId] = that.tableFormDataObj[xId];
- } else {
- // 负责则从对应行中获取行内原数据
- for (let key in item) {
- obj[key] = item[key];
- }
- item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
- tableFormDataObj[xId] = obj;
- }
- item.isSelection = true;
- }
- for (let item of that.tableData) {
- if (item.isSelection === false) {
- // that.tableData[item.seq] = JSON.parse(JSON.stringify(that.originalData[item.seq]));
- item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
- }
- }
- that.tableFormDataObj = tableFormDataObj;
- that.multipleSelection = val;
- this.getAdds();
- },
- // 当上月底码发生改变时计算抄度与实际电量
- getApportValue (seq, value, rowIndex, event) {
- let that = this;
- if (!isNaN(Number(value))) {
- if (!isNaN(Number(that.tableFormDataObj[seq].mintvalue)) && !isNaN(Number(that.tableFormDataObj[seq].mendvalue)) && that.tableFormDataObj[seq].mintvalue !== null && that.tableFormDataObj[seq].mendvalue !== null) {
- let poor = that.floatComputed(Number(that.tableFormDataObj[seq].mendvalue), Number(that.tableFormDataObj[seq].mintvalue), '-');
- that.tableFormDataObj[seq].apportvalue = that.floatComputed(poor, Number(that.tableFormDataObj[seq].mods), '*').toFixed(0);
- let rv1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
- that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
- that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
- }
- }
- },
- // 手动修改抄度后计算实际电量
- chnageApportvalue (seq, value, rowIndex) {
- let that = this;
- if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].wastage))) {
- that.tableFormDataObj[seq].realvalue = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].wastage), '+').toFixed(0);
- }
- that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
- },
- // 手动修改损耗后计算实际电量
- chnageWastage (seq, value, rowIndex) {
- let that = this;
- if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
- let rv1 = that.floatComputed(Number(value), Number(that.tableFormDataObj[seq].apportvalue), '+');
- that.tableFormDataObj[seq].realvalue = that.floatComputed(rv1, Number(that.tableFormDataObj[seq].secondVal), '-').toFixed(0);
- that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
- }
- },
- // 手动修改二次转供电后计算实际电量
- chnageSecondVal (seq, value, rowIndex) {
- let that = this;
- if (!isNaN(Number(value)) && !isNaN(Number(that.tableFormDataObj[seq].apportvalue)) && that.tableFormDataObj[seq].apportvalue !== null) {
- let val1 = that.floatComputed(Number(that.tableFormDataObj[seq].apportvalue), Number(that.tableFormDataObj[seq].wastage), '+');
- that.tableFormDataObj[seq].realvalue = that.floatComputed(val1, Number(value), '-').toFixed(0);
- that.showRealValue(rowIndex, that.tableFormDataObj[seq].realvalue);
- }
- },
- // 统计合计值
- getAdds () {
- let that = this;
- let wlarr = [];
- for (var i = 0; i < that.tableData.length; i++) {
- wlarr.push(that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke);
- }
- let wls = [...new Set(wlarr)]
- let arrs = [];
- for (let wl of wls) {
- let adds = 0;
- for (let item of that.tableData) {
- if (wl === item.workprocid + '-' + item.location + '-' + item.workshop + '-' + item.clock + '-' + item.clocke) {
- adds = that.floatComputed(Number(item.realvalue), adds, '+');
- }
- }
- for (let i = 0; i < that.tableData.length; i++) {
- if (wl === that.tableData[i].workprocid + '-' + that.tableData[i].location + '-' + that.tableData[i].workshop + '-' + that.tableData[i].clock + '-' + that.tableData[i].clocke) {
- that.tableData[i].adds = adds;
- }
- }
- }
- },
- // 展示实际电量
- showRealValue (rowIndex, value) {
- let that = this;
- for (let i = 0; i < that.tableData.length; i++) {
- if (i === rowIndex) {
- that.tableData[i].realvalue = value;
- }
- }
- this.getAdds();
- },
- // 批量修改
- but_edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr'].validate((valid, obj) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.tableFormDataObj) {
- let memoArr = that.tableFormDataObj[key].memo.split(';');
- for (let i = 0; i < that.tableFormDataObj[key].weight1.length; i++) {
- for (let keyname in that.tableFormDataObj[key].weight1[i]) {
- SubmitData.push({
- // weight: that.tableFormDataObj[key].weight[i][keyname],
- weight1: that.tableFormDataObj[key].weight1[i][keyname],
- weight2: that.tableFormDataObj[key].weight2[i][keyname],
- no: that.tableFormDataObj[key].no[i][i],
- memo: memoArr[i],
- cjsj: that.tableFormDataObj[key].cjsj,
- jzsj: that.tableFormDataObj[key].jzsj,
- line: that.tableFormDataObj[key].line,
- xgr: that.tableFormDataObj[key].xgr,
- xgsj: that.tableFormDataObj[key].xgsj,
- cp: that.tableFormDataObj[key].cp,
- sysl: that.tableFormDataObj[key].sysl,
- zt: that.tableFormDataObj[key].zt,
- wxsy: that.tableFormDataObj[key].wxsy,
- unit: that.tableFormDataObj[key].unit,
- parentid: that.filterForm.data.parentid,
- yearmonth: that.tableFormDataObj[key].yearmonth
- });
- };
- }
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/emsprodplanyears/batchupdateList', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '修改成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少选择一条数据');
- }
- },
- dataSave () {
- let that = this;
- let SubmitData = [];
- SubmitData.push({
- yearmonth: that.dialog.editorBox.form.data.yearmonth,
- // weight: that.dialog.editorBox.form.data.weight,
- weight1: that.dialog.editorBox.form.data.weight1,
- weight2: that.dialog.editorBox.form.data.weight2,
- unit: that.dialog.editorBox.form.data.unitid,
- line: that.dialog.editorBox.form.data.line,
- parentid: that.filterForm.data.parentid,
- productid: that.dialog.editorBox.form.data.productid,
- memo: that.dialog.editorBox.form.data.memo
- });
- // console.log(SubmitData)
- that.$refs['dialog_form'].validate((valid) => {
- if (valid) {
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanyears/', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- }
- );
- },
- // 批量删除
- but_del_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let item of that.multipleSelection) {
- if (item.zt === '2') {
- this.$message.error('已经审核的数据不能删除');
- return;
- };
- // console.log(item);
- for (let noItem in item.no) {
- SubmitData.push({
- no: item.no[noItem][noItem]
- });
- }
- }
- that.$confirm('是否删除已选数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.delete('pass/ems/v1/emsprodplanyears/delete', {
- data: SubmitData,
- contentType: 'application/json;charset=UTF-8'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '删除成功',
- type: 'success'
- });
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- }).catch(function () {
- });
- }).catch(() => {
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- upState (state = '2') {
- let that = this;
- let dataArr = [];
- for (let item of that.multipleSelection) {
- if (item.state !== state) {
- dataArr.push(item);
- }
- }
- if (dataArr.length > 0) {
- that.$confirm('本次将要' + (state === '2' ? '审核' : '撤销审核') + dataArr.length + '条数据,是否确定?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- let SubmitData = [];
- for (let item of dataArr) {
- SubmitData.push({
- state: state,
- id: item.id
- });
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/trmtransfereactvalues/batchcheck2', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: (state === '2' ? '审核' : '撤销') + '成功',
- type: 'success'
- });
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }).catch(() => {
- });
- } else {
- if (that.multipleSelection.length > 0) {
- this.$message.error('没有需要' + (state === '2' ? '审核' : '撤销') + '的数据');
- } else {
- this.$message.error('至少要选择一条数据');
- }
- }
- },
- but_add () {
- let that = this;
- that.dialog.editorBox.show = true;
- setTimeout(() => {
- that.$refs['dialog_form'].clearValidate();
- }, 100);
- },
- but_copy () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.dialog.editorBox2.show = true;
- setTimeout(() => {
- that.$refs['dialog_form2'].clearValidate();
- }, 100);
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- tableRowClassName ({row, rowIndex}) {
- // 把每一行的索引放进row
- row.index = rowIndex;
- },
- cellClick (row, column, cell, event) {
- let _this = this;
- this.rowIndex = row.index;
- this.columnId = column.id;
- _this.editSetFlag = row.index + column.id;
- _this.focusTarget = event.target;
- while (_this.focusTarget.tagName !== 'TD') {
- _this.focusTarget = _this.focusTarget.parentElement;
- }
- _this.$nextTick(() => {
- let target = this.focusTarget;
- $(target).find('input').focus();
- });
- },
- // 获取一行的总和
- rowSum: function (item, event) {
- let result = 0;
- let that = this;
- for (let weiIndex in item.weight1) {
- for (let weiKey in item.weight1[weiIndex]) {
- result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight2[weiIndex][weiKey]);
- }
- }
- return result;
- },
- // 小计
- rowSubSum: function (item, event) {
- let result = 0;
- let that = this;
- for (let weiIndex in item.weight1) {
- for (let weiKey in item.weight1[weiIndex]) {
- if (weiKey === '成品焦') {
- result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight1[weiIndex][weiKey]);
- };
- if (weiKey === '小粒焦') {
- result += Number(item.weight1[weiIndex][weiKey]) + Number(item.weight1[weiIndex][weiKey]);
- };
- };
- }
- return result;
- }
- },
- computed: {
- // 暂时用不上
- activeUsers: function () {
- let that = this;
- return that.tableData.filter(function (tableData) {
- // console.log(tableData);
- for (let item in tableData.weight1) {
- return isNaN((tableData.weight1[item]));
- }
- })
- },
- rowSumc: function (item, event) {
- let result = 0;
- let that = this;
- for (let item of that.tableFormDataOb) {
- result = 0;
- for (let weiIndex in that.tableFormDataObj[item.seq].weight1) {
- for (let weiKey in that.tableFormDataObj[item.seq].weight1[weiIndex]) {
- result += that.tableFormDataObj[item.seq].weight1[weiIndex][weiKey] +
- that.tableFormDataObj[item.seq].weight2[weiIndex][weiKey];
- }
- }
- item.total = result;
- }
- return result;
- }
- }
- }
- function sortNumber (a, b) {
- return a - b
- }
- </script>
- <style lang="less">
- .outElectricity{
- min-width: 700px;
- height: 100%;
- .box {
- height: 100%;
- padding: 15px 15px 0 15px;
- .box-top {
- .el-form-item {
- margin-bottom: 7px;
- }
- .box-top-gjl {
- overflow: hidden;
- padding: 7px 0;
- border-top: 1px solid #ccc;
- }
- }
- .rowDisable td {
- color: #6bb025 !important;
- }
- .el-table .el-table__row {
- height: 35px;
- }
- .el-table__body .el-form-item--mini.el-form-item {
- margin: 0px;
- .error {
- overflow: hidden;
- color: #f56c6c;
- font-size: 12px;
- line-height: 1;
- }
- }
- }
- .color_no {
- color: #7a7a7a;
- }
- .color_yes {
- color: #1a9f17;
- }
- .cnspicuous .el-checkbox__input.is-disabled .el-checkbox__inner {
- background-color: #dcdfe6;
- border-color: #babbbf;
- }
- }
- </style>
|