singleProductJobBom.vue 30 KB

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