planProjectRoundLG.vue 122 KB

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