planProjectRoundXG.vue 106 KB

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