planProjectRoundXG.vue 103 KB

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