workingProcedure.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="visible"
  6. :title="title"
  7. append-to-body
  8. :close-on-click-modal="false"
  9. width="85%"
  10. :maxable="true"
  11. >
  12. <el-card shadow="never">
  13. <header-title title="物品信息"></header-title>
  14. <el-form
  15. label-width="100px"
  16. ref="form"
  17. :model="rowData"
  18. class="item-height"
  19. >
  20. <el-row>
  21. <el-col :span="6" label-width="100px">
  22. <el-form-item label="名称" prop="name">
  23. <el-input
  24. disabled
  25. placeholder="物品名称"
  26. v-model="treeData.name"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6" label-width="100px">
  31. <el-form-item label="编码" prop="categoryCode">
  32. <el-input
  33. disabled
  34. placeholder="物品编码"
  35. v-model="treeData.categoryCode"
  36. ></el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="6" label-width="100px">
  40. <el-form-item label="型号" prop="modelType">
  41. <el-input
  42. disabled
  43. placeholder="物品型号"
  44. v-model="treeData.modelType"
  45. ></el-input>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6" label-width="100px">
  49. <el-form-item label="规格" prop="specification">
  50. <el-input
  51. disabled
  52. placeholder="物品规格"
  53. v-model="treeData.specification"
  54. ></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6" label-width="100px">
  58. <el-form-item label="bom编码" prop="code">
  59. <el-input
  60. disabled
  61. placeholder="物品规格"
  62. v-model="treeData.code"
  63. ></el-input>
  64. </el-form-item>
  65. </el-col>
  66. </el-row>
  67. </el-form>
  68. <header-title title="工序信息"></header-title>
  69. <el-form label-width="100px" ref="form" :model="rowData">
  70. <el-row>
  71. <el-col :span="6" label-width="100px">
  72. <el-form-item label="编码" prop="type">
  73. <el-input
  74. disabled
  75. placeholder="工序编码"
  76. v-model="rowData.code"
  77. ></el-input>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="6" label-width="100px">
  81. <el-form-item label="工序名称" prop="type">
  82. <el-input
  83. disabled
  84. placeholder="工序名称"
  85. v-model="rowData.name"
  86. ></el-input>
  87. </el-form-item>
  88. </el-col>
  89. <!-- <el-col :span="6" label-width="100px">
  90. <el-form-item label="名称" prop="type">
  91. <el-input
  92. disabled
  93. placeholder="物品名称"
  94. v-model="rowData.name"
  95. ></el-input>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="6" label-width="100px">
  99. <el-form-item label="物品编码" prop="type">
  100. <el-input
  101. disabled
  102. placeholder="工序名称"
  103. v-model="rowData.name"
  104. ></el-input>
  105. </el-form-item>
  106. </el-col> -->
  107. </el-row>
  108. </el-form>
  109. <el-tabs
  110. v-model="activeName"
  111. class="tab-box"
  112. type="border-card"
  113. @tab-click="tabsChange"
  114. >
  115. <el-tab-pane label="工艺参数" name="工艺参数">
  116. <ele-pro-table
  117. ref="table"
  118. :datasource="datasource"
  119. :immediate="true"
  120. :need-page="false"
  121. :columns="columns"
  122. >
  123. <!-- 表头工具栏 -->
  124. <template v-if="!isView" v-slot:toolbar>
  125. <el-button
  126. size="small"
  127. icon="el-icon-plus"
  128. class="ele-btn-icon"
  129. type="primary"
  130. @click.native="openParam('工艺')"
  131. >添加参数</el-button
  132. >
  133. </template>
  134. <template v-slot:sort="{ row }">
  135. <div v-if="isView">{{ row.sort }}</div>
  136. <el-input v-else v-model="row.sort"></el-input>
  137. </template>
  138. <!-- 默认值 -->
  139. <template v-slot:defaultValue="{ row }">
  140. <div v-if="isView">
  141. {{ row.defaultValue }}
  142. </div>
  143. <div v-else>
  144. <el-input
  145. v-if="
  146. row.textType == 1 ||
  147. row.textType == 4 ||
  148. row.textType == 3 ||
  149. row.textType == 5
  150. "
  151. v-model="row.defaultValue"
  152. placeholder="请输入"
  153. ></el-input>
  154. <el-select
  155. v-if="row.textType == 2"
  156. v-model="row.defaultValue"
  157. placeholder="请选择"
  158. >
  159. <el-option label="TRUE" :value="'TRUE'" />
  160. <el-option label="FALSE" :value="'FALSE'" />
  161. </el-select>
  162. </div>
  163. </template>
  164. <!-- 上限 -->
  165. <template v-slot:maxValue="{ row }">
  166. <div v-if="isView">
  167. {{ row.maxValue }}
  168. </div>
  169. <div v-else>
  170. <el-input
  171. v-if="row.textType == 3"
  172. v-model="row.maxValue"
  173. placeholder="请输入"
  174. ></el-input>
  175. </div>
  176. </template>
  177. <!-- 下限 -->
  178. <template v-slot:minValue="{ row }">
  179. <div v-if="isView">
  180. {{ row.minValue }}
  181. </div>
  182. <div v-else>
  183. <el-input
  184. v-if="row.textType == 3"
  185. v-model="row.minValue"
  186. placeholder="请输入"
  187. ></el-input>
  188. </div>
  189. </template>
  190. <!-- 单位 -->
  191. <template v-slot:unitName="{ row }">
  192. <div v-if="isView">
  193. {{ row.unitName }}
  194. </div>
  195. <div v-else>
  196. <DictSelection
  197. v-if="row.textType != 2 && row.textType != 5"
  198. dictName="工艺参数单位"
  199. clearable
  200. filterable
  201. v-model="row.unitName"
  202. >
  203. </DictSelection>
  204. <span v-if="row.textType == 5"> h(小时)</span>
  205. </div>
  206. </template>
  207. <!-- 操作列 -->
  208. <template v-slot:action="{ row }">
  209. <el-popconfirm
  210. class="ele-action"
  211. title="确定要删除当前参数吗?"
  212. @confirm="remove(row, '工艺')"
  213. >
  214. <template v-slot:reference>
  215. <el-link
  216. type="danger"
  217. :underline="false"
  218. icon="el-icon-delete"
  219. >
  220. 删除
  221. </el-link>
  222. </template>
  223. </el-popconfirm>
  224. </template>
  225. </ele-pro-table>
  226. </el-tab-pane>
  227. <el-tab-pane label="质检项参数" name="质检项参数">
  228. <term
  229. :qualityParam="qualityParam"
  230. :isView="isView"
  231. :isQualityInspection="false"
  232. ref="qualityParamRef"
  233. ></term>
  234. </el-tab-pane>
  235. <el-tab-pane label="生产节拍" name="生产节拍">
  236. <el-form
  237. label-width="140px"
  238. ref="form"
  239. :model="beatParam"
  240. style="width: 800px; margin: auto"
  241. >
  242. <el-row>
  243. <el-col :span="16" label-width="100px">
  244. <el-form-item label="节拍生产数量" prop="beatNum">
  245. <el-input
  246. v-if="!isView"
  247. placeholder=""
  248. v-model="beatParam.beatNum"
  249. maxlength="9"
  250. ></el-input>
  251. <div v-else>{{ beatParam.beatNum }}</div>
  252. </el-form-item>
  253. </el-col>
  254. <el-col :span="8" label-width="100px">
  255. <el-form-item label="单位:" prop="unit">
  256. <el-select
  257. v-if="!isView"
  258. v-model="beatParam.unit"
  259. filterable
  260. class="ele-block"
  261. @change="changeUnit"
  262. >
  263. <el-option
  264. v-for="item in dictList"
  265. :key="item.value"
  266. :value="item.value"
  267. :label="item.label"
  268. ></el-option>
  269. </el-select>
  270. <div v-else>{{ beatParam.unit }}</div>
  271. </el-form-item>
  272. </el-col>
  273. </el-row>
  274. <el-row>
  275. <el-col :span="16" label-width="100px">
  276. <el-form-item label="生产时长" prop="newBeatTime">
  277. <el-input
  278. v-if="!isView"
  279. placeholder=""
  280. v-model="beatParam.newBeatTime"
  281. @blur="convertVal(beatParam.newBeatTime, 'beatTime')"
  282. maxlength="9"
  283. oninput="value = value.replace(/[^\d.]/g, '')"
  284. ></el-input>
  285. <div v-else>{{ beatParam.newBeatTime }}</div>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="8" label-width="100px">
  289. <el-form-item label="单位:" prop="">
  290. <div>{{ beatParam.unit }}</div>
  291. </el-form-item>
  292. </el-col>
  293. </el-row>
  294. <el-row>
  295. <el-col :span="16" label-width="100px">
  296. <el-form-item label="准备时长" prop="newBeatPrepareTime">
  297. <el-input
  298. v-if="!isView"
  299. placeholder=""
  300. v-model="beatParam.newBeatPrepareTime"
  301. @blur="
  302. convertVal(
  303. beatParam.newBeatPrepareTime,
  304. 'beatPrepareTime'
  305. )
  306. "
  307. maxlength="9"
  308. oninput="value = value.replace(/[^\d.]/g, '')"
  309. ></el-input>
  310. <div v-else>{{ beatParam.newBeatPrepareTime }}</div>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="8" label-width="100px">
  314. <el-form-item label="单位:" prop="">
  315. <div>{{ beatParam.unit }}</div>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. <el-row>
  320. <el-col :span="16" label-width="140px">
  321. <el-form-item label="下道工序间隔时长" prop="newBeatRestTime">
  322. <el-input
  323. v-if="!isView"
  324. placeholder=""
  325. v-model="beatParam.newBeatRestTime"
  326. @blur="
  327. convertVal(beatParam.newBeatRestTime, 'beatRestTime')
  328. "
  329. maxlength="9"
  330. oninput="value = value.replace(/[^\d.]/g, '')"
  331. ></el-input>
  332. <div v-else>{{ beatParam.newBeatRestTime }}</div>
  333. </el-form-item>
  334. </el-col>
  335. <el-col :span="8" label-width="100px">
  336. <el-form-item label="单位:" prop="beatRestUnit">
  337. <div>{{ beatParam.unit }}</div>
  338. </el-form-item>
  339. </el-col>
  340. </el-row>
  341. <el-row>
  342. <el-col :span="16" label-width="100px">
  343. <el-form-item label="标准时长" prop="newTime">
  344. <el-input
  345. v-if="!isView"
  346. placeholder="标准时长"
  347. v-model="beatParam.newTime"
  348. @blur="convertVal(beatParam.newTime, 'time')"
  349. maxlength="9"
  350. oninput="value = value.replace(/[^\d.]/g, '')"
  351. ></el-input>
  352. <div v-else>{{ beatParam.newTime }}</div>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="8" label-width="100px">
  356. <el-form-item label="单位:" prop="">
  357. <div>{{ beatParam.unit }}</div>
  358. </el-form-item>
  359. </el-col>
  360. </el-row>
  361. <el-row>
  362. <el-col :span="24" label-width="100px">
  363. <el-form-item label="计价类型" prop="pricingType">
  364. <el-radio-group v-model="beatParam.pricingType">
  365. <el-radio :label="1" :disabled="isView">计时</el-radio>
  366. <el-radio :label="2" :disabled="isView">计件</el-radio>
  367. </el-radio-group>
  368. </el-form-item>
  369. </el-col>
  370. </el-row>
  371. <el-row>
  372. <el-col :span="16" label-width="100px">
  373. <el-form-item label="工时单价" prop="taskPrice">
  374. <el-input
  375. v-if="!isView"
  376. placeholder=""
  377. v-model="beatParam.taskPrice"
  378. oninput="value = value.replace(/[^\d.]/g, '')"
  379. maxlength="7"
  380. ></el-input>
  381. <div v-else>{{ beatParam.taskPrice }}</div>
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="8" label-width="100px">
  385. <el-form-item label="单位:" prop="">
  386. <div>元</div>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. <el-row>
  391. <el-col :span="24" label-width="100px">
  392. <el-form-item label="备注" prop="remark">
  393. <el-input
  394. v-if="!isView"
  395. placeholder=""
  396. v-model="beatParam.remark"
  397. type="textarea"
  398. :rows="4"
  399. ></el-input>
  400. <div v-else>{{ beatParam.remark }}</div>
  401. </el-form-item>
  402. </el-col>
  403. </el-row>
  404. </el-form>
  405. </el-tab-pane>
  406. <el-tab-pane label="材料定额" name="材料定额">
  407. <ele-pro-table
  408. ref="materialTable"
  409. :columns="columns1"
  410. :datasource="datasource"
  411. :need-page="false"
  412. :immediate="true"
  413. >
  414. <!-- 表头工具栏 -->
  415. <template v-slot:toolbar>
  416. <el-button
  417. type="primary"
  418. v-if="
  419. !isView &&
  420. attributeData.approvalStatus != 1 &&
  421. attributeData.approvalStatus != 2
  422. "
  423. @click="add"
  424. >添加</el-button
  425. >
  426. <el-button
  427. type="primary"
  428. v-if="
  429. !isView &&
  430. attributeData.approvalStatus != 1 &&
  431. attributeData.approvalStatus != 2
  432. "
  433. @click="detailsList"
  434. >从明细表导入</el-button
  435. >
  436. <div class="toolbar_box">
  437. <div>
  438. <el-form
  439. ref="form"
  440. :rules="rules"
  441. :model="form"
  442. label-width="80px"
  443. inline
  444. >
  445. <el-form-item prop="baseCount" label="基本数量">
  446. <el-input
  447. placeholder="请输入"
  448. disabled
  449. v-model.number="form.baseCount"
  450. >
  451. </el-input>
  452. </el-form-item>
  453. <el-form-item prop="baseCountUnit" label="单位">
  454. <!-- <DictSelection
  455. dictName="计量单位"
  456. clearable
  457. :disabled="true"
  458. v-model="form.baseCountUnit"
  459. ></DictSelection> -->
  460. <!-- <el-form-item label="单位:" prop="unit"> -->
  461. <el-select
  462. disabled
  463. v-model="form.baseCountUnit"
  464. filterable
  465. class="ele-block"
  466. @change="changeUnit"
  467. >
  468. <el-option
  469. v-for="item in unitList"
  470. :key="item.value"
  471. :value="item.value"
  472. :label="item.label"
  473. ></el-option>
  474. </el-select>
  475. <!-- </el-form-item> -->
  476. </el-form-item>
  477. </el-form>
  478. </div>
  479. </div>
  480. </template>
  481. <template
  482. v-if="
  483. attributeData.approvalStatus != 1 &&
  484. attributeData.approvalStatus != 2
  485. "
  486. v-slot:action="{ row, $index }"
  487. >
  488. <el-link type="danger" @click="handleDel(row, $index)"
  489. >删除</el-link
  490. >
  491. <el-link type="primary" @click="handSubstitution(row)"
  492. >替代料</el-link
  493. >
  494. </template>
  495. <template v-slot:subCode="{ row }">
  496. <div v-if="isView">{{ row.subCode }}</div>
  497. <el-input
  498. v-else
  499. v-model="row.subCode"
  500. placeholder="请输入"
  501. :disabled="
  502. attributeData.approvalStatus == 1 ||
  503. attributeData.approvalStatus == 2
  504. "
  505. ></el-input>
  506. </template>
  507. <template v-slot:isReworkBom="{ row }">
  508. <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
  509. <div v-else>
  510. <el-select
  511. v-model="row.isReworkBom"
  512. :disabled="
  513. attributeData.approvalStatus == 1 ||
  514. attributeData.approvalStatus == 2
  515. "
  516. >
  517. <el-option
  518. v-for="item in isReworkBomList"
  519. :key="item.value"
  520. :label="item.label"
  521. :value="item.value"
  522. >
  523. </el-option>
  524. </el-select>
  525. </div>
  526. </template>
  527. <template v-slot:unit="{ row }">
  528. <div v-if="isView">{{ row.unit }}</div>
  529. <div v-else>
  530. <DictSelection
  531. dictName="计量单位"
  532. :isProhibit="true"
  533. v-model="row.unit"
  534. ></DictSelection>
  535. </div>
  536. </template>
  537. <template v-slot:count="{ row }">
  538. <div v-if="isView">{{ row.count }}</div>
  539. <el-input
  540. v-else
  541. v-model="row.count"
  542. placeholder="请输入"
  543. style="width: 90px"
  544. @input="handleInput(row)"
  545. :disabled="
  546. attributeData.approvalStatus == 1 ||
  547. attributeData.approvalStatus == 2
  548. "
  549. ></el-input>
  550. </template>
  551. <template v-slot:categoryName="{ row, $index }">
  552. <el-link
  553. type="primary"
  554. :underline="false"
  555. @click="handSubstitution(row)"
  556. v-if="
  557. isView ||
  558. attributeData.approvalStatus == 1 ||
  559. attributeData.approvalStatus == 2
  560. "
  561. >{{ row.categoryName }}</el-link
  562. >
  563. <div v-else
  564. ><el-input
  565. :value="row.categoryName"
  566. placeholder="请选择"
  567. @click.native="categorySelect(row, $index)"
  568. ></el-input
  569. ></div>
  570. </template>
  571. <template v-slot:bomArtFiles="{ row }">
  572. <fileMain
  573. v-model="row.bomArtFiles"
  574. :type="
  575. isView ||
  576. attributeData.approvalStatus == 1 ||
  577. attributeData.approvalStatus == 2
  578. ? 'view'
  579. : 'add'
  580. "
  581. size="mini"
  582. />
  583. </template>
  584. <template v-slot:remark="{ row }">
  585. <div v-if="isView">{{ row.remark }}</div>
  586. <el-input
  587. v-else
  588. v-model="row.remark"
  589. placeholder="请输入"
  590. :disabled="
  591. attributeData.approvalStatus == 1 ||
  592. attributeData.approvalStatus == 2
  593. "
  594. ></el-input>
  595. </template>
  596. </ele-pro-table>
  597. </el-tab-pane>
  598. <el-tab-pane label="关键设备" name="关键设备">
  599. <ele-pro-table
  600. ref="deviceTabRef"
  601. :columns="standardCol"
  602. :datasource="datasource"
  603. :need-page="false"
  604. :immediate="true"
  605. >
  606. <!-- 表头工具栏 -->
  607. <template v-if="!isView" v-slot:toolbar>
  608. <el-button type="primary" @click="add">添加</el-button>
  609. </template>
  610. <template v-slot:action="{ row, $index }">
  611. <el-link type="danger" @click="handleDel(row, $index)"
  612. >删除</el-link
  613. >
  614. </template>
  615. </ele-pro-table>
  616. </el-tab-pane>
  617. <el-tab-pane label="制造资源" name="制造资源">
  618. <ele-pro-table
  619. ref="resourceTable"
  620. :columns="columns1"
  621. :datasource="datasource"
  622. :need-page="false"
  623. :immediate="true"
  624. >
  625. <!-- 表头工具栏 -->
  626. <template v-if="!isView" v-slot:toolbar>
  627. <el-button type="primary" @click="add">添加</el-button>
  628. </template>
  629. <template v-slot:action="{ row, $index }">
  630. <el-link type="primary" @click="handleDel(row, $index)"
  631. >删除</el-link
  632. >
  633. </template>
  634. <template v-slot:subCode="{ row }">
  635. <div v-if="isView">{{ row.subCode }}</div>
  636. <el-input
  637. v-else
  638. v-model="row.subCode"
  639. placeholder="请输入"
  640. ></el-input>
  641. </template>
  642. <template v-slot:isReworkBom="{ row }">
  643. <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
  644. <div v-else>
  645. <el-select v-model="row.isReworkBom">
  646. <el-option
  647. v-for="item in isReworkBomList"
  648. :key="item.value"
  649. :label="item.label"
  650. :value="item.value"
  651. >
  652. </el-option>
  653. </el-select>
  654. </div>
  655. </template>
  656. <template v-slot:unit="{ row }">
  657. <div v-if="isView">{{ row.unit }}</div>
  658. <div v-else>
  659. <DictSelection
  660. dictName="计量单位"
  661. v-model="row.unit"
  662. ></DictSelection>
  663. </div>
  664. </template>
  665. <template v-slot:count="{ row }">
  666. <div v-if="isView">{{ row.count }}</div>
  667. <el-input
  668. v-else
  669. v-model="row.count"
  670. placeholder="请输入"
  671. @input="
  672. (value) =>
  673. (row.count = value.replace(
  674. /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
  675. '$1$2.$3'
  676. ))
  677. "
  678. ></el-input>
  679. </template>
  680. <template v-slot:categoryName="{ row, $index }">
  681. <div v-if="isView">{{ row.categoryName }}</div>
  682. <div v-else
  683. ><el-input
  684. :value="row.categoryName"
  685. placeholder="请选择"
  686. @click.native="categorySelect(row, $index)"
  687. ></el-input
  688. ></div>
  689. </template>
  690. <template v-slot:bomArtFiles="{ row }">
  691. <fileUpload v-model="row.bomArtFiles" type="add" size="mini" />
  692. </template>
  693. <template v-slot:remark="{ row }">
  694. <div v-if="isView">{{ row.remark }}</div>
  695. <el-input
  696. v-else
  697. v-model="row.remark"
  698. placeholder="请输入"
  699. ></el-input>
  700. </template>
  701. </ele-pro-table>
  702. </el-tab-pane>
  703. <el-tab-pane label="工种" name="工种">
  704. <ele-pro-table
  705. ref="jobTable"
  706. :columns="jobColumns"
  707. :datasource="datasource"
  708. row-key="id"
  709. >
  710. <!-- 表头工具栏 -->
  711. <template v-slot:toolbar>
  712. <el-button
  713. size="small"
  714. type="primary"
  715. icon="el-icon-plus"
  716. class="ele-btn-icon"
  717. @click="addJob"
  718. >新增</el-button
  719. >
  720. </template>
  721. <template v-slot:action="{ row, $index }">
  722. <el-link type="primary" @click="handleDel(row, $index)"
  723. >删除</el-link
  724. >
  725. </template>
  726. </ele-pro-table>
  727. </el-tab-pane>
  728. <el-tab-pane label="工艺文件" name="工艺文件">
  729. <ele-pro-table
  730. ref="fileTable"
  731. :columns="jobColumns1"
  732. :datasource="datasource"
  733. :need-page="false"
  734. :immediate="true"
  735. >
  736. <template v-if="!isView" v-slot:toolbar>
  737. <el-button type="primary" @click="addFile">添加</el-button>
  738. </template>
  739. <template v-slot:action="{ row, $index }">
  740. <el-link type="primary" @click="handleDel(row, $index)"
  741. >删除</el-link
  742. >
  743. <el-link type="primary" @click="fileDetails(row)">详情</el-link>
  744. </template>
  745. </ele-pro-table>
  746. </el-tab-pane>
  747. <el-tab-pane label="标准产出" name="标准产出">
  748. <ele-pro-table
  749. ref="standard"
  750. :columns="standardCol"
  751. :datasource="datasource"
  752. :need-page="false"
  753. :immediate="true"
  754. >
  755. <!-- 表头工具栏 -->
  756. <template v-if="!isView" v-slot:toolbar>
  757. <el-button type="primary" @click="add">添加</el-button>
  758. </template>
  759. <template v-slot:action="{ row, $index }">
  760. <el-link type="danger" @click="handleDel(row, $index)"
  761. >删除</el-link
  762. >
  763. </template>
  764. </ele-pro-table>
  765. </el-tab-pane>
  766. <el-tab-pane label="过程控制" name="过程控制">
  767. <userSettingMatterProcess
  768. :produce-task-id="rowData.sourceTaskId"
  769. :produce-task-name="rowData.name"
  770. :produce-task-code="rowData.code"
  771. :bom-category-id="resourceBomId"
  772. ref="userSettingMatterProcessRef"
  773. ></userSettingMatterProcess>
  774. </el-tab-pane>
  775. <el-tab-pane label="首件两检" name="首件两检">
  776. <term
  777. :qualityParam="firstArticleDualInspectionParam"
  778. :isView="isView"
  779. ref="firstArticleDualInspectionParamRef"
  780. ></term>
  781. </el-tab-pane>
  782. <el-tab-pane label="NC程序" name="NC程序">
  783. <ele-pro-table
  784. ref="ncFileTable"
  785. :columns="jobColumns2"
  786. :datasource="ncCodeList"
  787. :need-page="false"
  788. :immediate="true"
  789. >
  790. <!-- 表头工具栏 -->
  791. <template v-if="!isView" v-slot:toolbar>
  792. <el-button type="primary" @click="addFile('ncCodeList')"
  793. >添加</el-button
  794. >
  795. </template>
  796. <template v-slot:action="{ row, $index }">
  797. <el-link type="primary" @click="handleDel(row, $index)"
  798. >删除</el-link
  799. >
  800. <el-link type="primary" @click="fileDetails(row, 'nc')"
  801. >详情</el-link
  802. >
  803. </template>
  804. </ele-pro-table>
  805. </el-tab-pane>
  806. </el-tabs>
  807. </el-card>
  808. <!-- 选择工艺参数 -->
  809. <jobDialog ref="jobRef" @chooseModal="chooseJob"></jobDialog>
  810. <ParamModal ref="paramRefs" @chooseModal="chooseModal"></ParamModal>
  811. <ProductModal ref="productRefs" @changeProduct="determineChoose" />
  812. <ProductModalMultiple
  813. ref="productMultipleRefs"
  814. @selection="addProductList"
  815. ></ProductModalMultiple>
  816. <standardOutput
  817. ref="standardOutputRefs"
  818. @selection="chooseStandardList"
  819. ></standardOutput>
  820. <fileIndex v-if="fileShow" @close="fileClose"></fileIndex>
  821. <fileBrowse ref="browseRef"></fileBrowse>
  822. <replaceMaterialPop
  823. ref="replaceMaterialRef"
  824. @selected="replaceSelected"
  825. :isView="isView"
  826. ></replaceMaterialPop>
  827. <mbomDatailList ref="bomDetailList"></mbomDatailList>
  828. <div class="btns">
  829. <el-button
  830. type="primary"
  831. size="small"
  832. v-if="!isView"
  833. @click="save('save')"
  834. >
  835. 保存</el-button
  836. >
  837. <el-button type="primary" size="small" @click="save('close')">{{
  838. isView ? '确定' : '保存并关闭'
  839. }}</el-button>
  840. <el-button size="small" @click="handleClose">关闭</el-button>
  841. </div>
  842. </ele-modal>
  843. </template>
  844. <script>
  845. import dictMixins from '@/mixins/dictMixins';
  846. import * as dayjs from 'dayjs';
  847. import { getFile } from '@/api/system/file';
  848. // import fileUpload from '@/components/addDoc/index.vue';
  849. import { workingProcedureUpdate } from '@/api/material/BOM';
  850. import ParamModal from '@/views/technology/productParam/components/ParamModal.vue';
  851. import ProductModal from '@/components/select/bom/ProductModal.vue';
  852. import { getByCode } from '@/api/system/dictionary-data';
  853. import ProductModalMultiple from './ProductModalMultiple.vue';
  854. import userSearch from './user-search.vue';
  855. import jobDialog from './jobDialog.vue';
  856. import standardOutput from './standardOutput.vue';
  857. import term from '../qualityTesting/term';
  858. import fileIndex from '../file/index.vue';
  859. import fileBrowse from '../file/fileBrowse.vue';
  860. import replaceMaterialPop from './replaceMaterialPop.vue';
  861. import { newFilePageAPI } from '@/api/material/file';
  862. import { getBomGetById, getDetailList } from '@/api/material/BOM.js';
  863. import mbomDatailList from './mbomDatailList.vue';
  864. import { setFileUrl } from '@/components/addDoc/util.js';
  865. import userSettingMatterProcess from '@/views/technology/production/components/user-setting-matter-process.vue';
  866. export default {
  867. components: {
  868. userSearch,
  869. ParamModal,
  870. // fileUpload,
  871. ProductModal,
  872. jobDialog,
  873. ProductModalMultiple,
  874. standardOutput,
  875. term,
  876. fileIndex,
  877. fileBrowse,
  878. replaceMaterialPop,
  879. mbomDatailList,
  880. userSettingMatterProcess
  881. },
  882. mixins: [dictMixins],
  883. data() {
  884. return {
  885. rules: {
  886. baseCount: [
  887. { required: true, message: '请输入基本数量', trigger: 'blur' }
  888. ],
  889. baseCountUnit: [
  890. { required: true, message: '请选择单位', trigger: 'change' }
  891. ]
  892. },
  893. form: {
  894. baseCount: 0,
  895. baseCountUnit: ''
  896. },
  897. baseCountUnit: '',
  898. baseCount2: '',
  899. baseCountUnit2: '',
  900. isView: false,
  901. filedList: [],
  902. jobFiledList: [],
  903. activeName: '工艺参数',
  904. attributeData: {},
  905. visible: false,
  906. title: '配置',
  907. statusOption: [
  908. {
  909. label: '启用',
  910. value: 1
  911. },
  912. {
  913. label: '停用',
  914. value: 0
  915. }
  916. ],
  917. isReworkBom: ['否', '是'],
  918. isReworkBomList: [
  919. { label: '否', value: 0 },
  920. { label: '是', value: 1 }
  921. ],
  922. dictList: [], //单位下拉
  923. // 表格列配置
  924. columns1: [],
  925. defaultColumns1: [
  926. {
  927. type: 'index',
  928. width: 55,
  929. align: 'center'
  930. },
  931. {
  932. label: '子项编号',
  933. prop: 'subCode',
  934. slot: 'subCode',
  935. action: 'subCode'
  936. },
  937. {
  938. label: '物料名称',
  939. prop: 'categoryName',
  940. slot: 'categoryName',
  941. action: 'categoryName'
  942. },
  943. {
  944. label: '是否回收料',
  945. prop: 'isReworkBom',
  946. slot: 'isReworkBom',
  947. action: 'isReworkBom'
  948. },
  949. {
  950. label: '编码',
  951. prop: 'categoryCode'
  952. },
  953. {
  954. label: '牌号',
  955. prop: 'brandNum'
  956. },
  957. {
  958. label: '型号',
  959. prop: 'modelType'
  960. },
  961. {
  962. prop: 'specification',
  963. label: '规格',
  964. align: 'center',
  965. showOverflowTooltip: true
  966. },
  967. {
  968. label: '数量',
  969. slot: 'count',
  970. action: 'count'
  971. },
  972. {
  973. label: '单位',
  974. slot: 'unit',
  975. action: 'unit'
  976. },
  977. {
  978. label: '附件',
  979. slot: 'bomArtFiles',
  980. action: 'bomArtFiles',
  981. minWidth: 150
  982. },
  983. {
  984. label: '备注',
  985. slot: 'remark',
  986. action: 'remark'
  987. }
  988. ],
  989. columns: [],
  990. // 表格列配置
  991. defaultColumns: [
  992. {
  993. prop: 'sort',
  994. slot: 'sort',
  995. label: '排序',
  996. minWidth: 60
  997. },
  998. {
  999. prop: 'code',
  1000. label: '参数编码',
  1001. showOverflowTooltip: true,
  1002. align: 'center',
  1003. minWidth: 110
  1004. },
  1005. {
  1006. prop: 'name',
  1007. label: '参数名称',
  1008. showOverflowTooltip: true,
  1009. align: 'center',
  1010. minWidth: 110
  1011. },
  1012. {
  1013. align: 'center',
  1014. prop: 'description',
  1015. label: '文本描述',
  1016. showOverflowTooltip: true,
  1017. minWidth: 110
  1018. },
  1019. {
  1020. prop: 'maxValue',
  1021. slot: 'maxValue',
  1022. label: '参数上限',
  1023. align: 'center'
  1024. },
  1025. {
  1026. prop: 'minValue',
  1027. slot: 'minValue',
  1028. label: '参数下限',
  1029. align: 'center'
  1030. },
  1031. {
  1032. prop: 'defaultValue',
  1033. slot: 'defaultValue',
  1034. label: '默认值',
  1035. align: 'center'
  1036. }
  1037. ],
  1038. levelOptions: [
  1039. {
  1040. label: '初级',
  1041. value: '1'
  1042. },
  1043. {
  1044. label: '中级',
  1045. value: '2'
  1046. },
  1047. {
  1048. label: '高级',
  1049. value: '3'
  1050. }
  1051. ],
  1052. // 表格列配置
  1053. jobColumns: [
  1054. {
  1055. label: '序号',
  1056. type: 'index',
  1057. width: 55,
  1058. align: 'center'
  1059. },
  1060. {
  1061. slot: 'type',
  1062. label: '类型',
  1063. showOverflowTooltip: true,
  1064. align: 'center',
  1065. minWidth: 110,
  1066. formatter: (_row) => {
  1067. return this.getDictValue('工种类型', _row.type);
  1068. }
  1069. },
  1070. {
  1071. align: 'center',
  1072. prop: 'code',
  1073. label: '编码',
  1074. showOverflowTooltip: true,
  1075. minWidth: 110
  1076. },
  1077. {
  1078. slot: 'name',
  1079. prop: 'name',
  1080. label: '名称',
  1081. showOverflowTooltip: true,
  1082. align: 'center',
  1083. minWidth: 110
  1084. },
  1085. {
  1086. slot: 'level',
  1087. prop: 'level',
  1088. label: '等级',
  1089. showOverflowTooltip: true,
  1090. align: 'center',
  1091. minWidth: 110,
  1092. formatter: (_row) => {
  1093. return this.levelOptions.filter(
  1094. (item) => _row.level == item.value
  1095. )[0].label;
  1096. }
  1097. },
  1098. {
  1099. slot: 'hourCost',
  1100. prop: 'hourCost',
  1101. label: '标准工时费',
  1102. showOverflowTooltip: true,
  1103. align: 'center',
  1104. minWidth: 110
  1105. },
  1106. {
  1107. columnKey: 'action',
  1108. label: '操作',
  1109. width: 260,
  1110. align: 'center',
  1111. resizable: false,
  1112. slot: 'action',
  1113. showOverflowTooltip: true
  1114. }
  1115. ],
  1116. // 表格选中数据
  1117. jobColumns1: [
  1118. {
  1119. label: '编码',
  1120. prop: 'code',
  1121. width: 180,
  1122. align: 'center',
  1123. showOverflowTooltip: true
  1124. },
  1125. {
  1126. prop: 'name',
  1127. label: '文档名称',
  1128. align: 'center',
  1129. slot: 'name',
  1130. showOverflowTooltip: true,
  1131. minWidth: 200
  1132. },
  1133. {
  1134. prop: 'storagePath',
  1135. label: '文件名称',
  1136. align: 'center',
  1137. showOverflowTooltip: true,
  1138. minWidth: 200,
  1139. formatter: (_row, _column, cellValue) => {
  1140. return cellValue[0]?.name;
  1141. }
  1142. },
  1143. {
  1144. prop: 'version',
  1145. label: '版本',
  1146. align: 'center',
  1147. showOverflowTooltip: true,
  1148. minWidth: 100
  1149. },
  1150. {
  1151. prop: 'createTime',
  1152. label: '创建时间',
  1153. showOverflowTooltip: true,
  1154. align: 'center',
  1155. minWidth: 110
  1156. },
  1157. {
  1158. columnKey: 'action',
  1159. label: '操作',
  1160. width: 260,
  1161. align: 'center',
  1162. resizable: false,
  1163. slot: 'action',
  1164. showOverflowTooltip: true
  1165. }
  1166. ],
  1167. // 表格选中数据
  1168. jobColumns2: [
  1169. {
  1170. columnKey: 'index',
  1171. label: '序号',
  1172. type: 'index',
  1173. width: 55,
  1174. align: 'center',
  1175. showOverflowTooltip: true
  1176. },
  1177. {
  1178. label: '编码',
  1179. prop: 'code',
  1180. width: 180,
  1181. align: 'center',
  1182. showOverflowTooltip: true
  1183. },
  1184. {
  1185. prop: 'name',
  1186. label: '名称',
  1187. align: 'center',
  1188. slot: 'name',
  1189. showOverflowTooltip: true,
  1190. minWidth: 200
  1191. },
  1192. {
  1193. prop: 'versions',
  1194. label: '版本',
  1195. align: 'center',
  1196. showOverflowTooltip: true,
  1197. minWidth: 100
  1198. },
  1199. {
  1200. prop: 'remark',
  1201. label: '文本描述',
  1202. align: 'center',
  1203. showOverflowTooltip: true,
  1204. minWidth: 200
  1205. },
  1206. {
  1207. prop: 'ncSize',
  1208. label: '文件大小',
  1209. align: 'center',
  1210. showOverflowTooltip: true,
  1211. minWidth: 100
  1212. },
  1213. {
  1214. prop: 'createName',
  1215. label: '创建人',
  1216. showOverflowTooltip: true,
  1217. align: 'center',
  1218. minWidth: 110
  1219. },
  1220. {
  1221. prop: 'createTime',
  1222. label: '创建时间',
  1223. showOverflowTooltip: true,
  1224. align: 'center',
  1225. minWidth: 110
  1226. },
  1227. {
  1228. columnKey: 'action',
  1229. label: '操作',
  1230. width: 260,
  1231. align: 'center',
  1232. resizable: false,
  1233. slot: 'action',
  1234. showOverflowTooltip: true
  1235. }
  1236. ],
  1237. standardCol: [
  1238. {
  1239. prop: 'code',
  1240. label: '编码'
  1241. },
  1242. {
  1243. prop: 'name',
  1244. label: '名称',
  1245. showOverflowTooltip: true
  1246. },
  1247. {
  1248. prop: 'brandNum',
  1249. label: '牌号'
  1250. },
  1251. {
  1252. prop: 'modelType',
  1253. label: '型号',
  1254. align: 'center',
  1255. showOverflowTooltip: true
  1256. },
  1257. {
  1258. prop: 'specification',
  1259. label: '规格',
  1260. align: 'center',
  1261. showOverflowTooltip: true
  1262. },
  1263. {
  1264. prop: 'measuringUnit',
  1265. label: '计量单位',
  1266. showOverflowTooltip: true,
  1267. minWidth: 90
  1268. },
  1269. {
  1270. columnKey: 'action',
  1271. label: '操作',
  1272. align: 'center',
  1273. resizable: false,
  1274. slot: 'action',
  1275. showOverflowTooltip: true
  1276. }
  1277. ],
  1278. rowData: {},
  1279. treeData: {},
  1280. currentIndex: 0,
  1281. tableData: {},
  1282. beatParam: {
  1283. newTime: '',
  1284. time: '',
  1285. newBeatPrepareTime: '',
  1286. beatPrepareTime: '',
  1287. newBeatTime: '',
  1288. beatTime: '',
  1289. newBeatRestTime: '',
  1290. beatRestTime: '',
  1291. taskPrice: ''
  1292. },
  1293. qualityParam: [],
  1294. ncCodeList: [],
  1295. firstArticleDualInspectionParam: [],
  1296. qualityPointParam: [],
  1297. fileShow: false,
  1298. resourceBomId: '',
  1299. level: '',
  1300. attributeData: {},
  1301. unitList: [],
  1302. fileListType: ''
  1303. };
  1304. },
  1305. created() {
  1306. this.requestDict('工种类型');
  1307. this.getDictList('time_unit');
  1308. this.getDicTUnitList('measuring_uint');
  1309. },
  1310. methods: {
  1311. addFile(fileListType) {
  1312. this.fileShow = true;
  1313. this.fileListType = fileListType;
  1314. },
  1315. fileClose(val) {
  1316. if (val == false) {
  1317. this.fileShow = false;
  1318. } else {
  1319. this.fileShow = false;
  1320. if (this.fileListType == 'ncCodeList') {
  1321. console.log(val, 'val');
  1322. this.ncCodeList.push(
  1323. ...val.map((item) => {
  1324. item.ncSize = item.sizeUnit;
  1325. item.versions = item.version;
  1326. item.fileId = item.id;
  1327. return item;
  1328. })
  1329. );
  1330. // this.tableData.taskParam[this.currentIndex].ncCodeList=this.tableData.taskParam[this.currentIndex].ncCodeList||[]
  1331. } else {
  1332. this.$refs.fileTable.setData([
  1333. ...val,
  1334. ...this.$refs.fileTable.getData()
  1335. ]);
  1336. this.$set(
  1337. this.tableData.taskParam[this.currentIndex],
  1338. 'fileParam',
  1339. this.$refs.fileTable.getData()
  1340. );
  1341. }
  1342. }
  1343. },
  1344. async getDicTUnitList(code) {
  1345. let { data: res } = await getByCode(code);
  1346. this.unitList = res.reduce((acc, curr) => {
  1347. let key = Object.keys(curr)[0]; // 获取当前对象的键
  1348. let value = curr[key]; // 获取当前对象的值
  1349. acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
  1350. return acc;
  1351. }, []); // 初始值为空数组 []
  1352. console.log(this.unitList, 'this.unitList');
  1353. },
  1354. handleInput(item) {
  1355. let newVal = item.count.replace(/[^\d.]/g, '');
  1356. // 2. 不能以点开头
  1357. if (newVal.startsWith('.')) {
  1358. newVal = '';
  1359. }
  1360. // 3. 只允许出现一个小数点
  1361. const firstDotIndex = newVal.indexOf('.');
  1362. if (firstDotIndex !== -1) {
  1363. newVal =
  1364. newVal.slice(0, firstDotIndex + 1) +
  1365. newVal.slice(firstDotIndex + 1).replace(/\./g, '');
  1366. }
  1367. const match = newVal.match(/^(\d+)(\.\d{0,4})?/);
  1368. item.count = match ? match[0] : '';
  1369. // 4. 更新数据
  1370. // item.count = newVal;
  1371. },
  1372. async detailsList() {
  1373. console.log(this.rowData, 'this.rowData');
  1374. await getDetailList({
  1375. bomType: this.attributeData.bomType,
  1376. bomCategoryId: this.resourceBomId,
  1377. taskId: this.rowData.id
  1378. }).then((res) => {
  1379. console.log(res);
  1380. this.$refs.materialTable.setData(res.data);
  1381. this.tableData.taskParam[this.currentIndex].materialQuota = res.data;
  1382. console.log(this.tableData, 'this.tableData');
  1383. });
  1384. // this.$refs.bomDetailList.open(this.resourceBomId, this.level)
  1385. },
  1386. fileDetails(row, type) {
  1387. if (type == 'nc') {
  1388. newFilePageAPI({
  1389. ids: "'" + row.fileId + "'"
  1390. }).then((res) => {
  1391. if (res.length) {
  1392. window.open(setFileUrl(res[0]));
  1393. }
  1394. });
  1395. } else {
  1396. window.open(setFileUrl(row));
  1397. }
  1398. },
  1399. addJob() {
  1400. this.$refs.jobRef.open();
  1401. },
  1402. chooseJob(data) {
  1403. this.$refs.jobTable.setData([
  1404. ...data,
  1405. ...this.$refs.jobTable.getData()
  1406. ]);
  1407. this.$set(
  1408. this.tableData.taskParam[this.currentIndex],
  1409. 'aptitudeParam',
  1410. this.$refs.jobTable.getData()
  1411. );
  1412. },
  1413. determineChoose(title, row, idx) {
  1414. let type = '';
  1415. if (this.activeName === '材料定额') {
  1416. type = 'materialQuota';
  1417. } else if (this.activeName === '制造资源') {
  1418. type = 'resource';
  1419. }
  1420. if (title == '选择物料') {
  1421. console.log(row, 'row');
  1422. this.$set(
  1423. this.tableData.taskParam[this.currentIndex][type][idx],
  1424. 'categoryName',
  1425. row.name
  1426. );
  1427. this.$set(
  1428. this.tableData.taskParam[this.currentIndex][type][idx],
  1429. 'categoryId',
  1430. row.id
  1431. );
  1432. this.$set(
  1433. this.tableData.taskParam[this.currentIndex][type][idx],
  1434. 'categoryCode',
  1435. row.code
  1436. );
  1437. this.$set(
  1438. this.tableData.taskParam[this.currentIndex][type][idx],
  1439. 'unit',
  1440. row.measuringUnit
  1441. );
  1442. this.$set(
  1443. this.tableData.taskParam[this.currentIndex][type][idx],
  1444. 'weightUnit',
  1445. row.weightUnit
  1446. );
  1447. this.$set(
  1448. this.tableData.taskParam[this.currentIndex][type][idx],
  1449. 'brandNum',
  1450. row.brandNum
  1451. );
  1452. this.$set(
  1453. this.tableData.taskParam[this.currentIndex][type][idx],
  1454. 'modelType',
  1455. row.modelType
  1456. );
  1457. this.$set(
  1458. this.tableData.taskParam[this.currentIndex][type][idx],
  1459. 'rootCategoryLevelId',
  1460. row.categoryLevelPathIdParent
  1461. );
  1462. this.$set(
  1463. this.tableData.taskParam[this.currentIndex][type][idx],
  1464. 'specification',
  1465. row.specification
  1466. );
  1467. this.$set(
  1468. this.tableData.taskParam[this.currentIndex][type][idx],
  1469. 'id',
  1470. row.id
  1471. );
  1472. }
  1473. },
  1474. uploadedSuccess(data, row) {
  1475. row.bomArtFiles = data[0].storePath;
  1476. this.filedList = [];
  1477. },
  1478. uploadedJobSuccess(data, row) {
  1479. row.path = data[0].storePath;
  1480. row.name = data[0].name;
  1481. this.jobFiledList = [];
  1482. },
  1483. downloadFile(url) {
  1484. getFile({ objectName: url }, '附件');
  1485. },
  1486. categorySelect(row, idx) {
  1487. this.$refs.productRefs.open(row, '选择物料', '1', idx);
  1488. },
  1489. handleDel(row, index) {
  1490. let type = '';
  1491. if (this.activeName === '材料定额') {
  1492. type = 'materialQuota';
  1493. } else if (this.activeName === '制造资源') {
  1494. type = 'resource';
  1495. } else if (this.activeName === '工种') {
  1496. type = 'aptitudeParam';
  1497. } else if (this.activeName === '工艺文件') {
  1498. type = 'fileParam';
  1499. } else if (this.activeName === '标准产出') {
  1500. type = 'standardOutput';
  1501. } else if (this.activeName === '关键设备') {
  1502. type = 'standardDevice';
  1503. } else if (this.activeName === 'NC程序') {
  1504. type = 'ncCodeList';
  1505. }
  1506. this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
  1507. if (type == 'fileParam') {
  1508. const data = this.$refs.fileTable.getData();
  1509. const id = row.id ? row.id : row;
  1510. const newData = data.filter((item) => item.id != id);
  1511. this.$refs.fileTable.setData(newData);
  1512. }
  1513. },
  1514. addProductList(list) {
  1515. let subCode = 0;
  1516. let array = [];
  1517. list.map((item, index) => {
  1518. let max = '';
  1519. if (
  1520. this.tableData.taskParam[this.currentIndex]['materialQuota']
  1521. .length > 0
  1522. ) {
  1523. max =
  1524. Math.max(
  1525. ...this.tableData.taskParam[this.currentIndex][
  1526. 'materialQuota'
  1527. ].map((i) => i.subCode)
  1528. ) +
  1529. 10 * ++index +
  1530. '';
  1531. if (max.length < 4) {
  1532. max = new Array(4 - max.length).fill('0').join('') + max;
  1533. }
  1534. } else {
  1535. max = 10 * ++index + '';
  1536. if (max.length < 4) {
  1537. max = new Array(4 - max.length).fill('0').join('') + max;
  1538. }
  1539. }
  1540. console.log('item', this.isValueANumber(item.specification));
  1541. if (
  1542. item.categoryLevelPathIdParent == 8 &&
  1543. this.isValueANumber(this.baseCount) &&
  1544. this.isValueANumber(item.specification)
  1545. ) {
  1546. let num = this.baseCount / item.specification;
  1547. item.count = num == 'Infinity' ? '' : num.toFixed(3);
  1548. }
  1549. subCode = max.substring(0, max.length - 1) + '0';
  1550. array.push({
  1551. subCode,
  1552. id: item.id,
  1553. categoryName: item.name,
  1554. categoryCode: item.code,
  1555. isReworkBom: 0,
  1556. brandNum: item.brandNum,
  1557. count: item.count || '',
  1558. modelType: item.modelType,
  1559. unit: item.measuringUnit,
  1560. bomArtFiles: [],
  1561. remark: '',
  1562. specification: item.specification,
  1563. rootCategoryLevelId: item.categoryLevelPathIdParent,
  1564. extInfo: item.extInfo
  1565. });
  1566. });
  1567. let _arr =
  1568. this.tableData.taskParam[this.currentIndex].materialQuota.concat(
  1569. array
  1570. );
  1571. let uniqueArray = [];
  1572. uniqueArray = _arr.reduce((acc, current) => {
  1573. const existing = acc.find((item) => item.id === current.id);
  1574. if (!existing) {
  1575. acc.push(current);
  1576. }
  1577. return acc;
  1578. }, []);
  1579. this.tableData.taskParam[this.currentIndex].materialQuota = uniqueArray;
  1580. this.$refs.materialTable.setData(
  1581. this.tableData.taskParam[this.currentIndex].materialQuota
  1582. );
  1583. },
  1584. isValueANumber(variable) {
  1585. if (variable === undefined || variable === null) {
  1586. return false; // 变量没有值
  1587. }
  1588. if (typeof variable === 'number') {
  1589. return true; // 基本类型的数字
  1590. }
  1591. if (
  1592. (typeof variable === 'string' &&
  1593. !isNaN(variable) &&
  1594. !variable.includes('.')) ||
  1595. (variable.includes('.') && !variable.endsWith('.'))
  1596. ) {
  1597. // 字符串类型的数字(注意:这个正则表达式判断较为简单,可能需要根据实际情况调整)
  1598. // 或者使用 Number.isFinite(parseFloat(variable)) 来代替这部分逻辑,但要注意性能开销和边缘情况
  1599. const num = Number(variable);
  1600. return !isNaN(num) && isFinite(num);
  1601. }
  1602. return false; // 其他类型
  1603. },
  1604. add() {
  1605. let subCode = '0010';
  1606. let type = '';
  1607. if (this.activeName === '材料定额') {
  1608. this.$refs.productMultipleRefs.open(1);
  1609. return;
  1610. } else if (this.activeName === '标准产出') {
  1611. this.$refs.standardOutputRefs.open(9);
  1612. return;
  1613. } else if (this.activeName === '关键设备') {
  1614. this.$refs.standardOutputRefs.open(4);
  1615. return;
  1616. } else if (this.activeName === '制造资源') {
  1617. type = 'resource';
  1618. }
  1619. console.log(this.tableData.taskParam[this.currentIndex]);
  1620. if (this.tableData.taskParam[this.currentIndex][type].length) {
  1621. let max =
  1622. Math.max(
  1623. ...this.tableData.taskParam[this.currentIndex][type].map(
  1624. (i) => i.subCode
  1625. )
  1626. ) +
  1627. 10 +
  1628. '';
  1629. if (max.length < 4) {
  1630. max = new Array(4 - max.length).fill('0').join('') + max;
  1631. }
  1632. subCode = max.substring(0, max.length - 1) + '0';
  1633. }
  1634. this.tableData.taskParam[this.currentIndex][type].push({
  1635. subCode,
  1636. bomArtFiles: [],
  1637. categoryId: '',
  1638. categoryName: '',
  1639. isReworkBom: 0,
  1640. brandNum: '',
  1641. count: '',
  1642. modelType: '',
  1643. unit: '',
  1644. rootCategoryLevelId: '',
  1645. categoryCode: '',
  1646. specification: '',
  1647. id: ''
  1648. });
  1649. },
  1650. /* 表格数据源 */
  1651. async datasource() {
  1652. return [];
  1653. },
  1654. tabsChange() {
  1655. console.log(this.activeName);
  1656. console.log(this.tableData.taskParam[this.currentIndex]);
  1657. if (this.activeName === '工艺参数') {
  1658. // 工艺参数
  1659. this.$refs.table.setData(
  1660. this.tableData.taskParam[this.currentIndex].produceList || []
  1661. );
  1662. } else if (this.activeName === '质检项参数') {
  1663. this.qualityParam =
  1664. this.tableData.taskParam[this.currentIndex].qualityParam || [];
  1665. } else if (this.activeName === '首件两检') {
  1666. this.firstArticleDualInspectionParam =
  1667. this.tableData.taskParam[this.currentIndex]
  1668. .firstArticleDualInspectionParam || [];
  1669. } else if (this.activeName === '生产节拍') {
  1670. this.beatParam =
  1671. this.tableData.taskParam[this.currentIndex].beatParam ||
  1672. this.beatParam;
  1673. } else if (this.activeName === '材料定额') {
  1674. this.$refs.materialTable.setData(
  1675. this.tableData.taskParam[this.currentIndex].materialQuota || []
  1676. );
  1677. } else if (this.activeName === '制造资源') {
  1678. this.$refs.resourceTable.setData(
  1679. this.tableData.taskParam[this.currentIndex].resource || []
  1680. );
  1681. } else if (this.activeName === '工种') {
  1682. if (
  1683. JSON.stringify(
  1684. this.tableData.taskParam[this.currentIndex].aptitudeParam
  1685. ) == '{}'
  1686. ) {
  1687. this.tableData.taskParam[this.currentIndex].aptitudeParam = [];
  1688. this.$refs.jobTable.setData([]);
  1689. } else {
  1690. this.$refs.jobTable.setData(
  1691. this.tableData.taskParam[this.currentIndex].aptitudeParam
  1692. );
  1693. }
  1694. } else if (this.activeName === '工艺文件') {
  1695. if (
  1696. this.tableData.taskParam[this.currentIndex].fileParam.length == 0
  1697. ) {
  1698. this.tableData.taskParam[this.currentIndex].fileParam = [];
  1699. this.$refs.fileTable.setData([]);
  1700. } else {
  1701. let fileId = this.tableData.taskParam[this.currentIndex].fileParam;
  1702. if (fileId.length > 0) {
  1703. this.fileParamDatasource(fileId);
  1704. }
  1705. // this.$refs.fileTable.setData(
  1706. // this.tableData.taskParam[this.currentIndex].fileParam
  1707. // );
  1708. }
  1709. } else if (this.activeName === '标准产出') {
  1710. this.$refs.standard.setData(
  1711. this.tableData.taskParam[this.currentIndex].standardOutput || []
  1712. );
  1713. } else if (this.activeName === '关键设备') {
  1714. this.$refs.deviceTabRef.setData(
  1715. this.tableData.taskParam[this.currentIndex].standardDevice || []
  1716. );
  1717. } else if (this.activeName === '过程控制') {
  1718. // 过程控制数据查询
  1719. }
  1720. },
  1721. openParam(type) {
  1722. let tableData = [];
  1723. if (type === '工艺') {
  1724. tableData = this.$refs.table.getData();
  1725. } else {
  1726. tableData = this.$refs.qualityTable.getData();
  1727. }
  1728. this.$refs.paramRefs.open(tableData);
  1729. },
  1730. chooseModal(data) {
  1731. let dom = null;
  1732. if (this.activeName === '工艺参数') {
  1733. dom = this.$refs.table;
  1734. }
  1735. dom.setData([...data, ...dom.getData()]);
  1736. this.$set(
  1737. this.tableData.taskParam[this.currentIndex],
  1738. this.activeName === '工艺参数' ? 'produceList' : '',
  1739. dom.getData()
  1740. );
  1741. },
  1742. chooseStandardList(type, data) {
  1743. let dom = null;
  1744. if (type == 9) {
  1745. dom = this.$refs.standard;
  1746. dom.setData([data[0]]);
  1747. this.$set(
  1748. this.tableData.taskParam[this.currentIndex],
  1749. 'standardOutput',
  1750. dom.getData()
  1751. );
  1752. } else if (type == 4) {
  1753. dom = this.$refs.deviceTabRef;
  1754. dom.setData([data[0]]);
  1755. this.$set(
  1756. this.tableData.taskParam[this.currentIndex],
  1757. 'standardDevice',
  1758. dom.getData()
  1759. );
  1760. }
  1761. },
  1762. remove(row, type) {
  1763. let dom = null;
  1764. if (type === '工艺') {
  1765. dom = this.$refs.table;
  1766. } else {
  1767. dom = this.$refs.qualityTable;
  1768. }
  1769. const data = dom.getData();
  1770. if (row.id) {
  1771. dom.setData(data.filter((d) => d.id !== row.id));
  1772. } else {
  1773. dom.setData(data.filter((d) => d.paramId !== row.paramId));
  1774. }
  1775. this.$set(
  1776. this.tableData.taskParam[this.currentIndex],
  1777. type === '工艺' ? 'produceList' : 'qualityParam',
  1778. dom.getData()
  1779. );
  1780. },
  1781. open(rowData, treeData, tableData, isView, attributeData, resourceBomId) {
  1782. // 工序信息
  1783. console.log('rowData', rowData);
  1784. // bom 信息
  1785. console.log('treeData', treeData);
  1786. // 工序信息列表 信息 包括工艺参数 材料定额等
  1787. console.log('tableData', tableData);
  1788. // 是否为详情 详情只能查看
  1789. console.log('isView', isView);
  1790. // bom 信息 和 treeData 一致
  1791. console.log('attributeData', attributeData);
  1792. // bom category id
  1793. console.log('resourceBomId', resourceBomId);
  1794. this.columns = [];
  1795. this.columns1 = [];
  1796. this.isView = isView; //true详情 false编辑
  1797. this.resourceBomId = resourceBomId;
  1798. this.attributeData = attributeData;
  1799. this.form.baseCount = attributeData.baseCount;
  1800. // if (rowData.baseCount) {
  1801. // this.form.baseCount = rowData.baseCount;
  1802. // } else {
  1803. // this.form.baseCount = attributeData.baseCount
  1804. // ? attributeData.baseCount
  1805. // : 1;
  1806. // }
  1807. // if (this.attributeData) {
  1808. // this.form.baseCount = this.attributeData.baseCount;
  1809. // } else {
  1810. // this.form.baseCount = 1;
  1811. // }
  1812. if (!this.isView) {
  1813. this.columns = this.defaultColumns.concat({
  1814. columnKey: 'action',
  1815. label: '操作',
  1816. align: 'center',
  1817. resizable: false,
  1818. slot: 'action',
  1819. showOverflowTooltip: true
  1820. });
  1821. this.columns1 = this.defaultColumns1.concat({
  1822. action: 'action',
  1823. slot: 'action',
  1824. label: '操作'
  1825. });
  1826. } else {
  1827. this.columns = this.defaultColumns;
  1828. this.columns1 = this.defaultColumns1;
  1829. }
  1830. this.rowData = JSON.parse(JSON.stringify(rowData));
  1831. this.treeData = JSON.parse(JSON.stringify(treeData));
  1832. this.tableData = JSON.parse(JSON.stringify(tableData));
  1833. this.currentIndex = tableData.taskParam.findIndex(
  1834. (item) => item.id === rowData.id
  1835. );
  1836. console.log('currentIndex', this.currentIndex);
  1837. this.activeName = '工艺参数';
  1838. // this.baseCount = rowData.baseCount;
  1839. // this.baseCountUnit = rowData.baseCountUnit;
  1840. console.log(rowData, 'rowData');
  1841. // this.form.baseCount = rowData.baseCount || 1;
  1842. this.form.baseCountUnit = rowData.baseCountUnit;
  1843. this.baseCount2 = rowData.baseCount2;
  1844. this.baseCountUnit2 = rowData.baseCountUnit2;
  1845. this.ncCodeList =
  1846. this.tableData.taskParam[this.currentIndex].ncCodeList || [];
  1847. this.visible = true;
  1848. setTimeout(() => {
  1849. console.log(this.$refs);
  1850. // 工艺参数
  1851. this.$refs.table.setData(
  1852. this.tableData.taskParam[this.currentIndex]?.produceList || []
  1853. );
  1854. this.$refs.userSettingMatterProcessRef.getMatterList();
  1855. }, 500);
  1856. this.getBomLevel();
  1857. },
  1858. async getBomLevel() {
  1859. await getBomGetById(this.resourceBomId).then((res) => {
  1860. if (res.data.level) {
  1861. this.level = res.data.level;
  1862. }
  1863. });
  1864. },
  1865. handleClose() {
  1866. this.visible = false;
  1867. this.$refs.table.setSelectedRows([]);
  1868. this.selection = [];
  1869. },
  1870. save(type) {
  1871. if (this.activeName == '材料定额') {
  1872. }
  1873. this.$refs.form.validate((valid) => {
  1874. let isYs = true;
  1875. if (this.activeName == '材料定额') {
  1876. isYs = valid;
  1877. }
  1878. if (isYs) {
  1879. if (this.isView) {
  1880. this.handleClose();
  1881. } else {
  1882. // 保存生产节拍
  1883. let userInfo = JSON.parse(localStorage.getItem('info'));
  1884. this.beatParam.createName = userInfo.name;
  1885. this.beatParam.createTime = dayjs(new Date()).format(
  1886. 'YYYY-MM-DD HH:mm:ss'
  1887. );
  1888. this.beatParam.updateName = userInfo.name;
  1889. this.beatParam.updateTime = dayjs(new Date()).format(
  1890. 'YYYY-MM-DD HH:mm:ss'
  1891. );
  1892. this.tableData.taskParam[this.currentIndex].beatParam =
  1893. this.beatParam;
  1894. // 保存材料定额
  1895. this.tableData.taskParam[this.currentIndex].baseCount =
  1896. this.form.baseCount;
  1897. this.tableData.taskParam[this.currentIndex].baseCountUnit =
  1898. this.form.baseCountUnit;
  1899. const isCount = this.tableData.taskParam[
  1900. this.currentIndex
  1901. ].materialQuota.every((item) => {
  1902. if (!item.count) {
  1903. return false;
  1904. }
  1905. return true;
  1906. });
  1907. if (!isCount) {
  1908. this.$message.warning('材料定额数量不能为空');
  1909. return;
  1910. }
  1911. this.tableData.taskParam[this.currentIndex].baseCount2 =
  1912. this.baseCount2;
  1913. this.tableData.taskParam[this.currentIndex].baseCountUnit2 =
  1914. this.baseCountUnit2;
  1915. if (this.$refs.qualityParamRef) {
  1916. this.tableData.taskParam[this.currentIndex].qualityParam =
  1917. this.$refs.qualityParamRef.getDate() || [];
  1918. }
  1919. if (this.$refs.firstArticleDualInspectionParamRef) {
  1920. this.tableData.taskParam[
  1921. this.currentIndex
  1922. ].firstArticleDualInspectionParam =
  1923. this.$refs.firstArticleDualInspectionParamRef.getDate() || [];
  1924. }
  1925. //工艺文件只传id
  1926. let fileParamArr = JSON.parse(
  1927. JSON.stringify(this.tableData.taskParam)
  1928. );
  1929. fileParamArr.map((item, index) => {
  1930. if (item.fileParam.length > 0) {
  1931. let val = [];
  1932. item.fileParam.map((fileItem) => {
  1933. let obj = {
  1934. id: fileItem.id
  1935. };
  1936. val.push(obj);
  1937. });
  1938. this.$set(this.tableData.taskParam[index], 'fileParam', val);
  1939. }
  1940. });
  1941. this.$set(
  1942. this.tableData.taskParam[this.currentIndex],
  1943. 'ncCodeList',
  1944. this.ncCodeList
  1945. );
  1946. // 保存过程控制事项
  1947. this.$refs.userSettingMatterProcessRef?.saveMatterList();
  1948. workingProcedureUpdate({
  1949. id: this.tableData.id,
  1950. categoryId: this.treeData.categoryId,
  1951. bomCategoryId: this.treeData.id,
  1952. categoryCode: this.treeData.categoryCode,
  1953. taskParam: this.tableData.taskParam
  1954. }).then(() => {
  1955. this.$message.success('保存成功');
  1956. this.$emit('chooseProcess');
  1957. if (type === 'close') {
  1958. this.handleClose();
  1959. }
  1960. });
  1961. }
  1962. }
  1963. });
  1964. },
  1965. //工艺文件表格回显
  1966. fileParamDatasource(fileParam) {
  1967. let fileId = fileParam.map((item) => item.id).join(',');
  1968. newFilePageAPI({
  1969. // pageNum: 1,
  1970. // size: 999,
  1971. // directoryId: null,
  1972. // lcyStatus: 1,
  1973. // fileType: 0,
  1974. // ids: fileId
  1975. ids: "'" + fileId + "'"
  1976. }).then((res) => {
  1977. this.$refs.fileTable.setData(res);
  1978. });
  1979. },
  1980. async getDictList(code) {
  1981. let { data: res } = await getByCode(code);
  1982. this.dictList = res.reduce((acc, curr) => {
  1983. let key = Object.keys(curr)[0]; // 获取当前对象的键
  1984. let value = curr[key]; // 获取当前对象的值
  1985. acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
  1986. return acc;
  1987. }, []); // 初始值为空数组 []
  1988. },
  1989. convertToSeconds(time) {
  1990. switch (this.beatParam.unit) {
  1991. case '秒':
  1992. return time;
  1993. case '分钟':
  1994. return time * 60;
  1995. case '小时':
  1996. return time * 3600;
  1997. case '天':
  1998. return time * 86400; // 24小时 * 60分钟 * 60秒
  1999. case '月':
  2000. // 近似值,一个月按30天计算
  2001. return time * 86400 * 30;
  2002. case '年':
  2003. // 近似值,一年按365天计算
  2004. return time * 86400 * 365;
  2005. case '毫秒':
  2006. return time / 1000;
  2007. case '微秒':
  2008. return time / 1000000;
  2009. default:
  2010. this.$message.error('不支持的时间单位: ' + unit);
  2011. }
  2012. },
  2013. convertVal(val, name) {
  2014. if (!this.beatParam.unit) {
  2015. return this.$message.error('请选择时间单位');
  2016. }
  2017. const isNumeric = /^\d*(\.\d+)?$/.test(val);
  2018. if (isNumeric) {
  2019. this.beatParam[name] = this.convertToSeconds(val);
  2020. } else {
  2021. this.$message.error('请输入数字');
  2022. this.beatParam[name] = '';
  2023. }
  2024. },
  2025. changeUnit() {
  2026. this.beatParam.newTime = '';
  2027. this.beatParam.time = '';
  2028. this.beatParam.newBeatPrepareTime = '';
  2029. this.beatParam.beatPrepareTime = '';
  2030. this.beatParam.newBeatTime = '';
  2031. this.beatParam.beatTime = '';
  2032. this.beatParam.newBeatRestTime = '';
  2033. this.beatParam.beatRestTime = '';
  2034. this.beatParam.taskPrice = '';
  2035. },
  2036. handSubstitution(row) {
  2037. this.$refs.replaceMaterialRef.open(row);
  2038. },
  2039. replaceSelected(id, list) {
  2040. let _arr = [];
  2041. _arr = this.tableData.taskParam[this.currentIndex].materialQuota;
  2042. _arr.forEach((item) => {
  2043. if (item.id === id) {
  2044. item.replaceMaterial = list;
  2045. }
  2046. });
  2047. this.tableData.taskParam[this.currentIndex].materialQuota = _arr;
  2048. }
  2049. }
  2050. };
  2051. </script>
  2052. <style lang="scss" scoped>
  2053. .btns {
  2054. text-align: center;
  2055. padding: 10px 0;
  2056. }
  2057. .downLoad {
  2058. display: flex;
  2059. }
  2060. .toolbar_box {
  2061. float: right;
  2062. margin-right: 10px;
  2063. > div {
  2064. display: flex;
  2065. align-items: center;
  2066. justify-content: center;
  2067. > span {
  2068. width: 150px;
  2069. }
  2070. > div {
  2071. margin-left: 10px;
  2072. }
  2073. }
  2074. }
  2075. .item-height {
  2076. margin-bottom: 20px;
  2077. }
  2078. </style>