planProjectRoundLG.vue 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135
  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. :type="'daterange'"
  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-input
  25. v-model="filterForm.data.Gmid"
  26. style="width: 100%;"
  27. refcous="true"
  28. ></el-input>
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. </el-form>
  33. <div class="box-top-gjl">
  34. <!-- <el-button
  35. class="button"
  36. type="primary"
  37. size="mini"
  38. icon="el-icon-plus"
  39. v-privilege="activeMenu + 'ADD'"
  40. @click="but_addNBJH()"
  41. >新增内部计划</el-button> -->
  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(1)"
  49. >新增子计划</el-button>
  50. <div style="float:right; text-align: right;">
  51. <el-button
  52. type="danger"
  53. size="mini"
  54. icon="el-icon-add-outline"
  55. @click="edit_plural()"
  56. >强制修改</el-button>
  57. <el-button
  58. type="primary"
  59. size="mini"
  60. icon="el-icon-search"
  61. v-privilege="activeMenu + 'QUERY'"
  62. @click="getTableData(1)"
  63. >查询</el-button>
  64. <el-button
  65. type="primary"
  66. size="mini"
  67. icon="el-icon-add-outline"
  68. @click="but_edit_plural()"
  69. >保存</el-button>
  70. <el-button
  71. type="primary"
  72. size="mini"
  73. icon="el-icon-add-outline"
  74. @click="issue()"
  75. >下发</el-button>
  76. <el-button
  77. type="primary"
  78. size="mini"
  79. icon="el-icon-add-outline"
  80. @click="offissue()"
  81. >取消下发</el-button>
  82. <el-button
  83. class="button"
  84. type="danger"
  85. size="mini"
  86. icon="el-icon-delete"
  87. @click="but_del_plural()"
  88. >删除</el-button>
  89. <el-button
  90. size="mini"
  91. :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
  92. :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
  93. @click="filterForm.show = !filterForm.show;
  94. $nextTick(() => {
  95. singleTableHeight = getRoleHeight($refs['boxBottom']) - 45;
  96. }
  97. );"
  98. >{{ filterForm.show ? '收起' : '展开' }}</el-button>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="box-bottom" ref="boxBottom">
  103. <div class="table-box" ref="table_box">
  104. <div class="table-left" :style="{ width: leftTableWidth + 'px' }">
  105. <el-form
  106. size="mini"
  107. ref="dialog_form_arr_1"
  108. label-width="0px"
  109. :model="tableFormDataObj"
  110. >
  111. <el-table stripe
  112. id="singleTable1"
  113. ref="singleTable1"
  114. :data="leftTableData"
  115. v-loading="leftTableLoading"
  116. style="width: 100%;"
  117. :height="singleTableHeight"
  118. border
  119. size="mini"
  120. highlight-current-row
  121. show-summary
  122. :summary-method="getSummaries"
  123. @current-change="getTableDetailData"
  124. @selection-change="handleSelectionChangeAsleft"
  125. @row-click="openDetails"
  126. >
  127. <!-- <el-table-column
  128. sortable
  129. type="selection"
  130. width="40"
  131. prop="seq"
  132. label="序号"
  133. align="center"
  134. :selectable="checkboxTLeft"
  135. fixed="left"
  136. class-name="cnspicuous"
  137. ></el-table-column> -->
  138. <el-table-column
  139. sortable
  140. prop="id"
  141. label="编号"
  142. align="center"
  143. fixed="left"
  144. width="148px"
  145. :show-overflow-tooltip="true"
  146. ></el-table-column>
  147. <el-table-column
  148. sortable
  149. prop="jhTime"
  150. label="排产日期"
  151. align="center"
  152. width="80px"
  153. :show-overflow-tooltip="true"
  154. ></el-table-column>
  155. <el-table-column
  156. sortable
  157. prop="deliveryDate"
  158. label="交货日期"
  159. align="center"
  160. width="80px"
  161. :show-overflow-tooltip="true"
  162. ></el-table-column>
  163. <el-table-column
  164. sortable
  165. prop="grades"
  166. align="center"
  167. label="钢种"
  168. width="71"
  169. :show-overflow-tooltip="true"
  170. >
  171. </el-table-column>
  172. <el-table-column
  173. sortable
  174. prop="specifications"
  175. label="规格"
  176. align="center"
  177. width="84px"
  178. :show-overflow-tooltip="true"
  179. v-if="filterForm.data.gx!='XG'"
  180. >
  181. </el-table-column>
  182. <el-table-column
  183. sortable
  184. prop="lengths"
  185. align="center"
  186. label="长度"
  187. min-width="72px"
  188. :show-overflow-tooltip="true"
  189. >
  190. </el-table-column>
  191. <el-table-column
  192. sortable
  193. prop="planweight"
  194. align="center"
  195. label="计划量"
  196. width="81px"
  197. :show-overflow-tooltip="true"
  198. >
  199. </el-table-column>
  200. <el-table-column
  201. sortable
  202. align="center"
  203. prop="kxf_weight"
  204. label="可下发量"
  205. min-width="81px"
  206. :show-overflow-tooltip="true"
  207. >
  208. </el-table-column>
  209. <el-table-column
  210. sortable
  211. prop="yxf_weight"
  212. align="center"
  213. label="已下发量"
  214. min-width="81px"
  215. :show-overflow-tooltip="true"
  216. >
  217. </el-table-column>
  218. </el-table>
  219. </el-form>
  220. </div>
  221. <div class="table-tuodong" :style="{ height: singleTableHeight + 'px' }"
  222. @mousedown="tableTDMousedown"
  223. ></div>
  224. <div class="table-right" :style="{ 'margin-left': (leftTableWidth + 7) + 'px' }">
  225. <el-form
  226. size="mini"
  227. ref="dialog_form_arr_2"
  228. label-width="0px"
  229. :model="rightTableObj"
  230. >
  231. <el-table stripe
  232. id="singleTable2"
  233. ref="singleTable2"
  234. :data="rightTableData"
  235. v-loading="tableLoading"
  236. style="width: 100%;"
  237. :height="singleTableHeight"
  238. border
  239. size="mini"
  240. highlight-current-row
  241. show-summary
  242. :summary-method="getSummaries"
  243. :row-class-name="tableRowClassName"
  244. @selection-change="handleSelectionChange"
  245. @cell-click="cellClick"
  246. >
  247. <el-table-column
  248. sortable
  249. type="selection"
  250. width="40"
  251. align="center"
  252. :selectable='checkboxT'
  253. fixed="left"
  254. class-name="cnspicuous"
  255. ></el-table-column>
  256. <el-table-column
  257. sortable
  258. prop="roundid"
  259. label="编号"
  260. align="center"
  261. min-width="151px"
  262. fixed="left"
  263. v-model="filterForm.data.sqno"
  264. :show-overflow-tooltip="true"
  265. ></el-table-column>
  266. <el-table-column
  267. sortable
  268. prop="may"
  269. label="排产日期"
  270. align="center"
  271. min-width="134px"
  272. :show-overflow-tooltip="true"
  273. >
  274. <template slot-scope="scope">
  275. <el-form-item
  276. :prop="scope.row.seq + '.describe'"
  277. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  278. :rules="tableFormRules.describe"
  279. >
  280. <el-date-picker
  281. value-format="yyyy-MM-dd"
  282. type="date"
  283. v-model="rightTableObj[scope.row.seq].may"
  284. placeholder=""
  285. style="width: 100%;"
  286. @keydown.native="keyDown"
  287. ></el-date-picker>
  288. </el-form-item>
  289. <span v-else>{{scope.row.may}}</span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column
  293. sortable
  294. prop="state"
  295. label="状态"
  296. align="center"
  297. min-width="75px"
  298. :show-overflow-tooltip="true"
  299. >
  300. <template slot-scope="scope">
  301. <span
  302. :style="{color: nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].color : ''}"
  303. >{{ nameObj.state.obj[scope.row.state] ? nameObj.state.obj[scope.row.state].name : scope.row.state }}</span>
  304. </template>
  305. </el-table-column>
  306. <el-table-column
  307. sortable
  308. prop="grades"
  309. label="钢种"
  310. align="center"
  311. min-width="126px"
  312. :show-overflow-tooltip="true"
  313. >
  314. <template slot-scope="scope">
  315. <el-form-item
  316. :prop="scope.row.seq + '.grades'"
  317. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  318. :rules="tableFormRules.grades"
  319. >
  320. <el-select
  321. allow-create
  322. filterable
  323. clearable
  324. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  325. v-model="rightTableObj[scope.row.seq].grades"
  326. placeholder=""
  327. >
  328. <el-option
  329. v-for="item of nameObj.grades.arr"
  330. :key="item.id"
  331. :value="item.name"
  332. :label="item.name"
  333. ></el-option>
  334. </el-select>
  335. </el-form-item>
  336. <span v-else>{{ nameObj.grades.obj[scope.row.grades] ? nameObj.grades.obj[scope.row.grades].name : scope.row.grades }}</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column
  340. sortable
  341. prop="specifications"
  342. label="规格"
  343. align="center"
  344. min-width="109px"
  345. :show-overflow-tooltip="true"
  346. >
  347. <template slot-scope="scope">
  348. <el-form-item
  349. :prop="scope.row.seq + '.specifications'"
  350. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  351. :rules="tableFormRules.specifications"
  352. >
  353. <el-select
  354. allow-create
  355. filterable
  356. clearable
  357. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  358. v-model="rightTableObj[scope.row.seq].specifications"
  359. placeholder=""
  360. >
  361. <el-option
  362. v-for="item of nameObj.specifications.arr"
  363. :key="item.id"
  364. :value="item.name"
  365. :label="item.name"
  366. ></el-option>
  367. </el-select>
  368. </el-form-item>
  369. <span v-else>{{ nameObj.specifications.obj[scope.row.specifications] ? nameObj.specifications.obj[scope.row.specifications].name : scope.row.specifications }}</span>
  370. </template>
  371. </el-table-column>
  372. <el-table-column
  373. sortable
  374. prop="lengths"
  375. label="长度"
  376. align="center"
  377. min-width="85px"
  378. :show-overflow-tooltip="true"
  379. >
  380. <template slot-scope="scope">
  381. <el-form-item
  382. :prop="scope.row.seq + '.lengths'"
  383. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  384. :rules="tableFormRules.lengths"
  385. >
  386. <el-input
  387. style="width: 100%;"
  388. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  389. v-model="rightTableObj[scope.row.seq].lengths"
  390. refcous="true"
  391. ></el-input>
  392. </el-form-item>
  393. <span v-else>{{scope.row.lengths}}</span>
  394. </template>
  395. </el-table-column>
  396. <el-table-column
  397. sortable
  398. prop="planWeight"
  399. label="计划量"
  400. align="center"
  401. min-width="75px"
  402. :show-overflow-tooltip="true"
  403. >
  404. <template slot-scope="scope">
  405. <el-form-item
  406. :prop="scope.row.seq + '.planWeight'"
  407. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  408. :rules="tableFormRules.planWeight"
  409. >
  410. <el-input
  411. style="width: 100%;"
  412. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  413. v-model="rightTableObj[scope.row.seq].planWeight"
  414. refcous="true"
  415. ></el-input>
  416. </el-form-item>
  417. <span v-else>{{scope.row.planWeight}}</span>
  418. </template>
  419. </el-table-column>
  420. <el-table-column
  421. sortable
  422. prop="surfaceStandard"
  423. label="表面质量执行标准"
  424. align="center"
  425. min-width="126px"
  426. :show-overflow-tooltip="true"
  427. >
  428. <template slot-scope="scope">
  429. <el-form-item
  430. :prop="scope.row.seq + '.surfaceStandard'"
  431. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  432. >
  433. <el-select
  434. allow-create
  435. filterable
  436. clearable
  437. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  438. v-model="rightTableObj[scope.row.seq].surfaceStandard"
  439. placeholder=""
  440. >
  441. <el-option
  442. v-for="item of nameObj.surfaceStandard.arr"
  443. :key="item.id"
  444. :value="item.name"
  445. :label="item.name"
  446. ></el-option>
  447. </el-select>
  448. </el-form-item>
  449. <span v-else>{{ nameObj.surfaceStandard.obj[scope.row.surfaceStandard] ? nameObj.surfaceStandard.obj[scope.row.surfaceStandard].name : scope.row.surfaceStandard }}</span>
  450. </template>
  451. </el-table-column>
  452. <el-table-column
  453. sortable
  454. prop="chemicalStandard"
  455. label="化学成份执行标准"
  456. align="center"
  457. min-width="126px"
  458. :show-overflow-tooltip="true"
  459. >
  460. <template slot-scope="scope">
  461. <el-form-item
  462. :prop="scope.row.seq + '.chemicalStandard'"
  463. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  464. >
  465. <el-select
  466. allow-create
  467. filterable
  468. clearable
  469. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  470. v-model="rightTableObj[scope.row.seq].chemicalStandard"
  471. placeholder=""
  472. >
  473. <el-option
  474. v-for="item of nameObj.chemicalStandard.arr"
  475. :key="item.id"
  476. :value="item.name"
  477. :label="item.name"
  478. ></el-option>
  479. </el-select>
  480. </el-form-item>
  481. <span v-else>{{ nameObj.chemicalStandard.obj[scope.row.chemicalStandard] ? nameObj.chemicalStandard.obj[scope.row.chemicalStandard].name : scope.row.chemicalStandard }}</span>
  482. </template>
  483. </el-table-column>
  484. <el-table-column
  485. sortable
  486. prop="goinfo"
  487. label="去向"
  488. align="center"
  489. min-width="85px"
  490. :show-overflow-tooltip="true"
  491. >
  492. <template slot-scope="scope">
  493. <el-form-item
  494. :prop="scope.row.seq + '.goinfo'"
  495. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  496. :rules="tableFormRules.goinfo"
  497. >
  498. <el-select
  499. filterable clearable
  500. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  501. v-model="rightTableObj[scope.row.seq].goinfo"
  502. placeholder=""
  503. >
  504. <el-option
  505. v-for="item of nameObj.goinfo.arr"
  506. :key="item.id"
  507. :value="item.id"
  508. :label="item.name"
  509. ></el-option>
  510. </el-select>
  511. </el-form-item>
  512. <span v-else>{{ nameObj.goinfo.obj[scope.row.goinfo] ? nameObj.goinfo.obj[scope.row.goinfo].name : scope.row.goinfo }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. sortable
  517. prop="describe"
  518. label="轮次描述"
  519. align="center"
  520. min-width="146px"
  521. :show-overflow-tooltip="true"
  522. >
  523. <template slot-scope="scope">
  524. <el-form-item
  525. :prop="scope.row.seq + '.describe'"
  526. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  527. :rules="tableFormRules.describe"
  528. >
  529. <el-input
  530. style="width: 100%;"
  531. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  532. v-model="rightTableObj[scope.row.seq].describe"
  533. refcous="true"
  534. ></el-input>
  535. </el-form-item>
  536. <span v-else>{{scope.row.describe}}</span>
  537. </template>
  538. </el-table-column>
  539. <el-table-column
  540. sortable
  541. prop="memo"
  542. label="备注"
  543. align="center"
  544. min-width="100px"
  545. :show-overflow-tooltip="true"
  546. >
  547. <template slot-scope="scope">
  548. <el-form-item
  549. :prop="scope.row.seq + '.memo'"
  550. v-if=" !isCheck && scope.row.isSelection && scope.row.state !== '2'"
  551. :rules="tableFormRules.memo"
  552. >
  553. <el-input
  554. style="width: 100%;"
  555. @keydown.native="keyDown" :id="scope.$index + scope.column.id"
  556. v-model="rightTableObj[scope.row.seq].memo"
  557. refcous="true"
  558. ></el-input>
  559. </el-form-item>
  560. <span v-else>{{scope.row.memo}}</span>
  561. </template>
  562. </el-table-column>
  563. <el-table-column
  564. sortable
  565. prop="issuedTime"
  566. label="下发时间"
  567. align="center"
  568. min-width="130px"
  569. :show-overflow-tooltip="true"
  570. ></el-table-column>
  571. <el-table-column
  572. sortable
  573. prop="createman"
  574. label="创建人"
  575. align="center"
  576. min-width="76px"
  577. :show-overflow-tooltip="true"
  578. ></el-table-column>
  579. <el-table-column
  580. sortable
  581. prop="createtime"
  582. label="创建时间"
  583. min-width="130px"
  584. :show-overflow-tooltip="true"
  585. ></el-table-column>
  586. <el-table-column
  587. sortable
  588. prop="updateman"
  589. label="修改人"
  590. align="center"
  591. min-width="76px"
  592. :show-overflow-tooltip="true"
  593. ></el-table-column>
  594. <el-table-column
  595. sortable
  596. prop="updatetime"
  597. label="修改时间"
  598. align="center"
  599. min-width="130px"
  600. :show-overflow-tooltip="true"
  601. ></el-table-column>
  602. <el-table-column
  603. prop="roundid"
  604. label="轮次序号"
  605. align="center"
  606. min-width="100px"
  607. :show-overflow-tooltip="true"
  608. v-if="filterForm.data.show"
  609. ></el-table-column>
  610. <el-table-column
  611. prop="parentid"
  612. label="月序号"
  613. min-width="100px"
  614. :show-overflow-tooltip="true"
  615. v-if="filterForm.data.show"
  616. ></el-table-column>
  617. <el-table-column
  618. prop="workprocType"
  619. label="工序类别"
  620. min-width="100px"
  621. :show-overflow-tooltip="true"
  622. v-if="filterForm.data.show"
  623. ></el-table-column>
  624. </el-table>
  625. </el-form>
  626. </div>
  627. </div>
  628. <el-row>
  629. <el-col :span="10">
  630. <el-pagination
  631. layout="total, sizes, prev, pager, next, jumper"
  632. :total="total1"
  633. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  634. :page-size="pageSize1"
  635. :current-page.sync="pageNum1"
  636. @size-change="LftetableSizeChange"
  637. @current-change="getTableData"
  638. style="text-align: left;margin-top: 10px;"
  639. ></el-pagination>
  640. </el-col>
  641. <el-col :span="14">
  642. <el-pagination
  643. layout="total, sizes, prev, pager, next, jumper"
  644. :total="total"
  645. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  646. :page-size="pageSize"
  647. :current-page.sync="pageNum"
  648. @size-change="tableSizeChange"
  649. @current-change="getTableDetailDatas()"
  650. style="text-align: right;margin-top: 10px;"
  651. ></el-pagination>
  652. </el-col>
  653. </el-row>
  654. </div>
  655. </div>
  656. <el-dialog
  657. title="内部计划 新增"
  658. :visible.sync="dialog.editorBox.show"
  659. width="600px"
  660. :close-on-click-modal="false"
  661. :show-close="!loading"
  662. >
  663. <div>
  664. <el-form
  665. ref="dialog_form"
  666. :model="dialog.editorBox.form.data"
  667. :rules="dialog.editorBox.form.rules"
  668. size="mini"
  669. label-width="95px"
  670. >
  671. <el-row>
  672. <el-col :span="12">
  673. <el-form-item
  674. label="排产日期"
  675. prop="may"
  676. :rules="dialog.editorBox.form.may"
  677. >
  678. <zj-timegran-date
  679. v-model="dialog.editorBox.form.data.may"
  680. style="width: 100%;"
  681. :timegranId="'DAY'"
  682. :oneFoo="getTableData"
  683. ></zj-timegran-date>
  684. </el-form-item>
  685. </el-col>
  686. <el-col :span="12">
  687. <el-form-item
  688. label="计划量"
  689. >
  690. <el-input
  691. clearable
  692. style="width: 100%;"
  693. v-model="dialog.editorBox.form.data.planWeight"
  694. >
  695. </el-input>
  696. </el-form-item>
  697. </el-col>
  698. </el-row>
  699. </el-form>
  700. </div>
  701. <span
  702. slot="footer"
  703. class="dialog-footer"
  704. >
  705. <el-button
  706. @click="dialog.editorBox.show = false"
  707. :loading="loading"
  708. >取 消</el-button>
  709. <el-button
  710. type="primary"
  711. @click="dataSave"
  712. :loading="loading"
  713. >保 存</el-button>
  714. </span>
  715. </el-dialog>
  716. <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
  717. </div>
  718. </template>
  719. <script>
  720. import { zCheckNumber1 } from '@/utils/validator.js';
  721. import timegranDate from '@/components/zg/timegranDate.vue';
  722. import formulaEditor from '@/components/zg/formulaEditor.vue';
  723. import {formatDate, commonSummaries} from '@/utils/util.js';
  724. export default {
  725. name: 'balanceSheetData',
  726. components: {
  727. 'zj-timegran-date': timegranDate,
  728. 'zj-formulaEditor': formulaEditor
  729. },
  730. data () {
  731. return {
  732. activeMenu: '',
  733. isCheck: false, // 是否为审核人
  734. rowIndex: '',
  735. columnId: '',
  736. focusTarget: null,
  737. seqArr: [],
  738. filterForm: {
  739. show: true,
  740. data: {
  741. id: '',
  742. Gmid: '',
  743. clock: '',
  744. workprocid: '',
  745. workprocType: '',
  746. workproc_type: '',
  747. may: '',
  748. canissue: '',
  749. weightMonth: '',
  750. issue: '',
  751. yxf_weight: '',
  752. kxf_weight: '',
  753. describe: '',
  754. state: '',
  755. grades: '',
  756. specifications: '',
  757. lengths: '',
  758. chemicalStandard: '',
  759. surfaceStandard: '',
  760. transportType: '',
  761. parentid: '',
  762. purpose: '',
  763. sqno: '',
  764. show: false,
  765. goinfo: ''
  766. }
  767. },
  768. rules: {
  769. },
  770. pageNum: 1,
  771. pageSize: 20,
  772. pageNum1: 1,
  773. pageSize1: 20,
  774. total: 0,
  775. total1: 0,
  776. singleTableHeight: 100,
  777. leftTableData: [],
  778. leftTableLoading: false,
  779. leftTableWidth: 550,
  780. difference: 0,
  781. rightTableData: [],
  782. rightTableObj: {
  783. },
  784. leftData: {
  785. },
  786. multipleSelection: [],
  787. multipleSelectionAscLeft: [],
  788. tableFormDataObj: {},
  789. tableFormRules: {
  790. planWeight: [
  791. { required: true, message: '该项不能为空', trigger: 'change' },
  792. { validator: zCheckNumber1, trigger: 'change' }
  793. ],
  794. grades: [
  795. { required: true, message: '该项不能为空', trigger: 'change' }
  796. ],
  797. specifications: [
  798. { required: true, message: '该项不能为空', trigger: 'change' }
  799. ],
  800. transportType: [
  801. { required: true, message: '该项不能为空', trigger: 'change' }
  802. ],
  803. purpose: [
  804. { required: true, message: '该项不能为空', trigger: 'change' }
  805. ]
  806. // chemicalStandard: [
  807. // { required: true, message: '该项不能为空', trigger: 'change' }
  808. // ]
  809. },
  810. nameObj: {
  811. timegranid: {
  812. obj: {},
  813. arr: []
  814. },
  815. energyid: {
  816. obj: {},
  817. arr: []
  818. },
  819. propertyid: {
  820. obj: {},
  821. arr: []
  822. },
  823. unit: {
  824. obj: {},
  825. arr: []
  826. },
  827. state: {
  828. obj: {
  829. '0': {
  830. name: '已编制',
  831. color: '#7a7a7a'
  832. },
  833. '1': {
  834. name: '已下发',
  835. color: 'rgb(28, 111, 217)'
  836. },
  837. '2': {
  838. name: '已接收',
  839. color: 'red'
  840. },
  841. arr: [
  842. {
  843. id: '0',
  844. name: '已编制'
  845. },
  846. {
  847. id: '1',
  848. name: '已下发'
  849. },
  850. {
  851. id: '2',
  852. name: '已接收'
  853. }
  854. ]
  855. }
  856. },
  857. grades: {
  858. obj: {},
  859. arr: []
  860. },
  861. specifications: {
  862. obj: {},
  863. arr: []
  864. },
  865. surfaceStandard: {
  866. obj: {},
  867. arr: []
  868. },
  869. goinfo: {
  870. obj: {
  871. '1036WM1': {
  872. id: '1036WM1',
  873. name: '外卖'
  874. },
  875. '1036XG1': {
  876. id: '1036XG1',
  877. name: '型钢厂'
  878. },
  879. '1036GX1': {
  880. id: '1036GX1',
  881. name: '高线一'
  882. },
  883. '1036GX2': {
  884. id: '1036GX2',
  885. name: '高线二'
  886. },
  887. '1036LG1': {
  888. id: '1036LG1',
  889. name: '炼钢厂'
  890. }
  891. },
  892. arr: [{
  893. id: '1036WM1',
  894. name: '外卖'
  895. },
  896. {
  897. id: '1036XG1',
  898. name: '型钢厂'
  899. },
  900. {
  901. id: '1036GX1',
  902. name: '高线一'
  903. },
  904. {
  905. id: '1036GX2',
  906. name: '高线二'
  907. },
  908. {
  909. id: '1036LG1',
  910. name: '炼钢厂'
  911. }
  912. ]
  913. },
  914. chemicalStandard: {
  915. obj: {},
  916. arr: []
  917. },
  918. purpose: {
  919. obj: {
  920. '0': {name: '标准件'},
  921. '1': {name: '铁丝'}
  922. },
  923. arr: [
  924. {
  925. id: '0',
  926. name: '标准件'
  927. },
  928. {
  929. id: '1',
  930. name: '铁丝'
  931. }
  932. ]
  933. }
  934. },
  935. loading: false,
  936. tableLoading: false,
  937. dialog: {
  938. fRow: null,
  939. editorBox: {
  940. show: false,
  941. type: '',
  942. form: {
  943. default: {
  944. workprocid: ''
  945. },
  946. data: {
  947. itemid: '',
  948. materialid: '',
  949. workprocid: '',
  950. unitid: '',
  951. seqno: '',
  952. mes_prodline: '',
  953. code: '',
  954. digits: '',
  955. may: '',
  956. canissue: '',
  957. weightMonth: '',
  958. issue: '',
  959. yxf_weight: '',
  960. kxf_weight: '',
  961. describe: '',
  962. state: '',
  963. grades: '',
  964. specifications: '',
  965. lengths: '',
  966. chemicalStandard: '',
  967. surfaceStandard: '',
  968. transportType: '',
  969. workprocType: '',
  970. purpose: '',
  971. planWeight: ''
  972. },
  973. rules: {
  974. planWeight: [
  975. { required: true, message: '该项不能为空', trigger: 'change' },
  976. { validator: zCheckNumber1, trigger: 'change' }
  977. ],
  978. grades: [
  979. { required: true, message: '该项不能为空', trigger: 'change' }
  980. ],
  981. specifications: [
  982. { required: true, message: '该项不能为空', trigger: 'change' }
  983. ],
  984. transportType: [
  985. { required: true, message: '该项不能为空', trigger: 'change' }
  986. ],
  987. purpose: [
  988. { required: true, message: '该项不能为空', trigger: 'change' }
  989. ],
  990. chemicalStandard: [
  991. { required: true, message: '该项不能为空', trigger: 'change' }
  992. ],
  993. may: [
  994. { required: true, message: '该项不能为空', trigger: 'change' }
  995. ],
  996. workprocid: [
  997. { required: true, message: '该项不能为空', trigger: 'change' }
  998. ]
  999. }
  1000. }
  1001. }
  1002. }
  1003. }
  1004. },
  1005. created () {
  1006. this.activeMenu = window.localStorage.getItem('activeMenu');
  1007. },
  1008. mounted () {
  1009. let that = this;
  1010. window.PEDataObj = {
  1011. // 将数据绑定到window上,供main页面使用
  1012. vm: that,
  1013. // tableArr:用于导出成Excel的表格的信息
  1014. tableArr: [
  1015. {
  1016. name: '左表格',
  1017. id: 'singleTable1'
  1018. },
  1019. {
  1020. name: '右表格',
  1021. id: 'singleTable2'
  1022. }
  1023. ]
  1024. };
  1025. // 接收路由参数
  1026. if (that.$route.query.workproc_type) {
  1027. that.filterForm.data.workproc_type = that.$route.query.workproc_type;
  1028. }
  1029. that.$nextTick(() => {
  1030. // 立即获取的height有一定偏差,通过setTimeout延迟来解决
  1031. setTimeout(() => {
  1032. that.singleTableHeight = that.getRoleHeight(that.$refs['boxBottom']) - 45;
  1033. }, 1);
  1034. });
  1035. that.getTimeGranData();
  1036. that.getEnergyIdData();
  1037. that.getPropertyIdData();
  1038. that.getGrades();
  1039. that.getSpecifications();
  1040. that.getStandards();
  1041. that.getUnitIdData();
  1042. that.getsurfaceStandard();
  1043. },
  1044. methods: {
  1045. // 计算树区域高度
  1046. getRoleHeight (dom) {
  1047. return window.innerHeight - dom.offsetTop;
  1048. },
  1049. // 自定义的表格合计方法:只给指定列进行合计
  1050. getSummaries (param) {
  1051. const prop = ['kxf_weight', 'planweight', 'yxf_weight', 'planWeight']; // 合计列绑定的prop
  1052. return commonSummaries(param, prop);
  1053. },
  1054. // 获取时间粒度(平衡表数据维护)
  1055. getTimeGranData () {
  1056. let that = this
  1057. let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmBalanceValue';
  1058. that.axios.get(url)
  1059. .then(function (res) {
  1060. if (res.code === '0') {
  1061. let arr = [];
  1062. let obj = {};
  1063. for (let item of res.data) {
  1064. arr.push({
  1065. id: item.ID,
  1066. name: item.NAME
  1067. })
  1068. obj[item.ID] = item.NAME;
  1069. that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
  1070. }
  1071. that.nameObj.timegranid.arr = arr;
  1072. that.nameObj.timegranid.obj = obj;
  1073. } else {
  1074. that.$message.error(res.message);
  1075. }
  1076. });
  1077. },
  1078. checkboxT (row, index) {
  1079. if (row.state === '2' && !this.isCheck) {
  1080. return false;
  1081. } else {
  1082. return true;
  1083. }
  1084. },
  1085. checkboxTLeft (row, index) {
  1086. return true;
  1087. },
  1088. // 获取能介(平衡表)
  1089. getEnergyIdData () {
  1090. let that = this
  1091. let url = 'pass/ems/v1/trmenergys/selectNameAndId/?isbalance=1';
  1092. that.axios.get(url)
  1093. .then(function (res) {
  1094. if (res.code === '0') {
  1095. let arr = [];
  1096. let obj = {};
  1097. for (let item of res.data) {
  1098. arr.push({
  1099. id: item.id,
  1100. name: item.name
  1101. })
  1102. obj[item.id] = item.name;
  1103. }
  1104. that.nameObj.energyid.arr = arr;
  1105. that.nameObj.energyid.obj = obj;
  1106. } else {
  1107. that.$message.error(res.message);
  1108. }
  1109. });
  1110. },
  1111. // 获取属性
  1112. getPropertyIdData () {
  1113. let that = this
  1114. let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
  1115. that.axios.get(url)
  1116. .then(function (res) {
  1117. if (res.code === '0') {
  1118. let arr = [];
  1119. let obj = {};
  1120. for (let item of res.data) {
  1121. arr.push({
  1122. id: item.id,
  1123. name: item.name
  1124. })
  1125. obj[item.id] = item.name;
  1126. }
  1127. that.nameObj.propertyid.arr = arr;
  1128. that.nameObj.propertyid.obj = obj;
  1129. } else {
  1130. that.$message.error(res.message);
  1131. }
  1132. });
  1133. },
  1134. // 获取标准计量单位
  1135. getUnitIdData () {
  1136. let that = this
  1137. let url = 'pass/ems/v1/trmunits/getIdAndName';
  1138. that.axios.get(url)
  1139. .then(function (res) {
  1140. if (res.code === '0') {
  1141. let arr = [];
  1142. let obj = {};
  1143. for (let item of res.data) {
  1144. arr.push({
  1145. id: item.id,
  1146. name: item.name
  1147. })
  1148. obj[item.id] = item.name;
  1149. if (item.name === '吨') {
  1150. that.nameObj.unit.defaults = that.nameObj.unit.defaults ? that.nameObj.unit.defaults : item.id;
  1151. }
  1152. }
  1153. that.nameObj.unit.arr = arr;
  1154. that.nameObj.unit.obj = obj;
  1155. } else {
  1156. that.$message.error(res.message);
  1157. }
  1158. });
  1159. },
  1160. // 获取表格中的数据
  1161. getTableData (pageNum1) {
  1162. let that = this,
  1163. params = {
  1164. workprocType: that.filterForm.data.workproc_type,
  1165. startTime: that.filterForm.data.clock[0],
  1166. endTime: that.filterForm.data.clock[1],
  1167. id: that.filterForm.data.Gmid
  1168. };
  1169. that.pageNum1 = pageNum1 || that.pageNum1;
  1170. that.leftTableLoading = true;
  1171. let url = 'pass/ems/v1/emsgmpcjhs/getGmDates/?pageNum=' + that.pageNum1 + '&pageSize=' + that.pageSize1;
  1172. that.axios.get(url, {
  1173. params: params
  1174. })
  1175. .then(function (res) {
  1176. if (res.code === '0') {
  1177. let arr = [];
  1178. for (let i = 0; i < res.data.list.length; i++) {
  1179. let item = res.data.list[i];
  1180. arr.push({
  1181. seq: i,
  1182. id: item.ID,
  1183. jhTime: item.JHTIME,
  1184. state: item.STATE,
  1185. grades: item.GRADES,
  1186. specifications: item.SPECIFICATIONS,
  1187. lengths: item.LENGTHS,
  1188. chemicalStandard: item.CHEMICALSTANDARD,
  1189. surfaceStandard: item.SURFACESTANDARD,
  1190. workprocType: item.WORKPROCTYPE,
  1191. iateralarea: item.IATERALAREA,
  1192. lengthtimeswidth: item.LENGTHTIMESWIDTH,
  1193. transportType: item.TRANSPORTTYPE,
  1194. receivetime: item.RECEIVETIME,
  1195. createman: item.CREATEMAN,
  1196. createtime: item.CREATETIME,
  1197. updateman: item.UPDATEMAN,
  1198. purpose: item.PURPOSE,
  1199. updatetime: item.UPDATETIME,
  1200. memo: item.MEMO,
  1201. planweight: item.PLANWEIGHT,
  1202. deliveryDate: item.DELIVERYDATE,
  1203. dimension: item.DIMENSION,
  1204. kxf_weight: item.PLANWEIGHT - item.YXF_WEIGHT,
  1205. yxf_weight: item.YXF_WEIGHT
  1206. })
  1207. }
  1208. that.leftTableData = arr;
  1209. that.total1 = res.data.total;
  1210. that.dialog.fRow = null;
  1211. } else {
  1212. that.$message.error(res.message);
  1213. }
  1214. that.leftTableLoading = false;
  1215. }).catch(function () {
  1216. that.leftTableLoading = false;
  1217. });
  1218. },
  1219. // 改变表格显示条数
  1220. tableSizeChange (val) {
  1221. let that = this;
  1222. that.pageSize = val;
  1223. that.getTableDetailDatas(1);
  1224. },
  1225. LftetableSizeChange (val) {
  1226. let that = this;
  1227. that.pageSize1 = val;
  1228. that.getTableData(1);
  1229. },
  1230. // 点击查询
  1231. getTableDetailData (row) {
  1232. let that = this;
  1233. if (row) {
  1234. that.tableLoading = true;
  1235. let url = 'pass/ems/v1/emsprodplanrounds/';
  1236. that.axios.get(url, {
  1237. params: {parentid: row.id}
  1238. })
  1239. .then(function (res) {
  1240. if (res.code === '0') {
  1241. let arr = [];
  1242. for (let i = 0; i < res.data.list.length; i++) {
  1243. let item = res.data.list[i];
  1244. arr.push({
  1245. seq: i,
  1246. parentid: item.parentid,
  1247. may: item.may,
  1248. roundid: item.id,
  1249. describe: item.describe,
  1250. state: item.state,
  1251. grades: item.grades,
  1252. planWeight: item.planWeight,
  1253. specifications: item.specifications,
  1254. transportType: item.transportType,
  1255. purpose: item.purpose,
  1256. chemicalStandard: item.chemicalStandard,
  1257. memo: item.memo,
  1258. issuedTime: item.issuedTime,
  1259. createman: item.createman,
  1260. createtime: item.createtime,
  1261. updateman: item.updateman,
  1262. updatetime: item.updatetime,
  1263. sqno: item.sqno,
  1264. workprocType: item.workprocType,
  1265. lengths: item.lengths,
  1266. surfaceStandard: item.surfaceStandard,
  1267. goinfo: item.goinfo
  1268. });
  1269. }
  1270. that.rightTableData = arr;
  1271. that.total = res.data.total;
  1272. } else {
  1273. that.$message.error(res.message);
  1274. }
  1275. that.tableLoading = false;
  1276. }).catch(function () {
  1277. that.tableLoading = false;
  1278. });
  1279. }
  1280. },
  1281. getTableDetailDatas (pageNum, type) {
  1282. let that = this;
  1283. let params = {};
  1284. if (type === 'Add') {
  1285. params = {
  1286. parentid: that.leftData.id
  1287. };
  1288. } else {
  1289. params = {
  1290. parentid: that.rightTableData[0].parentid,
  1291. workprocType: that.filterForm.data.workproc_type
  1292. };
  1293. }
  1294. that.pageNum = pageNum || that.pageNum;
  1295. that.tableLoading = true;
  1296. let url = 'pass/ems/v1/emsprodplanrounds/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
  1297. that.axios.get(url, {
  1298. params: params
  1299. })
  1300. .then(function (res) {
  1301. if (res.code === '0') {
  1302. let arr = [];
  1303. for (let i = 0; i < res.data.list.length; i++) {
  1304. let item = res.data.list[i];
  1305. arr.push({
  1306. seq: i,
  1307. parentid: item.parentid,
  1308. may: item.may,
  1309. roundid: item.id,
  1310. describe: item.describe,
  1311. state: item.state,
  1312. grades: item.grades,
  1313. planWeight: item.planWeight,
  1314. specifications: item.specifications,
  1315. purpose: item.purpose,
  1316. chemicalStandard: item.chemicalStandard,
  1317. memo: item.memo,
  1318. issuedTime: item.issuedTime,
  1319. createman: item.createman,
  1320. createtime: item.createtime,
  1321. updateman: item.updateman,
  1322. sqno: item.sqno,
  1323. updatetime: item.updatetime,
  1324. workprocType: item.workprocType,
  1325. lengths: item.lengths,
  1326. surfaceStandard: item.surfaceStandard,
  1327. goinfo: item.goinfo
  1328. });
  1329. }
  1330. that.rightTableData = arr;
  1331. that.total = res.data.total;
  1332. } else {
  1333. that.$message.error(res.message);
  1334. }
  1335. that.tableLoading = false;
  1336. }).catch(function () {
  1337. that.tableLoading = false;
  1338. });
  1339. },
  1340. jsDifference () {
  1341. let that = this;
  1342. let fV = that.dialog.fRow.apportvalue,
  1343. zV = 0;
  1344. let xId = that.dialog.fRow.itemid + '-' + that.dialog.fRow.timegranid + '-' + that.dialog.fRow.clock;
  1345. if (that.tableFormDataObj[xId]) {
  1346. fV = that.tableFormDataObj[xId].apportvalue;
  1347. }
  1348. for (let item of that.rightTableObj.tableData) {
  1349. zV = that.floatComputed(zV, item.apportvalue, '+');
  1350. }
  1351. that.difference = +that.floatComputed(fV, zV, '-').toFixed(3);
  1352. },
  1353. upTableFormDataObj () {
  1354. // 更新右侧表格编辑模式绑定的数据
  1355. let that = this;
  1356. let fRow = that.dialog.fRow;
  1357. if (fRow) {
  1358. if (!fRow.tableFormDataArr || !fRow.isSelection) {
  1359. // 当前选中行被勾选时不更新tableFormDataObj
  1360. fRow.tableFormDataArr = JSON.parse(JSON.stringify(fRow.childrenArr));
  1361. }
  1362. if (fRow.isSelection) {
  1363. that.rightTableObj.tableData = fRow.tableFormDataArr;
  1364. } else {
  1365. that.rightTableObj.tableData = fRow.childrenArr;
  1366. }
  1367. that.jsDifference();
  1368. }
  1369. },
  1370. // 左边菜单选中
  1371. handleSelectionChangeAsleft (val) {
  1372. let that = this;
  1373. let tableFormDataObj = {};
  1374. let arr = [];
  1375. for (let item of val) {
  1376. arr.push(item.seq);
  1377. }
  1378. this.seqArr = arr.sort(sortNumber);
  1379. for (let item of that.leftTableData) {
  1380. item.isSelection = false;
  1381. }
  1382. for (let item of val) {
  1383. let obj = {};
  1384. let xId = item.seq;
  1385. if (that.tableFormDataObj[xId]) {
  1386. // 如果已存在该数据则使用该数据
  1387. tableFormDataObj[xId] = that.tableFormDataObj[xId];
  1388. } else {
  1389. // 负责则从对应行中获取行内原数据
  1390. for (let key in item) {
  1391. obj[key] = item[key];
  1392. }
  1393. tableFormDataObj[xId] = obj;
  1394. }
  1395. item.isSelection = true;
  1396. }
  1397. that.tableFormDataObj = tableFormDataObj;
  1398. that.multipleSelectionAscLeft = val;
  1399. },
  1400. // 右边菜单选中
  1401. handleSelectionChange (val) {
  1402. let that = this;
  1403. let rightTableObj = {};
  1404. let arr = [];
  1405. for (let item of val) {
  1406. arr.push(item.seq);
  1407. }
  1408. this.seqArr = arr.sort(sortNumber);
  1409. for (let item of that.rightTableData) {
  1410. item.isSelection = false;
  1411. }
  1412. for (let item of val) {
  1413. let obj = {};
  1414. let xId = item.seq;
  1415. if (that.rightTableObj[xId]) {
  1416. // 如果已存在该数据则使用该数据
  1417. rightTableObj[xId] = that.rightTableObj[xId];
  1418. } else {
  1419. // 负责则从对应行中获取行内原数据
  1420. for (let key in item) {
  1421. obj[key] = item[key];
  1422. }
  1423. item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
  1424. rightTableObj[xId] = obj;
  1425. }
  1426. item.isSelection = true;
  1427. }
  1428. for (let item of that.rightTableData) {
  1429. if (item.isSelection === false) {
  1430. item.realvalue = (!isNaN(Number(item.apportvalue)) && !isNaN(Number(item.wastage))) ? Number(item.apportvalue) + Number(item.wastage) - Number(item.secondVal) : item.realvalue;
  1431. }
  1432. }
  1433. that.rightTableObj = rightTableObj;
  1434. that.multipleSelection = val;
  1435. },
  1436. but_edit_plural () {
  1437. let that = this;
  1438. if (that.multipleSelection.length > 0) {
  1439. that.$refs['dialog_form_arr_2'].validate((valid) => {
  1440. if (valid) {
  1441. let SubmitData = [];
  1442. for (let key in that.rightTableObj) {
  1443. SubmitData.push({
  1444. parentid: that.rightTableObj[key].parentid,
  1445. may: that.rightTableObj[key].may,
  1446. describe: that.rightTableObj[key].describe,
  1447. state: that.rightTableObj[key].state,
  1448. grades: that.rightTableObj[key].grades,
  1449. planWeight: that.rightTableObj[key].planWeight,
  1450. specifications: that.rightTableObj[key].specifications,
  1451. transportType: that.rightTableObj[key].transportType,
  1452. workprocType: that.rightTableObj[key].workprocType,
  1453. purpose: that.rightTableObj[key].purpose,
  1454. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1455. memo: that.rightTableObj[key].memo,
  1456. id: that.rightTableObj[key].roundid,
  1457. sqno: that.rightTableObj[key].sqno,
  1458. createman: that.rightTableObj[key].createman,
  1459. createtime: that.rightTableObj[key].createtime,
  1460. lengths: that.rightTableObj[key].lengths,
  1461. surfaceStandard: that.rightTableObj[key].surfaceStandard,
  1462. goinfo: that.rightTableObj[key].goinfo
  1463. });
  1464. }
  1465. that.loading = true;
  1466. that.axios.put('pass/ems/v1/emsprodplanrounds/batchUpdate', SubmitData)
  1467. .then(function (res) {
  1468. if (res.code === '0') {
  1469. that.$message({
  1470. message: '保存成功',
  1471. type: 'success'
  1472. });
  1473. that.getTableDetailDatas();
  1474. that.getStandards();
  1475. that.getsurfaceStandard();
  1476. } else {
  1477. that.$message.error(res.message);
  1478. }
  1479. that.loading = false;
  1480. }).catch(function () {
  1481. that.loading = false;
  1482. });
  1483. } else {
  1484. }
  1485. });
  1486. } else {
  1487. this.$message.error('至少要选择一条数据');
  1488. }
  1489. },
  1490. edit_plural () {
  1491. let that = this;
  1492. if (that.multipleSelection.length > 0) {
  1493. let SubmitData = [];
  1494. for (let key in that.rightTableObj) {
  1495. SubmitData.push({
  1496. parentid: that.rightTableObj[key].parentid,
  1497. may: that.rightTableObj[key].may,
  1498. describe: that.rightTableObj[key].describe,
  1499. state: that.rightTableObj[key].state,
  1500. grades: that.rightTableObj[key].grades,
  1501. planWeight: that.rightTableObj[key].planWeight,
  1502. specifications: that.rightTableObj[key].specifications,
  1503. transportType: that.rightTableObj[key].transportType,
  1504. workprocType: that.rightTableObj[key].workprocType,
  1505. purpose: that.rightTableObj[key].purpose,
  1506. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1507. memo: that.rightTableObj[key].memo,
  1508. id: that.rightTableObj[key].roundid,
  1509. sqno: that.rightTableObj[key].sqno,
  1510. createman: that.rightTableObj[key].createman,
  1511. createtime: that.rightTableObj[key].createtime,
  1512. lengths: that.rightTableObj[key].lengths,
  1513. surfaceStandard: that.rightTableObj[key].surfaceStandard,
  1514. goinfo: that.rightTableObj[key].goinfo
  1515. });
  1516. }
  1517. that.loading = true;
  1518. that.$confirm('确定要强制修改数据吗?', '提示', {
  1519. confirmButtonText: '确定',
  1520. cancelButtonText: '取消',
  1521. state: 'warning'
  1522. }).then(() => {
  1523. that.axios.put('pass/ems/v1/emsprodplanrounds/ForcedUpdate', SubmitData)
  1524. .then(function (res) {
  1525. if (res.code === '0') {
  1526. that.$message({
  1527. message: '保存成功',
  1528. type: 'success'
  1529. });
  1530. that.getTableDetailDatas(1, null);
  1531. } else {
  1532. that.$message.error(res.message);
  1533. }
  1534. that.loading = false;
  1535. }).catch(function () {
  1536. that.loading = false;
  1537. });
  1538. });
  1539. } else {
  1540. this.$message.error('至少要选择一条数据');
  1541. }
  1542. },
  1543. getGrades () {
  1544. let that = this
  1545. let url = 'pass/product/v1/emsvqcmbasesteel/getBase'
  1546. that.axios.get(url)
  1547. .then(function (res) {
  1548. if (res.code === '0') {
  1549. let arr = [];
  1550. let obj = {};
  1551. for (let item of res.data) {
  1552. arr.push({
  1553. id: item.id,
  1554. name: item.name
  1555. })
  1556. obj[item.id] = {
  1557. name: item.name,
  1558. id: item.id
  1559. }
  1560. }
  1561. that.nameObj.grades.arr = arr;
  1562. that.nameObj.grades.obj = obj;
  1563. } else {
  1564. that.$message.error(res.message);
  1565. }
  1566. });
  1567. },
  1568. getSpecifications () {
  1569. let that = this
  1570. let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
  1571. that.axios.get(url)
  1572. .then(function (res) {
  1573. if (res.code === '0') {
  1574. let arr = [];
  1575. let obj = {};
  1576. for (let item of res.data) {
  1577. arr.push({
  1578. id: item.id,
  1579. name: item.name
  1580. })
  1581. obj[item.id] = {
  1582. name: item.name,
  1583. id: item.id
  1584. }
  1585. }
  1586. that.nameObj.specifications.arr = arr;
  1587. that.nameObj.specifications.obj = obj;
  1588. } else {
  1589. that.$message.error(res.message);
  1590. }
  1591. });
  1592. },
  1593. getStandards () {
  1594. let that = this
  1595. let url = 'pass/ems/v1/emsprodplanrounds/getstdchem';
  1596. that.axios.get(url)
  1597. .then(function (res) {
  1598. if (res.code === '0') {
  1599. let arr = [];
  1600. let obj = {};
  1601. for (let item of res.data) {
  1602. arr.push({
  1603. id: item.id,
  1604. name: item.chemicalStandard
  1605. })
  1606. }
  1607. that.nameObj.chemicalStandard.arr = arr;
  1608. that.nameObj.chemicalStandard.obj = obj;
  1609. } else {
  1610. that.$message.error(res.message);
  1611. }
  1612. });
  1613. },
  1614. // 获取表面质量标准
  1615. getsurfaceStandard () {
  1616. let that = this
  1617. let url = 'pass/ems/v1/emsprodplanrounds/getsurfaceStandard';
  1618. that.axios.get(url)
  1619. .then(function (res) {
  1620. if (res.code === '0') {
  1621. let arr = [];
  1622. let obj = {};
  1623. for (let item of res.data) {
  1624. arr.push({
  1625. id: item.id,
  1626. name: item.surfaceStandard
  1627. })
  1628. }
  1629. that.nameObj.surfaceStandard.arr = arr;
  1630. that.nameObj.surfaceStandard.obj = obj;
  1631. console.log(that.nameObj.surfaceStandard);
  1632. } else {
  1633. that.$message.error(res.message);
  1634. }
  1635. });
  1636. },
  1637. issue () {
  1638. let that = this;
  1639. if (that.multipleSelection.length > 0) {
  1640. that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
  1641. if (valid) {
  1642. let SubmitData = [];
  1643. for (let key in that.rightTableObj) {
  1644. SubmitData.push({
  1645. parentid: that.rightTableObj[key].parentid,
  1646. may: that.rightTableObj[key].may,
  1647. roundid: that.rightTableObj[key].roundid,
  1648. describe: that.rightTableObj[key].describe,
  1649. grades: that.rightTableObj[key].grades,
  1650. planWeight: that.rightTableObj[key].planWeight,
  1651. specifications: that.rightTableObj[key].specifications,
  1652. transportType: that.rightTableObj[key].transportType,
  1653. workprocType: that.rightTableObj[key].workprocType,
  1654. purpose: that.rightTableObj[key].purpose,
  1655. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1656. memo: that.rightTableObj[key].memo,
  1657. issuedTime: that.rightTableObj[key].issuedTime,
  1658. createman: that.rightTableObj[key].createman,
  1659. createtime: that.rightTableObj[key].createtime,
  1660. updateman: that.rightTableObj[key].updateman,
  1661. updatetime: that.rightTableObj[key].updatetime,
  1662. id: that.rightTableObj[key].roundid,
  1663. state: that.rightTableObj[key].state,
  1664. sqno: that.rightTableObj[key].sqno,
  1665. lengths: that.rightTableObj[key].lengths,
  1666. surfaceStandard: that.rightTableObj[key].surfaceStandard,
  1667. goinfo: that.rightTableObj[key].goinfo
  1668. });
  1669. }
  1670. that.loading = true;
  1671. that.axios.post('pass/ems/v1/emsprodplanrounds/issue', SubmitData, {
  1672. contentType: 'application/json'
  1673. })
  1674. .then(function (res) {
  1675. if (res.code === '0') {
  1676. that.$message({
  1677. message: '操作成功',
  1678. type: 'success'
  1679. });
  1680. that.getTableData();
  1681. that.getTableDetailDatas();
  1682. } else {
  1683. that.$message.error(res.message);
  1684. }
  1685. that.loading = false;
  1686. }).catch(function () {
  1687. that.loading = false;
  1688. });
  1689. }
  1690. });
  1691. } else {
  1692. this.$message.error('至少要选择一条数据');
  1693. }
  1694. },
  1695. offissue () {
  1696. let that = this;
  1697. if (that.multipleSelection.length > 0) {
  1698. that.$refs['dialog_form_arr_2'].validate((valid, obj) => {
  1699. if (valid) {
  1700. let SubmitData = [];
  1701. for (let key in that.rightTableObj) {
  1702. SubmitData.push({
  1703. parentid: that.rightTableObj[key].parentid,
  1704. may: that.rightTableObj[key].may,
  1705. roundid: that.rightTableObj[key].roundid,
  1706. describe: that.rightTableObj[key].describe,
  1707. grades: that.rightTableObj[key].grades,
  1708. planWeight: that.rightTableObj[key].planWeight,
  1709. specifications: that.rightTableObj[key].specifications,
  1710. transportType: that.rightTableObj[key].transportType,
  1711. workprocType: that.rightTableObj[key].workprocType,
  1712. purpose: that.rightTableObj[key].purpose,
  1713. chemicalStandard: that.rightTableObj[key].chemicalStandard,
  1714. memo: that.rightTableObj[key].memo,
  1715. issuedTime: that.rightTableObj[key].issuedTime,
  1716. createman: that.rightTableObj[key].createman,
  1717. createtime: that.rightTableObj[key].createtime,
  1718. updateman: that.rightTableObj[key].updateman,
  1719. updatetime: that.rightTableObj[key].updatetime,
  1720. id: that.rightTableObj[key].roundid,
  1721. state: that.rightTableObj[key].state,
  1722. sqno: that.rightTableObj[key].sqno,
  1723. lengths: that.rightTableObj[key].lengths,
  1724. surfaceStandard: that.rightTableObj[key].surfaceStandard,
  1725. goinfo: that.rightTableObj[key].goinfo
  1726. });
  1727. }
  1728. that.loading = true;
  1729. that.axios.post('pass/ems/v1/emsprodplanrounds/offissue', SubmitData, {
  1730. contentType: 'application/json'
  1731. })
  1732. .then(function (res) {
  1733. if (res.code === '0') {
  1734. that.$message({
  1735. message: '操作成功',
  1736. type: 'success'
  1737. });
  1738. that.getTableData();
  1739. that.getTableDetailDatas();
  1740. } else {
  1741. that.$message.error(res.message);
  1742. }
  1743. that.loading = false;
  1744. }).catch(function () {
  1745. that.loading = false;
  1746. });
  1747. }
  1748. });
  1749. } else {
  1750. this.$message.error('至少要选择一条数据');
  1751. }
  1752. },
  1753. but_del_plural () {
  1754. let that = this;
  1755. if (that.multipleSelection.length > 0) {
  1756. let SubmitData = [];
  1757. for (let key in that.rightTableObj) {
  1758. SubmitData.push({
  1759. id: that.rightTableObj[key].roundid,
  1760. state: that.rightTableObj[key].state,
  1761. parentid: that.rightTableObj[key].parentid
  1762. });
  1763. }
  1764. that.$confirm('是否删除已选数据?', '提示', {
  1765. confirmButtonText: '确定',
  1766. cancelButtonText: '取消',
  1767. state: 'warning'
  1768. }).then(() => {
  1769. that.axios.post('pass/ems/v1/emsprodplanrounds/delete', SubmitData, {
  1770. contentType: 'application/json'
  1771. })
  1772. .then(function (res) {
  1773. if (res.code === '0') {
  1774. that.$message({
  1775. message: '删除成功',
  1776. type: 'success'
  1777. });
  1778. that.getTableDetailDatas(1, null);
  1779. that.getTableData();
  1780. that.dialog.editorBox.show = false;
  1781. } else {
  1782. that.$message.error(res.message);
  1783. }
  1784. that.loading = false;
  1785. }).catch(function () {
  1786. that.loading = false;
  1787. });
  1788. });
  1789. } else {
  1790. this.$message.error('至少要选择一条数据');
  1791. }
  1792. },
  1793. dataSave () {
  1794. let that = this;
  1795. let SubmitData = {
  1796. jhTime: that.dialog.editorBox.form.data.may,
  1797. planWeight: that.dialog.editorBox.form.data.planWeight,
  1798. workprocType: that.filterForm.data.workproc_type
  1799. };
  1800. that.$refs['dialog_form'].validate((valid) => {
  1801. if (valid) {
  1802. that.loading = true;
  1803. that.axios.post('pass/ems/v1/emsgmpcjhs/addNbJH', SubmitData, {
  1804. contentType: 'application/json'
  1805. })
  1806. .then(function (res) {
  1807. if (res.code === '0') {
  1808. that.$message({
  1809. message: '新增成功',
  1810. type: 'success'
  1811. });
  1812. that.dialog.editorBox.show = false;
  1813. that.getTableData();
  1814. } else {
  1815. that.$message.error(res.message);
  1816. }
  1817. that.loading = false;
  1818. }).catch(function () {
  1819. that.loading = false;
  1820. });
  1821. }
  1822. });
  1823. },
  1824. correctvalueUpFoo (row) {
  1825. let that = this;
  1826. // 防止数据为无效值
  1827. if (row.correctvalue === '' || !isFinite(row.correctvalue)) {
  1828. row.correctvalue = 0;
  1829. row.apportvalue = row.actualvalue;
  1830. } else {
  1831. row.apportvalue = that.floatComputed(row.actualvalue, row.correctvalue, '+');
  1832. }
  1833. that.jsDifference();
  1834. },
  1835. apportvalueUpFoo (row) {
  1836. let that = this;
  1837. if (row.apportvalue === '' || !isFinite(row.apportvalue)) {
  1838. row.correctvalue = 0;
  1839. row.apportvalue = row.actualvalue;
  1840. } else {
  1841. row.correctvalue = that.floatComputed(row.apportvalue, row.actualvalue, '-');
  1842. }
  1843. that.jsDifference();
  1844. },
  1845. tableTDMousedown (e) {
  1846. let that = this;
  1847. let nowPageX = e.pageX,
  1848. nowWidth = that.leftTableWidth,
  1849. minWidth = 200,
  1850. maxWidth = window.innerWidth - 200;
  1851. that.$refs.table_box.style.userSelect = 'none';
  1852. that.$refs.table_box.style.cursor = 'col-resize';
  1853. that.$refs.table_box.onmousemove = function (e) {
  1854. let bh = e.pageX - nowPageX;
  1855. if (nowWidth + bh > maxWidth) {
  1856. that.leftTableWidth = maxWidth;
  1857. } else if (nowWidth + bh < minWidth) {
  1858. that.leftTableWidth = minWidth;
  1859. } else {
  1860. that.leftTableWidth = nowWidth + bh;
  1861. }
  1862. }
  1863. that.$refs.table_box.onmouseup = function () {
  1864. that.$refs.table_box.onmousemove = false;
  1865. that.$refs.table_box.onmouseup = false;
  1866. that.$refs.table_box.style.userSelect = '';
  1867. that.$refs.table_box.style.cursor = ''
  1868. }
  1869. },
  1870. // 对proportion的值进行处理,使其符合要求
  1871. proportionFormat (row) {
  1872. let that = this;
  1873. if (row.proportion === '' || !isFinite(row.proportion)) {
  1874. row.proportion = 0;
  1875. }
  1876. },
  1877. // 重新计算,根据自定义的分配比例来自动调整最终值
  1878. againCount () {
  1879. let that = this;
  1880. if (that.multipleSelection.length > 0) {
  1881. for (let item of that.multipleSelection) {
  1882. let xId = item.itemid + '-' + item.timegranid + '-' + item.clock;
  1883. let objItem = that.tableFormDataObj[xId];
  1884. let bl = 0;
  1885. for (let dataObj of item.tableFormDataArr) {
  1886. bl = +that.floatComputed(bl, dataObj.proportion, '+');
  1887. }
  1888. if (bl !== 100) {
  1889. this.$message.error('所有比例之和不为100%,请调整比例后再执行计算。');
  1890. continue;
  1891. }
  1892. let sum = objItem.apportvalue;
  1893. for (let i = 0, ilength = item.tableFormDataArr.length; i < ilength; i++) {
  1894. if (i === (ilength - 1)) {
  1895. item.tableFormDataArr[i].apportvalue = sum;
  1896. } else {
  1897. let z = that.floatComputed(objItem.apportvalue, item.tableFormDataArr[i].proportion, '*');
  1898. item.tableFormDataArr[i].apportvalue = that.floatComputed(z, 100, '/');
  1899. sum = that.floatComputed(sum, item.tableFormDataArr[i].apportvalue, '-');
  1900. }
  1901. item.tableFormDataArr[i].correctvalue = that.floatComputed(item.tableFormDataArr[i].apportvalue, item.tableFormDataArr[i].actualvalue, '-');
  1902. }
  1903. that.jsDifference();
  1904. }
  1905. } else {
  1906. this.$message.error('请勾选一条数据');
  1907. }
  1908. },
  1909. but_add (type) {
  1910. let that = this;
  1911. let SubmitData = [];
  1912. SubmitData.push({
  1913. parentid: that.leftData.id,
  1914. may: that.leftData.jhTime,
  1915. describe: that.leftData.describe,
  1916. state: that.leftData.state,
  1917. grades: that.leftData.grades,
  1918. specifications: that.leftData.specifications,
  1919. workprocType: that.leftData.workprocType,
  1920. purpose: that.leftData.purpose,
  1921. chemicalStandard: that.leftData.chemicalStandard,
  1922. memo: that.leftData.memo,
  1923. createMan: that.leftData.createman,
  1924. createTime: that.leftData.createtime,
  1925. deliveryDate: that.leftData.deliveryDate,
  1926. lengths: that.leftData.lengths,
  1927. goinfo: that.leftData.id.substring(0, 1) === 'G' ? '1036WM1' : null,
  1928. surfaceStandard: that.leftData.surfaceStandard,
  1929. type: type
  1930. })
  1931. that.loading = true;
  1932. that.axios.post('pass/ems/v1/emsprodplanrounds/', SubmitData, {
  1933. contentType: 'application/json'
  1934. })
  1935. .then(function (res) {
  1936. if (res.code === '0') {
  1937. that.$message({
  1938. message: '新增成功',
  1939. type: 'success'
  1940. });
  1941. that.dialog.editorBox.show = false;
  1942. that.getTableDetailDatas(1, 'Add');
  1943. } else {
  1944. that.$message.error(res.message);
  1945. }
  1946. that.loading = false;
  1947. }).catch(function () {
  1948. that.loading = false;
  1949. });
  1950. },
  1951. // 用于检索字符串
  1952. getGoinfo (str) {
  1953. let ID = str.substring(0, 1);
  1954. if (ID === 'G') {
  1955. return true;
  1956. }
  1957. return null;
  1958. },
  1959. but_addNBJH () {
  1960. let that = this;
  1961. that.dialog.editorBox.form.data.planWeight = '';
  1962. that.dialog.editorBox.show = true;
  1963. setTimeout(() => {
  1964. that.$refs['dialog_form'].clearValidate();
  1965. }, 100);
  1966. },
  1967. getChildTable (row, expandedRows) {
  1968. let that = this;
  1969. if (!row.getTable) {
  1970. let params = {
  1971. clock: row.clock,
  1972. energyid: row.energyid
  1973. };
  1974. row.tableLoading = true;
  1975. let url = 'pass/ems/v1/trmbalancevalues/getitem';
  1976. that.axios.get(url, {
  1977. params: params
  1978. })
  1979. .then(function (res) {
  1980. if (res.code === '0') {
  1981. let arr = [];
  1982. for (let item of res.data) {
  1983. arr.push({
  1984. clock: item.CLOCK,
  1985. itemname: item.ITEMNAME,
  1986. timegranid: item.TIMEGRANID,
  1987. apportvalue: item.APPORTVALUE
  1988. })
  1989. }
  1990. row.tableData = arr;
  1991. row.getTable = true;
  1992. } else {
  1993. that.$message.error(res.message);
  1994. }
  1995. row.tableLoading = false;
  1996. }).catch(function () {
  1997. row.tableLoading = false;
  1998. });
  1999. }
  2000. },
  2001. keyDown (event1, disabledFlag) {
  2002. let tdTarget = event1.target;
  2003. let _this = this;
  2004. while (tdTarget.tagName !== 'TD') {
  2005. tdTarget = tdTarget.parentElement;
  2006. }
  2007. // 如果按下键盘下键或者回车键
  2008. if (event.keyCode === 40 || event.keyCode === 13) {
  2009. let index = parseInt(this.rowIndex);
  2010. // index++;
  2011. if (index !== this.seqArr[this.seqArr.length - 1]) {
  2012. for (let i = 0; i < this.seqArr.length; i++) {
  2013. if (index === this.seqArr[i]) {
  2014. index = this.seqArr[i + 1];
  2015. break;
  2016. }
  2017. }
  2018. }
  2019. this.editSetFlag = index + this.columnId;
  2020. let id = '#' + this.editSetFlag;
  2021. this.$nextTick(() => {
  2022. $(id).click();
  2023. });
  2024. console.log('下键')
  2025. } else if (event.keyCode === 38) { // 键盘上键
  2026. let index = parseInt(this.rowIndex);
  2027. if (index !== this.seqArr[0]) {
  2028. for (let i = 0; i < this.seqArr.length; i++) {
  2029. if (index === this.seqArr[i]) {
  2030. index = this.seqArr[i - 1];
  2031. break;
  2032. }
  2033. }
  2034. }
  2035. console.log('上键')
  2036. this.editSetFlag = index + this.columnId;
  2037. let id = '#' + this.editSetFlag;
  2038. this.$nextTick(() => {
  2039. $(id).click();
  2040. });
  2041. } else if (event.keyCode === 37) { // 键盘左键
  2042. console.log('左键')
  2043. $(tdTarget).prevAll().find('input:text').last().click();
  2044. } else if (event.keyCode === 39) { // 键盘右键
  2045. $(tdTarget).nextAll().find('input').eq(0).click();
  2046. console.log('右键')
  2047. }
  2048. },
  2049. cellClick (row, column, cell, event) {
  2050. let _this = this;
  2051. this.rowIndex = row.index;
  2052. this.columnId = column.id;
  2053. _this.editSetFlag = row.index + column.id;
  2054. _this.focusTarget = event.target;
  2055. while (_this.focusTarget.tagName !== 'TD') {
  2056. _this.focusTarget = _this.focusTarget.parentElement;
  2057. }
  2058. _this.$nextTick(() => {
  2059. let target = this.focusTarget;
  2060. $(target).find('input').focus();
  2061. });
  2062. },
  2063. tableRowClassName ({row, rowIndex}) {
  2064. // 把每一行的索引放进row
  2065. row.index = rowIndex;
  2066. },
  2067. openDetails (row) {
  2068. let that = this;
  2069. that.leftData = row;
  2070. }
  2071. }
  2072. }
  2073. function sortNumber (a, b) {
  2074. return a - b
  2075. }
  2076. </script>
  2077. <style lang="less">
  2078. .balanceSheetData {
  2079. min-width: 700px;
  2080. height: 100%;
  2081. .box {
  2082. height: 100%;
  2083. padding: 15px 15px 0 15px;
  2084. .box-top {
  2085. .el-form-item {
  2086. margin-bottom: 7px;
  2087. }
  2088. .box-top-gjl {
  2089. overflow: hidden;
  2090. // margin-top: -7px;
  2091. padding: 7px 0;
  2092. border-top: 1px solid #ccc;
  2093. // border-bottom: 1px solid #ccc;
  2094. // margin-bottom: 6px;
  2095. }
  2096. }
  2097. .table-box {
  2098. .table-left {
  2099. float: left;
  2100. width: 550px;
  2101. }
  2102. .table-tuodong {
  2103. float: left;
  2104. width: 5px;
  2105. margin: 0 1px 0 1px;
  2106. cursor: col-resize;
  2107. }
  2108. .table-right {
  2109. margin-left: 557px;
  2110. }
  2111. }
  2112. .el-table .el-table__row {
  2113. height: 35px;
  2114. }
  2115. .el-table__body .el-form-item--mini.el-form-item {
  2116. margin: 0px;
  2117. .error {
  2118. overflow: hidden;
  2119. color: #f56c6c;
  2120. font-size: 12px;
  2121. line-height: 1;
  2122. }
  2123. }
  2124. // 隐藏全选按钮
  2125. thead .el-table-column--selection .cell {
  2126. display: none;
  2127. }
  2128. }
  2129. }
  2130. </style>