planProjectRoundXG.vue 95 KB

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