planProjectRoundGx.vue 98 KB

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