planProjectRoundLG.vue 95 KB

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