singleProductJobBom.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name"> 报工信息: ({{ list.length || 0 }})个</view>
  5. </view>
  6. <view
  7. :class="[
  8. 'material',
  9. it.extInfo.reportWeight && it.extInfo.reportWeight && 'materialBor',
  10. ]"
  11. v-for="(it, idx) in list"
  12. :key="idx"
  13. >
  14. <view class="content_table">
  15. <view class="item rx-sc">
  16. <view class="rx">
  17. <view class="lable lable190 rx-cc" @click="getDelete2(idx)">
  18. <view class="round">{{ idx + 1 }}</view>
  19. <uni-icons
  20. custom-prefix="iconfont"
  21. type="icon-shanchu"
  22. size="16"
  23. color="#fa3534"
  24. ></uni-icons>
  25. 物料编码
  26. </view>
  27. <view class="content rx-bc">
  28. <view>{{ it.code }} </view>
  29. <view
  30. class="tag_box"
  31. v-if="
  32. Object.prototype.hasOwnProperty.call(it, 'extInfo') &&
  33. Object.prototype.hasOwnProperty.call(
  34. it.extInfo,
  35. 'productionTimes'
  36. ) &&
  37. Object.prototype.hasOwnProperty.call(
  38. it.extInfo.productionTimes,
  39. item.currentTaskDiagram.taskId
  40. )
  41. "
  42. >
  43. {{ it.extInfo.productionTimes[item.currentTaskDiagram.taskId] }}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="item rx-sc">
  49. <view class="rx">
  50. <view class="lable lable150 rx-cc">名称</view>
  51. <view class="content rx-bc">
  52. <view
  53. >{{ it.name }}
  54. <text
  55. v-if="[2, 23, 9, 28].includes(Number(it.rootCategoryLevelId))"
  56. >
  57. ({{
  58. it.rootCategoryLevelId == 2
  59. ? "在制品"
  60. : it.rootCategoryLevelId == 23
  61. ? "半成品"
  62. : it.rootCategoryLevelId == 9
  63. ? "产品"
  64. : it.rootCategoryLevelId == 28
  65. ? "废品"
  66. : ""
  67. }})
  68. </text>
  69. </view>
  70. <view class="rx-ec">
  71. <view
  72. class="tag_box"
  73. v-if="it.isCache"
  74. style="margin-right: -36rpx; margin-right: 4rpx"
  75. >缓</view
  76. >
  77. <view
  78. class="tag_box"
  79. v-if="
  80. Object.prototype.hasOwnProperty.call(
  81. it.extInfo,
  82. 'isOutsource'
  83. ) && it.extInfo.isOutsource == 1
  84. "
  85. style="margin-right: -36rpx"
  86. >委外</view
  87. >
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="item rx-sc">
  93. <view class="rx">
  94. <view class="lable lable150 rx-cc">型号</view>
  95. <view class="content rx-sc">
  96. <view>{{ it.modelType }}</view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="item rx-sc">
  101. <view class="rx">
  102. <view class="lable lable150 rx-cc">规格</view>
  103. <view class="content rx-sc">
  104. <view>{{ it.specification }}</view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="item rx-sc">
  109. <view class="rx ww50">
  110. <view class="lable lable150 rx-cc">批次号</view>
  111. <view class="content content_num">
  112. <view v-if="isDetails">{{ it.batchNo }}</view>
  113. <input class="uni-input" v-else v-model="it.batchNo" />
  114. </view>
  115. </view>
  116. <view class="rx ww50">
  117. <view class="lable lable150 rx-cc">牌号</view>
  118. <view class="content content_num">
  119. <view>{{ it.brandNum }}</view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="item rx-sc">
  124. <view class="rx ww50">
  125. <view class="lable lable150 rx-cc">物料代号</view>
  126. <view class="content content_num">
  127. <view v-if="isDetails">{{ it.extInfo.materielCode }}</view>
  128. <input
  129. class="uni-input"
  130. v-else
  131. v-model="it.extInfo.materielCode"
  132. />
  133. </view>
  134. </view>
  135. <view class="rx ww50">
  136. <view class="lable lable150 rx-cc">客户代号</view>
  137. <view class="content content_num">
  138. <view v-if="isDetails">{{ it.extInfo.clientCode }}</view>
  139. <input class="uni-input" v-else v-model="it.extInfo.clientCode" />
  140. </view>
  141. </view>
  142. </view>
  143. <view class="item rx-sc">
  144. <view class="rx ww50">
  145. <view class="lable lable150 rx-cc">刻码</view>
  146. <view class="content content_num">
  147. <view v-if="isDetails">{{ it.extInfo.engrave }}</view>
  148. <input class="uni-input" v-else v-model="it.extInfo.engrave" />
  149. </view>
  150. </view>
  151. <view class="rx ww50">
  152. <view class="lable lable150 rx-cc">序列号</view>
  153. <view class="content content_num">
  154. <view v-if="isDetails">{{ it.extInfo.productSequence }}</view>
  155. </view>
  156. </view>
  157. </view>
  158. <view class="item rx-sc">
  159. <view class="rx ww50">
  160. <view class="lable lable150 rx-cc">设备</view>
  161. <view class="content">
  162. <view v-if="isDetails">{{ it.deviceName }}</view>
  163. <zxz-uni-data-select
  164. :localdata="deviceList"
  165. v-model="it.deviceId"
  166. dataValue="instanceId"
  167. format="{name}"
  168. dataKey="instanceId"
  169. filterable
  170. :clear="false"
  171. v-else
  172. ></zxz-uni-data-select>
  173. </view>
  174. </view>
  175. <view class="rx ww50">
  176. <view class="lable lable150 rx-cc">炉次号</view>
  177. <view class="content content_num">
  178. <view v-if="isDetails">{{ it.extInfo.heatNumber }}</view>
  179. <input class="uni-input" v-else v-model="it.extInfo.heatNumber" />
  180. </view>
  181. </view>
  182. </view>
  183. <view class="item rx-sc">
  184. <view class="rx ww50">
  185. <view class="lable lable150 rx-cc">位置</view>
  186. <view class="content content_num">
  187. <view v-if="isDetails">{{ it.extInfo.position }}</view>
  188. <input class="uni-input" v-else v-model="it.extInfo.position" />
  189. </view>
  190. </view>
  191. </view>
  192. <view class="item rx-sc">
  193. <view class="rx ww45">
  194. <view class="lable lable150 rx-cc">是否合格</view>
  195. <view class="content content_num">
  196. <zxz-uni-data-select
  197. :localdata="isQualifiedList"
  198. v-model="it.extInfo.isQualified"
  199. dataValue="code"
  200. format="{name}"
  201. dataKey="code"
  202. filterable
  203. :disabled="isDetails"
  204. :clear="false"
  205. @change="handleInput"
  206. ></zxz-uni-data-select>
  207. </view>
  208. </view>
  209. <view
  210. class="rx ww45"
  211. v-if="it.extInfo.isQualified && it.extInfo.isQualified == 2"
  212. >
  213. <view class="lable lable150 rx-cc">处置类型</view>
  214. <view class="content content_num">
  215. <zxz-uni-data-select
  216. :localdata="notTypeList"
  217. v-model="it.extInfo.notType"
  218. dataValue="code"
  219. format="{name}"
  220. dataKey="code"
  221. filterable
  222. :disabled="isDetails"
  223. :clear="false"
  224. ></zxz-uni-data-select>
  225. </view>
  226. </view>
  227. </view>
  228. <view class="item rx-sc">
  229. <view class="rx ww50">
  230. <view class="lable lable150 rx-cc">原因/处置</view>
  231. <view
  232. class="content content_num"
  233. v-if="
  234. it.extInfo.isQualified != 1 &&
  235. it.extInfo.notType != 5 &&
  236. it.extInfo.notType != 8 &&
  237. it.extInfo.notType
  238. "
  239. >
  240. <view v-if="isDetails">{{ it.extInfo.notReason }}</view>
  241. <input class="uni-input" v-else v-model="it.extInfo.notReason" />
  242. </view>
  243. <view
  244. v-if="![1, 2, 3, 4, 6, 9, 7].includes(Number(it.extInfo.notType))"
  245. class="content content_num"
  246. >
  247. <span v-if="isDetails">{{ it.extInfo.taskName }}</span>
  248. <zxz-uni-data-select
  249. v-else
  250. :localdata="stepsList"
  251. v-model="it.extInfo.taskId"
  252. dataValue="taskId"
  253. format="{taskTypeName}"
  254. dataKey="taskId"
  255. filterable
  256. :disabled="isDetails"
  257. :clear="false"
  258. >
  259. </zxz-uni-data-select>
  260. </view>
  261. <!-- <view class="content content_num"> {{ "" }}</view> -->
  262. </view>
  263. <view class="rx ww50">
  264. <view class="lable lable150 rx-cc">报工重量</view>
  265. <view class="content content_num">
  266. <view v-if="isDetails">{{ it.extInfo.reportWeight }}</view>
  267. <input
  268. class="uni-input"
  269. v-else
  270. v-model="it.extInfo.reportWeight"
  271. @input="handleInput"
  272. />
  273. </view>
  274. </view>
  275. </view>
  276. </view>
  277. <view
  278. class="content_table2"
  279. v-if="
  280. ![1, 2, 3, 4].includes(Number(it.extInfo.notType)) &&
  281. clientEnvironmentId == 3
  282. "
  283. >
  284. <view class="head row rx-sc">
  285. <view class="item ww25" style="font-size: 20rpx"
  286. >{{ it.extInfo.newWeight ? "上道工序重量" : "物料重量" }}
  287. {{ it.extInfo.weightUnit }}
  288. </view>
  289. <view class="item ww25">报工重量{{ it.extInfo.weightUnit }}</view>
  290. <view class="item ww25" v-if="isFirstTask == 1">质检结果 </view>
  291. <view class="item ww25" :class="[isFirstTask == 1 ? 'ww25' : 'ww50']"
  292. >处置
  293. </view>
  294. </view>
  295. <view class="table">
  296. <view class="tr row rx-sc">
  297. <view
  298. class="item ww25"
  299. v-if="
  300. Object.prototype.hasOwnProperty.call(it.extInfo, 'newWeight') &&
  301. it.extInfo.newWeight
  302. "
  303. >
  304. {{ it.extInfo.newWeight }}
  305. </view>
  306. <view
  307. class="item ww25 content_num"
  308. v-if="
  309. !Object.prototype.hasOwnProperty.call(
  310. it.extInfo,
  311. 'newWeight'
  312. ) ||
  313. it.extInfo.newWeight == null ||
  314. it.extInfo.newWeight == 0
  315. "
  316. >
  317. <input
  318. class="uni-input"
  319. v-model="it.extInfo.weight"
  320. type="digit"
  321. />
  322. </view>
  323. <view class="item ww25 content_num">
  324. <view v-if="isDetails">{{ it.extInfo.reportWeight }}</view>
  325. <input
  326. class="uni-input"
  327. v-else
  328. v-model="it.extInfo.reportWeight"
  329. type="digit"
  330. @input="handleInput"
  331. />
  332. </view>
  333. <view
  334. class="item ww25"
  335. @click="openNumerate(it, idx)"
  336. v-if="isFirstTask == 1"
  337. >
  338. <view class="numerate">点击计算</view>
  339. </view>
  340. <view
  341. class="item"
  342. v-if="isDetails"
  343. :class="[isFirstTask == 1 ? 'ww25' : 'ww50']"
  344. >
  345. {{ it.extInfo.taskName }}
  346. </view>
  347. <view
  348. class="item"
  349. v-else
  350. :class="[isFirstTask == 1 ? 'ww25' : 'ww50']"
  351. >
  352. <zxz-uni-data-select
  353. :localdata="stepsList"
  354. v-model="it.extInfo.taskId"
  355. dataValue="taskId"
  356. format="{taskTypeName}"
  357. dataKey="taskId"
  358. filterable
  359. @change="(e) => (it.extInfo.taskName = e.taskTypeName)"
  360. :clear="false"
  361. ></zxz-uni-data-select>
  362. </view>
  363. </view>
  364. </view>
  365. </view>
  366. </view>
  367. <u-popup
  368. :show="show"
  369. mode="center"
  370. v-if="show"
  371. :closeOnClickOverlay="false"
  372. >
  373. <view class="popup_box">
  374. <view class="title_box rx-bc">
  375. <view class="name">工序计算列表</view>
  376. <view class="btn_box rx-ec">
  377. <view class="btn" @click="handAddParam">新增</view>
  378. </view>
  379. </view>
  380. <view class="content_table2">
  381. <view class="head row rx-sc">
  382. <view class="item ww30">工序名称</view>
  383. <view class="item ww20">坯体密度</view>
  384. <view class="item ww20">密度系数</view>
  385. <view class="item ww20">重量</view>
  386. <view class="item ww10">操作</view>
  387. </view>
  388. <view class="table">
  389. <view
  390. class="tr row rx-sc"
  391. v-for="(it, idx) in paramList"
  392. :key="idx"
  393. >
  394. <view class="item rx-bc ww30">
  395. <zxz-uni-data-select
  396. :localdata="stepsList"
  397. v-model="it.taskId"
  398. dataValue="taskId"
  399. format="{taskTypeName}"
  400. dataKey="taskId"
  401. filterable
  402. @change="(e) => (it.taskName = e.taskTypeName)"
  403. :clear="false"
  404. ></zxz-uni-data-select>
  405. </view>
  406. <view class="item ww20 content_num">
  407. <input
  408. class="uni-input"
  409. v-model="it.billet"
  410. type="digit"
  411. @input="changeInp(it, idx)"
  412. />
  413. </view>
  414. <view class="item ww20 content_num">
  415. <input
  416. class="uni-input"
  417. v-model="it.density"
  418. type="digit"
  419. @input="changeInp(it, idx)"
  420. />
  421. </view>
  422. <view
  423. class="item ww20"
  424. v-if="idx == 0 || idx != paramList.length - 1"
  425. >
  426. < {{ it.CVIWeight }}
  427. </view>
  428. <view
  429. class="item ww20"
  430. v-if="paramList.length > 1 && idx == paramList.length - 1"
  431. >
  432. ≥ {{ it.CVIWeight }}
  433. </view>
  434. <view class="item ww10 rx-cc" @click="getDelete(idx)">
  435. <uni-icons
  436. custom-prefix="iconfont"
  437. type="icon-shanchu"
  438. size="20"
  439. color="#fa3534"
  440. ></uni-icons>
  441. </view>
  442. </view>
  443. </view>
  444. <view class="formula_box"
  445. >计算公式: 物料重量/坯体密度*密度系数
  446. </view>
  447. <view class="rx-cc">
  448. <u-button
  449. size="small"
  450. class="u-reset-button"
  451. style="width: 300rpx; margin: 20rpx"
  452. type="success"
  453. @click="paramSave"
  454. >工序列表保存</u-button
  455. >
  456. </view>
  457. <view class="reportWeight rx-sc">
  458. 物料重量: {{ weight }} ; 报工重量: {{ reportWeight }}
  459. </view>
  460. </view>
  461. <view class="operate_box rx-sc">
  462. <u-button size="small" class="u-reset-button" @click="cancel"
  463. >取消</u-button
  464. >
  465. <u-button
  466. size="small"
  467. class="u-reset-button"
  468. type="success"
  469. @click="save"
  470. >确定</u-button
  471. >
  472. </view>
  473. </view>
  474. </u-popup>
  475. </view>
  476. </template>
  477. <script>
  478. import { getTaskInstanceList } from "@/api/pda/workOrder.js";
  479. import { saveParam, getComputeParam } from "@/api/pda/tangu.js";
  480. export default {
  481. props: {
  482. item: {
  483. type: Object,
  484. default: () => {},
  485. },
  486. list: {
  487. type: Array,
  488. default: () => [],
  489. },
  490. isDetails: {
  491. type: Boolean,
  492. default: false,
  493. },
  494. equipmentList: {
  495. type: Array,
  496. default: () => [],
  497. },
  498. },
  499. watch: {
  500. equipmentList: {
  501. immediate: true,
  502. deep: true,
  503. handler(newVal) {
  504. this.deviceList = newVal;
  505. this.changeHeatNumber();
  506. },
  507. },
  508. list: {
  509. immediate: true,
  510. deep: true,
  511. handler(newVal) {
  512. if (newVal.length) {
  513. console.log(newVal);
  514. this.newList = newVal;
  515. this.sumweight(newVal);
  516. // this.sunTj();
  517. }
  518. },
  519. },
  520. },
  521. data() {
  522. return {
  523. taskTypeName: null,
  524. isFirstTask: null,
  525. clientEnvironmentId:
  526. uni.getStorageSync("userInfo") &&
  527. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  528. show: false,
  529. rowIt: [],
  530. paramList: [],
  531. paramObj: {},
  532. weight: 0,
  533. reportWeight: 0,
  534. resultObj: {},
  535. resultIdx: 0,
  536. deviceList: [],
  537. newList: [],
  538. isQualifiedList: [
  539. {
  540. code: 1,
  541. name: "合格",
  542. },
  543. {
  544. code: 2,
  545. name: "不合格",
  546. },
  547. ],
  548. notTypeList: [
  549. {
  550. code: 1,
  551. name: "返工",
  552. },
  553. {
  554. code: 2,
  555. name: "返修",
  556. },
  557. {
  558. code: 3,
  559. name: "报废",
  560. },
  561. {
  562. code: 4,
  563. name: "降级使用",
  564. },
  565. {
  566. code: 5,
  567. name: "让步接收",
  568. },
  569. {
  570. code: 6,
  571. name: "留样",
  572. },
  573. {
  574. code: 7,
  575. name: "消耗",
  576. },
  577. {
  578. code: 8,
  579. name: "回用",
  580. },
  581. {
  582. code: 9,
  583. name: "转试销",
  584. },
  585. ],
  586. stepsList: [],
  587. };
  588. },
  589. created() {
  590. this.taskTypeName = this.item.currentTaskDiagram.taskTypeName;
  591. this.isFirstTask = this.item.currentTaskDiagram.isFirstTask;
  592. this.getSteps();
  593. this.getCompute();
  594. setTimeout(() => {
  595. this.handleInput();
  596. }, 800);
  597. },
  598. methods: {
  599. getSteps() {
  600. getTaskInstanceList(this.item.workOrderId).then((res) => {
  601. res.pop();
  602. this.stepsList = res;
  603. });
  604. },
  605. getCompute() {
  606. getComputeParam(
  607. this.item.workOrderId,
  608. this.item.currentTaskDiagram.taskId
  609. ).then((res) => {
  610. this.paramList = [];
  611. this.paramList = (res && res.paramList) || [];
  612. this.paramObj = res || {};
  613. });
  614. },
  615. handAddParam() {
  616. // billet: null,
  617. // density: null,
  618. // result: null,
  619. // PIPDensity: null,
  620. // volume: null,
  621. // coefficient: null
  622. if (this.isFirstTask == 1) {
  623. this.paramList.push({
  624. taskId: null,
  625. taskName: null,
  626. });
  627. }
  628. },
  629. getDelete(idx) {
  630. this.paramList.splice(idx, 1);
  631. },
  632. changeInp(item, index) {
  633. if (Number(item.billet) && Number(item.density)) {
  634. this.paramList[index].CVIWeight = (
  635. (Number(this.weight) / item.billet) *
  636. item.density
  637. ).toFixed(2);
  638. }
  639. },
  640. paramSave() {
  641. if (this.isFirstTask == 1 && this.paramList.length > 0) {
  642. let bol;
  643. let _i;
  644. bol = this.paramList.every((e, i) => {
  645. _i = i + 1;
  646. return e.taskId && e.billet && e.density;
  647. });
  648. if (!bol) {
  649. uni.showToast({
  650. title: `请完善第${_i}计算数据`,
  651. icon: "none",
  652. });
  653. return false;
  654. }
  655. if (this.paramList.length < 1) {
  656. uni.showToast({
  657. title: `请输入二个以上计算数据`,
  658. icon: "none",
  659. });
  660. return false;
  661. }
  662. }
  663. let param = {};
  664. if (!Object.prototype.hasOwnProperty.call(this.paramObj, "id")) {
  665. param = {
  666. paramList: this.paramList,
  667. workOrderId: this.item.workOrderId,
  668. taskId: this.item.currentTaskDiagram.taskId,
  669. };
  670. } else {
  671. this.paramObj.paramList = this.paramList;
  672. param = this.paramObj;
  673. }
  674. saveParam(param).then((res) => {
  675. uni.showToast({
  676. icon: "none",
  677. title: "操作成功",
  678. });
  679. this.getCompute();
  680. });
  681. },
  682. openNumerate(row, idx) {
  683. if (!row.extInfo.reportWeight) {
  684. uni.showToast({
  685. icon: "none",
  686. title: "请先输入报工重量",
  687. });
  688. return false;
  689. }
  690. this.weight = row.extInfo.weight;
  691. this.reportWeight = row.extInfo.reportWeight;
  692. this.resultIdx = idx;
  693. this.show = true;
  694. },
  695. handleInput() {
  696. let arr = JSON.parse(JSON.stringify(this.list));
  697. this.sumweight(arr);
  698. // this.sunTj();
  699. console.log("arr11111112222", arr);
  700. // console.log('this.list33333',this.list)
  701. },
  702. sumweight(arr) {
  703. let formedWeight = 0;
  704. let noFormedWeight = 0;
  705. arr.map((s, i) => {
  706. if (s.extInfo.reportWeight) {
  707. if (s.extInfo.isQualified == 1) {
  708. formedWeight += s.extInfo.reportWeight * 1;
  709. } else {
  710. noFormedWeight += s.extInfo.reportWeight * 1;
  711. }
  712. } else {
  713. s.extInfo.reportWeight = null;
  714. }
  715. this.$set(this.list[i].extInfo, "reportWeight", s.extInfo.reportWeight);
  716. });
  717. if (this.item.workReportInfo) {
  718. this.item.workReportInfo.formedWeight = parseFloat(
  719. formedWeight.toFixed(2)
  720. );
  721. this.item.workReportInfo.notFormedWeight = parseFloat(
  722. noFormedWeight.toFixed(2)
  723. );
  724. }
  725. },
  726. cancel() {
  727. this.show = false;
  728. this.reportWeight = 0;
  729. this.weight = 0;
  730. },
  731. taskChange(e) {
  732. console.log(e);
  733. },
  734. getDelete2(idx) {
  735. uni.showModal({
  736. title: "删除",
  737. content: "是否确实删除此物料!",
  738. confirmText: "确认", //这块是确定按钮的文字
  739. success: (rr) => {
  740. if (rr.confirm) {
  741. this.list.splice(idx, 1);
  742. }
  743. if (this.list.length != 0) {
  744. this.$set(this.item.workReportInfo, "formedNum", 0);
  745. this.$set(this.item.workReportInfo, "notFormedNum", 0);
  746. }
  747. this.$forceUpdate();
  748. },
  749. });
  750. },
  751. save() {
  752. if (this.isFirstTask == 1) {
  753. this.resultObj = {};
  754. if (Number(this.reportWeight) < Number(this.paramList[0].CVIWeight)) {
  755. this.resultObj = this.paramList[0];
  756. this.setDataSave();
  757. return false;
  758. }
  759. if (
  760. Number(this.reportWeight) >=
  761. this.paramList[this.paramList.length - 1].CVIWeight
  762. ) {
  763. this.resultObj = this.paramList[this.paramList.length - 1];
  764. this.setDataSave();
  765. return false;
  766. }
  767. for (let i = 1; i < this.paramList.length; i++) {
  768. console.log(i);
  769. console.log(
  770. 11,
  771. Number(this.paramList[i - 1].CVIWeight),
  772. Number(this.reportWeight)
  773. );
  774. if (
  775. Number(this.paramList[i - 1].CVIWeight) <
  776. Number(this.reportWeight) &&
  777. Number(this.reportWeight) < Number(this.paramList[i].CVIWeight)
  778. ) {
  779. this.resultObj = this.paramList[i];
  780. break;
  781. }
  782. }
  783. this.setDataSave();
  784. }
  785. },
  786. setDataSave() {
  787. this.$set(
  788. this.list[this.resultIdx].extInfo,
  789. "taskId",
  790. this.resultObj.taskId
  791. );
  792. this.$set(
  793. this.list[this.resultIdx].extInfo,
  794. "density",
  795. this.resultObj.density
  796. );
  797. this.$set(
  798. this.list[this.resultIdx].extInfo,
  799. "billet",
  800. this.resultObj.billet
  801. );
  802. this.$set(
  803. this.list[this.resultIdx].extInfo,
  804. "taskName",
  805. this.resultObj.taskName
  806. );
  807. this.cancel();
  808. },
  809. changeHeatNumber() {
  810. console.log(this.deviceList);
  811. this.deviceList.forEach((f) => {
  812. this.list.forEach((o) => {
  813. if (
  814. o.deviceId &&
  815. f.instanceId == o.deviceId &&
  816. this.deviceList.length > 1
  817. ) {
  818. o.extInfo.heatNumber = f.extInfo.heatNumber;
  819. o.deviceId = f.instanceId;
  820. this.$forceUpdate();
  821. } else if (this.deviceList.length == 1) {
  822. o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
  823. o.deviceId = this.deviceList[0].instanceId;
  824. this.$forceUpdate();
  825. } else if (this.deviceList.length > 1) {
  826. o.extInfo.heatNumber = f.extInfo.heatNumber;
  827. o.deviceId = f.instanceId;
  828. this.$forceUpdate();
  829. }
  830. // if (
  831. // o.deviceId &&
  832. // f.instanceId == o.deviceId &&
  833. // this.deviceList.length > 1
  834. // ) {
  835. // o.extInfo.heatNumber = f.extInfo.heatNumber;
  836. // this.$forceUpdate();
  837. // } else if (this.deviceList.length == 1) {
  838. // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
  839. // this.$forceUpdate();
  840. // }
  841. });
  842. });
  843. },
  844. },
  845. };
  846. </script>
  847. <style lang="scss" scoped>
  848. .title_box {
  849. margin-top: 20rpx;
  850. .name {
  851. font-size: 28rpx;
  852. font-style: normal;
  853. font-weight: 400;
  854. color: $theme-color;
  855. padding-left: 20rpx;
  856. position: relative;
  857. &:before {
  858. position: absolute;
  859. content: "";
  860. left: 0rpx;
  861. top: 0rpx;
  862. bottom: 0rpx;
  863. width: 4rpx;
  864. height: 28rpx;
  865. background: $theme-color;
  866. margin: auto;
  867. }
  868. }
  869. .btn_box {
  870. .btn {
  871. padding: 0 18rpx;
  872. height: 50rpx;
  873. line-height: 50rpx;
  874. background: $theme-color;
  875. font-size: 26rpx;
  876. font-style: normal;
  877. font-weight: 400;
  878. font-size: 24rpx;
  879. color: #fff;
  880. border-radius: 4rpx;
  881. margin-left: 24rpx;
  882. }
  883. }
  884. }
  885. .material {
  886. margin-top: 16rpx;
  887. border: 1rpx solid transparent;
  888. .content_table {
  889. width: 100%;
  890. border: 2rpx solid $border-color;
  891. box-sizing: border-box;
  892. .item {
  893. display: flex;
  894. border-bottom: 2rpx solid $border-color;
  895. .lable {
  896. width: 132rpx;
  897. text-align: center;
  898. background-color: #f7f9fa;
  899. font-size: 26rpx;
  900. border-right: 2rpx solid $border-color;
  901. flex-shrink: 0;
  902. }
  903. .lable150 {
  904. width: 156rpx !important;
  905. font-size: 24rpx;
  906. }
  907. .lable190 {
  908. width: 200rpx !important;
  909. font-size: 24rpx;
  910. }
  911. .ww80 {
  912. width: 80rpx;
  913. }
  914. .content {
  915. width: 518rpx;
  916. min-height: 64rpx;
  917. font-size: 28rpx;
  918. line-height: 28rpx;
  919. font-style: normal;
  920. font-weight: 400;
  921. padding: 18rpx 8rpx;
  922. box-sizing: border-box;
  923. word-wrap: break-word;
  924. flex-grow: 1 !important;
  925. .unit {
  926. padding: 0 4rpx;
  927. font-size: 24rpx;
  928. color: #404446;
  929. }
  930. .penalize {
  931. width: 160rpx;
  932. line-height: 60rpx;
  933. background: $theme-color;
  934. font-size: 24rpx;
  935. text-align: center;
  936. color: #fff;
  937. }
  938. }
  939. .content_H {
  940. min-height: 92rpx;
  941. }
  942. .pd4 {
  943. padding: 4rpx 8rpx;
  944. }
  945. &:last-child {
  946. border-bottom: none;
  947. }
  948. }
  949. .ww55 {
  950. width: 55%;
  951. }
  952. .ww50 {
  953. width: 50%;
  954. }
  955. .ww45 {
  956. width: 45%;
  957. }
  958. .tag_box {
  959. padding: 2rpx 10rpx;
  960. margin-right: 12rpx;
  961. background: #e6a23c;
  962. font-size: 22rpx;
  963. color: #fff;
  964. border-radius: 4rpx;
  965. }
  966. }
  967. }
  968. .materialBor {
  969. border: 1rpx solid #157a2c;
  970. }
  971. .content_table2 {
  972. width: 100%;
  973. .row {
  974. width: 100%;
  975. .item {
  976. color: #404446;
  977. font-size: 28rpx;
  978. padding-left: 12rpx;
  979. }
  980. .color157 {
  981. color: $theme-color;
  982. }
  983. .ww30 {
  984. width: 30%;
  985. }
  986. .ww20 {
  987. width: 20%;
  988. }
  989. .ww15 {
  990. width: 15%;
  991. }
  992. .ww25 {
  993. width: 25%;
  994. }
  995. .ww50 {
  996. width: 50%;
  997. }
  998. .ww10 {
  999. width: 10%;
  1000. }
  1001. }
  1002. .head {
  1003. height: 64rpx;
  1004. background: #f7f9fa;
  1005. // border-top: 2rpx solid #E3E5E5;
  1006. border-left: 2rpx solid #e3e5e5;
  1007. box-sizing: border-box;
  1008. .item {
  1009. height: 64rpx;
  1010. line-height: 64rpx;
  1011. border-right: 2rpx solid #e3e5e5;
  1012. box-sizing: border-box;
  1013. font-size: 22rpx;
  1014. }
  1015. }
  1016. .tr {
  1017. border-top: 2rpx solid #e3e5e5;
  1018. border-left: 2rpx solid #e3e5e5;
  1019. .item {
  1020. font-size: 24rpx;
  1021. min-height: 74rpx;
  1022. display: flex;
  1023. align-items: center;
  1024. border-right: 2rpx solid #e3e5e5;
  1025. box-sizing: border-box;
  1026. white-space: normal;
  1027. word-break: break-all;
  1028. }
  1029. &:last-child {
  1030. border-bottom: 2rpx solid #e3e5e5;
  1031. }
  1032. .numerate {
  1033. font-size: 22rpx;
  1034. color: $theme-color;
  1035. }
  1036. }
  1037. }
  1038. .content_num {
  1039. display: flex;
  1040. align-items: center;
  1041. padding: 0 4rpx;
  1042. /deep/ .uni-input-input {
  1043. border: 2rpx solid #f0f8f2;
  1044. background: #f0f8f2;
  1045. color: $theme-color;
  1046. }
  1047. }
  1048. .round {
  1049. width: 32rpx;
  1050. height: 32rpx;
  1051. line-height: 30rpx;
  1052. text-align: center;
  1053. border-radius: 50%;
  1054. background: $theme-color;
  1055. font-size: 24rpx;
  1056. font-style: normal;
  1057. font-weight: 400;
  1058. color: #fff;
  1059. margin-right: 10rpx;
  1060. }
  1061. .popup_box {
  1062. width: 94vw;
  1063. padding: 16rpx 12rpx;
  1064. box-sizing: border-box;
  1065. }
  1066. .operate_box {
  1067. margin-top: 32rpx;
  1068. padding: 10rpx 100rpx;
  1069. /deep/ .u-button {
  1070. width: 160rpx;
  1071. }
  1072. }
  1073. .formula_box {
  1074. font-size: 24rpx;
  1075. font-style: normal;
  1076. font-weight: 400;
  1077. margin-top: 12rpx;
  1078. }
  1079. .reportWeight {
  1080. font-size: 24rpx;
  1081. font-style: normal;
  1082. font-weight: 400;
  1083. margin-top: 30rpx;
  1084. text {
  1085. color: $theme-color;
  1086. }
  1087. }
  1088. </style>