12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135 |
- <template>
- <div class="balanceSheetData">
- <div class="box">
- <div class="box-top">
- <el-form
- style="overflow: hidden;"
- :style="filterForm.show ? null : { height: '0px' }"
- size="mini"
- label-width="70px"
- >
- <el-row>
- <el-col :span="6">
- <el-form-item label="排产日期">
- <zj-timegran-date
- v-model="filterForm.data.clock"
- style="width: 100%;"
- :type="'daterange'"
- :oneFoo="getTableData"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="编号">
- <el-input
- v-model="filterForm.data.Gmid"
- style="width: 100%;"
- refcous="true"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="box-top-gjl">
- <!-- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- v-privilege="activeMenu + 'ADD'"
- @click="but_addNBJH()"
- >新增内部计划</el-button> -->
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- v-privilege="activeMenu + 'ADD'"
- @click="but_add(1)"
- >新增子计划</el-button>
- <div style="float:right; text-align: right;">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-add-outline"
- @click="edit_plural()"
- >强制修改</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-search"
- v-privilege="activeMenu + 'QUERY'"
- @click="getTableData(1)"
- >查询</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="but_edit_plural()"
- >保存</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="issue()"
- >下发</el-button>
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-add-outline"
- @click="offissue()"
- >取消下发</el-button>
- <el-button
- class="button"
- type="danger"
- size="mini"
- icon="el-icon-delete"
- @click="but_del_plural()"
- >删除</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['boxBottom']) - 45;
- }
- );"
- >{{ filterForm.show ? '收起' : '展开' }}</el-button>
- </div>
- </div>
- </div>
- <div class="box-bottom" ref="boxBottom">
- <div class="table-box" ref="table_box">
- <div class="table-left" :style="{ width: leftTableWidth + 'px' }">
- <el-form
- size="mini"
- ref="dialog_form_arr_1"
- label-width="0px"
- :model="tableFormDataObj"
- >
- <el-table stripe
- id="singleTable1"
- ref="singleTable1"
- :data="leftTableData"
- v-loading="leftTableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- show-summary
- :summary-method="getSummaries"
- @current-change="getTableDetailData"
- @selection-change="handleSelectionChangeAsleft"
- @row-click="openDetails"
- >
- <!-- <el-table-column
- sortable
- type="selection"
- width="40"
- prop="seq"
- label="序号"
- align="center"
- :selectable="checkboxTLeft"
- fixed="left"
- class-name="cnspicuous"
- ></el-table-column> -->
- <el-table-column
- sortable
- prop="id"
- label="编号"
- align="center"
- fixed="left"
- width="148px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="jhTime"
- label="排产日期"
- align="center"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="deliveryDate"
- label="交货日期"
- align="center"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="grades"
- align="center"
- label="钢种"
- width="71"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="specifications"
- label="规格"
- align="center"
- width="84px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.gx!='XG'"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="lengths"
- align="center"
- label="长度"
- min-width="72px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="planweight"
- align="center"
- label="计划量"
- width="81px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- align="center"
- prop="kxf_weight"
- label="可下发量"
- min-width="81px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="yxf_weight"
- align="center"
- label="已下发量"
- min-width="81px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- </el-table>
- </el-form>
- </div>
- <div class="table-tuodong" :style="{ height: singleTableHeight + 'px' }"
- @mousedown="tableTDMousedown"
- ></div>
- <div class="table-right" :style="{ 'margin-left': (leftTableWidth + 7) + 'px' }">
- <el-form
- size="mini"
- ref="dialog_form_arr_2"
- label-width="0px"
- :model="rightTableObj"
- >
- <el-table stripe
- id="singleTable2"
- ref="singleTable2"
- :data="rightTableData"
- v-loading="tableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- show-summary
- :summary-method="getSummaries"
- :row-class-name="tableRowClassName"
- @selection-change="handleSelectionChange"
- @cell-click="cellClick"
- >
- <el-table-column
- sortable
- type="selection"
- width="40"
- align="center"
- :selectable='checkboxT'
- fixed="left"
- class-name="cnspicuous"
- ></el-table-column>
- <el-table-column
- sortable
- prop="roundid"
- label="编号"
- align="center"
- min-width="151px"
- fixed="left"
- v-model="filterForm.data.sqno"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="may"
- label="排产日期"
- align="center"
- min-width="134px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.describe'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.describe"
- >
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="rightTableObj[scope.row.seq].may"
- placeholder=""
- style="width: 100%;"
- @keydown.native="keyDown"
- ></el-date-picker>
- </el-form-item>
- <span v-else>{{scope.row.may}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="state"
- label="状态"
- align="center"
- min-width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span
- :style="{color: nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].color : ''}"
- >{{ nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].name : scope.row.state }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="grades"
- label="钢种"
- align="center"
- min-width="126px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.grades'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.grades"
- >
- <el-select
- allow-create
- filterable
- clearable
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].grades"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.grades.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.grades.obj[scope.row.grades] ? nameObj.grades.obj[scope.row.grades].name : scope.row.grades }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="specifications"
- label="规格"
- align="center"
- min-width="109px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.specifications'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.specifications"
- >
- <el-select
- allow-create
- filterable
- clearable
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].specifications"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.specifications.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.specifications.obj[scope.row.specifications] ? nameObj.specifications.obj[scope.row.specifications].name : scope.row.specifications }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="lengths"
- label="长度"
- align="center"
- min-width="85px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.lengths'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.lengths"
- >
- <el-input
- style="width: 100%;"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].lengths"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.lengths}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="planWeight"
- label="计划量"
- align="center"
- min-width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.planWeight'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.planWeight"
- >
- <el-input
- style="width: 100%;"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].planWeight"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.planWeight}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="surfaceStandard"
- label="表面质量执行标准"
- align="center"
- min-width="126px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.surfaceStandard'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- >
- <el-select
- allow-create
- filterable
- clearable
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].surfaceStandard"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.surfaceStandard.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.surfaceStandard.obj[scope.row.surfaceStandard] ? nameObj.surfaceStandard.obj[scope.row.surfaceStandard].name : scope.row.surfaceStandard }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="chemicalStandard"
- label="化学成份执行标准"
- align="center"
- min-width="126px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.chemicalStandard'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- >
- <el-select
- allow-create
- filterable
- clearable
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].chemicalStandard"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.chemicalStandard.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="goinfo"
- label="去向"
- align="center"
- min-width="85px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.goinfo'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.goinfo"
- >
- <el-select
- filterable clearable
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].goinfo"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.goinfo.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.goinfo.obj[scope.row.goinfo] ? nameObj.goinfo.obj[scope.row.goinfo].name : scope.row.goinfo }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="describe"
- label="轮次描述"
- align="center"
- min-width="146px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.describe'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.describe"
- >
- <el-input
- style="width: 100%;"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].describe"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.describe}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="memo"
- label="备注"
- align="center"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.memo'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.memo"
- >
- <el-input
- style="width: 100%;"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].memo"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.memo}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="issuedTime"
- label="下发时间"
- align="center"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="createman"
- label="创建人"
- align="center"
- min-width="76px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="createtime"
- label="创建时间"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updateman"
- label="修改人"
- align="center"
- min-width="76px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updatetime"
- label="修改时间"
- align="center"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="roundid"
- label="轮次序号"
- align="center"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- <el-table-column
- prop="parentid"
- label="月序号"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- <el-table-column
- prop="workprocType"
- label="工序类别"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- </el-table>
- </el-form>
- </div>
- </div>
- <el-row>
- <el-col :span="10">
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total1"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize1"
- :current-page.sync="pageNum1"
- @size-change="LftetableSizeChange"
- @current-change="getTableData"
- style="text-align: left;margin-top: 10px;"
- ></el-pagination>
- </el-col>
- <el-col :span="14">
- <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="getTableDetailDatas()"
- style="text-align: right;margin-top: 10px;"
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- <el-dialog
- title="内部计划 新增"
- :visible.sync="dialog.editorBox.show"
- width="600px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <div>
- <el-form
- ref="dialog_form"
- :model="dialog.editorBox.form.data"
- :rules="dialog.editorBox.form.rules"
- size="mini"
- label-width="95px"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item
- label="排产日期"
- prop="may"
- :rules="dialog.editorBox.form.may"
- >
- <zj-timegran-date
- v-model="dialog.editorBox.form.data.may"
- style="width: 100%;"
- :timegranId="'DAY'"
- :oneFoo="getTableData"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item
- label="计划量"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.planWeight"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button
- @click="dialog.editorBox.show = false"
- :loading="loading"
- >取 消</el-button>
- <el-button
- type="primary"
- @click="dataSave"
- :loading="loading"
- >保 存</el-button>
- </span>
- </el-dialog>
- <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
- </div>
- </template>
- <script>
- import { zCheckNumber1 } from '@/utils/validator.js';
- import timegranDate from '@/components/zg/timegranDate.vue';
- import formulaEditor from '@/components/zg/formulaEditor.vue';
- import {formatDate, commonSummaries} from '@/utils/util.js';
- export default {
- name: 'balanceSheetData',
- components: {
- 'zj-timegran-date': timegranDate,
- 'zj-formulaEditor': formulaEditor
- },
- data () {
- return {
- activeMenu: '',
- isCheck: false, // 是否为审核人
- rowIndex: '',
- columnId: '',
- focusTarget: null,
- seqArr: [],
- filterForm: {
- show: true,
- data: {
- id: '',
- Gmid: '',
- clock: '',
- workprocid: '',
- workprocType: '',
- workproc_type: '',
- may: '',
- canissue: '',
- weightMonth: '',
- issue: '',
- yxf_weight: '',
- kxf_weight: '',
- describe: '',
- state: '',
- grades: '',
- specifications: '',
- lengths: '',
- chemicalStandard: '',
- surfaceStandard: '',
- transportType: '',
- parentid: '',
- purpose: '',
- sqno: '',
- show: false,
- goinfo: ''
- }
- },
- rules: {
- },
- pageNum: 1,
- pageSize: 20,
- pageNum1: 1,
- pageSize1: 20,
- total: 0,
- total1: 0,
- singleTableHeight: 100,
- leftTableData: [],
- leftTableLoading: false,
- leftTableWidth: 550,
- difference: 0,
- rightTableData: [],
- rightTableObj: {
- },
- leftData: {
- },
- multipleSelection: [],
- multipleSelectionAscLeft: [],
- tableFormDataObj: {},
- tableFormRules: {
- planWeight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- grades: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- specifications: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- transportType: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- purpose: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ]
- // chemicalStandard: [
- // { required: true, message: '该项不能为空', trigger: 'change' }
- // ]
- },
- nameObj: {
- timegranid: {
- obj: {},
- arr: []
- },
- energyid: {
- obj: {},
- arr: []
- },
- propertyid: {
- obj: {},
- arr: []
- },
- unit: {
- obj: {},
- arr: []
- },
- state: {
- obj: {
- '0': {
- name: '已编制',
- color: '#7a7a7a'
- },
- '1': {
- name: '已下发',
- color: 'rgb(28, 111, 217)'
- },
- '2': {
- name: '已接收',
- color: 'red'
- },
- arr: [
- {
- id: '0',
- name: '已编制'
- },
- {
- id: '1',
- name: '已下发'
- },
- {
- id: '2',
- name: '已接收'
- }
- ]
- }
- },
- grades: {
- obj: {},
- arr: []
- },
- specifications: {
- obj: {},
- arr: []
- },
- surfaceStandard: {
- obj: {},
- arr: []
- },
- goinfo: {
- obj: {
- '1036WM1': {
- id: '1036WM1',
- name: '外卖'
- },
- '1036XG1': {
- id: '1036XG1',
- name: '型钢厂'
- },
- '1036GX1': {
- id: '1036GX1',
- name: '高线一'
- },
- '1036GX2': {
- id: '1036GX2',
- name: '高线二'
- },
- '1036LG1': {
- id: '1036LG1',
- name: '炼钢厂'
- }
- },
- arr: [{
- id: '1036WM1',
- name: '外卖'
- },
- {
- id: '1036XG1',
- name: '型钢厂'
- },
- {
- id: '1036GX1',
- name: '高线一'
- },
- {
- id: '1036GX2',
- name: '高线二'
- },
- {
- id: '1036LG1',
- name: '炼钢厂'
- }
- ]
- },
- chemicalStandard: {
- obj: {},
- arr: []
- },
- purpose: {
- obj: {
- '0': {name: '标准件'},
- '1': {name: '铁丝'}
- },
- arr: [
- {
- id: '0',
- name: '标准件'
- },
- {
- id: '1',
- name: '铁丝'
- }
- ]
- }
- },
- loading: false,
- tableLoading: false,
- dialog: {
- fRow: null,
- editorBox: {
- show: false,
- type: '',
- form: {
- default: {
- workprocid: ''
- },
- data: {
- itemid: '',
- materialid: '',
- workprocid: '',
- unitid: '',
- seqno: '',
- mes_prodline: '',
- code: '',
- digits: '',
- may: '',
- canissue: '',
- weightMonth: '',
- issue: '',
- yxf_weight: '',
- kxf_weight: '',
- describe: '',
- state: '',
- grades: '',
- specifications: '',
- lengths: '',
- chemicalStandard: '',
- surfaceStandard: '',
- transportType: '',
- workprocType: '',
- purpose: '',
- planWeight: ''
- },
- rules: {
- planWeight: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- grades: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- specifications: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- transportType: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- purpose: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- chemicalStandard: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- may: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- workprocid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ]
- }
- }
- }
- }
- }
- },
- created () {
- this.activeMenu = window.localStorage.getItem('activeMenu');
- },
- mounted () {
- let that = this;
- window.PEDataObj = {
- // 将数据绑定到window上,供main页面使用
- vm: that,
- // tableArr:用于导出成Excel的表格的信息
- tableArr: [
- {
- name: '左表格',
- id: 'singleTable1'
- },
- {
- name: '右表格',
- id: 'singleTable2'
- }
- ]
- };
- // 接收路由参数
- if (that.$route.query.workproc_type) {
- that.filterForm.data.workproc_type = that.$route.query.workproc_type;
- }
- that.$nextTick(() => {
- // 立即获取的height有一定偏差,通过setTimeout延迟来解决
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
- }, 1);
- });
- that.getTimeGranData();
- that.getEnergyIdData();
- that.getPropertyIdData();
- that.getGrades();
- that.getSpecifications();
- that.getStandards();
- that.getUnitIdData();
- that.getsurfaceStandard();
- },
- methods: {
- // 计算树区域高度
- getRoleHeight (dom) {
- return window.innerHeight - dom.offsetTop;
- },
- // 自定义的表格合计方法:只给指定列进行合计
- getSummaries (param) {
- const prop = ['kxf_weight', 'planweight', 'yxf_weight', 'planWeight']; // 合计列绑定的prop
- return commonSummaries(param, prop);
- },
- // 获取时间粒度(平衡表数据维护)
- getTimeGranData () {
- let that = this
- let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmBalanceValue';
- 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.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
- }
- that.nameObj.timegranid.arr = arr;
- that.nameObj.timegranid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- checkboxT (row, index) {
- if (row.state === '2' && !this.isCheck) {
- return false;
- } else {
- return true;
- }
- },
- checkboxTLeft (row, index) {
- return true;
- },
- // 获取能介(平衡表)
- getEnergyIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergys/selectNameAndId/?isbalance=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.energyid.arr = arr;
- that.nameObj.energyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取属性
- getPropertyIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergypropertys/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.propertyid.arr = arr;
- that.nameObj.propertyid.obj = obj;
- } 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.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
- }
- }
- that.nameObj.unit.arr = arr;
- that.nameObj.unit.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取表格中的数据
- getTableData (pageNum1) {
- let that = this,
- params = {
- workprocType: that.filterForm.data.workproc_type,
- startTime: that.filterForm.data.clock[0],
- endTime: that.filterForm.data.clock[1],
- id: that.filterForm.data.Gmid
- };
- that.pageNum1 = pageNum1 || that.pageNum1;
- that.leftTableLoading = true;
- let url = 'pass/ems/v1/emsgmpcjhs/getGmDates/?pageNum=' + that.pageNum1 + '&pageSize=' + that.pageSize1;
- 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,
- id: item.ID,
- jhTime: item.JHTIME,
- state: item.STATE,
- grades: item.GRADES,
- specifications: item.SPECIFICATIONS,
- lengths: item.LENGTHS,
- chemicalStandard: item.CHEMICALSTANDARD,
- surfaceStandard: item.SURFACESTANDARD,
- workprocType: item.WORKPROCTYPE,
- iateralarea: item.IATERALAREA,
- lengthtimeswidth: item.LENGTHTIMESWIDTH,
- transportType: item.TRANSPORTTYPE,
- receivetime: item.RECEIVETIME,
- createman: item.CREATEMAN,
- createtime: item.CREATETIME,
- updateman: item.UPDATEMAN,
- purpose: item.PURPOSE,
- updatetime: item.UPDATETIME,
- memo: item.MEMO,
- planweight: item.PLANWEIGHT,
- deliveryDate: item.DELIVERYDATE,
- dimension: item.DIMENSION,
- kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
- yxf_weight: item.YXF_WEIGHT
- })
- }
- that.leftTableData = arr;
- that.total1 = res.data.total;
- that.dialog.fRow = null;
- } else {
- that.$message.error(res.message);
- }
- that.leftTableLoading = false;
- }).catch(function () {
- that.leftTableLoading = false;
- });
- },
- // 改变表格显示条数
- tableSizeChange (val) {
- let that = this;
- that.pageSize = val;
- that.getTableDetailDatas(1);
- },
- LftetableSizeChange (val) {
- let that = this;
- that.pageSize1 = val;
- that.getTableData(1);
- },
- // 点击查询
- getTableDetailData (row) {
- let that = this;
- if (row) {
- that.tableLoading = true;
- let url = 'pass/ems/v1/emsprodplanrounds/';
- that.axios.get(url, {
- params: {parentid: row.id}
- })
- .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,
- parentid: item.parentid,
- may: item.may,
- roundid: item.id,
- describe: item.describe,
- state: item.state,
- grades: item.grades,
- planWeight: item.planWeight,
- specifications: item.specifications,
- transportType: item.transportType,
- purpose: item.purpose,
- chemicalStandard: item.chemicalStandard,
- memo: item.memo,
- issuedTime: item.issuedTime,
- createman: item.createman,
- createtime: item.createtime,
- updateman: item.updateman,
- updatetime: item.updatetime,
- sqno: item.sqno,
- workprocType: item.workprocType,
- lengths: item.lengths,
- surfaceStandard: item.surfaceStandard,
- goinfo: item.goinfo
- });
- }
- that.rightTableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- }
- },
- getTableDetailDatas (pageNum, type) {
- let that = this;
- let params = {};
- if (type === 'Add') {
- params = {
- parentid: that.leftData.id
- };
- } else {
- params = {
- parentid: that.rightTableData[0].parentid,
- workprocType: that.filterForm.data.workproc_type
- };
- }
- that.pageNum = pageNum || that.pageNum;
- that.tableLoading = true;
- let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&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,
- parentid: item.parentid,
- may: item.may,
- roundid: item.id,
- describe: item.describe,
- state: item.state,
- grades: item.grades,
- planWeight: item.planWeight,
- specifications: item.specifications,
- purpose: item.purpose,
- chemicalStandard: item.chemicalStandard,
- memo: item.memo,
- issuedTime: item.issuedTime,
- createman: item.createman,
- createtime: item.createtime,
- updateman: item.updateman,
- sqno: item.sqno,
- updatetime: item.updatetime,
- workprocType: item.workprocType,
- lengths: item.lengths,
- surfaceStandard: item.surfaceStandard,
- goinfo: item.goinfo
- });
- }
- that.rightTableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- jsDifference () {
- let that = this;
- let fV = that.dialog.fRow.apportvalue,
- zV = 0;
- let xId = that.dialog.fRow.itemid + '-' + that.dialog.fRow.timegranid + '-' + that.dialog.fRow.clock;
- if (that.tableFormDataObj[xId]) {
- fV = that.tableFormDataObj[xId].apportvalue;
- }
- for (let item of that.rightTableObj.tableData) {
- zV = that.floatComputed(zV, item.apportvalue, '+');
- }
- that.difference = +that.floatComputed(fV, zV, '-').toFixed(3);
- },
- upTableFormDataObj () {
- // 更新右侧表格编辑模式绑定的数据
- let that = this;
- let fRow = that.dialog.fRow;
- if (fRow) {
- if (!fRow.tableFormDataArr || !fRow.isSelection) {
- // 当前选中行被勾选时不更新tableFormDataObj
- fRow.tableFormDataArr = JSON.parse(JSON.stringify(fRow.childrenArr));
- }
- if (fRow.isSelection) {
- that.rightTableObj.tableData = fRow.tableFormDataArr;
- } else {
- that.rightTableObj.tableData = fRow.childrenArr;
- }
- that.jsDifference();
- }
- },
- // 左边菜单选中
- handleSelectionChangeAsleft (val) {
- let that = this;
- let tableFormDataObj = {};
- let arr = [];
- for (let item of val) {
- arr.push(item.seq);
- }
- this.seqArr = arr.sort(sortNumber);
- for (let item of that.leftTableData) {
- item.isSelection = false;
- }
- 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];
- }
- tableFormDataObj[xId] = obj;
- }
- item.isSelection = true;
- }
- that.tableFormDataObj = tableFormDataObj;
- that.multipleSelectionAscLeft = val;
- },
- // 右边菜单选中
- handleSelectionChange (val) {
- let that = this;
- let rightTableObj = {};
- let arr = [];
- for (let item of val) {
- arr.push(item.seq);
- }
- this.seqArr = arr.sort(sortNumber);
- for (let item of that.rightTableData) {
- item.isSelection = false;
- }
- for (let item of val) {
- let obj = {};
- let xId = item.seq;
- if (that.rightTableObj[xId]) {
- // 如果已存在该数据则使用该数据
- rightTableObj[xId] = that.rightTableObj[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;
- rightTableObj[xId] = obj;
- }
- item.isSelection = true;
- }
- for (let item of that.rightTableData) {
- if (item.isSelection === false) {
- item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
- }
- }
- that.rightTableObj = rightTableObj;
- that.multipleSelection = val;
- },
- but_edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- describe: that.rightTableObj[key].describe,
- state: that.rightTableObj[key].state,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- id: that.rightTableObj[key].roundid,
- sqno: that.rightTableObj[key].sqno,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- lengths: that.rightTableObj[key].lengths,
- surfaceStandard: that.rightTableObj[key].surfaceStandard,
- goinfo: that.rightTableObj[key].goinfo
- });
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '保存成功',
- type: 'success'
- });
- that.getTableDetailDatas();
- that.getStandards();
- that.getsurfaceStandard();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- describe: that.rightTableObj[key].describe,
- state: that.rightTableObj[key].state,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- id: that.rightTableObj[key].roundid,
- sqno: that.rightTableObj[key].sqno,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- lengths: that.rightTableObj[key].lengths,
- surfaceStandard: that.rightTableObj[key].surfaceStandard,
- goinfo: that.rightTableObj[key].goinfo
- });
- }
- that.loading = true;
- that.$confirm('确定要强制修改数据吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.put('pass/ems/v1/emsprodplanrounds/ForcedUpdate', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '保存成功',
- type: 'success'
- });
- that.getTableDetailDatas(1, null);
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- getGrades () {
- let that = this
- let url = 'pass/product/v1/emsvqcmbasesteel/getBase'
- 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] = {
- name: item.name,
- id: item.id
- }
- }
- that.nameObj.grades.arr = arr;
- that.nameObj.grades.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- getSpecifications () {
- let that = this
- let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
- 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] = {
- name: item.name,
- id: item.id
- }
- }
- that.nameObj.specifications.arr = arr;
- that.nameObj.specifications.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- getStandards () {
- let that = this
- let url = 'pass/ems/v1/emsprodplanrounds/getstdchem';
- 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.chemicalStandard
- })
- }
- that.nameObj.chemicalStandard.arr = arr;
- that.nameObj.chemicalStandard.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取表面质量标准
- getsurfaceStandard () {
- let that = this
- let url = 'pass/ems/v1/emsprodplanrounds/getsurfaceStandard';
- 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.surfaceStandard
- })
- }
- that.nameObj.surfaceStandard.arr = arr;
- that.nameObj.surfaceStandard.obj = obj;
- console.log(that.nameObj.surfaceStandard);
- } else {
- that.$message.error(res.message);
- }
- });
- },
- issue () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- roundid: that.rightTableObj[key].roundid,
- describe: that.rightTableObj[key].describe,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- issuedTime: that.rightTableObj[key].issuedTime,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- updateman: that.rightTableObj[key].updateman,
- updatetime: that.rightTableObj[key].updatetime,
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- sqno: that.rightTableObj[key].sqno,
- lengths: that.rightTableObj[key].lengths,
- surfaceStandard: that.rightTableObj[key].surfaceStandard,
- goinfo: that.rightTableObj[key].goinfo
- });
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '操作成功',
- type: 'success'
- });
- that.getTableData();
- that.getTableDetailDatas();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- offissue () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- parentid: that.rightTableObj[key].parentid,
- may: that.rightTableObj[key].may,
- roundid: that.rightTableObj[key].roundid,
- describe: that.rightTableObj[key].describe,
- grades: that.rightTableObj[key].grades,
- planWeight: that.rightTableObj[key].planWeight,
- specifications: that.rightTableObj[key].specifications,
- transportType: that.rightTableObj[key].transportType,
- workprocType: that.rightTableObj[key].workprocType,
- purpose: that.rightTableObj[key].purpose,
- chemicalStandard: that.rightTableObj[key].chemicalStandard,
- memo: that.rightTableObj[key].memo,
- issuedTime: that.rightTableObj[key].issuedTime,
- createman: that.rightTableObj[key].createman,
- createtime: that.rightTableObj[key].createtime,
- updateman: that.rightTableObj[key].updateman,
- updatetime: that.rightTableObj[key].updatetime,
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- sqno: that.rightTableObj[key].sqno,
- lengths: that.rightTableObj[key].lengths,
- surfaceStandard: that.rightTableObj[key].surfaceStandard,
- goinfo: that.rightTableObj[key].goinfo
- });
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/offissue', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '操作成功',
- type: 'success'
- });
- that.getTableData();
- that.getTableDetailDatas();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- but_del_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- let SubmitData = [];
- for (let key in that.rightTableObj) {
- SubmitData.push({
- id: that.rightTableObj[key].roundid,
- state: that.rightTableObj[key].state,
- parentid: that.rightTableObj[key].parentid
- });
- }
- that.$confirm('是否删除已选数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '删除成功',
- type: 'success'
- });
- that.getTableDetailDatas(1, null);
- 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 = {
- jhTime: that.dialog.editorBox.form.data.may,
- planWeight: that.dialog.editorBox.form.data.planWeight,
- workprocType: that.filterForm.data.workproc_type
- };
- that.$refs['dialog_form'].validate((valid) => {
- if (valid) {
- that.loading = true;
- that.axios.post('pass/ems/v1/emsgmpcjhs/addNbJH', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.dialog.editorBox.show = false;
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- },
- correctvalueUpFoo (row) {
- let that = this;
- // 防止数据为无效值
- if (row.correctvalue === '' || !isFinite(row.correctvalue)) {
- row.correctvalue = 0;
- row.apportvalue = row.actualvalue;
- } else {
- row.apportvalue = that.floatComputed(row.actualvalue, row.correctvalue, '+');
- }
- that.jsDifference();
- },
- apportvalueUpFoo (row) {
- let that = this;
- if (row.apportvalue === '' || !isFinite(row.apportvalue)) {
- row.correctvalue = 0;
- row.apportvalue = row.actualvalue;
- } else {
- row.correctvalue = that.floatComputed(row.apportvalue, row.actualvalue, '-');
- }
- that.jsDifference();
- },
- tableTDMousedown (e) {
- let that = this;
- let nowPageX = e.pageX,
- nowWidth = that.leftTableWidth,
- minWidth = 200,
- maxWidth = window.innerWidth - 200;
- that.$refs.table_box.style.userSelect = 'none';
- that.$refs.table_box.style.cursor = 'col-resize';
- that.$refs.table_box.onmousemove = function (e) {
- let bh = e.pageX - nowPageX;
- if (nowWidth + bh > maxWidth) {
- that.leftTableWidth = maxWidth;
- } else if (nowWidth + bh < minWidth) {
- that.leftTableWidth = minWidth;
- } else {
- that.leftTableWidth = nowWidth + bh;
- }
- }
- that.$refs.table_box.onmouseup = function () {
- that.$refs.table_box.onmousemove = false;
- that.$refs.table_box.onmouseup = false;
- that.$refs.table_box.style.userSelect = '';
- that.$refs.table_box.style.cursor = ''
- }
- },
- // 对proportion的值进行处理,使其符合要求
- proportionFormat (row) {
- let that = this;
- if (row.proportion === '' || !isFinite(row.proportion)) {
- row.proportion = 0;
- }
- },
- // 重新计算,根据自定义的分配比例来自动调整最终值
- againCount () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- for (let item of that.multipleSelection) {
- let xId = item.itemid + '-' + item.timegranid + '-' + item.clock;
- let objItem = that.tableFormDataObj[xId];
- let bl = 0;
- for (let dataObj of item.tableFormDataArr) {
- bl = +that.floatComputed(bl, dataObj.proportion, '+');
- }
- if (bl !== 100) {
- this.$message.error('所有比例之和不为100%,请调整比例后再执行计算。');
- continue;
- }
- let sum = objItem.apportvalue;
- for (let i = 0, ilength = item.tableFormDataArr.length; i < ilength; i++) {
- if (i === (ilength - 1)) {
- item.tableFormDataArr[i].apportvalue = sum;
- } else {
- let z = that.floatComputed(objItem.apportvalue, item.tableFormDataArr[i].proportion, '*');
- item.tableFormDataArr[i].apportvalue = that.floatComputed(z, 100, '/');
- sum = that.floatComputed(sum, item.tableFormDataArr[i].apportvalue, '-');
- }
- item.tableFormDataArr[i].correctvalue = that.floatComputed(item.tableFormDataArr[i].apportvalue, item.tableFormDataArr[i].actualvalue, '-');
- }
- that.jsDifference();
- }
- } else {
- this.$message.error('请勾选一条数据');
- }
- },
- but_add (type) {
- let that = this;
- let SubmitData = [];
- SubmitData.push({
- parentid: that.leftData.id,
- may: that.leftData.jhTime,
- describe: that.leftData.describe,
- state: that.leftData.state,
- grades: that.leftData.grades,
- specifications: that.leftData.specifications,
- workprocType: that.leftData.workprocType,
- purpose: that.leftData.purpose,
- chemicalStandard: that.leftData.chemicalStandard,
- memo: that.leftData.memo,
- createMan: that.leftData.createman,
- createTime: that.leftData.createtime,
- deliveryDate: that.leftData.deliveryDate,
- lengths: that.leftData.lengths,
- goinfo: that.leftData.id.substring(0, 1) === 'G' ? '1036WM1' : null,
- surfaceStandard: that.leftData.surfaceStandard,
- type: type
- })
- that.loading = true;
- that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.dialog.editorBox.show = false;
- that.getTableDetailDatas(1, 'Add');
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- },
- // 用于检索字符串
- getGoinfo (str) {
- let ID = str.substring(0, 1);
- if (ID === 'G') {
- return true;
- }
- return null;
- },
- but_addNBJH () {
- let that = this;
- that.dialog.editorBox.form.data.planWeight = '';
- that.dialog.editorBox.show = true;
- setTimeout(() => {
- that.$refs['dialog_form'].clearValidate();
- }, 100);
- },
- getChildTable (row, expandedRows) {
- let that = this;
- if (!row.getTable) {
- let params = {
- clock: row.clock,
- energyid: row.energyid
- };
- row.tableLoading = true;
- let url = 'pass/ems/v1/trmbalancevalues/getitem';
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let item of res.data) {
- arr.push({
- clock: item.CLOCK,
- itemname: item.ITEMNAME,
- timegranid: item.TIMEGRANID,
- apportvalue: item.APPORTVALUE
- })
- }
- row.tableData = arr;
- row.getTable = true;
- } else {
- that.$message.error(res.message);
- }
- row.tableLoading = false;
- }).catch(function () {
- row.tableLoading = false;
- });
- }
- },
- 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();
- });
- console.log('下键')
- } 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;
- }
- }
- }
- console.log('上键')
- this.editSetFlag = index + this.columnId;
- let id = '#' + this.editSetFlag;
- this.$nextTick(() => {
- $(id).click();
- });
- } else if (event.keyCode === 37) { // 键盘左键
- console.log('左键')
- $(tdTarget).prevAll().find('input:text').last().click();
- } else if (event.keyCode === 39) { // 键盘右键
- $(tdTarget).nextAll().find('input').eq(0).click();
- console.log('右键')
- }
- },
- 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();
- });
- },
- tableRowClassName ({row, rowIndex}) {
- // 把每一行的索引放进row
- row.index = rowIndex;
- },
- openDetails (row) {
- let that = this;
- that.leftData = row;
- }
- }
- }
- function sortNumber (a, b) {
- return a - b
- }
- </script>
- <style lang="less">
- .balanceSheetData {
- 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;
- // margin-top: -7px;
- padding: 7px 0;
- border-top: 1px solid #ccc;
- // border-bottom: 1px solid #ccc;
- // margin-bottom: 6px;
- }
- }
- .table-box {
- .table-left {
- float: left;
- width: 550px;
- }
- .table-tuodong {
- float: left;
- width: 5px;
- margin: 0 1px 0 1px;
- cursor: col-resize;
- }
- .table-right {
- margin-left: 557px;
- }
- }
- .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;
- }
- }
- // 隐藏全选按钮
- thead .el-table-column--selection .cell {
- display: none;
- }
- }
- }
- </style>
|