measurementPlace.vue 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164
  1. <template>
  2. <!-- 计量点信息维护 -->
  3. <div class="measurementPlace">
  4. <div class="box">
  5. <div class="box-top">
  6. <el-form
  7. style="overflow: hidden;"
  8. :style="filterForm.show ? null : { height: '0px' }"
  9. size="mini"
  10. label-width="80px"
  11. >
  12. <el-row>
  13. <el-col :span="6">
  14. <el-form-item label="能介类型">
  15. <el-select
  16. filterable clearable
  17. v-model="filterForm.data.energytypeid"
  18. multiple
  19. collapse-tags
  20. placeholder="能介类型"
  21. style="width: 100%;"
  22. >
  23. <el-option
  24. v-for="item of nameObj.energytypeid.arr"
  25. :key="item.id"
  26. :value="item.id"
  27. :label="item.name"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="能介">
  34. <el-select
  35. filterable clearable
  36. v-model="filterForm.data.energyid"
  37. multiple
  38. collapse-tags
  39. placeholder="能介"
  40. style="width: 100%;"
  41. >
  42. <template v-for="item of nameObj.energyid.arr">
  43. <el-option
  44. v-if="filterForm.data.energytypeid.indexOf(item.energytypeid) !== -1 || Object.keys(filterForm.data.energytypeid).length === 0"
  45. :key="item.id"
  46. :value="item.id"
  47. :label="item.name"
  48. ></el-option>
  49. </template>
  50. </el-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <el-form-item label="用能属性">
  55. <el-select
  56. filterable clearable
  57. v-model="filterForm.data.propertyid"
  58. placeholder="用能属性"
  59. multiple
  60. collapse-tags
  61. style="width: 100%;"
  62. >
  63. <el-option
  64. v-for="item of nameObj.propertyid.arr"
  65. :key="item.id"
  66. :value="item.id"
  67. :label="item.name"
  68. ></el-option>
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="6">
  73. <el-form-item label="手抄或自动">
  74. <el-select
  75. filterable clearable
  76. v-model="filterForm.data.itemtype"
  77. placeholder="手抄或自动"
  78. style="width: 100%;"
  79. >
  80. <el-option
  81. v-for="item of nameObj.itemtype.arr"
  82. :key="item.id"
  83. :value="item.id"
  84. :label="item.name"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. <el-row>
  91. <el-col :span="6">
  92. <el-form-item label="工序">
  93. <el-select
  94. filterable clearable
  95. v-model="filterForm.data.costid"
  96. placeholder="工序"
  97. multiple
  98. collapse-tags
  99. style="width: 100%;"
  100. >
  101. <el-option
  102. v-for="item of nameObj.workprocid.arr"
  103. :key="item.id"
  104. :value="item.id"
  105. :label="item.name"
  106. ></el-option>
  107. </el-select>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="6">
  111. <el-form-item label="站所">
  112. <el-select
  113. filterable clearable
  114. v-model="filterForm.data.networkid"
  115. placeholder="站所"
  116. multiple
  117. collapse-tags
  118. style="width: 100%;"
  119. >
  120. <el-option
  121. v-for="item of nameObj.networkid.arr"
  122. :key="item.id"
  123. :value="item.id"
  124. :label="item.name"
  125. ></el-option>
  126. </el-select>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="6">
  130. <el-form-item label="计量点编号">
  131. <el-input clearable
  132. v-model.trim="filterForm.data.itemid"
  133. placeholder="计量点编号"
  134. style="width: 100%;"
  135. @keyup.enter.native="getTableData(1)"
  136. ></el-input>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="6">
  140. <el-form-item label="计量点名称">
  141. <el-input clearable
  142. v-model.trim="filterForm.data.itemname"
  143. placeholder="计量点名称"
  144. style="width: 100%;"
  145. @keyup.enter.native="getTableData(1)"
  146. ></el-input>
  147. </el-form-item>
  148. </el-col>
  149. </el-row>
  150. <el-row>
  151. <!-- <el-col :span="6">
  152. <el-form-item label="计量层级">
  153. <el-select
  154. filterable clearable
  155. v-model="filterForm.data.hierarchy"
  156. placeholder="计量层级"
  157. style="width: 100%;"
  158. >
  159. <el-option
  160. v-for="item of nameObj.hierarchy.arr"
  161. :key="item.id"
  162. :value="item.id"
  163. :label="item.name"
  164. ></el-option>
  165. </el-select>
  166. </el-form-item>
  167. </el-col> -->
  168. <el-col :span="6">
  169. <el-form-item label="位置">
  170. <el-select
  171. filterable clearable
  172. v-model="filterForm.data.locateid"
  173. placeholder="位置"
  174. multiple
  175. collapse-tags
  176. style="width: 100%;"
  177. >
  178. <el-option
  179. v-for="item of nameObj.locateid.arr"
  180. :key="item.id"
  181. :value="item.id"
  182. :label="item.name"
  183. ></el-option>
  184. </el-select>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="6">
  188. <el-form-item label="TAG点别名">
  189. <el-input clearable
  190. v-model.trim="filterForm.data.tagAlias"
  191. placeholder="TAG点别名"
  192. style="width: 100%;"
  193. @keyup.enter.native="getTableData(1)"
  194. ></el-input>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="6">
  198. <el-form-item label="数据表">
  199. <el-input clearable
  200. v-model.trim="filterForm.data.tagTable"
  201. placeholder="小时数据表"
  202. style="width: 100%;"
  203. @keyup.enter.native="getTableData(1)"
  204. ></el-input>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="6">
  208. <el-form-item label="数据列">
  209. <el-input clearable
  210. v-model.trim="filterForm.data.tagCol"
  211. placeholder="小时表列(TAG)"
  212. style="width: 100%;"
  213. @keyup.enter.native="getTableData(1)"
  214. ></el-input>
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. <!-- <div style="text-align: right;margin-bottom: 13px;">
  219. </div> -->
  220. </el-form>
  221. <div class="box-top-gjl">
  222. <el-button
  223. class="button"
  224. type="primary"
  225. size="mini"
  226. icon="el-icon-plus"
  227. v-if="butPrivilege.ADD"
  228. @click="but_add"
  229. >新增</el-button>
  230. <!-- <el-button
  231. class="button"
  232. type="primary"
  233. size="mini"
  234. icon="el-icon-upload2"
  235. >导入计量点</el-button>
  236. <el-button
  237. class="button"
  238. type="primary"
  239. size="mini"
  240. icon="el-icon-download"
  241. >导出全部计量点</el-button> -->
  242. <div style="float:right; text-align: right;">
  243. <el-button
  244. class="button"
  245. type="primary"
  246. size="mini"
  247. icon="el-icon-search"
  248. v-if="butPrivilege.QUERY"
  249. @click="filterForm.useflag='';getTableData(1);"
  250. >查询全部</el-button>
  251. <el-button
  252. class="button"
  253. type="primary"
  254. icon="el-icon-search"
  255. size="mini"
  256. v-if="butPrivilege.QUERY"
  257. @click="filterForm.useflag='1';getTableData(1)"
  258. >查询</el-button>
  259. <el-button
  260. class="button"
  261. type="primary"
  262. icon="el-icon-refresh"
  263. size="mini"
  264. v-if="butPrivilege.QUERY"
  265. @click="tableDataCancel();"
  266. >重置</el-button>
  267. <el-button
  268. size="mini"
  269. :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
  270. :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
  271. @click="filterForm.show = !filterForm.show;
  272. $nextTick(() => {
  273. singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
  274. }
  275. );"
  276. >{{ filterForm.show ? '收起' : '展开' }}</el-button>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="box-bottom">
  281. <el-table
  282. stripe
  283. id="singleTable"
  284. ref="singleTable"
  285. :data="tableData"
  286. v-loading="tableLoading"
  287. style="width: 100%;"
  288. :height="singleTableHeight"
  289. border
  290. size="mini"
  291. highlight-current-row
  292. @current-change="handleCurrentChange"
  293. :row-class-name="rowClassName"
  294. >
  295. <el-table-column
  296. sortable
  297. prop="itemid"
  298. label="计量点编号"
  299. width="120px"
  300. :show-overflow-tooltip="true"
  301. ></el-table-column>
  302. <el-table-column
  303. sortable
  304. prop="itemname"
  305. label="计量点名称"
  306. min-width="150px"
  307. :show-overflow-tooltip="true"
  308. ></el-table-column>
  309. <el-table-column
  310. sortable
  311. prop="tagAlias"
  312. label="TAG别名"
  313. min-width="150px"
  314. :show-overflow-tooltip="true"
  315. ></el-table-column>
  316. <el-table-column
  317. sortable
  318. prop="itemdesc"
  319. label="描述信息"
  320. min-width="150px"
  321. :show-overflow-tooltip="true"
  322. ></el-table-column>
  323. <el-table-column
  324. sortable
  325. prop="itemtype"
  326. label="手抄自动"
  327. width="72px"
  328. :show-overflow-tooltip="true"
  329. >
  330. <template slot-scope="scope">
  331. <span>{{ nameObj.itemtype.obj[scope.row.itemtype] ? nameObj.itemtype.obj[scope.row.itemtype] : scope.row.itemtype }}</span>
  332. </template>
  333. </el-table-column>
  334. <el-table-column
  335. sortable
  336. prop="costid"
  337. label="工序"
  338. min-width="100px"
  339. :show-overflow-tooltip="true"
  340. >
  341. <template slot-scope="scope">
  342. <span>{{ nameObj.workprocid.obj[scope.row.costid] ? nameObj.workprocid.obj[scope.row.costid] : scope.row.costid }}</span>
  343. </template>
  344. </el-table-column>
  345. <el-table-column
  346. sortable
  347. prop="locateid"
  348. label="位置"
  349. min-width="100px"
  350. :show-overflow-tooltip="true"
  351. >
  352. <template slot-scope="scope">
  353. <span>{{ nameObj.locateid.obj[scope.row.locateid] ? nameObj.locateid.obj[scope.row.locateid] : scope.row.locateid }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column
  357. sortable
  358. prop="networkid"
  359. label="站所"
  360. min-width="100px"
  361. :show-overflow-tooltip="true"
  362. >
  363. <template slot-scope="scope">
  364. <span>{{ nameObj.networkid.obj[scope.row.networkid] ? nameObj.networkid.obj[scope.row.networkid] : scope.row.networkid }}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. sortable
  369. prop="energytypeid"
  370. label="能介类型"
  371. width="75px"
  372. :show-overflow-tooltip="true"
  373. >
  374. <template slot-scope="scope">
  375. <span>{{ nameObj.energytypeid.obj[scope.row.energytypeid] ? nameObj.energytypeid.obj[scope.row.energytypeid] : scope.row.energytypeid }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. sortable
  380. prop="energyid"
  381. label="能介"
  382. width="85px"
  383. :show-overflow-tooltip="true"
  384. >
  385. <template slot-scope="scope">
  386. <span>{{ nameObj.energyid.obj[scope.row.energyid] ? nameObj.energyid.obj[scope.row.energyid].name : scope.row.energyid }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column
  390. sortable
  391. prop="propertyid"
  392. label="用能属性"
  393. width="80px"
  394. :show-overflow-tooltip="true"
  395. >
  396. <template slot-scope="scope">
  397. <span>{{ nameObj.propertyid.obj[scope.row.propertyid] ? nameObj.propertyid.obj[scope.row.propertyid] : scope.row.propertyid }}</span>
  398. </template>
  399. </el-table-column>
  400. <el-table-column
  401. sortable
  402. prop="unitid"
  403. label="计量单位"
  404. min-width="80px"
  405. :show-overflow-tooltip="true"
  406. >
  407. <template slot-scope="scope">
  408. <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column
  412. sortable
  413. prop="mintimegranid"
  414. label="最小时间粒度"
  415. min-width="100px"
  416. :show-overflow-tooltip="true"
  417. >
  418. <template slot-scope="scope">
  419. <span>{{ nameObj.mintimegranid.obj[scope.row.mintimegranid] ? nameObj.mintimegranid.obj[scope.row.mintimegranid] : scope.row.mintimegranid }}</span>
  420. </template>
  421. </el-table-column>
  422. <!-- <el-table-column
  423. sortable
  424. prop="isschedule"
  425. label="是否调度项"
  426. width="90px"
  427. :show-overflow-tooltip="true"
  428. >
  429. <template slot-scope="scope">
  430. <span :class="{color_yes: scope.row.isschedule === '1', color_no: scope.row.isschedule === '0'}">{{ scope.row.isschedule === '0' ? '否' : scope.row.isschedule === '1' ? '是' : '' }}</span>
  431. </template>
  432. </el-table-column>
  433. <el-table-column
  434. sortable
  435. prop="issettle"
  436. label="是否结算项"
  437. width="90px"
  438. :show-overflow-tooltip="true"
  439. >
  440. <template slot-scope="scope">
  441. <span :class="{color_yes: scope.row.issettle === '1', color_no: scope.row.issettle === '0'}">{{ scope.row.issettle === '0' ? '否' : scope.row.issettle === '1' ? '是' : '' }}</span>
  442. </template>
  443. </el-table-column> -->
  444. <el-table-column
  445. sortable
  446. prop="useflag"
  447. label="启用"
  448. width="60px"
  449. :show-overflow-tooltip="true"
  450. >
  451. <template slot-scope="scope">
  452. <span :class="{color_yes: scope.row.useflag === '1', color_no: scope.row.useflag === '0'}">{{ scope.row.useflag === '0' ? '否' : scope.row.useflag === '1' ? '是' : '' }}</span>
  453. </template>
  454. </el-table-column>
  455. <!-- <el-table-column
  456. sortable
  457. prop="showno"
  458. label="顺序号"
  459. width="90px"
  460. :show-overflow-tooltip="true"
  461. ></el-table-column> -->
  462. <el-table-column
  463. sortable
  464. prop="sourceType"
  465. label="数据来源"
  466. min-width="100px"
  467. :show-overflow-tooltip="true"
  468. >
  469. </el-table-column>
  470. <el-table-column
  471. sortable
  472. prop="bdesc1"
  473. label="das地址"
  474. min-width="100px"
  475. :show-overflow-tooltip="true"
  476. ></el-table-column>
  477. <el-table-column
  478. sortable
  479. prop="tagTable"
  480. label="对应数据表"
  481. width="200px"
  482. :show-overflow-tooltip="true"
  483. ></el-table-column>
  484. <el-table-column
  485. sortable
  486. prop="tagCol"
  487. label="对应数据列"
  488. width="90px"
  489. :show-overflow-tooltip="true"
  490. ></el-table-column>
  491. <el-table-column
  492. sortable
  493. prop="transfer"
  494. label="转供工序"
  495. width="90px"
  496. :show-overflow-tooltip="true"
  497. >
  498. <template slot-scope="scope">
  499. <span>{{ nameObj.workprocid.obj[scope.row.transfer] ? nameObj.workprocid.obj[scope.row.transfer] : scope.row.transfer }}</span>
  500. </template></el-table-column>
  501. <el-table-column
  502. class-name="gn-TableDownloadExcel-none"
  503. v-if="butPrivilege.PUT || butPrivilege.DELETE"
  504. label="操作"
  505. align="center"
  506. min-width="236px"
  507. fixed="right"
  508. >
  509. <template slot-scope="scope">
  510. <div>
  511. <el-button
  512. type="primary"
  513. size="mini"
  514. @click="but_equationEditing(scope.row)"
  515. v-if="butPrivilege.PUT && scope.row.itemtype === 'VIRTUAL'"
  516. >公式</el-button>
  517. <el-button
  518. type="primary"
  519. size="mini"
  520. v-if="butPrivilege.PUT"
  521. @click="but_edit(scope.row)"
  522. >修改</el-button>
  523. <el-button
  524. v-if="butPrivilege.PUT && scope.row.useflag === '1'"
  525. type="danger"
  526. size="mini"
  527. @click="upUseflag(scope.row, '0')"
  528. >禁用</el-button>
  529. <el-button
  530. v-if="butPrivilege.PUT && scope.row.useflag !== '1'"
  531. type="primary"
  532. size="mini"
  533. @click="upUseflag(scope.row, '1')"
  534. >启用</el-button>
  535. <el-button
  536. type="danger"
  537. size="mini"
  538. v-if="butPrivilege.DELETE"
  539. @click="but_del(scope.row)"
  540. >删除</el-button>
  541. </div>
  542. </template>
  543. </el-table-column>
  544. </el-table>
  545. <el-pagination
  546. layout="total, sizes, prev, pager, next, jumper"
  547. :total="total"
  548. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  549. :page-size="pageSize"
  550. :current-page.sync="pageNum"
  551. @size-change="tableSizeChange"
  552. @current-change="getTableData()"
  553. style="text-align: right;margin-top: 10px;"
  554. ></el-pagination>
  555. </div>
  556. </div>
  557. <el-dialog
  558. :title="'计量点信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
  559. :visible.sync="dialog.editorBox.show"
  560. width="950px"
  561. :close-on-click-modal="false"
  562. :show-close="!loading"
  563. >
  564. <el-tabs
  565. v-model="dialog.editorBox.activeName"
  566. type="border-card"
  567. >
  568. <el-tab-pane
  569. label="基础信息"
  570. name="1"
  571. >
  572. <div>
  573. <el-form
  574. ref="dialog_form"
  575. :model="dialog.editorBox.form.data"
  576. :rules="dialog.editorBox.form.rules"
  577. size="mini"
  578. label-width="90px"
  579. >
  580. <el-row>
  581. <el-col :span="8">
  582. <el-form-item
  583. label="计量点编号"
  584. prop="itemid"
  585. >
  586. <el-input clearable
  587. style="width: 100%;"
  588. v-model="dialog.editorBox.form.data.itemid"
  589. disabled
  590. ></el-input>
  591. </el-form-item>
  592. </el-col>
  593. <el-col :span="8">
  594. <el-form-item
  595. label="计量点名称"
  596. prop="itemname"
  597. >
  598. <el-input clearable
  599. style="width: 100%;"
  600. v-model="dialog.editorBox.form.data.itemname"
  601. ></el-input>
  602. </el-form-item>
  603. </el-col>
  604. <el-col :span="8">
  605. <el-form-item
  606. label="TAG别名"
  607. prop="tagAlias"
  608. >
  609. <el-input clearable
  610. style="width: 100%;"
  611. v-model="dialog.editorBox.form.data.tagAlias"
  612. ></el-input>
  613. </el-form-item>
  614. </el-col>
  615. </el-row>
  616. <el-row>
  617. <el-col :span="8">
  618. <el-form-item
  619. label="位置"
  620. prop="locateid"
  621. >
  622. <el-select
  623. filterable clearable
  624. style="width: 100%;"
  625. v-model="dialog.editorBox.form.data.locateid"
  626. @change="autoSetName()"
  627. >
  628. <el-option
  629. v-for="item of nameObj.locateid.arr"
  630. :key="item.id"
  631. :value="item.id"
  632. :label="item.name"
  633. ></el-option>
  634. </el-select>
  635. </el-form-item>
  636. </el-col>
  637. <el-col :span="8">
  638. <el-form-item
  639. label="能介类型"
  640. prop="energytypeid"
  641. >
  642. <el-select
  643. filterable clearable
  644. style="width: 100%;"
  645. v-model="dialog.editorBox.form.data.energytypeid"
  646. @change="dialog.editorBox.form.data.energyid='';"
  647. >
  648. <el-option
  649. v-for="item of nameObj.energytypeid.arr"
  650. :key="item.id"
  651. :value="item.id"
  652. :label="item.name"
  653. ></el-option>
  654. </el-select>
  655. </el-form-item>
  656. </el-col>
  657. <el-col :span="8">
  658. <el-form-item
  659. label="能介"
  660. prop="energyid"
  661. >
  662. <el-select
  663. filterable clearable
  664. style="width: 100%;"
  665. v-model="dialog.editorBox.form.data.energyid"
  666. @change="dialog.editorBox.form.data.unitid = nameObj.energyid.obj[dialog.editorBox.form.data.energyid].unitid; autoSetName()"
  667. >
  668. <template v-for="item of nameObj.energyid.arr">
  669. <el-option
  670. v-if="item.energytypeid === dialog.editorBox.form.data.energytypeid || dialog.editorBox.form.data.energytypeid === ''"
  671. :key="item.id"
  672. :value="item.id"
  673. :label="item.name"
  674. ></el-option>
  675. </template>
  676. </el-select>
  677. </el-form-item>
  678. </el-col>
  679. </el-row>
  680. <el-row>
  681. <el-col :span="8">
  682. <el-form-item
  683. label="用能属性"
  684. prop="propertyid"
  685. >
  686. <el-select
  687. filterable clearable
  688. style="width: 100%;"
  689. v-model="dialog.editorBox.form.data.propertyid"
  690. @change="autoSetName()"
  691. >
  692. <el-option
  693. v-for="item of nameObj.propertyid.arr"
  694. :key="item.id"
  695. :value="item.id"
  696. :label="item.name"
  697. ></el-option>
  698. </el-select>
  699. </el-form-item>
  700. </el-col>
  701. <el-col :span="8">
  702. <el-form-item
  703. label="手抄或自动"
  704. prop="itemtype"
  705. >
  706. <el-select
  707. filterable clearable
  708. style="width: 100%;"
  709. v-model="dialog.editorBox.form.data.itemtype"
  710. >
  711. <el-option
  712. v-for="item of nameObj.itemtype.arr"
  713. :key="item.id"
  714. :value="item.id"
  715. :label="item.name"
  716. ></el-option>
  717. </el-select>
  718. </el-form-item>
  719. </el-col>
  720. <el-col :span="8">
  721. <el-form-item
  722. label="站所"
  723. prop="networkid"
  724. :rules="[{required: dialog.editorBox.form.data.energytypeid === 'E', message:'该项不能为空'}]"
  725. >
  726. <el-select
  727. filterable clearable
  728. style="width: 100%;"
  729. v-model="dialog.editorBox.form.data.networkid"
  730. >
  731. <el-option
  732. v-for="item of nameObj.networkid.arr"
  733. :key="item.id"
  734. :value="item.id"
  735. :label="item.name"
  736. ></el-option>
  737. </el-select>
  738. </el-form-item>
  739. </el-col>
  740. </el-row>
  741. <el-row>
  742. <el-col :span="8">
  743. <el-form-item
  744. label="描述信息"
  745. prop="itemdesc"
  746. >
  747. <el-input clearable
  748. style="width: 100%;"
  749. v-model.trim="dialog.editorBox.form.data.itemdesc"
  750. ></el-input>
  751. </el-form-item>
  752. </el-col>
  753. <el-col :span="8">
  754. <el-form-item
  755. label="计量单位"
  756. prop="unitid"
  757. >
  758. <el-select
  759. filterable clearable
  760. style="width: 100%;"
  761. v-model="dialog.editorBox.form.data.unitid"
  762. >
  763. <el-option
  764. v-for="item of nameObj.unitid.arr"
  765. :key="item.id"
  766. :value="item.id"
  767. :label="item.name"
  768. ></el-option>
  769. </el-select>
  770. </el-form-item>
  771. </el-col>
  772. <el-col :span="8">
  773. <el-form-item
  774. label="最小时间粒度"
  775. prop="mintimegranid"
  776. >
  777. <el-select
  778. filterable clearable
  779. style="width: 100%;"
  780. v-model="dialog.editorBox.form.data.mintimegranid"
  781. >
  782. <el-option
  783. v-for="item of nameObj.mintimegranid.arr"
  784. :key="item.id"
  785. :value="item.id"
  786. :label="item.name"
  787. ></el-option>
  788. </el-select>
  789. </el-form-item>
  790. </el-col>
  791. </el-row>
  792. <el-row>
  793. <!-- <el-col :span="8">
  794. <el-form-item
  795. label="是否调度项"
  796. prop="isschedule"
  797. >
  798. <el-select
  799. filterable clearable
  800. style="width: 100%;"
  801. v-model="dialog.editorBox.form.data.isschedule"
  802. >
  803. <el-option
  804. label="是"
  805. value="1"
  806. ></el-option>
  807. <el-option
  808. label="否"
  809. value="0"
  810. ></el-option>
  811. </el-select>
  812. </el-form-item>
  813. </el-col> -->
  814. <el-col :span="8">
  815. <el-form-item
  816. label="工序"
  817. prop="costid"
  818. >
  819. <el-select
  820. filterable clearable
  821. style="width: 100%;"
  822. v-model="dialog.editorBox.form.data.costid"
  823. >
  824. <el-option
  825. v-for="item of nameObj.workprocid.arr"
  826. :key="item.id"
  827. :value="item.id"
  828. :label="item.name"
  829. ></el-option>
  830. </el-select>
  831. </el-form-item>
  832. </el-col>
  833. <el-col :span="8">
  834. <el-form-item
  835. label="数据来源"
  836. prop="sourceType"
  837. >
  838. <el-input filterable clearable
  839. style="width: 100%;"
  840. v-model.trim="dialog.editorBox.form.data.sourceType"
  841. >
  842. </el-input>
  843. </el-form-item>
  844. </el-col>
  845. <el-col :span="8">
  846. <el-form-item
  847. label="转供工序"
  848. prop="transfer"
  849. >
  850. <el-select
  851. filterable clearable
  852. style="width: 100%;"
  853. v-model="dialog.editorBox.form.data.transfer"
  854. >
  855. <el-option
  856. v-for="item of nameObj.workprocid.arr"
  857. :key="item.id"
  858. :value="item.id"
  859. :label="item.name"
  860. ></el-option>
  861. </el-select>
  862. </el-form-item>
  863. </el-col>
  864. </el-row>
  865. </el-form>
  866. </div>
  867. </el-tab-pane>
  868. <el-tab-pane
  869. label="计量点属性"
  870. name="2"
  871. >
  872. <div class="attribute-box">
  873. <div class="item">
  874. <p class="bt">基本属性</p>
  875. <el-form
  876. ref="dialog_form1"
  877. :model="dialog.editorBox.form1.data"
  878. :rules="dialog.editorBox.form1.rules"
  879. class="nr"
  880. label-width="90px"
  881. size="mini"
  882. >
  883. <el-row>
  884. <el-col :span="8">
  885. <el-form-item label="默认值" prop="defaultvalue">
  886. <el-input clearable
  887. style="width: 100%;"
  888. v-model.trim="dialog.editorBox.form1.data.defaultvalue"
  889. ></el-input>
  890. </el-form-item>
  891. </el-col>
  892. <el-col :span="8">
  893. <el-form-item label="累计精度" prop="digits">
  894. <el-input clearable
  895. style="width: 100%;"
  896. v-model.trim="dialog.editorBox.form1.data.digits"
  897. ></el-input>
  898. </el-form-item>
  899. </el-col>
  900. <el-col :span="8">
  901. <el-form-item label="级别" prop="node">
  902. <el-input clearable
  903. style="width: 100%;"
  904. v-model.trim="dialog.editorBox.form1.data.node"
  905. ></el-input>
  906. </el-form-item>
  907. </el-col>
  908. </el-row>
  909. <el-row>
  910. <el-col :span="8">
  911. <el-form-item label="顺序号" prop="showno">
  912. <el-input clearable
  913. style="width: 100%;"
  914. v-model.trim="dialog.editorBox.form1.data.showno"
  915. ></el-input>
  916. </el-form-item>
  917. </el-col>
  918. <el-col :span="8">
  919. <el-form-item label="父级ID" prop="parentid">
  920. <el-input clearable
  921. style="width: 100%;"
  922. v-model.trim="dialog.editorBox.form1.data.parentid"
  923. ></el-input>
  924. </el-form-item>
  925. </el-col>
  926. <el-col :span="8">
  927. <el-form-item label="记录创建时间" prop="recTime">
  928. <el-input clearable
  929. style="width: 100%;"
  930. v-model="dialog.editorBox.form1.data.recTime"
  931. disabled
  932. ></el-input>
  933. </el-form-item>
  934. </el-col>
  935. </el-row>
  936. <el-row>
  937. <el-col :span="8">
  938. <el-form-item label="启用" prop="useflag">
  939. <el-select
  940. filterable clearable
  941. style="width: 100%;"
  942. v-model="dialog.editorBox.form1.data.useflag"
  943. >
  944. <el-option
  945. label="是"
  946. value="1"
  947. ></el-option>
  948. <el-option
  949. label="否"
  950. value="0"
  951. ></el-option>
  952. </el-select>
  953. </el-form-item>
  954. </el-col>
  955. <el-col :span="8">
  956. <el-form-item label="点状态" prop="status">
  957. <el-select
  958. filterable clearable
  959. style="width: 100%;"
  960. v-model="dialog.editorBox.form1.data.status"
  961. >
  962. <el-option
  963. label="是"
  964. value="1"
  965. ></el-option>
  966. <el-option
  967. label="否"
  968. value="0"
  969. ></el-option>
  970. </el-select>
  971. </el-form-item>
  972. </el-col>
  973. </el-row>
  974. </el-form>
  975. </div>
  976. <div class="item">
  977. <p class="bt">扩展属性</p>
  978. <el-form
  979. class="nr"
  980. label-width="90px"
  981. size="mini"
  982. >
  983. <el-row>
  984. <el-col :span="8">
  985. <el-form-item label="仪表ID" prop="tagid">
  986. <el-input clearable
  987. style="width: 100%;"
  988. v-model.trim="dialog.editorBox.form1.data.tagid"
  989. ></el-input>
  990. </el-form-item>
  991. </el-col>
  992. <el-col :span="8">
  993. <el-form-item label="仪表名称" prop="tagname">
  994. <el-input clearable
  995. style="width: 100%;"
  996. v-model.trim="dialog.editorBox.form1.data.tagname"
  997. ></el-input>
  998. </el-form-item>
  999. </el-col>
  1000. <el-col :span="8">
  1001. <el-form-item label="跳变范围" prop="rangeVal">
  1002. <el-input clearable
  1003. style="width: 100%;"
  1004. v-model.trim="dialog.editorBox.form1.data.rangeVal"
  1005. ></el-input>
  1006. </el-form-item>
  1007. </el-col>
  1008. </el-row>
  1009. <el-row>
  1010. <el-col :span="8">
  1011. <el-form-item label="异常点标签" prop="tagBadSymbol">
  1012. <el-input clearable
  1013. style="width: 100%;"
  1014. v-model.trim="dialog.editorBox.form1.data.tagBadSymbol"
  1015. ></el-input>
  1016. </el-form-item>
  1017. </el-col>
  1018. <el-col :span="8">
  1019. <el-form-item label="倍率" prop="tagModulus">
  1020. <el-input clearable
  1021. style="width: 100%;"
  1022. v-model.trim="dialog.editorBox.form1.data.tagModulus"
  1023. ></el-input>
  1024. </el-form-item>
  1025. </el-col>
  1026. <el-col :span="8">
  1027. <el-form-item label="瞬时信号ID" prop="tagIdMap">
  1028. <el-input clearable
  1029. style="width: 100%;"
  1030. v-model.trim="dialog.editorBox.form1.data.tagIdMap"
  1031. ></el-input>
  1032. </el-form-item>
  1033. </el-col>
  1034. </el-row>
  1035. <el-row>
  1036. <el-col :span="8">
  1037. <el-form-item label="计算模式" prop="calcMod">
  1038. <el-input clearable
  1039. style="width: 100%;"
  1040. v-model.trim="dialog.editorBox.form1.data.calcMod"
  1041. ></el-input>
  1042. </el-form-item>
  1043. </el-col>
  1044. <el-col :span="8">
  1045. <el-form-item label="数据类型" prop="dataType">
  1046. <el-input clearable
  1047. style="width: 100%;"
  1048. v-model.trim="dialog.editorBox.form1.data.dataType"
  1049. ></el-input>
  1050. </el-form-item>
  1051. </el-col>
  1052. <el-col :span="8">
  1053. <el-form-item label="仪表类型" prop="meterType">
  1054. <el-input clearable
  1055. style="width: 100%;"
  1056. v-model.trim="dialog.editorBox.form1.data.meterType"
  1057. ></el-input>
  1058. </el-form-item>
  1059. </el-col>
  1060. </el-row>
  1061. <el-row>
  1062. <el-col :span="8">
  1063. <el-form-item label="底码精度" prop="meterScale">
  1064. <el-input clearable
  1065. style="width: 100%;"
  1066. v-model.trim="dialog.editorBox.form1.data.meterScale"
  1067. ></el-input>
  1068. </el-form-item>
  1069. </el-col>
  1070. <el-col :span="8">
  1071. <el-form-item label="仪表位置" prop="meterLoc">
  1072. <el-input clearable
  1073. style="width: 100%;"
  1074. v-model.trim="dialog.editorBox.form1.data.meterLoc"
  1075. ></el-input>
  1076. </el-form-item>
  1077. </el-col>
  1078. </el-row>
  1079. </el-form>
  1080. </div>
  1081. <div class="item">
  1082. <p class="bt">特殊属性</p>
  1083. <el-form
  1084. class="nr"
  1085. label-width="90px"
  1086. size="mini"
  1087. >
  1088. <el-row>
  1089. <el-col :span="8">
  1090. <el-form-item label="对应数据表" prop="tagTable">
  1091. <el-input clearable
  1092. style="width: 100%;"
  1093. v-model.trim="dialog.editorBox.form1.data.tagTable"
  1094. ></el-input>
  1095. </el-form-item>
  1096. </el-col>
  1097. <el-col :span="8">
  1098. <el-form-item label="对应数据列" prop="tagCol">
  1099. <el-input clearable
  1100. style="width: 100%;"
  1101. v-model.trim="dialog.editorBox.form1.data.tagCol"
  1102. ></el-input>
  1103. </el-form-item>
  1104. </el-col>
  1105. <el-col :span="8">
  1106. <el-form-item label="最大值标志位" prop="maxVal">
  1107. <el-input clearable
  1108. style="width: 100%;"
  1109. v-model.trim="dialog.editorBox.form1.data.maxVal"
  1110. ></el-input>
  1111. </el-form-item>
  1112. </el-col>
  1113. </el-row>
  1114. <el-row>
  1115. <el-col :span="8">
  1116. <el-form-item label="最小值标志位" prop="minVal">
  1117. <el-input clearable
  1118. style="width: 100%;"
  1119. v-model.trim="dialog.editorBox.form1.data.minVal"
  1120. ></el-input>
  1121. </el-form-item>
  1122. </el-col>
  1123. <el-col :span="8">
  1124. <el-form-item label="平均值标志位" prop="avgVal">
  1125. <el-input clearable
  1126. style="width: 100%;"
  1127. v-model.trim="dialog.editorBox.form1.data.avgVal"
  1128. ></el-input>
  1129. </el-form-item>
  1130. </el-col>
  1131. <el-col :span="8">
  1132. <el-form-item label="累计值标志位" prop="sumVal">
  1133. <el-input clearable
  1134. style="width: 100%;"
  1135. v-model.trim="dialog.editorBox.form1.data.sumVal"
  1136. ></el-input>
  1137. </el-form-item>
  1138. </el-col>
  1139. </el-row>
  1140. <el-row>
  1141. <el-col :span="8">
  1142. <el-form-item label="电开关号" prop="bcode">
  1143. <el-input clearable
  1144. style="width: 100%;"
  1145. v-model.trim="dialog.editorBox.form1.data.bcode"
  1146. ></el-input>
  1147. </el-form-item>
  1148. </el-col>
  1149. <el-col :span="8">
  1150. <el-form-item label="das地址" prop="bdesc1">
  1151. <el-input clearable
  1152. style="width: 100%;"
  1153. v-model="dialog.editorBox.form1.data.bdesc1"
  1154. ></el-input>
  1155. </el-form-item>
  1156. </el-col>
  1157. <el-col :span="8">
  1158. <el-form-item label="录入序号" prop="bdesc2">
  1159. <el-input clearable
  1160. style="width: 100%;"
  1161. v-model.trim="dialog.editorBox.form1.data.bdesc2"
  1162. ></el-input>
  1163. </el-form-item>
  1164. </el-col>
  1165. </el-row>
  1166. <el-row>
  1167. <el-col :span="8">
  1168. <el-form-item label="备用描述" prop="btype1">
  1169. <el-input clearable
  1170. style="width: 100%;"
  1171. v-model.trim="dialog.editorBox.form1.data.btype1"
  1172. ></el-input>
  1173. </el-form-item>
  1174. </el-col>
  1175. <el-col :span="16">
  1176. <el-form-item label="十分钟表字段" prop="btype2">
  1177. <el-input clearable
  1178. style="width: 100%;"
  1179. v-model.trim="dialog.editorBox.form1.data.btype2"
  1180. ></el-input>
  1181. </el-form-item>
  1182. </el-col>
  1183. </el-row>
  1184. </el-form>
  1185. </div>
  1186. </div>
  1187. </el-tab-pane>
  1188. </el-tabs>
  1189. <span
  1190. slot="footer"
  1191. class="dialog-footer"
  1192. >
  1193. <el-button
  1194. size="mini"
  1195. @click="dialog.editorBox.show = false"
  1196. :loading="loading"
  1197. >取 消</el-button>
  1198. <el-button
  1199. size="mini"
  1200. type="primary"
  1201. @click="dataSave"
  1202. :loading="loading"
  1203. >保 存</el-button>
  1204. </span>
  1205. </el-dialog>
  1206. <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
  1207. </div>
  1208. </template>
  1209. <script>
  1210. import formulaEditor from '~/components/zg/formulaEditor.vue'
  1211. import { zCheckNumber2 } from '~/utils/validator.js'
  1212. import { formatDate } from '@/utils/util.js';
  1213. export default {
  1214. name: 'measurementPlace',
  1215. components: {
  1216. 'zj-formulaEditor': formulaEditor
  1217. },
  1218. data () {
  1219. return {
  1220. activeMenu: '',
  1221. filterForm: {
  1222. show: true,
  1223. useflag: '1',
  1224. data: {
  1225. energytypeid: '',
  1226. energyid: '',
  1227. propertyid: '',
  1228. itemtype: '',
  1229. locateid: '',
  1230. itemid: '',
  1231. itemname: '',
  1232. networkid: '',
  1233. costid: '',
  1234. hierarchy: '',
  1235. tagAlias: '',
  1236. version: formatDate(new Date(), 'yyyyMM00'),
  1237. tagTable: '',
  1238. tagCol: ''
  1239. },
  1240. rules: {
  1241. }
  1242. },
  1243. pageNum: 1,
  1244. pageSize: 20,
  1245. total: 0,
  1246. singleTableHeight: 100,
  1247. tableData: [],
  1248. nameObj: {
  1249. workprocid: {
  1250. obj: {},
  1251. arr: []
  1252. },
  1253. energytypeid: {
  1254. obj: {},
  1255. arr: []
  1256. },
  1257. energyid: {
  1258. obj: {},
  1259. arr: []
  1260. },
  1261. propertyid: {
  1262. obj: {},
  1263. arr: []
  1264. },
  1265. locateid: {
  1266. obj: {},
  1267. arr: []
  1268. },
  1269. networkid: {
  1270. obj: {},
  1271. arr: []
  1272. },
  1273. unitid: {
  1274. obj: {},
  1275. arr: []
  1276. },
  1277. hierarchy: {
  1278. obj: {},
  1279. arr: []
  1280. },
  1281. itemtype: {
  1282. obj: {
  1283. 'AUTO': '自动上传',
  1284. 'MANUAL': '手抄',
  1285. 'VIRTUAL': '虚拟'
  1286. },
  1287. arr: [
  1288. {
  1289. id: 'AUTO',
  1290. name: '自动上传'
  1291. },
  1292. {
  1293. id: 'MANUAL',
  1294. name: '手抄'
  1295. },
  1296. {
  1297. id: 'VIRTUAL',
  1298. name: '虚拟'
  1299. }
  1300. ]
  1301. },
  1302. mintimegranid: {
  1303. obj: {
  1304. 'SHIFT': '班',
  1305. 'DAY': '日',
  1306. 'MONTH': '月',
  1307. 'YEAR': '年'
  1308. },
  1309. arr: [
  1310. // {
  1311. // id: 'SHIFT',
  1312. // name: '班'
  1313. // },
  1314. {
  1315. id: 'DAY',
  1316. name: '日'
  1317. },
  1318. {
  1319. id: 'MONTH',
  1320. name: '月'
  1321. },
  1322. {
  1323. id: 'YEAR',
  1324. name: '年'
  1325. }
  1326. ]
  1327. }
  1328. },
  1329. loading: false,
  1330. tableLoading: false,
  1331. dialog: {
  1332. editorBox: {
  1333. show: false,
  1334. activeName: '1',
  1335. type: '',
  1336. addRow: null,
  1337. form: {
  1338. data: {
  1339. itemid: '',
  1340. itemname: '',
  1341. tagAlias: '',
  1342. itemdesc: '',
  1343. itemtype: '',
  1344. locateid: '',
  1345. networkid: '',
  1346. energytypeid: '',
  1347. energyid: '',
  1348. propertyid: '',
  1349. unitid: '',
  1350. isschedule: '0',
  1351. costid: '',
  1352. sourceType: '',
  1353. mintimegranid: 'DAY',
  1354. transfer: ''
  1355. },
  1356. rules: {
  1357. // itemid: [
  1358. // { required: true, message: '该项不能为空', trigger: 'change' }
  1359. // ],
  1360. itemname: [
  1361. { required: true, message: '该项不能为空', trigger: 'change' }
  1362. ],
  1363. // tagAlias: [
  1364. // { required: true, message: '该项不能为空', trigger: 'change' }
  1365. // ],
  1366. locateid: [
  1367. { required: true, message: '该项不能为空', trigger: 'change' }
  1368. ],
  1369. networkid: [],
  1370. energytypeid: [
  1371. { required: true, message: '该项不能为空', trigger: 'change' }
  1372. ],
  1373. energyid: [
  1374. { required: true, message: '该项不能为空', trigger: 'change' }
  1375. ],
  1376. propertyid: [
  1377. { required: true, message: '该项不能为空', trigger: 'change' }
  1378. ],
  1379. itemtype: [
  1380. { required: true, message: '该项不能为空', trigger: 'change' }
  1381. ],
  1382. mintimegranid: [
  1383. { required: true, message: '该项不能为空', trigger: 'change' }
  1384. ],
  1385. bdesc2: [
  1386. { validator: zCheckNumber2, trigger: 'change' }
  1387. ]
  1388. }
  1389. },
  1390. form1: {
  1391. data: {
  1392. // 基础
  1393. defaultvalue: '',
  1394. digits: '',
  1395. node: '',
  1396. showno: '',
  1397. parentid: '',
  1398. recTime: '',
  1399. useflag: '',
  1400. status: '',
  1401. // 扩展
  1402. tagid: '',
  1403. tagname: '',
  1404. rangeVal: '',
  1405. tagBadSymbol: '',
  1406. tagModulus: '',
  1407. tagIdMap: '',
  1408. calcMod: '',
  1409. dataType: '',
  1410. meterType: '',
  1411. meterScale: '',
  1412. meterLoc: '',
  1413. // 特殊
  1414. tagTable: '',
  1415. tagCol: '',
  1416. maxVal: '',
  1417. minVal: '',
  1418. avgVal: '',
  1419. sumVal: '',
  1420. bcode: '',
  1421. bdesc1: '',
  1422. bdesc2: '',
  1423. btype1: '',
  1424. btype2: ''
  1425. },
  1426. rules: {
  1427. showno: [
  1428. { validator: zCheckNumber2, trigger: 'change' }
  1429. ]
  1430. }
  1431. }
  1432. },
  1433. equationEditing: {
  1434. show: false,
  1435. form: {
  1436. data: {
  1437. clock: '',
  1438. code: ''
  1439. }
  1440. }
  1441. }
  1442. },
  1443. butPrivilege: {
  1444. QUERY: false,
  1445. ADD: false,
  1446. PUT: false,
  1447. DELETE: false
  1448. }
  1449. }
  1450. },
  1451. created () {
  1452. // 获取按钮权限
  1453. this.activeMenu = window.localStorage.getItem('activeMenu');
  1454. for (let key in this.butPrivilege) {
  1455. this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
  1456. }
  1457. },
  1458. mounted () {
  1459. let that = this;
  1460. window.PEDataObj = {
  1461. // 将数据绑定到window上,供main页面使用
  1462. vm: that,
  1463. // tableArr:用于导出成Excel的表格的信息
  1464. tableArr: [
  1465. {
  1466. name: '',
  1467. id: 'singleTable'
  1468. }
  1469. ]
  1470. };
  1471. that.$nextTick(() => {
  1472. // 立即获取的height有一定偏差,通过setTimeout延迟来解决
  1473. setTimeout(() => {
  1474. that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
  1475. }, 1);
  1476. });
  1477. that.getEnergyTypeIdData();
  1478. that.getEnergyIdData();
  1479. that.getPropertyIdData();
  1480. that.getLocateIdData();
  1481. that.getNetworkIdData();
  1482. // that.getSourceTypeData();
  1483. that.getworkprocidData();
  1484. that.getUnitIdData();
  1485. that.getHierarchyData();
  1486. that.getTableData();
  1487. },
  1488. methods: {
  1489. // 计算树区域高度
  1490. getRoleHeight (dom) {
  1491. return window.innerHeight - dom.offsetTop;
  1492. },
  1493. // 获取工序
  1494. getworkprocidData () {
  1495. let that = this
  1496. let url = 'pass/ems/v1/trmworkprocs/getIdAndName';
  1497. that.axios.get(url)
  1498. .then(function (res) {
  1499. if (res.code === '0') {
  1500. let arr = [];
  1501. let obj = {};
  1502. for (let item of res.data) {
  1503. arr.push({
  1504. id: item.id,
  1505. name: item.name
  1506. })
  1507. obj[item.id] = item.name;
  1508. }
  1509. that.nameObj.workprocid.arr = arr;
  1510. that.nameObj.workprocid.obj = obj;
  1511. } else {
  1512. that.$message.error(res.message);
  1513. }
  1514. });
  1515. },
  1516. // 获取能介类型
  1517. getEnergyTypeIdData () {
  1518. let that = this
  1519. let url = 'pass/ems/v1/trmenergytypes/selectNameAndId/';
  1520. that.axios.get(url)
  1521. .then(function (res) {
  1522. if (res.code === '0') {
  1523. let arr = [];
  1524. let obj = {};
  1525. for (let item of res.data) {
  1526. arr.push({
  1527. id: item.id,
  1528. name: item.name
  1529. })
  1530. obj[item.id] = item.name;
  1531. }
  1532. that.nameObj.energytypeid.arr = arr;
  1533. that.nameObj.energytypeid.obj = obj;
  1534. } else {
  1535. that.$message.error(res.message);
  1536. }
  1537. });
  1538. },
  1539. connn () {
  1540. // this.filterForm.data.energytypeid = this.filterForm.data.energytypeid.join(',')
  1541. // console.log(this.filterForm.data.energytypeid)
  1542. // console.log(111)
  1543. // let that = this;
  1544. // let set = new Set();
  1545. // console.log(that.filterForm.data.energytypeid)
  1546. // if (!that.filterForm.data.energytypeid || that.filterForm.data.energytypeid.length === 0) {
  1547. // that.nameObj.energytypeid.showDataArr = that.nameObj.energytypeid.arr;
  1548. // } else {
  1549. // for (let key of that.filterForm.data.energytypeid) {
  1550. // if (that.nameObj.energytypeid.obj[key]) {
  1551. // for (let name of that.nameObj.energytypeid.obj[key]) {
  1552. // set.add(name);
  1553. // }
  1554. // }
  1555. // }
  1556. // that.nameObj.energytypeid.showDataArr = [...set];
  1557. // // console.log(that.nameObj.energytypeid.showDataArr)
  1558. // }
  1559. },
  1560. // 获取能介
  1561. getEnergyIdData () {
  1562. let that = this;
  1563. let url = 'pass/ems/v1/trmenergys/selectNameAndId/';
  1564. that.axios.get(url)
  1565. .then(function (res) {
  1566. if (res.code === '0') {
  1567. let arr = [];
  1568. let obj = {};
  1569. for (let item of res.data) {
  1570. arr.push({
  1571. id: item.id,
  1572. name: item.name,
  1573. energytypeid: item.energytypeid,
  1574. unitid: item.unitid
  1575. })
  1576. obj[item.id] = {
  1577. name: item.name,
  1578. unitid: item.unitid
  1579. }
  1580. }
  1581. that.nameObj.energyid.arr = arr;
  1582. that.nameObj.energyid.obj = obj;
  1583. } else {
  1584. that.$message.error(res.message);
  1585. }
  1586. });
  1587. },
  1588. // 获取属性
  1589. getPropertyIdData () {
  1590. let that = this
  1591. let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
  1592. that.axios.get(url)
  1593. .then(function (res) {
  1594. if (res.code === '0') {
  1595. let arr = [];
  1596. let obj = {};
  1597. for (let item of res.data) {
  1598. arr.push({
  1599. id: item.id,
  1600. name: item.name
  1601. })
  1602. obj[item.id] = item.name;
  1603. }
  1604. that.nameObj.propertyid.arr = arr;
  1605. that.nameObj.propertyid.obj = obj;
  1606. } else {
  1607. that.$message.error(res.message);
  1608. }
  1609. });
  1610. },
  1611. // 获取位置
  1612. getLocateIdData () {
  1613. let that = this
  1614. let url = 'pass/ems/v1/trmlocations/getidandname/';
  1615. that.axios.get(url)
  1616. .then(function (res) {
  1617. if (res.code === '0') {
  1618. let arr = [];
  1619. let obj = {};
  1620. for (let item of res.data) {
  1621. arr.push({
  1622. id: item.id,
  1623. name: item.name
  1624. })
  1625. obj[item.id] = item.name;
  1626. }
  1627. that.nameObj.locateid.arr = arr;
  1628. that.nameObj.locateid.obj = obj;
  1629. } else {
  1630. that.$message.error(res.message);
  1631. }
  1632. });
  1633. },
  1634. // 获取站所
  1635. getNetworkIdData () {
  1636. let that = this
  1637. let url = 'pass/ems/v1/trmstations/getidandname/';
  1638. that.axios.get(url)
  1639. .then(function (res) {
  1640. if (res.code === '0') {
  1641. let arr = [];
  1642. let obj = {};
  1643. for (let item of res.data) {
  1644. arr.push({
  1645. id: item.id,
  1646. name: item.name
  1647. })
  1648. obj[item.id] = item.name;
  1649. }
  1650. that.nameObj.networkid.arr = arr;
  1651. that.nameObj.networkid.obj = obj;
  1652. } else {
  1653. that.$message.error(res.message);
  1654. }
  1655. });
  1656. },
  1657. // // 获取数据来源
  1658. // getSourceTypeData () {
  1659. // let that = this
  1660. // let url = 'pass/ems/v1/trml1sources/getidandname/';
  1661. // that.axios.get(url)
  1662. // .then(function (res) {
  1663. // if (res.code === '0') {
  1664. // let arr = [];
  1665. // let obj = {};
  1666. // for (let item of res.data) {
  1667. // arr.push({
  1668. // id: item.id,
  1669. // name: item.name
  1670. // })
  1671. // obj[item.id] = item.name;
  1672. // }
  1673. // that.nameObj.sourceType.arr = arr;
  1674. // that.nameObj.sourceType.obj = obj;
  1675. // } else {
  1676. // that.$message.error(res.message);
  1677. // }
  1678. // });
  1679. // },
  1680. // 获取标准计量单位
  1681. getUnitIdData () {
  1682. let that = this
  1683. let url = 'pass/ems/v1/trmunits/getIdAndName';
  1684. that.axios.get(url)
  1685. .then(function (res) {
  1686. if (res.code === '0') {
  1687. let arr = [];
  1688. let obj = {};
  1689. for (let item of res.data) {
  1690. arr.push({
  1691. id: item.id,
  1692. name: item.name
  1693. })
  1694. obj[item.id] = item.name;
  1695. // if (item.name === '吨') {
  1696. // that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
  1697. // }
  1698. }
  1699. that.nameObj.unitid.arr = arr;
  1700. that.nameObj.unitid.obj = obj;
  1701. } else {
  1702. that.$message.error(res.message);
  1703. }
  1704. });
  1705. },
  1706. // 获取计量层级
  1707. getHierarchyData () {
  1708. let that = this
  1709. let url = 'pass/ems/v1/trmcalpoints/getRmCalpoint/';
  1710. that.axios.get(url)
  1711. .then(function (res) {
  1712. if (res.code === '0') {
  1713. let arr = [];
  1714. let obj = {};
  1715. for (let item of res.data) {
  1716. arr.push({
  1717. id: item.id,
  1718. name: item.name
  1719. })
  1720. obj[item.id] = item.name;
  1721. }
  1722. that.nameObj.hierarchy.arr = arr;
  1723. that.nameObj.hierarchy.obj = obj;
  1724. } else {
  1725. that.$message.error(res.message);
  1726. }
  1727. });
  1728. },
  1729. // 获取表格中的数据
  1730. getTableData (pageNum) {
  1731. let that = this,
  1732. params = {
  1733. energytypeid: that.filterForm.data.energytypeid.join(','),
  1734. energyid: that.filterForm.data.energyid.join(','),
  1735. propertyid: that.filterForm.data.propertyid.join(','),
  1736. itemtype: that.filterForm.data.itemtype,
  1737. locateid: that.filterForm.data.locateid.join(','),
  1738. itemid: that.filterForm.data.itemid,
  1739. itemname: that.filterForm.data.itemname,
  1740. networkid: that.filterForm.data.networkid.join(','),
  1741. costid: that.filterForm.data.costid.join(','),
  1742. node: that.filterForm.data.hierarchy,
  1743. tagAlias: that.filterForm.data.tagAlias,
  1744. version: that.filterForm.data.version,
  1745. tagTable: that.filterForm.data.tagTable,
  1746. tagCol: that.filterForm.data.tagCol,
  1747. useflag: that.filterForm.useflag
  1748. };
  1749. that.pageNum = pageNum || that.pageNum;
  1750. that.tableLoading = true;
  1751. let url = 'pass/ems/v1/trmcalpoints/like/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
  1752. that.axios.get(url, {
  1753. params: params
  1754. })
  1755. .then(function (res) {
  1756. if (res.code === '0') {
  1757. let arr = [];
  1758. for (let item of res.data.list) {
  1759. arr.push({
  1760. itemid: item.itemid,
  1761. itemname: item.itemname,
  1762. tagAlias: item.tagAlias,
  1763. itemdesc: item.itemdesc,
  1764. itemtype: item.itemtype,
  1765. locateid: item.locateid,
  1766. networkid: item.networkid,
  1767. energytypeid: item.energytypeid,
  1768. energyid: item.energyid,
  1769. propertyid: item.propertyid,
  1770. unitid: item.unitid,
  1771. isschedule: item.isschedule,
  1772. // issettle: item.issettle,
  1773. costid: item.costid,
  1774. sourceType: item.sourceType,
  1775. mintimegranid: item.mintimegranid,
  1776. // 基础
  1777. defaultvalue: item.defaultvalue,
  1778. digits: item.digits,
  1779. node: item.node,
  1780. showno: item.showno,
  1781. parentid: item.parentid,
  1782. recTime: item.recTime,
  1783. useflag: item.useflag,
  1784. status: item.status,
  1785. transfer: item.transfer,
  1786. // 扩展
  1787. tagid: item.tagid,
  1788. tagname: item.tagname,
  1789. rangeVal: item.rangeVal,
  1790. tagBadSymbol: item.tagBadSymbol,
  1791. tagModulus: item.tagModulus,
  1792. tagIdMap: item.tagIdMap,
  1793. calcMod: item.calcMod,
  1794. dataType: item.dataType,
  1795. meterType: item.meterType,
  1796. meterScale: item.meterScale,
  1797. meterLoc: item.meterLoc,
  1798. // 特殊
  1799. tagTable: item.tagTable,
  1800. tagCol: item.tagCol,
  1801. maxVal: item.maxVal,
  1802. minVal: item.minVal,
  1803. avgVal: item.avgVal,
  1804. sumVal: item.sumVal,
  1805. bcode: item.bcode,
  1806. bdesc1: item.bdesc1,
  1807. bdesc2: item.bdesc2,
  1808. btype1: item.btype1,
  1809. btype2: item.btype2
  1810. })
  1811. }
  1812. that.tableData = arr;
  1813. that.total = res.data.total;
  1814. } else {
  1815. that.$message.error(res.message);
  1816. }
  1817. that.tableLoading = false;
  1818. }).catch(function () {
  1819. that.tableLoading = false;
  1820. });
  1821. },
  1822. // 改变表格显示条数
  1823. tableSizeChange (val) {
  1824. let that = this;
  1825. that.pageSize = val;
  1826. that.getTableData(1);
  1827. },
  1828. // 重置搜索
  1829. tableDataCancel () {
  1830. let that = this;
  1831. for (let key in that.filterForm.data) {
  1832. if (that.filterForm.data[key] instanceof Array) {
  1833. that.filterForm.data[key] = [];
  1834. } else {
  1835. that.filterForm.data[key] = '';
  1836. }
  1837. }
  1838. that.getTableData(1);
  1839. },
  1840. // 选择添加时的模板
  1841. handleCurrentChange (row) {
  1842. let that = this;
  1843. that.dialog.editorBox.addRow = row;
  1844. },
  1845. // 自动生成名称
  1846. autoSetName () {
  1847. let that = this;
  1848. if (that.dialog.editorBox.form.data.itemname === '') {
  1849. if (that.dialog.editorBox.form.data.locateid && that.dialog.editorBox.form.data.energyid && that.dialog.editorBox.form.data.propertyid) {
  1850. that.dialog.editorBox.form.data.itemname += that.nameObj.locateid.obj[that.dialog.editorBox.form.data.locateid];
  1851. that.dialog.editorBox.form.data.itemname += that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid].name;
  1852. that.dialog.editorBox.form.data.itemname += that.nameObj.propertyid.obj[that.dialog.editorBox.form.data.propertyid];
  1853. }
  1854. }
  1855. },
  1856. but_add () {
  1857. let that = this;
  1858. if (that.dialog.editorBox.addRow) {
  1859. for (let key in that.dialog.editorBox.form.data) {
  1860. if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
  1861. that.dialog.editorBox.form.data[key] = that.dialog.editorBox.addRow[key];
  1862. } else {
  1863. that.dialog.editorBox.form.data[key] = '';
  1864. }
  1865. }
  1866. for (let key in that.dialog.editorBox.form1.data) {
  1867. if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
  1868. that.dialog.editorBox.form1.data[key] = that.dialog.editorBox.addRow[key];
  1869. } else {
  1870. that.dialog.editorBox.form1.data[key] = '';
  1871. }
  1872. }
  1873. this.$refs['singleTable'].setCurrentRow();
  1874. } else {
  1875. for (let key in that.dialog.editorBox.form.data) {
  1876. if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
  1877. that.dialog.editorBox.form.data[key] = that.filterForm.data[key];
  1878. } else {
  1879. that.dialog.editorBox.form.data[key] = '';
  1880. }
  1881. }
  1882. for (let key in that.dialog.editorBox.form1.data) {
  1883. if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
  1884. that.dialog.editorBox.form1.data[key] = that.filterForm.data[key];
  1885. } else {
  1886. that.dialog.editorBox.form1.data[key] = '';
  1887. }
  1888. }
  1889. that.dialog.editorBox.form.data.unitid = that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid] ? that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid].unitid : '';
  1890. // that.dialog.editorBox.form.data.unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
  1891. that.dialog.editorBox.form.data.isschedule = '0';
  1892. that.dialog.editorBox.form1.data.useflag = '1';
  1893. that.dialog.editorBox.form1.data.status = '0';
  1894. }
  1895. that.dialog.editorBox.form.data.itemid = '';
  1896. // that.dialog.editorBox.form.data.itemname = '';
  1897. that.dialog.editorBox.form1.data.recTime = '';
  1898. that.dialog.editorBox.activeName = '1';
  1899. that.dialog.editorBox.type = 'add';
  1900. that.dialog.editorBox.show = true;
  1901. setTimeout(() => {
  1902. that.$refs['dialog_form'].clearValidate();
  1903. }, 100);
  1904. },
  1905. but_edit (row) {
  1906. let that = this;
  1907. for (let key in that.dialog.editorBox.form.data) {
  1908. if (typeof row[key] !== 'undefined') {
  1909. that.dialog.editorBox.form.data[key] = row[key];
  1910. }
  1911. }
  1912. for (let key in that.dialog.editorBox.form1.data) {
  1913. if (typeof row[key] !== 'undefined') {
  1914. that.dialog.editorBox.form1.data[key] = row[key];
  1915. }
  1916. }
  1917. that.dialog.editorBox.activeName = '1';
  1918. that.dialog.editorBox.type = 'edit';
  1919. that.dialog.editorBox.show = true;
  1920. },
  1921. but_del (row) {
  1922. let that = this;
  1923. that.$confirm('是否删除该条数据?', '提示', {
  1924. confirmButtonText: '确定',
  1925. cancelButtonText: '取消',
  1926. state: 'warning'
  1927. }).then(() => {
  1928. that.axios.delete('pass/ems/v1/trmcalpoints/' + row.itemid)
  1929. .then(function (res) {
  1930. if (res.code === '0') {
  1931. that.$message({
  1932. message: '删除成功',
  1933. type: 'success'
  1934. });
  1935. that.getTableData();
  1936. } else {
  1937. that.$message.error(res.message);
  1938. }
  1939. }).catch(function () {
  1940. });
  1941. }).catch(() => {
  1942. });
  1943. },
  1944. dataSave () {
  1945. let that = this;
  1946. let SubmitData = {
  1947. itemid: that.dialog.editorBox.form.data.itemid,
  1948. itemname: that.dialog.editorBox.form.data.itemname,
  1949. tagAlias: that.dialog.editorBox.form.data.tagAlias,
  1950. itemdesc: that.dialog.editorBox.form.data.itemdesc,
  1951. itemtype: that.dialog.editorBox.form.data.itemtype,
  1952. locateid: that.dialog.editorBox.form.data.locateid,
  1953. networkid: that.dialog.editorBox.form.data.networkid,
  1954. energytypeid: that.dialog.editorBox.form.data.energytypeid,
  1955. energyid: that.dialog.editorBox.form.data.energyid,
  1956. propertyid: that.dialog.editorBox.form.data.propertyid,
  1957. unitid: that.dialog.editorBox.form.data.unitid,
  1958. isschedule: that.dialog.editorBox.form.data.isschedule,
  1959. costid: that.dialog.editorBox.form.data.costid,
  1960. sourceType: that.dialog.editorBox.form.data.sourceType,
  1961. mintimegranid: that.dialog.editorBox.form.data.mintimegranid,
  1962. transfer: that.dialog.editorBox.form.data.transfer,
  1963. // 基础
  1964. defaultvalue: that.dialog.editorBox.form1.data.defaultvalue,
  1965. digits: that.dialog.editorBox.form1.data.digits,
  1966. node: that.dialog.editorBox.form1.data.node,
  1967. showno: that.dialog.editorBox.form1.data.showno,
  1968. parentid: that.dialog.editorBox.form1.data.parentid,
  1969. recTime: that.dialog.editorBox.form1.data.recTime,
  1970. useflag: that.dialog.editorBox.form1.data.useflag,
  1971. status: that.dialog.editorBox.form1.data.status,
  1972. // 扩展
  1973. tagid: that.dialog.editorBox.form1.data.tagid,
  1974. tagname: that.dialog.editorBox.form1.data.tagname,
  1975. rangeVal: that.dialog.editorBox.form1.data.rangeVal,
  1976. tagBadSymbol: that.dialog.editorBox.form1.data.tagBadSymbol,
  1977. tagModulus: that.dialog.editorBox.form1.data.tagModulus,
  1978. tagIdMap: that.dialog.editorBox.form1.data.tagIdMap,
  1979. calcMod: that.dialog.editorBox.form1.data.calcMod,
  1980. dataType: that.dialog.editorBox.form1.data.dataType,
  1981. meterType: that.dialog.editorBox.form1.data.meterType,
  1982. meterScale: that.dialog.editorBox.form1.data.meterScale,
  1983. meterLoc: that.dialog.editorBox.form1.data.meterLoc,
  1984. // 特殊
  1985. tagTable: that.dialog.editorBox.form1.data.tagTable,
  1986. tagCol: that.dialog.editorBox.form1.data.tagCol,
  1987. maxVal: that.dialog.editorBox.form1.data.maxVal,
  1988. minVal: that.dialog.editorBox.form1.data.minVal,
  1989. avgVal: that.dialog.editorBox.form1.data.avgVal,
  1990. sumVal: that.dialog.editorBox.form1.data.sumVal,
  1991. bcode: that.dialog.editorBox.form1.data.bcode,
  1992. bdesc1: that.dialog.editorBox.form1.data.bdesc1,
  1993. bdesc2: that.dialog.editorBox.form1.data.bdesc2,
  1994. btype1: that.dialog.editorBox.form1.data.btype1,
  1995. btype2: that.dialog.editorBox.form1.data.btype2
  1996. };
  1997. that.$refs['dialog_form'].validate((valid) => {
  1998. if (valid) {
  1999. that.$refs['dialog_form1'].validate((valid1) => {
  2000. if (valid1) {
  2001. if (that.dialog.editorBox.type === 'add') {
  2002. let foorData = new FormData();
  2003. for (let key in SubmitData) {
  2004. foorData.append(key, SubmitData[key]);
  2005. }
  2006. that.loading = true;
  2007. that.axios.post('pass/ems/v1/trmcalpoints/', foorData, {
  2008. headers: {
  2009. 'Content-Type': 'multipart/form-data'
  2010. }
  2011. })
  2012. .then(function (res) {
  2013. if (res.code === '0') {
  2014. that.$message({
  2015. message: '新增成功',
  2016. type: 'success'
  2017. });
  2018. that.getTableData();
  2019. that.dialog.editorBox.show = false;
  2020. } else {
  2021. that.$message.error(res.message);
  2022. }
  2023. that.loading = false;
  2024. }).catch(function () {
  2025. that.loading = false;
  2026. });
  2027. } else {
  2028. that.loading = true;
  2029. that.axios.put('pass/ems/v1/trmcalpoints/' + SubmitData.itemid, SubmitData)
  2030. .then(function (res) {
  2031. if (res.code === '0') {
  2032. let msg = res.message
  2033. if (!msg || msg === '操作成功') {
  2034. that.$message({
  2035. message: '修改成功',
  2036. type: 'success'
  2037. });
  2038. } else {
  2039. that.$message.warning('修改成功,注意:' + msg);
  2040. }
  2041. that.getTableData();
  2042. that.dialog.editorBox.show = false;
  2043. } else {
  2044. that.$message.error(res.message);
  2045. }
  2046. that.loading = false;
  2047. }).catch(function () {
  2048. that.loading = false;
  2049. });
  2050. }
  2051. } else {
  2052. that.dialog.editorBox.activeName = '2';
  2053. }
  2054. });
  2055. } else {
  2056. that.dialog.editorBox.activeName = '1';
  2057. }
  2058. });
  2059. },
  2060. but_equationEditing (row) {
  2061. let that = this;
  2062. that.dialog.equationEditing.form.data.clock = that.filterForm.data.version;
  2063. that.dialog.equationEditing.form.data.code = row.itemid;
  2064. that.dialog.equationEditing.show = true;
  2065. },
  2066. rowClassName ({row, rowIndex}) {
  2067. return row.useflag !== '1' ? 'rowDisable' : ''
  2068. },
  2069. upUseflag (row, useflag = 0) {
  2070. let that = this;
  2071. let SubmitData = {
  2072. itemname: row.itemname,
  2073. tagAlias: row.tagAlias,
  2074. itemdesc: row.itemdesc,
  2075. itemtype: row.itemtype,
  2076. locateid: row.locateid,
  2077. networkid: row.networkid,
  2078. energytypeid: row.energytypeid,
  2079. energyid: row.energyid,
  2080. propertyid: row.propertyid,
  2081. unitid: row.unitid,
  2082. isschedule: row.isschedule,
  2083. sourceType: row.sourceType,
  2084. transfer: row.transfer,
  2085. useflag: useflag,
  2086. mintimegranid: row.mintimegranid
  2087. };
  2088. that.$confirm('是否' + (useflag === '1' ? '启用' : '禁用') + '?', '提示', {
  2089. confirmButtonText: '确定',
  2090. cancelButtonText: '取消',
  2091. type: 'warning'
  2092. }).then(() => {
  2093. that.axios.put('pass/ems/v1/trmcalpoints/' + row.itemid, SubmitData)
  2094. .then(function (res) {
  2095. if (res.code === '0') {
  2096. that.$message({
  2097. message: useflag === '1' ? '启用成功' : '禁用成功',
  2098. type: 'success'
  2099. });
  2100. that.getTableData();
  2101. that.dialog.editorBox.show = false;
  2102. } else {
  2103. that.$message.error(res.message);
  2104. }
  2105. }).catch(function () {
  2106. });
  2107. }).catch(() => {
  2108. })
  2109. }
  2110. }
  2111. }
  2112. </script>
  2113. <style lang="less">
  2114. .measurementPlace {
  2115. min-width: 700px;
  2116. height: 100%;
  2117. .box {
  2118. height: 100%;
  2119. padding: 15px 15px 0 15px;
  2120. .box-top {
  2121. .el-form-item {
  2122. margin-bottom: 7px;
  2123. }
  2124. .box-top-gjl {
  2125. overflow: hidden;
  2126. // margin-top: -7px;
  2127. padding: 7px 0;
  2128. border-top: 1px solid #ccc;
  2129. // border-bottom: 1px solid #ccc;
  2130. // margin-bottom: 6px;
  2131. }
  2132. }
  2133. .rowDisable td {
  2134. background-color: #dfdfdf !important;
  2135. }
  2136. }
  2137. .attribute-box {
  2138. .item {
  2139. border: #ccc 1px solid;
  2140. padding: 5px;
  2141. margin-bottom: 6px;
  2142. .bt {
  2143. font-size: 14px;
  2144. font-weight: 600;
  2145. color: #000;
  2146. padding-left: 10px;
  2147. border-left: #008fe0 5px solid;
  2148. }
  2149. }
  2150. }
  2151. .color_no {
  2152. color: #7a7a7a;
  2153. }
  2154. .color_yes {
  2155. color: #1a9f17;
  2156. }
  2157. .el-button--mini {
  2158. padding: 7px 12px;
  2159. }
  2160. }
  2161. </style>