planProjectRoundGx.vue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742
  1. <template>
  2. <div class="balanceSheetData">
  3. <div class="box">
  4. <div class="box-top">
  5. <el-form
  6. style="overflow: hidden;"
  7. :style="filterForm.show ? null : { height: '0px' }"
  8. size="mini"
  9. label-width="70px"
  10. >
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="月份">
  14. <zj-timegran-date
  15. v-model="filterForm.data.clock"
  16. style="width: 100%;"
  17. :timegranId="filterForm.data.timegranid"
  18. :oneFoo="getTableData"
  19. ></zj-timegran-date>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="6">
  23. <el-form-item label="产线">
  24. <el-select
  25. filterable clearable
  26. v-model="filterForm.data.workprocid"
  27. placeholder=""
  28. style="width: 100%;"
  29. >
  30. <el-option
  31. v-for="item of nameObj.workprocid.arr"
  32. :key="item.id"
  33. :value="item.id"
  34. :label="item.name"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-col>
  39. </el-row>
  40. </el-form>
  41. <div class="box-top-gjl">
  42. <el-button
  43. class="button"
  44. type="primary"
  45. size="mini"
  46. icon="el-icon-plus"
  47. v-privilege="activeMenu + 'ADD'"
  48. @click="but_add"
  49. >新增</el-button>
  50. <el-button
  51. type="primary"
  52. size="mini"
  53. icon="el-icon-add-outline"
  54. @click="but_edit_plural()"
  55. >修改</el-button>
  56. <el-button
  57. class="button"
  58. type="danger"
  59. size="mini"
  60. icon="el-icon-delete"
  61. @click="but_del_plural()"
  62. >删除</el-button>
  63. <el-button
  64. type="primary"
  65. size="mini"
  66. icon="el-icon-add-outline"
  67. @click="issue(1)"
  68. >下发</el-button>
  69. <el-button
  70. type="primary"
  71. size="mini"
  72. icon="el-icon-add-outline"
  73. @click="issue(0)"
  74. >取消下发</el-button>
  75. <div style="float:right; text-align: right;">
  76. <el-button
  77. class="button"
  78. type="primary"
  79. size="mini"
  80. icon="el-icon-search"
  81. v-privilege="activeMenu + 'QUERY'"
  82. @click="getTableData(1)"
  83. >查询</el-button>
  84. <el-button
  85. size="mini"
  86. :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
  87. :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
  88. @click="filterForm.show = !filterForm.show;
  89. $nextTick(() => {
  90. singleTableHeight = getRoleHeight($refs['boxBottom']) - 45;
  91. }
  92. );"
  93. >{{ filterForm.show ? '收起' : '展开' }}</el-button>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="box-bottom" ref="boxBottom">
  98. <div class="table-box" ref="table_box">
  99. <div class="table-left" :style="{ width: leftTableWidth + 'px' }">
  100. <el-form
  101. size="mini"
  102. ref="dialog_form_arr_1"
  103. label-width="0px"
  104. :model="tableFormDataObj"
  105. >
  106. <el-table stripe
  107. id="singleTable1"
  108. ref="singleTable1"
  109. :data="leftTableData"
  110. v-loading="leftTableLoading"
  111. style="width: 100%;"
  112. :height="singleTableHeight"
  113. border
  114. size="mini"
  115. highlight-current-row
  116. show-summary
  117. :summary-method="getSummaries"
  118. @current-change="getTableDetailData"
  119. >
  120. <el-table-column
  121. prop="sqno"
  122. label="序号"
  123. fixed="left"
  124. width="50px"
  125. :show-overflow-tooltip="true"
  126. ></el-table-column>
  127. <el-table-column
  128. prop="may"
  129. label="月份"
  130. min-width="100px"
  131. :show-overflow-tooltip="true"
  132. ></el-table-column>
  133. <el-table-column
  134. prop="workprocid"
  135. label="工序"
  136. min-width="100px"
  137. :show-overflow-tooltip="true"
  138. >
  139. <template slot-scope="scope">
  140. <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid].name : scope.row.workprocid }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column
  144. sortable
  145. prop="unit"
  146. label="单位"
  147. min-width="100px"
  148. :show-overflow-tooltip="true"
  149. >
  150. <template slot-scope="scope">
  151. <span>{{ nameObj.unit.obj[scope.row.unit] ? nameObj.unit.obj[scope.row.unit] : scope.row.unit }}</span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column
  155. sortable
  156. prop="weightMonth"
  157. label="年度计划量(月)"
  158. min-width="115px"
  159. :show-overflow-tooltip="true"
  160. >
  161. </el-table-column>
  162. <el-table-column
  163. sortable
  164. prop="kxf_weight"
  165. label="可下发量"
  166. min-width="100px"
  167. :show-overflow-tooltip="true"
  168. >
  169. </el-table-column>
  170. <el-table-column
  171. sortable
  172. prop="yxf_weight"
  173. label="已下发量"
  174. min-width="100px"
  175. :show-overflow-tooltip="true"
  176. >
  177. </el-table-column>
  178. <el-table-column
  179. prop="id"
  180. label="序号"
  181. fixed="left"
  182. width="50px"
  183. :show-overflow-tooltip="true"
  184. v-if="filterForm.data.show"
  185. ></el-table-column>
  186. </el-table>
  187. </el-form>
  188. </div>
  189. <div class="table-tuodong" :style="{ height: singleTableHeight + 'px' }"
  190. @mousedown="tableTDMousedown"
  191. ></div>
  192. <div class="table-right" :style="{ 'margin-left': (leftTableWidth + 7) + 'px' }">
  193. <el-form
  194. size="mini"
  195. ref="dialog_form_arr_2"
  196. label-width="0px"
  197. :model="rightTableObj"
  198. >
  199. <el-table stripe
  200. id="singleTable2"
  201. ref="singleTable2"
  202. :data="rightTableData"
  203. v-loading="tableLoading"
  204. style="width: 100%;"
  205. :height="singleTableHeight"
  206. border
  207. size="mini"
  208. highlight-current-row
  209. show-summary
  210. :summary-method="getSummaries"
  211. @selection-change="handleSelectionChange"
  212. >
  213. <el-table-column
  214. type="selection"
  215. width="40"
  216. align="center"
  217. :selectable='checkboxT'
  218. fixed="left"
  219. class-name="cnspicuous"
  220. ></el-table-column>
  221. <el-table-column
  222. prop="sqno"
  223. label="月序号"
  224. min-width="100px"
  225. v-model="filterForm.data.sqno"
  226. :show-overflow-tooltip="true"
  227. ></el-table-column>
  228. <el-table-column
  229. prop="may"
  230. label="月份"
  231. min-width="100px"
  232. :show-overflow-tooltip="true"
  233. >
  234. </el-table-column>
  235. <el-table-column
  236. prop="describe"
  237. label="轮次描述"
  238. min-width="100px"
  239. :show-overflow-tooltip="true"
  240. >
  241. </el-table-column>
  242. <el-table-column
  243. prop="state"
  244. label="状态"
  245. min-width="100px"
  246. :show-overflow-tooltip="true"
  247. >
  248. <template slot-scope="scope">
  249. <span
  250. :style="{color: nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].color : ''}"
  251. >{{ nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].name : scope.row.state }}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. prop="grades"
  256. label="钢种"
  257. min-width="100px"
  258. :show-overflow-tooltip="true"
  259. >
  260. <template slot-scope="scope">
  261. <el-form-item
  262. :prop="scope.row.seq + '.grades'"
  263. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  264. :rules="tableFormRules.grades"
  265. >
  266. <el-select
  267. filterable clearable
  268. v-model="rightTableObj[scope.row.seq].grades"
  269. placeholder=""
  270. >
  271. <el-option
  272. v-for="item of nameObj.grades.arr"
  273. :key="item.id"
  274. :value="item.id"
  275. :label="item.name"
  276. ></el-option>
  277. </el-select>
  278. </el-form-item>
  279. <span v-else>{{ nameObj.grades.obj[scope.row.grades] ? nameObj.grades.obj[scope.row.grades].name : scope.row.grades }}</span>
  280. </template>
  281. </el-table-column>
  282. <el-table-column
  283. prop="planWeight"
  284. label="计划量"
  285. min-width="100px"
  286. :show-overflow-tooltip="true"
  287. >
  288. <template slot-scope="scope">
  289. <el-form-item
  290. :prop="scope.row.seq + '.planWeight'"
  291. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  292. :rules="tableFormRules.planWeight"
  293. >
  294. <el-input
  295. style="width: 100%;"
  296. v-model="rightTableObj[scope.row.seq].planWeight"
  297. refcous="true"
  298. ></el-input>
  299. </el-form-item>
  300. <span v-else>{{scope.row.planWeight}}</span>
  301. </template>
  302. </el-table-column>
  303. <el-table-column
  304. prop="specifications"
  305. label="规格"
  306. min-width="100px"
  307. :show-overflow-tooltip="true"
  308. >
  309. <template slot-scope="scope">
  310. <el-form-item
  311. :prop="scope.row.seq + '.specifications'"
  312. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  313. :rules="tableFormRules.specifications"
  314. >
  315. <el-select
  316. filterable clearable
  317. v-model="rightTableObj[scope.row.seq].specifications"
  318. placeholder=""
  319. >
  320. <el-option
  321. v-for="item of nameObj.specifications.arr"
  322. :key="item.id"
  323. :value="item.id"
  324. :label="item.name"
  325. ></el-option>
  326. </el-select>
  327. </el-form-item>
  328. <span v-else>{{ nameObj.specifications.obj[scope.row.specifications] ? nameObj.specifications.obj[scope.row.specifications].name : scope.row.specifications }}</span>
  329. </template>
  330. </el-table-column>
  331. <el-table-column
  332. prop="transportType"
  333. label="运输方式"
  334. min-width="100px"
  335. :show-overflow-tooltip="true"
  336. >
  337. <template slot-scope="scope">
  338. <el-form-item
  339. :prop="scope.row.seq + '.transportType'"
  340. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  341. :rules="tableFormRules.transportType"
  342. >
  343. <el-select
  344. filterable clearable
  345. v-model="rightTableObj[scope.row.seq].transportType"
  346. placeholder=""
  347. >
  348. <el-option
  349. v-for="item of nameObj.transportType.arr"
  350. :key="item.id"
  351. :value="item.id"
  352. :label="item.name"
  353. ></el-option>
  354. </el-select>
  355. </el-form-item>
  356. <span v-else>{{ nameObj.transportType.obj[scope.row.transportType] ? nameObj.transportType.obj[scope.row.transportType].name : scope.row.transportType }}</span>
  357. </template>
  358. </el-table-column>
  359. <el-table-column
  360. prop="purpose"
  361. label="用途"
  362. min-width="100px"
  363. :show-overflow-tooltip="true"
  364. >
  365. <template slot-scope="scope">
  366. <el-form-item
  367. :prop="scope.row.seq + '.purpose'"
  368. :rules="tableFormRules.purpose"
  369. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  370. >
  371. <el-select
  372. filterable clearable
  373. v-model="rightTableObj[scope.row.seq].purpose"
  374. placeholder=""
  375. >
  376. <el-option
  377. v-for="item of nameObj.purpose.arr"
  378. :key="item.id"
  379. :value="item.id"
  380. :label="item.name"
  381. ></el-option>
  382. </el-select>
  383. </el-form-item>
  384. <span v-else>{{ nameObj.purpose.obj[scope.row.purpose] ? nameObj.purpose.obj[scope.row.purpose].name : scope.row.purpose }}</span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column
  388. prop="chemicalStandard"
  389. label="执行标准"
  390. min-width="100px"
  391. :show-overflow-tooltip="true"
  392. >
  393. <template slot-scope="scope">
  394. <el-form-item
  395. :prop="scope.row.seq + '.chemicalStandard'"
  396. :rules="tableFormRules.chemicalStandard"
  397. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  398. >
  399. <el-select
  400. filterable clearable
  401. v-model="rightTableObj[scope.row.seq].chemicalStandard"
  402. placeholder=""
  403. >
  404. <el-option
  405. v-for="item of nameObj.chemicalStandard.arr"
  406. :key="item.id"
  407. :value="item.id"
  408. :label="item.name"
  409. ></el-option>
  410. </el-select>
  411. </el-form-item>
  412. <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
  413. </template>
  414. </el-table-column>
  415. <el-table-column
  416. prop="memo"
  417. label="备注"
  418. min-width="100px"
  419. :show-overflow-tooltip="true"
  420. >
  421. </el-table-column>
  422. <el-table-column
  423. prop="issuedTime"
  424. label="下发时间"
  425. min-width="100px"
  426. :show-overflow-tooltip="true"
  427. ></el-table-column>
  428. <el-table-column
  429. prop="createman"
  430. label="创建人"
  431. min-width="100px"
  432. :show-overflow-tooltip="true"
  433. ></el-table-column>
  434. <el-table-column
  435. prop="createtime"
  436. label="创建时间"
  437. min-width="100px"
  438. :show-overflow-tooltip="true"
  439. ></el-table-column>
  440. <el-table-column
  441. prop="updateman"
  442. label="修改人"
  443. min-width="100px"
  444. :show-overflow-tooltip="true"
  445. ></el-table-column>
  446. <el-table-column
  447. prop="updatetime"
  448. label="修改时间"
  449. min-width="100px"
  450. :show-overflow-tooltip="true"
  451. ></el-table-column>
  452. <el-table-column
  453. prop="roundid"
  454. label="轮次序号"
  455. min-width="100px"
  456. :show-overflow-tooltip="true"
  457. v-if="filterForm.data.show"
  458. ></el-table-column>
  459. <el-table-column
  460. prop="parentid"
  461. label="月序号"
  462. min-width="100px"
  463. :show-overflow-tooltip="true"
  464. v-if="filterForm.data.show"
  465. ></el-table-column>
  466. <el-table-column
  467. prop="workprocType"
  468. label="工序类别"
  469. min-width="100px"
  470. :show-overflow-tooltip="true"
  471. v-if="filterForm.data.show"
  472. ></el-table-column>
  473. </el-table>
  474. </el-form>
  475. </div>
  476. </div>
  477. <el-pagination
  478. layout="total, sizes, prev, pager, next, jumper"
  479. :total="total"
  480. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  481. :page-size="pageSize"
  482. :current-page.sync="pageNum"
  483. @size-change="tableSizeChange"
  484. @current-change="getTableData()"
  485. style="text-align: left;margin-top: 10px;"
  486. ></el-pagination>
  487. </div>
  488. </div>
  489. <el-dialog
  490. title="轮次计划-高线 新增"
  491. :visible.sync="dialog.editorBox.show"
  492. width="600px"
  493. :close-on-click-modal="false"
  494. :show-close="!loading"
  495. >
  496. <div>
  497. <el-form
  498. ref="dialog_form"
  499. :model="dialog.editorBox.form.data"
  500. :rules="dialog.editorBox.form.rules"
  501. size="mini"
  502. label-width="95px"
  503. >
  504. <el-row>
  505. <el-col :span="12">
  506. <el-form-item
  507. label="工序"
  508. prop="workprocid"
  509. :rules="dialog.editorBox.form.workprocid"
  510. >
  511. <el-select
  512. filterable clearable
  513. v-model="dialog.editorBox.form.data.workprocid"
  514. placeholder=""
  515. style="width: 100%;"
  516. >
  517. <el-option
  518. v-for="item of nameObj.workprocid.arr"
  519. :key="item.id"
  520. :value="item.id"
  521. :label="item.name"
  522. ></el-option>
  523. </el-select>
  524. </el-form-item>
  525. </el-col>
  526. <el-col :span="12">
  527. <el-form-item
  528. label="月份"
  529. prop="may"
  530. :rules="dialog.editorBox.form.may"
  531. >
  532. <zj-timegran-date
  533. v-model="dialog.editorBox.form.data.may"
  534. style="width: 100%;"
  535. :timegranId="filterForm.data.timegranid"
  536. :oneFoo="getTableData"
  537. ></zj-timegran-date>
  538. </el-form-item>
  539. </el-col>
  540. </el-row>
  541. <el-row>
  542. <el-col :span="12">
  543. <el-form-item
  544. label="轮次描述"
  545. prop="describe"
  546. :rules="dialog.editorBox.form.describe"
  547. >
  548. <el-input
  549. clearable
  550. style="width: 100%;"
  551. v-model="dialog.editorBox.form.data.describe"
  552. >
  553. </el-input>
  554. </el-form-item>
  555. </el-col>
  556. <el-col :span="12">
  557. <el-form-item
  558. label="钢种"
  559. prop="grades"
  560. >
  561. <el-select
  562. filterable clearable
  563. v-model="dialog.editorBox.form.data.grades"
  564. placeholder=""
  565. style="width: 100%;"
  566. :rules="tableFormRules.grades"
  567. >
  568. <el-option
  569. v-for="item of nameObj.grades.arr"
  570. :key="item.id"
  571. :value="item.id"
  572. :label="item.name"
  573. ></el-option>
  574. </el-select>
  575. </el-form-item>
  576. </el-col>
  577. </el-row>
  578. <el-row>
  579. <el-col :span="12">
  580. <el-form-item
  581. label="规格"
  582. prop="specifications"
  583. >
  584. <el-select
  585. filterable clearable
  586. v-model="dialog.editorBox.form.data.specifications"
  587. placeholder=""
  588. style="width: 100%;"
  589. :rules="tableFormRules.specifications"
  590. >
  591. <el-option
  592. v-for="item of nameObj.specifications.arr"
  593. :key="item.id"
  594. :value="item.id"
  595. :label="item.name"
  596. ></el-option>
  597. </el-select>
  598. </el-form-item>
  599. </el-col>
  600. <el-col :span="12">
  601. <el-form-item
  602. label="运输方式"
  603. prop="transportType"
  604. >
  605. <el-select
  606. filterable clearable
  607. v-model="dialog.editorBox.form.data.transportType"
  608. placeholder=""
  609. style="width: 100%;"
  610. :rules="tableFormRules.transportType"
  611. >
  612. <el-option
  613. v-for="item of nameObj.transportType.arr"
  614. :key="item.id"
  615. :value="item.id"
  616. :label="item.name"
  617. ></el-option>
  618. </el-select>
  619. </el-form-item>
  620. </el-col>
  621. </el-row>
  622. <el-row>
  623. <el-col :span="12">
  624. <el-form-item
  625. label="执行标准"
  626. prop="chemicalStandard"
  627. :rules="tableFormRules.chemicalStandard"
  628. >
  629. <el-select
  630. filterable clearable
  631. v-model="dialog.editorBox.form.data.chemicalStandard"
  632. placeholder=""
  633. style="width: 100%;"
  634. :rules="dialog.editorBox.form.chemicalStandard"
  635. >
  636. <el-option
  637. v-for="item of nameObj.chemicalStandard.arr"
  638. :key="item.id"
  639. :value="item.name"
  640. :label="item.name"
  641. ></el-option>
  642. </el-select>
  643. </el-form-item>
  644. </el-col>
  645. <el-col :span="12">
  646. <el-form-item
  647. label="计划量"
  648. prop="planWeight"
  649. :rules="dialog.editorBox.form.planWeight"
  650. >
  651. <el-input
  652. clearable
  653. style="width: 100%;"
  654. v-model="dialog.editorBox.form.data.planWeight"
  655. >
  656. </el-input>
  657. </el-form-item>
  658. </el-col>
  659. </el-row>
  660. <el-row>
  661. <el-col :span="12">
  662. <el-form-item
  663. label="用途"
  664. prop="purpose"
  665. :rules="dialog.editorBox.form.purpose"
  666. >
  667. <el-select
  668. filterable clearable
  669. v-model="dialog.editorBox.form.data.purpose"
  670. placeholder=""
  671. style="width: 100%;"
  672. :rules="dialog.editorBox.form.purpose"
  673. >
  674. <el-option
  675. v-for="item of nameObj.purpose.arr"
  676. :key="item.id"
  677. :value="item.name"
  678. :label="item.name"
  679. ></el-option>
  680. </el-select>
  681. </el-form-item>
  682. </el-col>
  683. </el-row>
  684. </el-form>
  685. </div>
  686. <span
  687. slot="footer"
  688. class="dialog-footer"
  689. >
  690. <el-button
  691. @click="dialog.editorBox.show = false"
  692. :loading="loading"
  693. >取 消</el-button>
  694. <el-button
  695. type="primary"
  696. @click="dataSave"
  697. :loading="loading"
  698. >保 存</el-button>
  699. </span>
  700. </el-dialog>
  701. <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
  702. </div>
  703. </template>
  704. <script>
  705. import { zCheckNumber1 } from '@/utils/validator.js';
  706. import timegranDate from '@/components/zg/timegranDate.vue';
  707. import formulaEditor from '@/components/zg/formulaEditor.vue';
  708. import {formatDate, commonSummaries} from '@/utils/util.js';
  709. export default {
  710. name: 'balanceSheetData',
  711. components: {
  712. 'zj-timegran-date': timegranDate,
  713. 'zj-formulaEditor': formulaEditor
  714. },
  715. data () {
  716. return {
  717. activeMenu: '',
  718. isCheck: false, // 是否为审核人
  719. filterForm: {
  720. show: true,
  721. data: {
  722. id: '',
  723. timegranid: '',
  724. clock: '',
  725. workprocid: '',
  726. workprocType: '',
  727. energyid: '',
  728. propertyid: '',
  729. itemid: '',
  730. itemname: '',
  731. itemdesc: '',
  732. may: '',
  733. canissue: '',
  734. weightMonth: '',
  735. issue: '',
  736. yxf_weight: '',
  737. kxf_weight: '',
  738. describe: '',
  739. state: '',
  740. grades: '',
  741. specifications: '',
  742. lengths: '',
  743. chemicalStandard: '',
  744. surfaceStandard: '',
  745. transportType: '',
  746. parentid: '',
  747. purpose: '',
  748. sqno: '',
  749. show: false
  750. }
  751. },
  752. rules: {
  753. },
  754. pageNum: 1,
  755. pageSize: 20,
  756. total: 0,
  757. rightTableData: [],
  758. singleTableHeight: 100,
  759. leftTableData: [],
  760. leftTableLoading: false,
  761. leftTableWidth: 550,
  762. difference: 0,
  763. rightTableObj: {},
  764. multipleSelection: [],
  765. tableFormDataObj: {},
  766. tableFormRules: {
  767. planWeight: [
  768. { required: true, message: '该项不能为空', trigger: 'change' },
  769. { validator: zCheckNumber1, trigger: 'change' }
  770. ],
  771. grades: [
  772. { required: true, message: '该项不能为空', trigger: 'change' }
  773. ],
  774. specifications: [
  775. { required: true, message: '该项不能为空', trigger: 'change' }
  776. ],
  777. transportType: [
  778. { required: true, message: '该项不能为空', trigger: 'change' }
  779. ],
  780. purpose: [
  781. { required: true, message: '该项不能为空', trigger: 'change' }
  782. ],
  783. chemicalStandard: [
  784. { required: true, message: '该项不能为空', trigger: 'change' }
  785. ]
  786. },
  787. nameObj: {
  788. timegranid: {
  789. obj: {},
  790. arr: []
  791. },
  792. workprocid: {
  793. obj: {
  794. 'AT2005': {
  795. id: 'AT2005',
  796. name: '一高线'
  797. },
  798. 'AT2006': {
  799. id: 'AT2006',
  800. name: '二高线'
  801. }
  802. },
  803. arr: [{
  804. id: 'AT2005',
  805. name: '一高线'
  806. },
  807. {
  808. id: 'AT2006',
  809. name: '二高线'
  810. }]
  811. },
  812. energyid: {
  813. obj: {},
  814. arr: []
  815. },
  816. propertyid: {
  817. obj: {},
  818. arr: []
  819. },
  820. unit: {
  821. obj: {},
  822. arr: []
  823. },
  824. state: {
  825. obj: {
  826. '0': {
  827. name: '已编制',
  828. color: '#7a7a7a'
  829. },
  830. '1': {
  831. name: '已下发',
  832. color: 'rgb(28, 111, 217)'
  833. },
  834. '2': {
  835. name: '已接收',
  836. color: 'red'
  837. },
  838. arr: [
  839. {
  840. id: '0',
  841. name: '已编制'
  842. },
  843. {
  844. id: '1',
  845. name: '已下发'
  846. },
  847. {
  848. id: '2',
  849. name: '已接收'
  850. }
  851. ]
  852. }
  853. },
  854. grades: {
  855. obj: {
  856. '0': {name: 'Q235'},
  857. '1': {name: 'Q195'}
  858. },
  859. arr: [
  860. {
  861. id: '0',
  862. name: 'Q235'
  863. },
  864. {
  865. id: '1',
  866. name: 'Q195'
  867. }
  868. ]
  869. },
  870. specifications: {
  871. obj: {
  872. '0': {name: '6.5'},
  873. '1': {name: '20'}
  874. },
  875. arr: [
  876. {
  877. id: '0',
  878. name: '6.5'
  879. },
  880. {
  881. id: '1',
  882. name: '20'
  883. }
  884. ]
  885. },
  886. transportType: {
  887. obj: {'0': {name: '火运'}, '1': {name: '汽运'}},
  888. arr: [
  889. {
  890. id: '0',
  891. name: '火运'
  892. },
  893. {
  894. id: '1',
  895. name: '汽运'
  896. }
  897. ]
  898. },
  899. chemicalStandard: {
  900. obj: {
  901. '0': {name: 'Q/JXT017-2021'},
  902. '1': {name: 'GB/T 700-2006'},
  903. '2': {name: 'GB/T 701-2008'}
  904. },
  905. arr: [
  906. {
  907. id: '0',
  908. name: 'Q/JXT017-2021'
  909. },
  910. {
  911. id: '1',
  912. name: 'GB/T 700-2006'
  913. },
  914. {
  915. id: '2',
  916. name: 'GB/T 701-2008'
  917. }
  918. ]
  919. },
  920. purpose: {
  921. obj: {
  922. '0': {name: '标准件'},
  923. '1': {name: '铁丝'}
  924. },
  925. arr: [
  926. {
  927. id: '0',
  928. name: '标准件'
  929. },
  930. {
  931. id: '1',
  932. name: '铁丝'
  933. }
  934. ]
  935. }
  936. },
  937. loading: false,
  938. tableLoading: false,
  939. dialog: {
  940. fRow: null,
  941. editorBox: {
  942. show: false,
  943. type: '',
  944. form: {
  945. default: {
  946. workprocid: ''
  947. },
  948. data: {
  949. itemid: '',
  950. materialid: '',
  951. workprocid: '',
  952. unitid: '',
  953. seqno: '',
  954. mes_prodline: '',
  955. code: '',
  956. digits: '',
  957. may: '',
  958. canissue: '',
  959. weightMonth: '',
  960. issue: '',
  961. yxf_weight: '',
  962. kxf_weight: '',
  963. describe: '',
  964. state: '',
  965. grades: '',
  966. specifications: '',
  967. lengths: '',
  968. chemicalStandard: '',
  969. surfaceStandard: '',
  970. transportType: '',
  971. workprocType: '',
  972. purpose: '',
  973. planWeight: ''
  974. },
  975. rules: {
  976. planWeight: [
  977. { required: true, message: '该项不能为空', trigger: 'change' },
  978. { validator: zCheckNumber1, trigger: 'change' }
  979. ],
  980. grades: [
  981. { required: true, message: '该项不能为空', trigger: 'change' }
  982. ],
  983. specifications: [
  984. { required: true, message: '该项不能为空', trigger: 'change' }
  985. ],
  986. transportType: [
  987. { required: true, message: '该项不能为空', trigger: 'change' }
  988. ],
  989. purpose: [
  990. { required: true, message: '该项不能为空', trigger: 'change' }
  991. ],
  992. chemicalStandard: [
  993. { required: true, message: '该项不能为空', trigger: 'change' }
  994. ],
  995. may: [
  996. { required: true, message: '该项不能为空', trigger: 'change' }
  997. ],
  998. workprocid: [
  999. { required: true, message: '该项不能为空', trigger: 'change' }
  1000. ]
  1001. }
  1002. }
  1003. }
  1004. }
  1005. }
  1006. },
  1007. created () {
  1008. this.activeMenu = window.localStorage.getItem('activeMenu');
  1009. },
  1010. mounted () {
  1011. let that = this;
  1012. window.PEDataObj = {
  1013. // 将数据绑定到window上,供main页面使用
  1014. vm: that,
  1015. // tableArr:用于导出成Excel的表格的信息
  1016. tableArr: [
  1017. {
  1018. name: '左表格',
  1019. id: 'singleTable1'
  1020. },
  1021. {
  1022. name: '右表格',
  1023. id: 'singleTable2'
  1024. }
  1025. ]
  1026. };
  1027. that.$nextTick(() => {
  1028. // 立即获取的height有一定偏差,通过setTimeout延迟来解决
  1029. setTimeout(() => {
  1030. that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
  1031. }, 1);
  1032. });
  1033. that.getTimeGranData();
  1034. that.getEnergyIdData();
  1035. that.getPropertyIdData();
  1036. that.getUnitIdData();
  1037. },
  1038. methods: {
  1039. // 计算树区域高度
  1040. getRoleHeight (dom) {
  1041. return window.innerHeight - dom.offsetTop;
  1042. },
  1043. // 自定义的表格合计方法:只给指定列进行合计
  1044. getSummaries (param) {
  1045. const prop = ['kxf_weight', 'weightMonth', 'yxf_weight', 'planWeight']; // 合计列绑定的prop
  1046. return commonSummaries(param, prop);
  1047. },
  1048. // 获取时间粒度(平衡表数据维护)
  1049. getTimeGranData () {
  1050. let that = this
  1051. let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmBalanceValue';
  1052. that.axios.get(url)
  1053. .then(function (res) {
  1054. if (res.code === '0') {
  1055. let arr = [];
  1056. let obj = {};
  1057. for (let item of res.data) {
  1058. arr.push({
  1059. id: item.ID,
  1060. name: item.NAME
  1061. })
  1062. obj[item.ID] = item.NAME;
  1063. that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
  1064. }
  1065. that.nameObj.timegranid.arr = arr;
  1066. that.nameObj.timegranid.obj = obj;
  1067. } else {
  1068. that.$message.error(res.message);
  1069. }
  1070. });
  1071. },
  1072. checkboxT (row, index) {
  1073. if (row.state === '2' && !this.isCheck) {
  1074. return false;
  1075. } else {
  1076. return true;
  1077. }
  1078. },
  1079. // 获取能介(平衡表)
  1080. getEnergyIdData () {
  1081. let that = this
  1082. let url = 'pass/ems/v1/trmenergys/selectNameAndId/?isbalance=1';
  1083. that.axios.get(url)
  1084. .then(function (res) {
  1085. if (res.code === '0') {
  1086. let arr = [];
  1087. let obj = {};
  1088. for (let item of res.data) {
  1089. arr.push({
  1090. id: item.id,
  1091. name: item.name
  1092. })
  1093. obj[item.id] = item.name;
  1094. }
  1095. that.nameObj.energyid.arr = arr;
  1096. that.nameObj.energyid.obj = obj;
  1097. } else {
  1098. that.$message.error(res.message);
  1099. }
  1100. });
  1101. },
  1102. // 获取属性
  1103. getPropertyIdData () {
  1104. let that = this
  1105. let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
  1106. that.axios.get(url)
  1107. .then(function (res) {
  1108. if (res.code === '0') {
  1109. let arr = [];
  1110. let obj = {};
  1111. for (let item of res.data) {
  1112. arr.push({
  1113. id: item.id,
  1114. name: item.name
  1115. })
  1116. obj[item.id] = item.name;
  1117. }
  1118. that.nameObj.propertyid.arr = arr;
  1119. that.nameObj.propertyid.obj = obj;
  1120. } else {
  1121. that.$message.error(res.message);
  1122. }
  1123. });
  1124. },
  1125. // 获取标准计量单位
  1126. getUnitIdData () {
  1127. let that = this
  1128. let url = 'pass/ems/v1/trmunits/getIdAndName';
  1129. that.axios.get(url)
  1130. .then(function (res) {
  1131. if (res.code === '0') {
  1132. let arr = [];
  1133. let obj = {};
  1134. for (let item of res.data) {
  1135. arr.push({
  1136. id: item.id,
  1137. name: item.name
  1138. })
  1139. obj[item.id] = item.name;
  1140. if (item.name === '吨') {
  1141. that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
  1142. }
  1143. }
  1144. that.nameObj.unit.arr = arr;
  1145. that.nameObj.unit.obj = obj;
  1146. } else {
  1147. that.$message.error(res.message);
  1148. }
  1149. });
  1150. },
  1151. // 获取表格中的数据
  1152. getTableData (pageNum) {
  1153. let that = this,
  1154. params = {
  1155. timegranid: that.filterForm.data.timegranid,
  1156. may: that.filterForm.data.clock,
  1157. workprocid: that.filterForm.data.workprocid,
  1158. energyid: that.filterForm.data.energyid,
  1159. propertyid: that.filterForm.data.propertyid,
  1160. itemid: that.filterForm.data.itemid,
  1161. itemname: that.filterForm.data.itemname,
  1162. itemdesc: that.filterForm.data.itemdesc,
  1163. fid: '',
  1164. type: 'gx'
  1165. };
  1166. that.pageNum = pageNum || that.pageNum;
  1167. that.leftTableLoading = true;
  1168. let url = 'pass/ems/v1/emsprodplanmonths/getDates/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
  1169. that.axios.get(url, {
  1170. params: params
  1171. })
  1172. .then(function (res) {
  1173. if (res.code === '0') {
  1174. let arr = [];
  1175. for (let item of res.data.list) {
  1176. arr.push({
  1177. unit: item.unit,
  1178. canissue: item.canissue,
  1179. weightMonth: item.weightMonth,
  1180. issue: item.issue,
  1181. may: item.may,
  1182. workprocid: item.workprocid,
  1183. yxf_weight: item.yxf_weight,
  1184. kxf_weight: item.kxf_weight,
  1185. parentid: item.id,
  1186. id: item.id,
  1187. sqno: item.sqno
  1188. })
  1189. }
  1190. that.leftTableData = arr;
  1191. that.rightTableObj.tableData = [];
  1192. that.dialog.fRow = null;
  1193. that.total = res.data.total;
  1194. } else {
  1195. that.$message.error(res.message);
  1196. }
  1197. that.leftTableLoading = false;
  1198. }).catch(function () {
  1199. that.leftTableLoading = false;
  1200. });
  1201. },
  1202. // 改变表格显示条数
  1203. tableSizeChange (val) {
  1204. let that = this;
  1205. that.pageSize = val;
  1206. that.getTableData(1);
  1207. },
  1208. // 点击查询
  1209. getTableDetailData (row) {
  1210. let that = this;
  1211. let params = {
  1212. parentid: row.id
  1213. };
  1214. that.tableLoading = true;
  1215. let url = 'pass/ems/v1/emsprodplanrounds/';
  1216. that.axios.get(url, {
  1217. params: params
  1218. })
  1219. .then(function (res) {
  1220. if (res.code === '0') {
  1221. let arr = [];
  1222. for (let i = 0; i < res.data.list.length; i++) {
  1223. let item = res.data.list[i];
  1224. arr.push({
  1225. seq: i,
  1226. parentid: item.parentid,
  1227. may: item.may,
  1228. roundid: item.id,
  1229. describe: item.describe,
  1230. state: item.state,
  1231. grades: item.grades,
  1232. planWeight: item.planWeight,
  1233. specifications: item.specifications,
  1234. transportType: item.transportType,
  1235. purpose: item.purpose,
  1236. chemicalStandard: item.chemicalStandard,
  1237. memo: item.memo,
  1238. issuedTime: item.issuedTime,
  1239. createman: item.createman,
  1240. createtime: item.createtime,
  1241. updateman: item.updateman,
  1242. updatetime: item.updatetime,
  1243. sqno: item.sqno,
  1244. workprocType: item.workprocType
  1245. });
  1246. }
  1247. that.rightTableData = arr;
  1248. that.total = res.data.total;
  1249. } else {
  1250. that.$message.error(res.message);
  1251. }
  1252. that.tableLoading = false;
  1253. }).catch(function () {
  1254. that.tableLoading = false;
  1255. });
  1256. },
  1257. getTableDetailDatas () {
  1258. let that = this;
  1259. let params = {
  1260. may: that.filterForm.data.clock,
  1261. workprocType: that.filterForm.data.workprocid ? that.nameObj.workprocid.obj['AT2005'].id : 'AT2005'
  1262. };
  1263. that.tableLoading = true;
  1264. let url = 'pass/ems/v1/emsprodplanrounds/';
  1265. that.axios.get(url, {
  1266. params: params
  1267. })
  1268. .then(function (res) {
  1269. if (res.code === '0') {
  1270. let arr = [];
  1271. for (let i = 0; i < res.data.list.length; i++) {
  1272. let item = res.data.list[i];
  1273. arr.push({
  1274. seq: i,
  1275. parentid: item.parentid,
  1276. may: item.may,
  1277. roundid: item.id,
  1278. describe: item.describe,
  1279. state: item.state,
  1280. grades: item.grades,
  1281. planWeight: item.planWeight,
  1282. specifications: item.specifications,
  1283. transportType: item.transportType,
  1284. purpose: item.purpose,
  1285. chemicalStandard: item.chemicalStandard,
  1286. memo: item.memo,
  1287. issuedTime: item.issuedTime,
  1288. createman: item.createman,
  1289. createtime: item.createtime,
  1290. updateman: item.updateman,
  1291. updatetime: item.updatetime
  1292. });
  1293. }
  1294. that.rightTableData = arr;
  1295. that.total = res.data.total;
  1296. } else {
  1297. that.$message.error(res.message);
  1298. }
  1299. that.tableLoading = false;
  1300. }).catch(function () {
  1301. that.tableLoading = false;
  1302. });
  1303. },
  1304. jsDifference () {
  1305. let that = this;
  1306. let fV = that.dialog.fRow.apportvalue,
  1307. zV = 0;
  1308. let xId = that.dialog.fRow.itemid + '-' + that.dialog.fRow.timegranid + '-' + that.dialog.fRow.clock;
  1309. if (that.tableFormDataObj[xId]) {
  1310. fV = that.tableFormDataObj[xId].apportvalue;
  1311. }
  1312. for (let item of that.rightTableObj.tableData) {
  1313. zV = that.floatComputed(zV, item.apportvalue, '+');
  1314. }
  1315. that.difference = +that.floatComputed(fV, zV, '-').toFixed(3);
  1316. },
  1317. upTableFormDataObj () {
  1318. // 更新右侧表格编辑模式绑定的数据
  1319. let that = this;
  1320. let fRow = that.dialog.fRow;
  1321. if (fRow) {
  1322. if (!fRow.tableFormDataArr || !fRow.isSelection) {
  1323. // 当前选中行被勾选时不更新tableFormDataObj
  1324. fRow.tableFormDataArr = JSON.parse(JSON.stringify(fRow.childrenArr));
  1325. }
  1326. if (fRow.isSelection) {
  1327. that.rightTableObj.tableData = fRow.tableFormDataArr;
  1328. } else {
  1329. that.rightTableObj.tableData = fRow.childrenArr;
  1330. }
  1331. that.jsDifference();
  1332. }
  1333. },
  1334. handleSelectionChange (val) {
  1335. let that = this;
  1336. let rightTableObj = {};
  1337. let arr = [];
  1338. for (let item of val) {
  1339. arr.push(item.seq);
  1340. }
  1341. this.seqArr = arr.sort(sortNumber);
  1342. for (let item of that.rightTableData) {
  1343. item.isSelection = false;
  1344. }
  1345. for (let item of val) {
  1346. let obj = {};
  1347. let xId = item.seq;
  1348. if (that.rightTableObj[xId]) {
  1349. // 如果已存在该数据则使用该数据
  1350. rightTableObj[xId] = that.rightTableObj[xId];
  1351. } else {
  1352. // 负责则从对应行中获取行内原数据
  1353. for (let key in item) {
  1354. obj[key] = item[key];
  1355. }
  1356. item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
  1357. rightTableObj[xId] = obj;
  1358. }
  1359. item.isSelection = true;
  1360. }
  1361. for (let item of that.rightTableData) {
  1362. if (item.isSelection === false) {
  1363. item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
  1364. }
  1365. }
  1366. that.rightTableObj = rightTableObj;
  1367. that.multipleSelection = val;
  1368. },
  1369. but_edit_plural () {
  1370. let that = this;
  1371. if (that.multipleSelection.length > 0) {
  1372. that.$refs['dialog_form_arr_2'].validate((valid) => {
  1373. if (valid) {
  1374. let SubmitData = [];
  1375. for (let key in that.rightTableObj) {
  1376. SubmitData.push({
  1377. parentid: that.rightTableObj[key].parentid,
  1378. may: that.rightTableObj[key].may,
  1379. describe: that.rightTableObj[key].describe,
  1380. state: that.rightTableObj[key].state,
  1381. grades: that.rightTableObj[key].grades,
  1382. planWeight: that.rightTableObj[key].planWeight,
  1383. specifications: that.rightTableObj[key].specifications,
  1384. transportType: that.rightTableObj[key].transportType,
  1385. workprocType: that.rightTableObj[key].workprocType,
  1386. purpose: that.rightTableObj[key].purpose,
  1387. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1388. memo: that.rightTableObj[key].memo,
  1389. id: that.rightTableObj[key].roundid,
  1390. sqno: that.rightTableObj[key].sqno,
  1391. createman: that.rightTableObj[key].createman,
  1392. createtime: that.rightTableObj[key].createtime
  1393. });
  1394. }
  1395. console.log(SubmitData)
  1396. that.loading = true;
  1397. that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
  1398. .then(function (res) {
  1399. if (res.code === '0') {
  1400. that.$message({
  1401. message: '保存成功',
  1402. type: 'success'
  1403. });
  1404. that.getTableDetailDatas();
  1405. that.getTableData();
  1406. } else {
  1407. that.$message.error(res.message);
  1408. }
  1409. that.loading = false;
  1410. }).catch(function () {
  1411. that.loading = false;
  1412. });
  1413. } else {
  1414. }
  1415. });
  1416. } else {
  1417. this.$message.error('至少要选择一条数据');
  1418. }
  1419. },
  1420. issue (sate) {
  1421. let that = this;
  1422. if (that.multipleSelection.length > 0) {
  1423. that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
  1424. if (valid) {
  1425. let SubmitData = [];
  1426. for (let key in that.rightTableObj) {
  1427. SubmitData.push({
  1428. parentid: that.rightTableObj[key].parentid,
  1429. may: that.rightTableObj[key].may,
  1430. roundid: that.rightTableObj[key].roundid,
  1431. describe: that.rightTableObj[key].describe,
  1432. grades: that.rightTableObj[key].grades,
  1433. planWeight: that.rightTableObj[key].planWeight,
  1434. specifications: that.rightTableObj[key].specifications,
  1435. transportType: that.rightTableObj[key].transportType,
  1436. workprocType: that.rightTableObj[key].workprocType,
  1437. purpose: that.rightTableObj[key].purpose,
  1438. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1439. memo: that.rightTableObj[key].memo,
  1440. issuedTime: that.rightTableObj[key].issuedTime,
  1441. createman: that.rightTableObj[key].createman,
  1442. createtime: that.rightTableObj[key].createtime,
  1443. updateman: that.rightTableObj[key].updateman,
  1444. updatetime: that.rightTableObj[key].updatetime,
  1445. id: that.rightTableObj[key].roundid,
  1446. state: that.rightTableObj[key].state,
  1447. sqno: that.rightTableObj[key].sqno,
  1448. isxf: sate
  1449. });
  1450. }
  1451. that.loading = true;
  1452. that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
  1453. contentType: 'application/json'
  1454. })
  1455. .then(function (res) {
  1456. if (res.code === '0') {
  1457. that.$message({
  1458. message: '操作成功',
  1459. type: 'success'
  1460. });
  1461. that.getTableData();
  1462. that.getTableDetailDatas();
  1463. } else {
  1464. that.$message.error(res.message);
  1465. }
  1466. that.loading = false;
  1467. }).catch(function () {
  1468. that.loading = false;
  1469. });
  1470. }
  1471. });
  1472. } else {
  1473. this.$message.error('至少要选择一条数据');
  1474. }
  1475. },
  1476. but_del_plural () {
  1477. let that = this;
  1478. if (that.multipleSelection.length > 0) {
  1479. that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
  1480. if (valid) {
  1481. let SubmitData = [];
  1482. for (let key in that.rightTableObj) {
  1483. SubmitData.push({
  1484. id: that.rightTableObj[key].roundid,
  1485. state: that.rightTableObj[key].state
  1486. });
  1487. }
  1488. console.log(SubmitData)
  1489. that.loading = true;
  1490. that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
  1491. contentType: 'application/json'
  1492. })
  1493. .then(function (res) {
  1494. if (res.code === '0') {
  1495. that.$message({
  1496. message: '删除成功',
  1497. type: 'success'
  1498. });
  1499. that.getTableData();
  1500. that.getTableDetailDatas();
  1501. that.dialog.editorBox.show = false;
  1502. } else {
  1503. that.$message.error(res.message);
  1504. }
  1505. that.loading = false;
  1506. }).catch(function () {
  1507. that.loading = false;
  1508. });
  1509. }
  1510. });
  1511. } else {
  1512. this.$message.error('至少要选择一条数据');
  1513. }
  1514. },
  1515. dataSave () {
  1516. let that = this;
  1517. let SubmitData = {
  1518. may: that.dialog.editorBox.form.data.may,
  1519. describe: that.dialog.editorBox.form.data.describe,
  1520. grades: that.dialog.editorBox.form.data.grades,
  1521. specifications: that.dialog.editorBox.form.data.specifications,
  1522. transportType: that.dialog.editorBox.form.data.transportType,
  1523. chemicalStandard: that.dialog.editorBox.form.data.chemicalStandard,
  1524. workprocType: that.dialog.editorBox.form.data.workprocid,
  1525. planWeight: that.dialog.editorBox.form.data.planWeight,
  1526. purpose: that.dialog.editorBox.form.data.purpose
  1527. };
  1528. console.log(SubmitData)
  1529. that.$refs['dialog_form'].validate((valid) => {
  1530. if (valid) {
  1531. that.loading = true;
  1532. that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
  1533. contentType: 'application/json'
  1534. })
  1535. .then(function (res) {
  1536. if (res.code === '0') {
  1537. that.$message({
  1538. message: '新增成功',
  1539. type: 'success'
  1540. });
  1541. that.getTableData();
  1542. that.dialog.editorBox.show = false;
  1543. } else {
  1544. that.$message.error(res.message);
  1545. }
  1546. that.loading = false;
  1547. }).catch(function () {
  1548. that.loading = false;
  1549. });
  1550. }
  1551. });
  1552. },
  1553. correctvalueUpFoo (row) {
  1554. let that = this;
  1555. // 防止数据为无效值
  1556. if (row.correctvalue === '' || !isFinite(row.correctvalue)) {
  1557. row.correctvalue = 0;
  1558. row.apportvalue = row.actualvalue;
  1559. } else {
  1560. row.apportvalue = that.floatComputed(row.actualvalue, row.correctvalue, '+');
  1561. }
  1562. that.jsDifference();
  1563. },
  1564. apportvalueUpFoo (row) {
  1565. let that = this;
  1566. if (row.apportvalue === '' || !isFinite(row.apportvalue)) {
  1567. row.correctvalue = 0;
  1568. row.apportvalue = row.actualvalue;
  1569. } else {
  1570. row.correctvalue = that.floatComputed(row.apportvalue, row.actualvalue, '-');
  1571. }
  1572. that.jsDifference();
  1573. },
  1574. tableTDMousedown (e) {
  1575. let that = this;
  1576. let nowPageX = e.pageX,
  1577. nowWidth = that.leftTableWidth,
  1578. minWidth = 200,
  1579. maxWidth = window.innerWidth - 200;
  1580. that.$refs.table_box.style.userSelect = 'none';
  1581. that.$refs.table_box.style.cursor = 'col-resize';
  1582. that.$refs.table_box.onmousemove = function (e) {
  1583. let bh = e.pageX - nowPageX;
  1584. if (nowWidth + bh > maxWidth) {
  1585. that.leftTableWidth = maxWidth;
  1586. } else if (nowWidth + bh < minWidth) {
  1587. that.leftTableWidth = minWidth;
  1588. } else {
  1589. that.leftTableWidth = nowWidth + bh;
  1590. }
  1591. }
  1592. that.$refs.table_box.onmouseup = function () {
  1593. that.$refs.table_box.onmousemove = false;
  1594. that.$refs.table_box.onmouseup = false;
  1595. that.$refs.table_box.style.userSelect = '';
  1596. that.$refs.table_box.style.cursor = ''
  1597. }
  1598. },
  1599. // 对proportion的值进行处理,使其符合要求
  1600. proportionFormat (row) {
  1601. let that = this;
  1602. if (row.proportion === '' || !isFinite(row.proportion)) {
  1603. row.proportion = 0;
  1604. }
  1605. },
  1606. // 重新计算,根据自定义的分配比例来自动调整最终值
  1607. againCount () {
  1608. let that = this;
  1609. if (that.multipleSelection.length > 0) {
  1610. for (let item of that.multipleSelection) {
  1611. let xId = item.itemid + '-' + item.timegranid + '-' + item.clock;
  1612. let objItem = that.tableFormDataObj[xId];
  1613. let bl = 0;
  1614. for (let dataObj of item.tableFormDataArr) {
  1615. bl = +that.floatComputed(bl, dataObj.proportion, '+');
  1616. }
  1617. if (bl !== 100) {
  1618. this.$message.error('所有比例之和不为100%,请调整比例后再执行计算。');
  1619. continue;
  1620. }
  1621. let sum = objItem.apportvalue;
  1622. for (let i = 0, ilength = item.tableFormDataArr.length; i < ilength; i++) {
  1623. if (i === (ilength - 1)) {
  1624. item.tableFormDataArr[i].apportvalue = sum;
  1625. } else {
  1626. let z = that.floatComputed(objItem.apportvalue, item.tableFormDataArr[i].proportion, '*');
  1627. item.tableFormDataArr[i].apportvalue = that.floatComputed(z, 100, '/');
  1628. sum = that.floatComputed(sum, item.tableFormDataArr[i].apportvalue, '-');
  1629. }
  1630. item.tableFormDataArr[i].correctvalue = that.floatComputed(item.tableFormDataArr[i].apportvalue, item.tableFormDataArr[i].actualvalue, '-');
  1631. }
  1632. that.jsDifference();
  1633. }
  1634. } else {
  1635. this.$message.error('请勾选一条数据');
  1636. }
  1637. },
  1638. but_add () {
  1639. let that = this;
  1640. that.dialog.editorBox.show = true;
  1641. setTimeout(() => {
  1642. that.$refs['dialog_form'].clearValidate();
  1643. }, 100);
  1644. },
  1645. getChildTable (row, expandedRows) {
  1646. let that = this;
  1647. if (!row.getTable) {
  1648. let params = {
  1649. clock: row.clock,
  1650. energyid: row.energyid
  1651. };
  1652. row.tableLoading = true;
  1653. let url = 'pass/ems/v1/trmbalancevalues/getitem';
  1654. that.axios.get(url, {
  1655. params: params
  1656. })
  1657. .then(function (res) {
  1658. if (res.code === '0') {
  1659. let arr = [];
  1660. for (let item of res.data) {
  1661. arr.push({
  1662. clock: item.CLOCK,
  1663. itemname: item.ITEMNAME,
  1664. timegranid: item.TIMEGRANID,
  1665. apportvalue: item.APPORTVALUE
  1666. })
  1667. }
  1668. console.log(arr)
  1669. row.tableData = arr;
  1670. row.getTable = true;
  1671. } else {
  1672. that.$message.error(res.message);
  1673. }
  1674. row.tableLoading = false;
  1675. }).catch(function () {
  1676. row.tableLoading = false;
  1677. });
  1678. }
  1679. }
  1680. }
  1681. }
  1682. function sortNumber (a, b) {
  1683. return a - b
  1684. }
  1685. </script>
  1686. <style lang="less">
  1687. .balanceSheetData {
  1688. min-width: 700px;
  1689. height: 100%;
  1690. .box {
  1691. height: 100%;
  1692. padding: 15px 15px 0 15px;
  1693. .box-top {
  1694. .el-form-item {
  1695. margin-bottom: 7px;
  1696. }
  1697. .box-top-gjl {
  1698. overflow: hidden;
  1699. // margin-top: -7px;
  1700. padding: 7px 0;
  1701. border-top: 1px solid #ccc;
  1702. // border-bottom: 1px solid #ccc;
  1703. // margin-bottom: 6px;
  1704. }
  1705. }
  1706. .table-box {
  1707. .table-left {
  1708. float: left;
  1709. width: 550px;
  1710. }
  1711. .table-tuodong {
  1712. float: left;
  1713. width: 5px;
  1714. margin: 0 1px 0 1px;
  1715. cursor: col-resize;
  1716. }
  1717. .table-right {
  1718. margin-left: 557px;
  1719. }
  1720. }
  1721. .el-table .el-table__row {
  1722. height: 35px;
  1723. }
  1724. .el-table__body .el-form-item--mini.el-form-item {
  1725. margin: 0px;
  1726. .error {
  1727. overflow: hidden;
  1728. color: #f56c6c;
  1729. font-size: 12px;
  1730. line-height: 1;
  1731. }
  1732. }
  1733. // 隐藏全选按钮
  1734. thead .el-table-column--selection .cell {
  1735. display: none;
  1736. }
  1737. }
  1738. }
  1739. </style>