1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119 |
- <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"
- :defaultOffset="-1"
- ></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="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"
- >
- <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="编号"
- fixed="left"
- width="136px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="jhTime"
- label="排产日期"
- width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="grades"
- label="钢种"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="iateralArea"
- label="断面"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="dimension"
- label="截面尺寸"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="lengthTimesWidth"
- label="高度*宽度"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="lengths"
- label="长度"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="planweight"
- label="计划量"
- width="110px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="kxf_weight"
- label="可下发量"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="yxf_weight"
- label="已下发量"
- min-width="100px"
- :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"
- @selection-change="handleSelectionChange"
- :row-class-name="tableRowClassName"
- @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="编号"
- min-width="142px"
- v-model="filterForm.data.sqno"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="may"
- label="排产日期"
- 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"
- >
- <zj-timegran-date
- v-model="rightTableObj[scope.row.seq].may"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- style="width: 100%;"
- :timegranId="'DAY'"
- :custom="1"
- ></zj-timegran-date>
- </el-form-item>
- <span v-else>{{scope.row.may}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="describe"
- label="轮次描述"
- min-width="160px"
- :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%;"
- v-model="rightTableObj[scope.row.seq].describe"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.describe}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="state"
- label="状态"
- min-width="100px"
- :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="钢种"
- min-width="100px"
- :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
- v-model="rightTableObj[scope.row.seq].grades"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- 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="lengths"
- label="长度"
- min-width="100px"
- :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="计划量"
- min-width="100px"
- :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%;"
- v-model="rightTableObj[scope.row.seq].planWeight"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- refcous="true"
- ></el-input>
- </el-form-item>
- <span v-else>{{scope.row.planWeight}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="iateralArea"
- label="断面"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.iateralArea'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.iateralArea"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].iateralArea"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.iateralArea.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.iateralArea.obj[scope.row.iateralArea] ? nameObj.iateralArea.obj[scope.row.iateralArea].name : scope.row.iateralArea }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="dimension"
- label="截面尺寸"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.dimension'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.dimension"
- >
- <!-- <el-input
- style="width: 100%;"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- v-model="rightTableObj[scope.row.seq].dimension"
- refcous="true"
- ></el-input> -->
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].dimension"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.dimension.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.dimension.obj[scope.row.dimension] ? nameObj.dimension.obj[scope.row.dimension].name : scope.row.dimension }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="lengthTimesWidth"
- label="高度*宽度"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.lengthTimesWidth'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.lengthTimesWidth"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].lengthTimesWidth"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.lengthTimeswidth.arr"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.lengthTimeswidth.obj[scope.row.lengthTimesWidth] ? nameObj.lengthTimeswidth.obj[scope.row.lengthTimesWidth].name : scope.row.lengthTimesWidth }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="transportType"
- label="运输方式"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.transportType'"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- :rules="tableFormRules.transportType"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].transportType"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- placeholder=""
- >
- <el-option
- v-for="item of nameObj.transportType.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- <span v-else>{{ nameObj.transportType.obj[scope.row.transportType] ? nameObj.transportType.obj[scope.row.transportType].name : scope.row.transportType }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="chemicalStandard"
- label="化学成份执行标准"
- min-width="120px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <el-form-item
- :prop="scope.row.seq + '.chemicalStandard'"
- :rules="tableFormRules.chemicalStandard"
- v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
- >
- <el-select
- allow-create
- filterable
- clearable
- v-model="rightTableObj[scope.row.seq].chemicalStandard"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- 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="memo"
- label="备注"
- 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%;"
- v-model="rightTableObj[scope.row.seq].memo"
- @keydown.native="keyDown" :id="scope.$index + scope.column.id"
- 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="下发时间"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="createman"
- label="创建人"
- min-width="100px"
- :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="修改人"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updatetime"
- label="修改时间"
- min-width="130px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- prop="roundid"
- label="轮次序号"
- min-width="100px"
- :show-overflow-tooltip="true"
- v-if="filterForm.data.show"
- ></el-table-column>
- <el-table-column
- prop="parentid"
- label="父级id"
- 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, // 是否为审核人
- filterForm: {
- show: true,
- data: {
- id: '',
- Gmid: '',
- timegranid: '',
- clock: '',
- workprocid: '',
- workprocType: '',
- workproc_type: '',
- energyid: '',
- propertyid: '',
- itemid: '',
- itemname: '',
- itemdesc: '',
- may: '',
- canissue: '',
- weightMonth: '',
- issue: '',
- yxf_weight: '',
- kxf_weight: '',
- describe: '',
- state: '',
- grades: '',
- specifications: '',
- lengths: '',
- chemicalStandard: '',
- surfaceStandard: '',
- transportType: '',
- parentid: '',
- purpose: '',
- sqno: '',
- show: false
- }
- },
- rules: {
- },
- pageNum: 1,
- pageSize: 20,
- total: 0,
- pageNum1: 1,
- pageSize1: 20,
- total1: 0,
- singleTableHeight: 100,
- leftTableData: [],
- leftTableLoading: false,
- leftTableWidth: 550,
- difference: 0,
- rightTableData: [],
- rightTableObj: {
- },
- 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: []
- },
- workprocid: {
- obj: {
- 'AT2005': {
- id: 'AT2005',
- name: '一高线'
- },
- 'AT2006': {
- id: 'AT2006',
- name: '二高线'
- }
- },
- arr: [{
- id: 'AT2005',
- name: '一高线'
- },
- {
- id: 'AT2006',
- name: '二高线'
- }]
- },
- lengthTimeswidth: {
- obj: {},
- arr: []
- },
- dimension: {
- obj: {},
- arr: []
- },
- iateralArea: {
- 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: []
- },
- transportType: {
- obj: {'0': {name: '火运'}, '1': {name: '汽运'}},
- arr: [
- {
- id: '0',
- name: '火运'
- },
- {
- id: '1',
- 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.getStandards();
- that.getUnitIdData();
- that.getiateralArea();
- that.getdimension();
- that.getlengthTimesWidth();
- },
- 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);
- }
- });
- },
- // 获取高度和宽度
- getlengthTimesWidth () {
- let that = this
- let url = 'pass/ems/v1/emsprodplanrounds/getlengthTimesWidth';
- 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.lengthTimesWidth
- })
- }
- that.nameObj.lengthTimeswidth.arr = arr;
- that.nameObj.lengthTimeswidth.obj = obj;
- console.log(that.nameObj.lengthTimeswidth);
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取截面尺寸
- getdimension () {
- let that = this
- let url = 'pass/ems/v1/emsprodplanrounds/getdimension';
- 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.dimension
- })
- }
- that.nameObj.dimension.arr = arr;
- that.nameObj.dimension.obj = obj;
- console.log(that.nameObj.dimension);
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取断面
- getiateralArea () {
- let that = this
- let url = 'pass/ems/v1/emsprodplanrounds/getiateralArea';
- 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.iateralArea
- })
- }
- that.nameObj.iateralArea.arr = arr;
- that.nameObj.iateralArea.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,
- dimension: item.DIMENSION,
- kxf_weight: item.KXF_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,
- lengthTimesWidth: item.lengthTimesWidth,
- dimension: item.dimension,
- iateralArea: item.iateralArea,
- lengths: item.lengths
- });
- }
- 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.multipleSelectionAscLeft[0].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,
- transportType: item.transportType,
- 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,
- lengthTimesWidth: item.lengthTimesWidth,
- dimension: item.dimension,
- iateralArea: item.iateralArea,
- lengths: item.lengths
- });
- }
- 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,
- lengthTimesWidth: that.rightTableObj[key].lengthTimesWidth,
- dimension: that.rightTableObj[key].dimension,
- iateralArea: that.rightTableObj[key].iateralArea,
- lengths: that.rightTableObj[key].lengths
- });
- }
- 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();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- getGrades () {
- let that = this
- let url = 'pass/product/v1/emssteel/getGrades/?type=' + '型钢';
- 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.steelName
- })
- }
- that.nameObj.grades.arr = arr;
- that.nameObj.grades.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- getStandards () {
- let that = this
- let url = 'pass/product/v1/emsstandard/getStandards';
- 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.basecode,
- name: item.basename
- })
- }
- that.nameObj.chemicalStandard.arr = arr;
- that.nameObj.chemicalStandard.obj = obj;
- } 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,
- auditState: that.rightTableObj[key].auditState,
- sqno: that.rightTableObj[key].sqno,
- lengthTimesWidth: that.rightTableObj[key].lengthTimesWidth,
- dimension: that.rightTableObj[key].dimension,
- iateralArea: that.rightTableObj[key].iateralArea,
- lengths: that.rightTableObj[key].lengths
- });
- }
- 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,
- lengthTimesWidth: that.rightTableObj[key].lengthTimesWidth,
- dimension: that.rightTableObj[key].dimension,
- iateralArea: that.rightTableObj[key].iateralArea,
- lengths: that.rightTableObj[key].lengths
- });
- }
- 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;
- if (that.multipleSelectionAscLeft.length > 0) {
- let SubmitData = [];
- for (let key in that.tableFormDataObj) {
- SubmitData.push({
- parentid: that.tableFormDataObj[key].id,
- may: that.tableFormDataObj[key].jhTime,
- describe: that.tableFormDataObj[key].describe,
- state: that.tableFormDataObj[key].state,
- grades: that.tableFormDataObj[key].grades,
- specifications: that.tableFormDataObj[key].specifications,
- transportType: that.tableFormDataObj[key].transportType,
- workprocType: that.tableFormDataObj[key].workprocType,
- purpose: that.tableFormDataObj[key].purpose,
- chemicalStandard: that.tableFormDataObj[key].chemicalStandard,
- memo: that.tableFormDataObj[key].memo,
- createMan: that.tableFormDataObj[key].createman,
- createTime: that.tableFormDataObj[key].createtime,
- lengthTimesWidth: that.tableFormDataObj[key].lengthTimesWidth,
- dimension: that.tableFormDataObj[key].dimension,
- iateralArea: that.tableFormDataObj[key].iateralArea,
- lengths: that.tableFormDataObj[key].lengths,
- 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;
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- // let that = this;
- // that.dialog.editorBox.form.data.describe = '';
- // that.dialog.editorBox.form.data.grades = '';
- // that.dialog.editorBox.form.data.specifications = '';
- // that.dialog.editorBox.form.data.transportType = '';
- // that.dialog.editorBox.form.data.chemicalStandard = '';
- // that.dialog.editorBox.form.data.workprocid = '';
- // that.dialog.editorBox.form.data.planWeight = '';
- // that.dialog.editorBox.form.data.purpose = '';
- // that.dialog.editorBox.show = true;
- // that.dialog.editorBox.form.data.planWeight = '';
- // setTimeout(() => {
- // that.$refs['dialog_form'].clearValidate();
- // }, 100);
- },
- 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;
- }
- }
- }
- 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>
|