planProjectRoundGx.vue 95 KB

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