123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809 |
- <template>
- <!-- 计量点数据录入 -->
- <div class="measuringLocationAdd">
- <div class="box">
- <div class="box-top">
- <el-form
- style="overflow: hidden;"
- :style="filterForm.show ? null : { height: '0px' }"
- size="mini"
- label-width="80px"
- >
- <el-row>
- <el-col :span="6">
- <el-form-item label="时间粒度">
- <el-select
- filterable
- clearable
- v-model="filterForm.data.timegranid"
- placeholder="时间粒度"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.timegranid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="日期">
- <!-- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="filterForm.data.clock"
- placeholder="时间"
- style="width: 100%;"
- ></el-date-picker> -->
- <!-- <zj-timegran-date
- v-model="filterForm.data.clock"
- style="width: 100%;"
- :timegranId="filterForm.data.timegranid"
- :oneFoo="getTableData"
- :defaultOffset="-1"
- ></zj-timegran-date> -->
- <zj-timegran-date
- v-model="filterForm.data.clock"
- style="width: 100%;"
- :type="'daterange'"
- :timegranId="filterForm.data.timegranid"
- :oneFoo="getTableData"
- :defaultOffset="-1"
- ></zj-timegran-date>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="能介类型">
- <el-select
- filterable
- clearable
- v-model="filterForm.data.energytypeid"
- placeholder="能介类型"
- style="width: 100%;"
- @change="filterForm.data.energyid = []"
- >
- <el-option
- v-for="item of nameObj.energytypeid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="能介">
- <el-select
- filterable
- clearable
- multiple
- collapse-tags
- v-model="filterForm.data.energyid"
- placeholder="能介"
- style="width: 100%;"
- >
- <template v-for="item of nameObj.energyid.arr">
- <el-option
- v-if="item.energytypeid === filterForm.data.energytypeid || filterForm.data.energytypeid === ''"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </template>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="6">
- <el-form-item label="手抄或自动">
- <el-select
- filterable
- clearable
- v-model="filterForm.data.itemtype"
- placeholder="手抄或自动"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.itemtype.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="位置">
- <el-select
- filterable
- clearable
- multiple
- collapse-tags
- v-model="filterForm.data.locateid"
- placeholder="位置"
- style="width: 100%;"
- :disabled="filterForm.disabled.locateid"
- >
- <el-option
- v-for="item of nameObj.locateid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="计量点编号">
- <el-input
- clearable
- v-model.trim="filterForm.data.itemid"
- placeholder="计量点编号"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="计量点名称">
- <el-input
- clearable
- v-model.trim="filterForm.data.itemname"
- placeholder="计量点名称"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="6">
- <el-form-item label="工序">
- <el-select
- filterable clearable
- v-model="filterForm.data.costid"
- placeholder="工序"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.workprocid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="站所">
- <el-select
- filterable
- clearable
- multiple
- collapse-tags
- v-model="filterForm.data.networkid"
- placeholder="站所"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.networkid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="6">
- <el-form-item label="计量层级">
- <el-select
- filterable clearable
- v-model="filterForm.data.hierarchy"
- placeholder="计量层级"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.hierarchy.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col> -->
- <el-col :span="6">
- <el-form-item label="TAG点别名">
- <el-input
- clearable
- v-model.trim="filterForm.data.tagAlias"
- placeholder="TAG点别名"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="用能属性">
- <el-select
- filterable clearable
- v-model="filterForm.data.propertyid"
- placeholder="用能属性"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.propertyid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="box-top-gjl">
- <el-button
- type="primary"
- size="mini"
- @click="look_trendChart()"
- >查看趋势</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-edit-outline"
- v-privilege="activeMenu + 'PUT'"
- @click="but_edit_plural()"
- :loading="loading"
- >修改</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'PUT'"
- @click="but_re_compute()"
- :loading="loading"
- >重新计算</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'PUT'"
- @click="but_redata()"
- :loading="loading"
- >重新生成数据</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'BQ'"
- @click="but_resData()"
- :loading="loading"
- >数据补全</el-button>
- <div style="float:right; text-align: right;">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-search"
- v-privilege="activeMenu + 'QUERY'"
- @click="getTableData(1)"
- >查询</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-refresh"
- v-privilege="activeMenu + 'QUERY'"
- @click="tableDataCancel();"
- >重置</el-button>
- <el-button
- size="mini"
- :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
- :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
- @click="filterForm.show = !filterForm.show;
- $nextTick(() => {
- singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
- }
- );"
- >{{ filterForm.show ? '收起' : '展开' }}</el-button>
- </div>
- </div>
- </div>
- <div class="box-bottom">
- <el-form
- size="mini"
- ref="dialog_form_arr"
- label-width="0px"
- :model="tableFormDataObj"
- >
- <el-table
- stripe
- id="singleTable"
- ref="singleTable"
- :data="tableData"
- v-loading="tableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- @selection-change="handleSelectionChange"
- show-summary
- :summary-method="getSummaries"
- >
- <el-table-column
- sortable
- type="selection"
- width="40"
- align="center"
- fixed="left"
- ></el-table-column>
- <el-table-column
- sortable
- prop="timegranid"
- label="时间粒度"
- width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.timegranid.obj[scope.row.timegranid] ? nameObj.timegranid.obj[scope.row.timegranid] : scope.row.timegranid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="clock"
- label="时间"
- width="75px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="itemid"
- label="计量点编号"
- min-width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="itemname"
- label="计量点名称"
- min-width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="tagAlias"
- label="TAG别名"
- min-width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="propertyid"
- label="用能属性"
- min-width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable prop="ename"
- label="能介"
- width="70px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="costid"
- label="工序"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.workprocid.obj[scope.row.costid] ? nameObj.workprocid.obj[scope.row.costid] : scope.row.costid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable prop="lname"
- label="位置"
- width="75px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="tagModulus"
- label="倍率"
- width="60px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- :sort-by="function(row, index) { return sortFoo(row, index, 'unitid') }"
- prop="unitid"
- label="计量单位"
- width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="mintvalue"
- label="仪表期初值"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="mendvalue"
- label="仪表期末值"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- label="期末-期初"
- prop="subtracts"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ isNaN(scope.row.mendvalue - scope.row.mintvalue) ? '' : floatComputed(scope.row.mendvalue, scope.row.mintvalue, '-') }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="actualvalue"
- label="计算值"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="correctvalue"
- label="修正值"
- min-width="100px"
- :show-overflow-tooltip="true"
- > <template slot-scope="scope">
- <el-form-item
- v-if="scope.row.isSelection"
- :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.correctvalue'"
- :rules="dialog.editorBox.form.rules.correctvalue"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model.trim="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].correctvalue"
- @change="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].apportvalue = floatComputed(scope.row.actualvalue, tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].correctvalue, '+')"
- ></el-input>
- <template
- slot="error"
- slot-scope="scope"
- >
- <p
- class="error"
- :title="scope.error"
- >{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else>{{scope.row.correctvalue}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="apportvalue"
- label="最终值"
- min-width="100px"
- :show-overflow-tooltip="true"
- > <template slot-scope="scope">
- <el-form-item
- v-if="scope.row.isSelection"
- :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.apportvalue'"
- :rules="dialog.editorBox.form.rules.apportvalue"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model.trim="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].apportvalue"
- @change="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].correctvalue = floatComputed(tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].apportvalue, scope.row.actualvalue, '-')"
- ></el-input>
- <template
- slot="error"
- slot-scope="scope"
- >
- <p
- class="error"
- :title="scope.error"
- >{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else>{{scope.row.apportvalue}}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- sortable
- prop="sumvalue"
- label="累计值"
- min-width="100px"
- :show-overflow-tooltip="true"
- > </el-table-column> -->
- <el-table-column
- sortable
- prop="updatereason"
- label="修改原因"
- min-width="100px"
- :show-overflow-tooltip="true"
- > <template slot-scope="scope">
- <el-form-item
- v-if="scope.row.isSelection"
- :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.updatereason'"
- :rules="dialog.editorBox.form.rules.updatereason"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model.trim="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].updatereason"
- ></el-input>
- <template
- slot="error"
- slot-scope="scope"
- >
- <p
- class="error"
- :title="scope.error"
- >{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else>{{scope.row.updatereason}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="bz"
- label="备注"
- min-width="100px"
- :show-overflow-tooltip="true"
- > <template slot-scope="scope">
- <el-form-item
- v-if="scope.row.isSelection"
- :prop="scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid + '.bz'"
- :rules="dialog.editorBox.form.rules.bz"
- >
- <el-input
- clearable
- style="width: 100%;"
- v-model.trim="tableFormDataObj[scope.row.itemid + '-' + scope.row.clock + '-' + scope.row.timegranid].bz"
- ></el-input>
- <template
- slot="error"
- slot-scope="scope"
- >
- <p
- class="error"
- :title="scope.error"
- >{{ scope.error }}</p>
- </template>
- </el-form-item>
- <span v-else>{{scope.row.bz}}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="rectime"
- label="创建时间"
- min-width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updateUser"
- label="创建人"
- min-width="80px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updateman"
- label="修改人"
- width="65px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="updatetime"
- label="修改时间"
- width="125px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <!-- <el-table-column
- class-name="gn-TableDownloadExcel-none"
- label="操作"
- align="center"
- width="70px"
- fixed="right"
- >
- <template slot-scope="scope">
- <div>
- <el-button
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'PUT'"
- @click="but_edit(scope.row)"
- >修改</el-button>
- </div>
- </template>
- </el-table-column> -->
- <el-table-column
- sortable
- class-name="gn-TableDownloadExcel-none"
- label="操作"
- align="center"
- width="86px"
- fixed="right"
- >
- <template slot-scope="scope">
- <div>
- <!-- <el-button
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'PUT'"
- @click="but_edit(scope.row)"
- >修改</el-button> -->
- <el-button
- type="primary"
- size="mini"
- v-privilege="activeMenu + 'QUERY'"
- @click="but_sdata(scope.row)"
- >计算过程</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize"
- :current-page.sync="pageNum"
- @size-change="tableSizeChange"
- @current-change="getTableData()"
- style="text-align: right;margin-top: 10px;"
- ></el-pagination>
- </div>
- </div>
- <!-- <el-dialog
- :title="'计量点数据 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
- :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="70px"
- >
- <el-form-item label="计算值">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.actualvalue"
- readonly
- ></el-input>
- </el-form-item>
- <el-form-item label="修正值" prop="correctvalue">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.correctvalue"
- @change="dialog.editorBox.form.data.apportvalue = floatComputed(dialog.editorBox.form.data.actualvalue, dialog.editorBox.form.data.correctvalue, '+')"
- ></el-input>
- </el-form-item>
- <el-form-item label="最终值" prop="apportvalue">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.apportvalue"
- @change="dialog.editorBox.form.data.correctvalue = floatComputed(dialog.editorBox.form.data.apportvalue, dialog.editorBox.form.data.actualvalue, '-')"
- ></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="bz">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.bz"
- ></el-input>
- </el-form-item>
- <el-form-item label="修改原因" prop="updatereason">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.updatereason"
- ></el-input>
- </el-form-item>
- </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> -->
- <el-dialog
- title="趋势图"
- :visible.sync="dialog.trendChart.show"
- width="900px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <div>
- <el-form
- label-width="83px"
- size="mini"
- inline
- >
- <!-- <el-form-item label="查看连续周期">
- <el-checkbox></el-checkbox>
- </el-form-item> -->
- <el-form-item label="图表类型">
- <el-select
- filterable
- clearable
- v-model="dialog.trendChart.form.data.chartSeriesType"
- @change="chartSeriesType"
- >
- <el-option
- value="bar"
- label="柱状图"
- ></el-option>
- <el-option
- value="line"
- label="折线图"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务日期(前)">
- <el-input-number
- v-model="dialog.trendChart.size"
- @change="getTrendChart()"
- :min="1"
- :max="365"
- label=""
- >
- </el-input-number>
- </el-form-item>
- <span>天</span>
- </el-form>
- <div style="min-height: 400px;">
- <icore-graphical
- ref="graphical"
- v-if="dialog.trendChart.show && dialog.trendChart.chart.show"
- :option="dialog.trendChart.chart.option"
- :width="'100%'"
- :height="'400px'"
- >
- </icore-graphical>
- </div>
- </div>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button @click="dialog.trendChart.show = false">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { zCheckNumber1 } from '~/utils/validator.js'
- import store from '@/store/index.js';
- import timegranDate from '~/components/zg/timegranDate.vue'
- import { formatDate, XtcommonSummaries } from '@/utils/util.js';
- export default {
- name: 'measuringLocationAdd',
- components: {
- 'zj-timegran-date': timegranDate
- },
- data () {
- return {
- multipleSelection: [],
- tableFormDataObj: {},
- store,
- userInfo: {
- data: null
- },
- activeMenu: '',
- filterForm: {
- show: true,
- data: {
- itemtype: '',
- clock: '',
- energytypeid: '',
- energyid: '',
- timegranid: '',
- locateid: '',
- itemid: '',
- itemname: '',
- networkid: '',
- hierarchy: '',
- tagAlias: '',
- propertyid: ''
- },
- disabled: {
- locateid: false
- },
- rules: {
- }
- },
- pageNum: 1,
- pageSize: 20,
- total: 0,
- singleTableHeight: 200,
- tableData: [],
- nameObj: {
- workprocid: {
- obj: {},
- arr: []
- },
- timegranid: {
- obj: {},
- arr: []
- },
- energytypeid: {
- obj: {},
- arr: []
- },
- energyid: {
- obj: {},
- arr: []
- },
- propertyid: {
- obj: {},
- arr: []
- },
- itemtype: {
- obj: {
- 'AUTO': '自动上传',
- 'MANUAL': '手抄',
- 'VIRTUAL': '虚拟'
- },
- arr: [
- {
- id: 'AUTO',
- name: '自动上传'
- },
- {
- id: 'MANUAL',
- name: '手抄'
- },
- {
- id: 'VIRTUAL',
- name: '虚拟'
- }
- ]
- },
- locateid: {
- obj: {},
- arr: []
- },
- networkid: {
- obj: {},
- arr: []
- },
- hierarchy: {
- obj: {},
- arr: []
- },
- unitid: {
- obj: {},
- arr: []
- }
- },
- loading: false,
- tableLoading: false,
- dialog: {
- editorBox: {
- show: false,
- type: '',
- form: {
- data: {
- itemid: '',
- correctvalue: '',
- apportvalue: '',
- bz: '',
- updatereason: ''
- },
- rules: {
- correctvalue: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- apportvalue: [
- { required: true, message: '该项不能为空', trigger: 'change' },
- { validator: zCheckNumber1, trigger: 'change' }
- ],
- update_reason: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ]
- }
- }
- },
- trendChart: {
- show: false,
- size: 7,
- form: {
- data: {
- chartSeriesType: 'bar'
- }
- },
- chart: {
- show: true,
- option: {
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data: []
- },
- toolbox: {
- feature: {
- saveAsImage: {}
- }
- },
- xAxis: {
- type: 'category',
- data: []
- },
- yAxis: {
- type: 'value'
- },
- series: [
- // {
- // name: '计量点1号',
- // type: 'bar',
- // data: [1230, 2234, 3000, 4500, 3120]
- // },
- // {
- // name: '计量点2号',
- // type: 'bar',
- // data: [1980, 1200, 3200, 2300, 3212]
- // }
- ]
- }
- }
- }
- }
- }
- },
- created () {
- this.activeMenu = window.localStorage.getItem('activeMenu');
- },
- mounted () {
- let that = this;
- window.PEDataObj = {
- // 将数据绑定到window上,供main页面使用
- vm: that,
- // tableArr:用于导出成Excel的表格的信息
- tableArr: [
- {
- name: '',
- id: 'singleTable'
- }
- ]
- };
- that.$nextTick(() => {
- // 立即获取的height有一定偏差,通过setTimeout延迟来解决
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
- }, 1);
- });
- that.store.dispatch('getUserInfo').then((res) => {
- that.userInfo.data = res.data;
- });
- // 接收路由参数
- if (that.$route.query.locateid) {
- that.filterForm.disabled.locateid = true;
- that.filterForm.data.locateid = that.$route.query.locateid;
- }
- if (that.$route.query.timegranid) {
- that.filterForm.data.timegranid = that.$route.query.timegranid;
- }
- if (that.$route.query.itemtype) {
- that.filterForm.data.itemtype = that.$route.query.itemtype;
- }
- that.getTimeGranData();
- that.getEnergyTypeIdData();
- that.getEnergyIdData();
- that.getLocateIdData();
- that.getNetworkIdData();
- that.getworkprocidData();
- that.getHierarchyData();
- that.getUnitIdData();
- that.getPropertyIdData();
- // that.getTableData();
- },
- methods: {
- // 计算树区域高度
- getRoleHeight (dom) {
- return window.innerHeight - dom.offsetTop;
- },
- // 自定义的表格合计方法:只给指定列进行合计
- getSummaries (param) {
- const prop = ['subtracts','actualvalue', 'correctvalue', 'apportvalue', 'sumvalue']; // 合计列绑定的prop
- return XtcommonSummaries(param, prop);
- },
- // 获取时间粒度(计量点数据录入)
- getTimeGranData () {
- let that = this
- let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmCalpointValue';
- 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.TIMEGRANID,
- name: item.NAME
- })
- obj[item.TIMEGRANID] = item.NAME;
- that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.TIMEGRANID;
- }
- that.nameObj.timegranid.arr = arr;
- that.nameObj.timegranid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取能介类型
- getEnergyTypeIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergytypes/selectNameAndId/';
- 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.energytypeid.arr = arr;
- that.nameObj.energytypeid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取能介
- getEnergyIdData () {
- let that = this;
- let url = 'pass/ems/v1/trmenergys/selectNameAndId/';
- 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,
- energytypeid: item.energytypeid,
- unitid: item.unitid
- })
- obj[item.id] = {
- name: item.name,
- unitid: item.unitid
- }
- }
- that.nameObj.energyid.arr = arr;
- that.nameObj.energyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取位置
- getLocateIdData () {
- let that = this
- let url = 'pass/ems/v1/trmlocations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.locateid.arr = arr;
- that.nameObj.locateid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取站所
- getNetworkIdData () {
- let that = this
- let url = 'pass/ems/v1/trmstations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.networkid.arr = arr;
- that.nameObj.networkid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取计量层级
- getHierarchyData () {
- let that = this
- let url = 'pass/ems/v1/trmcalpoints/getRmCalpoint/';
- 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.hierarchy.arr = arr;
- that.nameObj.hierarchy.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.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
- }
- }
- that.nameObj.unitid.arr = arr;
- that.nameObj.unitid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取属性
- 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);
- }
- });
- },
- // 获取表格中的数据
- getTableData (pageNum) {
- let that = this,
- params = {
- itemtype: that.filterForm.data.itemtype,
- clock: that.filterForm.data.clock[0],
- clocke: that.filterForm.data.clock[1],
- energytypeid: that.filterForm.data.energytypeid,
- energyid: that.filterForm.data.energyid.toString(),
- timegranid: that.filterForm.data.timegranid,
- locateid: that.filterForm.data.locateid.toString(),
- itemid: that.filterForm.data.itemid,
- itemname: that.filterForm.data.itemname,
- networkid: that.filterForm.data.networkid.toString(),
- hierarchy: that.filterForm.data.hierarchy,
- tagAlias: that.filterForm.data.tagAlias,
- propertyid: that.filterForm.data.propertyid.toString(),
- costid: that.filterForm.data.costid.join(',')
- };
- that.pageNum = pageNum || that.pageNum;
- that.tableLoading = true;
- let url = 'pass/ems/v1/trmcalpoints/getDate312ForPage?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let item of res.data.list) {
- arr.push({
- itemid: item.ITEMID,
- clock: item.CLOCK,
- itemname: item.ITEMNAME,
- tagAlias: item.TAG_ALIAS,
- tagModulus: item.TAG_MODULUS,
- unitid: item.UNITID,
- mintvalue: item.MINTVALUE,
- mendvalue: item.MENDVALUE,
- actualvalue: item.ACTUALVALUE,
- correctvalue: item.CORRECTVALUE,
- apportvalue: item.APPORTVALUE,
- sumvalue: item.SUMVALUE,
- bz: item.BZ,
- updatereason: item.UPDATE_REASON,
- rectime: item.REC_TIME,
- updateUser: item.UPDATE_USER,
- ename: item.ENAME,
- lname: item.LNAME,
- updateman: item.UPMAN,
- updatetime: item.UPTIME,
- costid: item.COSTID,
- // 暂时没显示
- itemtype: item.ITEMTYPE,
- timegranid: item.TIMEGRANID,
- propertyid: that.nameObj.propertyid.obj[item.PROPERTYID],
- subtracts: item.MENDVALUE-item.MINTVALUE
- })
- }
- that.tableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- that.$nextTick(() => {
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 46;
- }, 1);
- });
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- // 改变表格显示条数
- tableSizeChange (val) {
- let that = this;
- that.pageSize = val;
- that.getTableData(1);
- },
- // 重置搜索
- tableDataCancel () {
- let that = this;
- for (let key in that.filterForm.data) {
- if (!that.filterForm.disabled || !that.filterForm.disabled[key]) {
- if (that.filterForm.data[key] instanceof Array) {
- that.filterForm.data[key] = [];
- } else {
- that.filterForm.data[key] = '';
- }
- }
- }
- that.getTableData(1);
- },
- // 批量修改
- but_edit_plural () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr'].validate((valid, msg) => {
- if (valid) {
- let SubmitData = [];
- for (let key in that.tableFormDataObj) {
- SubmitData.push({
- clock: that.tableFormDataObj[key].clock,
- timegranid: that.tableFormDataObj[key].timegranid,
- itemid: that.tableFormDataObj[key].itemid,
- actualvalue: that.tableFormDataObj[key].actualvalue,
- correctvalue: that.tableFormDataObj[key].correctvalue,
- apportvalue: that.tableFormDataObj[key].apportvalue,
- updatereason: that.tableFormDataObj[key].updatereason,
- bz: that.tableFormDataObj[key].bz
- });
- }
- that.loading = true;
- that.axios.put('pass/ems/v1/trmcalpointvalues/batchupdate', SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '修改成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- let col = Object.keys(msg)[0].split('.')[1];
- if (col && col === 'CORRECTVALUE') {
- this.$message.error('请填写正确的修正值');
- } else if (col && col === 'APPORTVALUE') {
- this.$message.error('请填写正确的最终值');
- } else {
- this.$message.error('数据不完整或者格式错误');
- }
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- // 批量重新计算(由小时表数据计算而来),这里是个假的,因为propertyid在行内显示的是文字,暂时不动
- but_re_compute () {
- let that = this;
- if (that.multipleSelection.length > 0) {
- that.$refs['dialog_form_arr'].validate((valid) => {
- if (valid) {
- let SubmitData = {};
- for (let key in that.tableFormDataObj) {
- SubmitData = {
- clock: that.filterForm.data.clock[0],
- clocke: that.filterForm.data.clock[1],
- timegranid: that.tableFormDataObj[key].timegranid,
- itemid: that.tableFormDataObj[key].itemid,
- tb: 'hour',
- energytypeid: that.tableFormDataObj[key].energytypeid,
- energyid: that.tableFormDataObj[key].energyid,
- locateid: that.tableFormDataObj[key].locateid,
- itemname: that.tableFormDataObj[key].itemname,
- networkid: that.tableFormDataObj[key].networkid,
- tagAlias: that.tableFormDataObj[key].tagAlias,
- propertyid: that.tableFormDataObj[key].propertyid
- }
- // SubmitData.push({
- // clock: that.tableFormDataObj[key].clock,
- // timegranid: that.tableFormDataObj[key].timegranid,
- // itemid: that.tableFormDataObj[key].itemid
- // });
- }
- that.loading = true;
- that.axios.get('pass/ems/v1/trmactvalues/reDatas', {
- params: SubmitData
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '重新计算成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- },
- // but_edit (row) {
- // let that = this;
- // that.dialog.editorBox.form.data.itemid = row.itemid;
- // that.dialog.editorBox.form.data.clock = row.clock;
- // that.dialog.editorBox.form.data.timegranid = row.timegranid;
- // that.dialog.editorBox.form.data.actualvalue = row.actualvalue;
- // that.dialog.editorBox.form.data.correctvalue = row.correctvalue;
- // that.dialog.editorBox.form.data.apportvalue = row.apportvalue;
- // that.dialog.editorBox.form.data.bz = row.bz;
- // that.dialog.editorBox.form.data.updatereason = row.updatereason;
- // that.dialog.editorBox.type = 'edit';
- // that.dialog.editorBox.show = true;
- // },
- // dataSave () {
- // let that = this;
- // let SubmitData = {
- // itemid: that.dialog.editorBox.form.data.itemid,
- // clock: that.dialog.editorBox.form.data.clock,
- // timegranid: that.dialog.editorBox.form.data.timegranid,
- // actualvalue: that.dialog.editorBox.form.data.actualvalue,
- // correctvalue: that.dialog.editorBox.form.data.correctvalue,
- // apportvalue: that.dialog.editorBox.form.data.apportvalue,
- // bz: that.dialog.editorBox.form.data.bz,
- // update_reason: that.dialog.editorBox.form.data.updatereason,
- // update_user: that.userInfo.data.userCode
- // };
- // that.$refs['dialog_form'].validate((valid) => {
- // if (valid) {
- // that.loading = true;
- // that.axios.put('pass/ems/v1/trmcalpointvalues/update', SubmitData)
- // .then(function (res) {
- // if (res.code === '0') {
- // that.$message({
- // message: '修改成功',
- // type: 'success'
- // });
- // that.getTableData();
- // that.dialog.editorBox.show = false;
- // } else {
- // that.$message.error(res.message);
- // }
- // that.loading = false;
- // }).catch(function () {
- // that.loading = false;
- // });
- // }
- // });
- // },
- // 表格中多选按钮的相关方法
- handleSelectionChange (val) {
- let that = this;
- let tableFormDataObj = {};
- for (let item of that.tableData) {
- item.isSelection = false;
- }
- for (let item of val) {
- let obj = {};
- let xId = item.itemid + '-' + item.clock + '-' + item.timegranid;
- 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.multipleSelection = val;
- },
- look_trendChart () {
- let that = this;
- if (this.multipleSelection && this.multipleSelection.length > 0) {
- that.getTrendChart();
- that.dialog.trendChart.show = true;
- } else {
- this.$message.error('请选择计量点');
- }
- },
- getTrendChart () {
- let that = this;
- let SubmitData = {
- size: that.dialog.trendChart.size,
- list: []
- };
- for (let item of that.multipleSelection) {
- SubmitData.list.push({
- itemid: item.itemid,
- clock: that.filterForm.data.clock,
- timegranid: that.filterForm.data.timegranid
- });
- }
- let url = 'pass/ems/v1/trmcalpoints/getDate312ForChart';
- that.axios.post(url, SubmitData, {
- contentType: 'application/json'
- })
- .then(function (res) {
- if (res.code === '0') {
- let legendArr = [],
- xAxisArr = [],
- seriesArr = [];
- for (let item of res.data) {
- for (let key in item) {
- let itemname = /\$.*$/.exec(key)[0].replace(/^\$/, '');
- legendArr.push(itemname);
- let seriesObj = {
- name: itemname,
- type: that.dialog.trendChart.form.data.chartSeriesType,
- data: []
- };
- let clocks = [];
- for (let item2 of item[key]) {
- seriesObj.data.push(item2.APPORTVALUE);
- clocks.push(item2.CLOCK);
- }
- seriesArr.push(seriesObj);
- if (xAxisArr.length === 0) {
- xAxisArr = clocks;
- }
- }
- }
- that.dialog.trendChart.chart.option.legend.data = legendArr;
- that.dialog.trendChart.chart.option.xAxis.data = xAxisArr;
- that.dialog.trendChart.chart.option.series = seriesArr;
- // that.$refs['graphical'].setGraphical();
- that.dialog.trendChart.chart.show = false;
- setTimeout(() => {
- that.dialog.trendChart.chart.show = true;
- }, 100);
- } else {
- that.$message.error(res.message);
- }
- }).catch(function () {
- });
- },
- // 获取工序
- getworkprocidData () {
- let that = this
- let url = 'pass/ems/v1/trmworkprocs/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.workprocid.arr = arr;
- that.nameObj.workprocid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- chartSeriesType () {
- let that = this;
- for (let item of that.dialog.trendChart.chart.option.series) {
- item.type = that.dialog.trendChart.form.data.chartSeriesType;
- }
- // that.dialog.trendChart.chart.show = false;
- // setTimeout(() => {
- // that.dialog.trendChart.chart.show = true;
- // }, 100);
- that.$refs['graphical'].setGraphical();
- },
- // 重新生成数据
- but_redata () {
- let that = this;
- if (!that.filterForm.data.clock || that.filterForm.data.clock.length === 0) {
- that.$message.warning('请选择日期范围');
- return true;
- }
- if (!that.filterForm.data.clock[0] || !that.filterForm.data.clock[1]) {
- that.$message.warning('请选择开始日期与结束日期');
- return true;
- }
- if (!that.filterForm.data.timegranid) {
- that.$message.warning('请选择时间粒度');
- return true;
- }
- let params = {
- itemtype: that.filterForm.data.itemtype,
- clock: that.filterForm.data.clock[0],
- clocke: that.filterForm.data.clock[1],
- energytypeid: that.filterForm.data.energytypeid,
- energyid: that.filterForm.data.energyid.toString(),
- timegranid: that.filterForm.data.timegranid,
- locateid: that.filterForm.data.locateid.toString(),
- itemid: that.filterForm.data.itemid,
- itemname: that.filterForm.data.itemname,
- networkid: that.filterForm.data.networkid.toString(),
- tagAlias: that.filterForm.data.tagAlias,
- propertyid: that.filterForm.data.propertyid.toString()
- };
- that.$confirm('是否重新生成数据?日期跨度不易太长!否则运行时间较长', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.loading = true;
- let url = 'pass/ems/v1/trmcalpointvalues/reData'
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- if (res.message && res.message !== '操作成功') {
- that.$message.warning('重新生成数据成功, 其中【' + res.message + '】');
- } else {
- that.$message({
- message: '重新生成数据成功',
- type: 'success'
- });
- }
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }).catch(() => {
- });
- },
- // 计算过程
- but_sdata (row) {
- let that = this;
- let params = {
- timegranid: row.timegranid,
- clock: row.clock, // 开始时间
- itemid: row.itemid // 项目编号
- };
- that.axios.get('pass/ems/v1/formulas/getAnaByVal/', {
- params: params
- }).then(function (res) {
- if (res.code === '0') {
- that.$message({
- dangerouslyUseHTMLString: true,
- message: res.data,
- type: 'success'
- });
- } else {
- that.$message.error(res.message);
- }
- }).catch(function () {});
- },
- // 补全数据
- but_resData () {
- let that = this;
- if (!that.filterForm.data.clock || that.filterForm.data.clock.length === 0) {
- that.$message.warning('请选择日期范围');
- return true;
- }
- if (!that.filterForm.data.clock[0] || !that.filterForm.data.clock[1]) {
- that.$message.warning('请选择开始日期与结束日期');
- return true;
- }
- if (!that.filterForm.data.timegranid) {
- that.$message.warning('请选择时间粒度');
- return true;
- }
- if (that.multipleSelection.length > 0) {
- that.$confirm('是否补全日数据?数据不益多选!否则运行时间较长', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- let SubmitData = {};
- for (let key in that.tableFormDataObj) {
- SubmitData = {
- clock: that.filterForm.data.clock[0],
- clocke: that.filterForm.data.clock[1],
- itemid: that.tableFormDataObj[key].itemid
- }
- // SubmitData.push({
- // clock: that.tableFormDataObj[key].clock,
- // timegranid: that.tableFormDataObj[key].timegranid,
- // itemid: that.tableFormDataObj[key].itemid
- // });
- }
- that.loading = true;
- let url = 'pass/ems/v1/trmcalpointvalues/resData'
- that.axios.get(url, {
- params: SubmitData
- })
- .then(function (res) {
- if (res.code === '0') {
- if (res.message && res.message !== '操作成功') {
- that.$message.warning('重新生成数据成功, 其中【' + res.message + '】');
- } else {
- that.$message({
- message: '重新生成数据成功',
- type: 'success'
- });
- }
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }).catch(() => {
- this.$message.warning('用户取消操作');
- });
- } else {
- this.$message.error('至少要选择一条数据');
- }
- }
- }
- }
- </script>
- <style lang="less">
- .measuringLocationAdd {
- min-width: 700px;
- height: 100%;
- .box {
- height: 100%;
- padding: 15px 15px 0 15px;
- .box-top {
- .el-form-item {
- margin-bottom: 7px;
- }
- .box-top-gjl {
- overflow: hidden;
- padding: 7px 0;
- border-top: 1px solid #ccc;
- // border-bottom: 1px solid #ccc;
- // margin-bottom: 6px;
- }
- }
- .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;
- }
- }
- }
- .attribute-box {
- .item {
- border: #ccc 1px solid;
- padding: 5px;
- margin-bottom: 6px;
- .bt {
- font-size: 14px;
- font-weight: 600;
- color: #000;
- padding-left: 10px;
- border-left: #008fe0 5px solid;
- }
- }
- }
- }
- </style>
|