semiProductJobBomPL.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  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="it.id + 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
  71. class="tag_box"
  72. v-if="it.isCache"
  73. style="margin-right: -36rpx"
  74. >缓</view
  75. >
  76. </view>
  77. </view>
  78. </view>
  79. <view class="item rx-sc">
  80. <view class="rx">
  81. <view class="lable lable150 rx-cc">型号</view>
  82. <view class="content rx-sc">
  83. <view>{{ it.modelType }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- <view class="item rx-sc">
  88. <view class="rx ww50">
  89. <view class="lable lable150 rx-cc ">设备</view>
  90. <view class="content rx-sc">
  91. <view>{{ it.deviceName || it.extInfo.deviceName }}</view>
  92. </view>
  93. </view>
  94. <view class="rx ww50">
  95. <view class="lable lable150 rx-cc ">炉次号</view>
  96. <view class="content content_num ">
  97. <view v-if='isDetails'>{{it.extInfo.heatNumber }}</view>
  98. <input class="uni-input" v-else v-model="it.extInfo.heatNumber"></input>
  99. </view>
  100. </view>
  101. </view> -->
  102. <view class="item rx-sc">
  103. <view class="rx">
  104. <view class="lable lable190 rx-cc"
  105. >{{ it.extInfo.newWeight ? "上道工序总重量" : "物料总重量" }}(
  106. {{ it.extInfo.weightUnit }})
  107. </view>
  108. <view class="content content_num rx-sc">
  109. <view v-if="it.extInfo.newWeight"
  110. >{{ it.extInfo.newWeight }}
  111. </view>
  112. <input
  113. v-else
  114. class="uni-input"
  115. size="mini"
  116. v-model="it.extInfo.weight"
  117. />
  118. </view>
  119. </view>
  120. </view>
  121. <view class="item rx-sc">
  122. <view class="rx ww50">
  123. <view class="lable lable150 rx-cc">投料数量</view>
  124. <view class="content content_num">
  125. <view style="color: #157a2c">{{ it.feedQuantity }}</view>
  126. </view>
  127. </view>
  128. <view class="rx ww50">
  129. <view class="lable lable150 rx-cc">投料类型</view>
  130. <view class="content rx-sc" style="color: #157a2c">
  131. <view>批量投料</view>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. <view class="content_table2">
  137. <view class="head row rx-sc">
  138. <view class="item ww15" style="font-size: 20rpx"> 合格品数量 </view>
  139. <view class="item ww25">报工总重量/{{ it.extInfo.weightUnit }} </view>
  140. <view class="item ww20" style="font-size: 20rpx"> 设备 </view>
  141. <view class="item ww20" style="font-size: 20rpx"> 炉次号 </view>
  142. <view class="item ww20 rx-bc">
  143. <text>处置</text>
  144. <image
  145. v-if="!isDetails"
  146. class="icon"
  147. @click="handAddListPL(it, idx)"
  148. src="~@/static/pda/add.svg"
  149. style="width: 46rpx; height: 46rpx; margin-right: 12rpx"
  150. ></image>
  151. </view>
  152. <view class="item ww10"> 操作 </view>
  153. </view>
  154. <view class="table">
  155. <view
  156. class="tr row rx-sc"
  157. v-for="(yy, yyIdx) in it.extInfo.batchReportInfo"
  158. >
  159. <view class="item ww15 content_num">
  160. <view v-if="isDetails">{{ yy.allFeedQuantity }}</view>
  161. <input
  162. class="uni-input"
  163. v-else
  164. v-model="yy.allFeedQuantity"
  165. @input="blurNum($event, idx, yyIdx)"
  166. type="number"
  167. v-show="keyYes"
  168. />
  169. </view>
  170. <view class="item ww25 content_num">
  171. <view v-if="isDetails">{{ yy.allReportWeight }}</view>
  172. <input
  173. class="uni-input"
  174. v-else
  175. v-model="yy.allReportWeight"
  176. type="digit"
  177. @input="blurWeight(it, idx, yyIdx)"
  178. />
  179. </view>
  180. <view class="item ww20 content_num">
  181. <view v-if="isDetails">{{ yy.deviceName }}</view>
  182. <zxz-uni-data-select
  183. v-else
  184. :localdata="deviceList"
  185. v-model="yy.deviceId"
  186. dataValue="instanceId"
  187. format="{name}"
  188. dataKey="instanceId"
  189. filterable
  190. @change="(e) => selectValBatch(e, it, idx, yyIdx)"
  191. :clear="false"
  192. ></zxz-uni-data-select>
  193. </view>
  194. <view class="item ww20 content_num">
  195. <view v-if="isDetails">{{ yy.heatNumber }}</view>
  196. <input
  197. class="uni-input"
  198. v-else
  199. v-model="yy.heatNumber"
  200. type="digit"
  201. />
  202. </view>
  203. <view class="item ww20" v-if="isDetails">
  204. {{ yy.taskName }}
  205. </view>
  206. <view class="item ww20" v-else>
  207. <zxz-uni-data-select
  208. :localdata="stepsList"
  209. v-model="yy.taskId"
  210. dataValue="taskId"
  211. format="{taskTypeName}"
  212. dataKey="taskId"
  213. filterable
  214. @change="(e) => (yy.taskName = e.taskTypeName)"
  215. :clear="false"
  216. ></zxz-uni-data-select>
  217. </view>
  218. <view class="item ww10">
  219. <uni-icons
  220. v-if="!isDetails"
  221. custom-prefix="iconfont"
  222. type="icon-shanchu"
  223. size="16"
  224. @click="handDel3(idx, yyIdx)"
  225. color="#fa3534"
  226. ></uni-icons>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. <view class="content_table2">
  232. <view class="head row rx-sc">
  233. <view class="item ww15" style="font-size: 20rpx"> 不合格数 </view>
  234. <view class="item ww10" style="font-size: 20rpx"> 重量 </view>
  235. <view class="item ww15">类型</view>
  236. <view class="item ww15" style="font-size: 20rpx"> 设备 </view>
  237. <view class="item ww15" style="font-size: 20rpx"> 炉次号 </view>
  238. <view class="item ww25 rx-bc">
  239. <text>处置/原因</text>
  240. <image
  241. v-if="!isDetails"
  242. class="icon"
  243. @click="handAddListPL4(it, idx)"
  244. src="~@/static/pda/add.svg"
  245. style="width: 46rpx; height: 46rpx; margin-right: 12rpx"
  246. ></image>
  247. </view>
  248. <view class="item ww10"> 操作 </view>
  249. </view>
  250. <view class="table">
  251. <view
  252. class="tr row rx-sc"
  253. v-for="(yy, yyIdx) in it.extInfo.notBatchReportInfo"
  254. :key="'not' + idx + yyIdx"
  255. >
  256. <view class="item ww10 content_num">
  257. <view v-if="isDetails">{{ yy.allFeedQuantity }}</view>
  258. <input
  259. class="uni-input"
  260. v-else
  261. v-model="yy.allFeedQuantity"
  262. @input="blurNum2($event, idx, yyIdx)"
  263. type="number"
  264. v-show="keyNo"
  265. />
  266. </view>
  267. <view class="item ww10 content_num">
  268. <view v-if="isDetails">{{ yy.allReportWeight }}</view>
  269. <input
  270. class="uni-input"
  271. v-else
  272. v-model="yy.allReportWeight"
  273. type="number"
  274. @input="blurWeight2(it, idx, yyIdx)"
  275. />
  276. </view>
  277. <view class="item ww15 content_num">
  278. <zxz-uni-data-select
  279. :localdata="notTypeList"
  280. v-model="yy.notType"
  281. dataValue="code"
  282. format="{name}"
  283. dataKey="code"
  284. filterable
  285. :disabled="isDetails"
  286. @change="handLoad()"
  287. :clear="false"
  288. ></zxz-uni-data-select>
  289. </view>
  290. <view class="item ww15 content_num">
  291. <view v-if="isDetails">{{ yy.deviceName }}</view>
  292. <zxz-uni-data-select
  293. :localdata="deviceList"
  294. v-model="yy.deviceId"
  295. dataValue="instanceId"
  296. format="{name}"
  297. dataKey="instanceId"
  298. filterable
  299. @change="(e) => selectValNoBatch(e, it, idx, yyIdx)"
  300. :clear="false"
  301. ></zxz-uni-data-select>
  302. </view>
  303. <view class="item ww15 content_num">
  304. <view v-if="isDetails">{{ yy.heatNumber }}</view>
  305. <input class="uni-input" v-else v-model="yy.heatNumber" />
  306. </view>
  307. <view class="item ww25" v-if="isDetails">
  308. {{ yy.notType == 5 ? yy.taskName : yy.notReason }}
  309. </view>
  310. <view
  311. class="item ww25 content_num"
  312. v-if="!isDetails && yy.notType == 5"
  313. >
  314. <zxz-uni-data-select
  315. :localdata="stepsList"
  316. v-model="yy.taskId"
  317. dataValue="taskId"
  318. format="{taskTypeName}"
  319. dataKey="taskId"
  320. filterable
  321. @change="(e) => (yy.taskName = e.taskTypeName)"
  322. :clear="false"
  323. ></zxz-uni-data-select>
  324. </view>
  325. <view
  326. class="item ww25 content_num"
  327. v-if="!isDetails && yy.notType != 5"
  328. >
  329. <input
  330. class="uni-input"
  331. v-if="yy.notType != 5"
  332. v-model="yy.notReason"
  333. />
  334. </view>
  335. <view class="item ww10">
  336. <uni-icons
  337. v-if="!isDetails"
  338. custom-prefix="iconfont"
  339. type="icon-shanchu"
  340. size="16"
  341. @click="handDel4(idx, yyIdx)"
  342. color="#fa3534"
  343. ></uni-icons>
  344. </view>
  345. </view>
  346. </view>
  347. </view>
  348. </view>
  349. </view>
  350. </template>
  351. <script>
  352. import { getTaskInstanceList } from "@/api/pda/workOrder.js";
  353. export default {
  354. props: {
  355. item: {
  356. type: Object,
  357. default: () => {},
  358. },
  359. list: {
  360. type: Array,
  361. default: () => [],
  362. },
  363. isDetails: {
  364. type: Boolean,
  365. default: false,
  366. },
  367. equipmentList: {
  368. type: Array,
  369. default: () => [],
  370. },
  371. },
  372. watch: {
  373. equipmentList: {
  374. immediate: true,
  375. deep: true,
  376. handler(newVal) {
  377. // this.deviceList = newVal
  378. //设备下拉框数据来源
  379. let newData = JSON.parse(JSON.stringify(newVal));
  380. if (this.isDetails) {
  381. this.deviceList = newData;
  382. } else {
  383. this.deviceArr(newData);
  384. }
  385. this.changeHeatNumber();
  386. },
  387. },
  388. },
  389. data() {
  390. return {
  391. stepsList: [],
  392. deviceList: [],
  393. notTypeList: [
  394. {
  395. code: "1",
  396. name: "返工",
  397. },
  398. {
  399. code: "2",
  400. name: "返修",
  401. },
  402. {
  403. code: "3",
  404. name: "报废",
  405. },
  406. {
  407. code: "4",
  408. name: "降级使用",
  409. },
  410. {
  411. code: "5",
  412. name: "让步接收",
  413. },
  414. ],
  415. keyNo: "1",
  416. keyYes: "1",
  417. };
  418. },
  419. created() {
  420. this.getSteps();
  421. console.log(this.list);
  422. },
  423. mounted() {
  424. this.theFirst();
  425. },
  426. methods: {
  427. theFirst() {
  428. if (this.deviceList.length > 0) {
  429. let obj = this.deviceList[0];
  430. this.list.map((item, index) => {
  431. this.$set(
  432. this.list[index].extInfo.batchReportInfo[0],
  433. "deviceName",
  434. obj.name
  435. );
  436. this.$set(
  437. this.list[index].extInfo.batchReportInfo[0],
  438. "heatNumber",
  439. obj.extInfo.heatNumber
  440. );
  441. this.$set(
  442. this.list[index].extInfo.batchReportInfo[0],
  443. "deviceId",
  444. obj.instanceId
  445. );
  446. this.$set(
  447. this.list[index].extInfo.notBatchReportInfo[0],
  448. "deviceName",
  449. obj.name
  450. );
  451. this.$set(
  452. this.list[index].extInfo.notBatchReportInfo[0],
  453. "heatNumber",
  454. obj.extInfo.heatNumber
  455. );
  456. this.$set(
  457. this.list[index].extInfo.notBatchReportInfo[0],
  458. "deviceId",
  459. obj.instanceId
  460. );
  461. });
  462. }
  463. },
  464. getSteps() {
  465. getTaskInstanceList(this.item.workOrderId).then((res) => {
  466. if (this.item.singleReport == 1) {
  467. this.stepsList = res;
  468. } else {
  469. this.stepsList = res.filter((f) => f.type != 6);
  470. }
  471. });
  472. },
  473. deviceArr(data) {
  474. data.forEach((o, i) => {
  475. o.id = o.id ? o.id.toString() + "/" + i : "";
  476. o.instanceId = o.instanceId ? o.instanceId.toString() + "/" + i : "";
  477. });
  478. this.deviceList = data;
  479. if (this.deviceList.length == 0) {
  480. this.list.forEach((o, index) => {
  481. //碳谷合格分批设备炉次号
  482. o.extInfo.batchReportInfo.map((report, ridx) => {
  483. this.$set(
  484. this.list[index].extInfo.batchReportInfo[ridx],
  485. "deviceName",
  486. this.deviceList[0].name
  487. );
  488. this.$set(
  489. this.list[index].extInfo.batchReportInfo[ridx],
  490. "deviceId",
  491. this.deviceList[0].id || this.deviceList[0].instanceId
  492. );
  493. //炉次号
  494. this.$set(
  495. this.list[index].extInfo.batchReportInfo[ridx],
  496. "heatNumber",
  497. this.deviceList[0].extInfo.heatNumber
  498. );
  499. });
  500. o.extInfo.notBatchReportInfo.map((noReport, noidx) => {
  501. this.$set(
  502. this.list[index].extInfo.notBatchReportInfo[noidx],
  503. "deviceName",
  504. this.deviceList[0].name
  505. );
  506. this.$set(
  507. this.list[index].extInfo.notBatchReportInfo[noidx],
  508. "deviceId",
  509. this.deviceList[0].id || this.deviceList[0].instanceId
  510. );
  511. //炉次号
  512. this.$set(
  513. this.list[index].extInfo.notBatchReportInfo[noidx],
  514. "heatNumber",
  515. this.deviceList[0].extInfo.heatNumber
  516. );
  517. });
  518. //碳谷合格分批设备炉次号
  519. this.$forceUpdate();
  520. });
  521. }
  522. },
  523. handAddListPL(it, idx) {
  524. let deviceid = "";
  525. if (this.deviceList.length > 0) {
  526. deviceid = this.deviceList[0].id || this.deviceList[0].instanceId;
  527. }
  528. this.list[idx].extInfo.batchReportInfo.push({
  529. allFeedQuantity: "",
  530. allReportWeight: "",
  531. taskId: "",
  532. taskName: "",
  533. deviceId: deviceid ? deviceid : "",
  534. deviceName:
  535. this.deviceList.length > 0 ? this.deviceList[0].deviceName : "",
  536. heatNumber:
  537. this.deviceList.length > 0
  538. ? this.deviceList[0].extInfo.heatNumber
  539. : "",
  540. });
  541. this.$forceUpdate();
  542. },
  543. handDel3(idx, yyIdx) {
  544. this.list[idx].extInfo.batchReportInfo.splice(yyIdx, 1);
  545. },
  546. blurNum(event, idx, yyIdx) {
  547. let value = event.target.value;
  548. value = value.replace(/\./g, "");
  549. this.$set(
  550. this.list[idx].extInfo.batchReportInfo[yyIdx],
  551. "allFeedQuantity",
  552. value
  553. );
  554. let count = 0;
  555. this.list[idx].extInfo.batchReportInfo.forEach((m) => {
  556. count = count + Number(m.allFeedQuantity || 0);
  557. });
  558. let count2 = 0;
  559. this.list[idx].extInfo.notBatchReportInfo.forEach((m) => {
  560. count2 = count2 + Number(m.allFeedQuantity || 0);
  561. });
  562. this.keyYes = false;
  563. if (Number(count + count2) > this.list[idx].feedQuantity) {
  564. this.$set(
  565. this.list[idx].extInfo.batchReportInfo[yyIdx],
  566. "allFeedQuantity",
  567. 0
  568. );
  569. this.$forceUpdate();
  570. this.keyYes = true;
  571. uni.showToast({
  572. title: `投料数不能大于投料数量`,
  573. icon: "none",
  574. });
  575. this.$emit("countNumPl", this.list, idx);
  576. } else {
  577. this.keyYes = true;
  578. this.$emit("countNumPl", this.list, idx);
  579. }
  580. },
  581. blurWeight(it, idx, yyIdx) {
  582. this.$emit("countNumPl", this.list, idx);
  583. },
  584. blurWeight2(it, idx, yyIdx) {
  585. this.$emit("countNumPl", this.list, idx);
  586. },
  587. blurNum2(event, idx, yyIdx) {
  588. // let value = event.target.value;
  589. // value = value.replace(/\./g, '');
  590. // this.$set(this.list[idx].extInfo.notBatchReportInfo[yyIdx], 'allFeedQuantity', value);
  591. let count = 0;
  592. this.list[idx].extInfo.batchReportInfo.forEach((m) => {
  593. count = count + Number(m.allFeedQuantity || 0);
  594. });
  595. let count2 = 0;
  596. this.list[idx].extInfo.notBatchReportInfo.forEach((m) => {
  597. count2 = count2 + Number(m.allFeedQuantity || 0);
  598. });
  599. this.keyNo = false;
  600. if (Number(count + count2) > this.list[idx].feedQuantity) {
  601. this.$set(
  602. this.list[idx].extInfo.notBatchReportInfo[yyIdx],
  603. "allFeedQuantity",
  604. 0
  605. );
  606. this.$nextTick(() => {
  607. // this.$set(this.list[idx].extInfo.notBatchReportInfo[yyIdx], 'allFeedQuantity', 0)
  608. });
  609. this.keyNo = true;
  610. this.$forceUpdate();
  611. uni.showToast({
  612. title: `投料数不能大于投料数量`,
  613. icon: "none",
  614. });
  615. this.$emit("countNumPl", this.list, idx);
  616. } else {
  617. this.keyNo = true;
  618. this.$emit("countNumPl", this.list, idx);
  619. }
  620. },
  621. getDelete2(idx) {
  622. uni.showModal({
  623. title: "删除",
  624. content: "是否确实删除此物料!",
  625. confirmText: "确认", //这块是确定按钮的文字
  626. success: (rr) => {
  627. if (rr.confirm) {
  628. this.list.splice(idx, 1);
  629. }
  630. },
  631. });
  632. },
  633. selectValBatch(e, item, idx, bidx) {
  634. let obj = this.deviceList.find(
  635. (f) => f.id || f.instanceId == e.instanceId
  636. );
  637. //设备名称
  638. this.$set(
  639. this.list[idx].extInfo.batchReportInfo[bidx],
  640. "deviceName",
  641. obj.name
  642. );
  643. //炉次号
  644. this.$set(
  645. this.list[idx].extInfo.batchReportInfo[bidx],
  646. "heatNumber",
  647. obj.extInfo.heatNumber
  648. );
  649. //设备id
  650. this.$set(
  651. this.list[idx].extInfo.batchReportInfo[bidx],
  652. "deviceId",
  653. obj.id || obj.instanceId
  654. );
  655. this.$forceUpdate();
  656. },
  657. selectValNoBatch(e, item, idx, bidx) {
  658. let obj = this.deviceList.find(
  659. (f) => f.id || f.instanceId == e.instanceId
  660. );
  661. //设备名称
  662. this.$set(
  663. this.list[idx].extInfo.notBatchReportInfo[bidx],
  664. "deviceName",
  665. obj.name
  666. );
  667. //炉次号
  668. this.$set(
  669. this.list[idx].extInfo.notBatchReportInfo[bidx],
  670. "heatNumber",
  671. obj.extInfo.heatNumber
  672. );
  673. //设备id
  674. this.$set(
  675. this.list[idx].extInfo.notBatchReportInfo[bidx],
  676. "deviceId",
  677. obj.id || obj.instanceId
  678. );
  679. console.log("456", this.list[idx].extInfo.notBatchReportInfo[bidx]);
  680. this.$forceUpdate();
  681. },
  682. handAddListPL4(it, idx) {
  683. let deviceid = "";
  684. if (this.deviceList.length > 0) {
  685. deviceid = this.deviceList[0].id || this.deviceList[0].instanceId;
  686. }
  687. this.list[idx].extInfo.notBatchReportInfo.push({
  688. allFeedQuantity: "",
  689. allReportWeight: "",
  690. notType: "",
  691. taskId: "",
  692. taskName: "",
  693. notReason: "",
  694. deviceId: deviceid ? deviceid : "",
  695. deviceName:
  696. this.deviceList.length > 0 ? this.deviceList[0].deviceName : "",
  697. heatNumber:
  698. this.deviceList.length > 0
  699. ? this.deviceList[0].extInfo.heatNumber
  700. : "",
  701. });
  702. this.$forceUpdate();
  703. },
  704. handDel4(idx, yyIdx) {
  705. this.list[idx].extInfo.notBatchReportInfo.splice(yyIdx, 1);
  706. this.$forceUpdate();
  707. },
  708. handLoad() {
  709. this.$forceUpdate();
  710. },
  711. changeHeatNumber() {
  712. console.log(this.list, "PLList22222");
  713. this.deviceList.forEach((f) => {
  714. this.list.forEach((o, index) => {
  715. // o.deviceId &&
  716. // f.instanceId == o.deviceId &&
  717. if (this.deviceList.length > 1) {
  718. // o.extInfo.heatNumber = f.extInfo.heatNumber;
  719. this.$set(
  720. this.list[index].extInfo,
  721. "heatNumber",
  722. f.extInfo.heatNumber
  723. );
  724. //碳谷合格分批设备炉次号
  725. o.extInfo.batchReportInfo.map((report, ridx) => {
  726. if (report.deviceId == f.instanceId) {
  727. this.$set(
  728. this.list[index].extInfo.batchReportInfo[ridx],
  729. "heatNumber",
  730. f.extInfo.heatNumber
  731. );
  732. }
  733. });
  734. o.extInfo.notBatchReportInfo.map((noReport, noidx) => {
  735. if (noReport.deviceId == f.instanceId) {
  736. this.$set(
  737. this.list[index].extInfo.notBatchReportInfo[noidx],
  738. "heatNumber",
  739. f.extInfo.heatNumber
  740. );
  741. }
  742. });
  743. this.$forceUpdate();
  744. } else if (this.deviceList.length == 1) {
  745. o["deviceId"] = this.deviceList[0].id;
  746. // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
  747. this.$set(
  748. this.list[index].extInfo,
  749. "heatNumber",
  750. this.deviceList[0].extInfo.heatNumber
  751. );
  752. //碳谷合格分批设备炉次号
  753. o.extInfo.batchReportInfo.map((report, ridx) => {
  754. this.$set(
  755. this.list[index].extInfo.batchReportInfo[ridx],
  756. "deviceId",
  757. this.deviceList[0].instanceId
  758. );
  759. this.$set(
  760. this.list[index].extInfo.batchReportInfo[ridx],
  761. "heatNumber",
  762. this.deviceList[0].extInfo.heatNumber
  763. );
  764. this.$set(
  765. this.list[index].extInfo.batchReportInfo[ridx],
  766. "deviceName",
  767. this.deviceList[0].extInfo.name
  768. );
  769. });
  770. //碳谷合格分批设备炉次号
  771. o.extInfo.notBatchReportInfo.map((noReport, noidx) => {
  772. this.$set(
  773. this.list[index].extInfo.notBatchReportInfo[noidx],
  774. "deviceId",
  775. this.deviceList[0].instanceId
  776. );
  777. this.$set(
  778. this.list[index].extInfo.notBatchReportInfo[noidx],
  779. "heatNumber",
  780. this.deviceList[0].extInfo.heatNumber
  781. );
  782. this.$set(
  783. this.list[index].extInfo.notBatchReportInfo[noidx],
  784. "deviceName",
  785. this.deviceList[0].extInfo.name
  786. );
  787. });
  788. this.$forceUpdate();
  789. }
  790. });
  791. });
  792. },
  793. toFixedFn(weight, num) {
  794. let total = Number(weight) * Number(num);
  795. return total.toFixed(2);
  796. },
  797. },
  798. };
  799. </script>
  800. <style lang="scss" scoped>
  801. .title_box {
  802. margin-top: 20rpx;
  803. .name {
  804. font-size: 28rpx;
  805. font-style: normal;
  806. font-weight: 400;
  807. color: $theme-color;
  808. padding-left: 20rpx;
  809. position: relative;
  810. &:before {
  811. position: absolute;
  812. content: "";
  813. left: 0rpx;
  814. top: 0rpx;
  815. bottom: 0rpx;
  816. width: 4rpx;
  817. height: 28rpx;
  818. background: $theme-color;
  819. margin: auto;
  820. }
  821. }
  822. .btn_box {
  823. .btn {
  824. padding: 0 18rpx;
  825. height: 50rpx;
  826. line-height: 50rpx;
  827. background: $theme-color;
  828. font-size: 26rpx;
  829. font-style: normal;
  830. font-weight: 400;
  831. font-size: 24rpx;
  832. color: #fff;
  833. border-radius: 4rpx;
  834. margin-left: 24rpx;
  835. }
  836. }
  837. }
  838. .material {
  839. margin-top: 16rpx;
  840. border: 1rpx solid transparent;
  841. .content_table {
  842. width: 100%;
  843. border: 2rpx solid $border-color;
  844. box-sizing: border-box;
  845. .item {
  846. display: flex;
  847. border-bottom: 2rpx solid $border-color;
  848. .lable {
  849. width: 132rpx;
  850. text-align: center;
  851. background-color: #f7f9fa;
  852. font-size: 26rpx;
  853. border-right: 2rpx solid $border-color;
  854. flex-shrink: 0;
  855. }
  856. .lable150 {
  857. width: 156rpx !important;
  858. font-size: 24rpx;
  859. }
  860. .lable190 {
  861. width: 230rpx !important;
  862. font-size: 24rpx;
  863. }
  864. .ww80 {
  865. width: 80rpx;
  866. }
  867. .content {
  868. width: 500rpx;
  869. min-height: 64rpx;
  870. font-size: 28rpx;
  871. line-height: 28rpx;
  872. font-style: normal;
  873. font-weight: 400;
  874. padding: 18rpx 8rpx;
  875. box-sizing: border-box;
  876. word-wrap: break-word;
  877. flex-grow: 1 !important;
  878. .unit {
  879. padding: 0 4rpx;
  880. font-size: 24rpx;
  881. color: #404446;
  882. }
  883. .penalize {
  884. width: 160rpx;
  885. line-height: 60rpx;
  886. background: $theme-color;
  887. font-size: 24rpx;
  888. text-align: center;
  889. color: #fff;
  890. }
  891. }
  892. .content_H {
  893. min-height: 92rpx;
  894. }
  895. .pd4 {
  896. padding: 4rpx 8rpx;
  897. }
  898. &:last-child {
  899. border-bottom: none;
  900. }
  901. }
  902. .ww55 {
  903. width: 55%;
  904. }
  905. .ww10 {
  906. width: 10%;
  907. }
  908. .ww40 {
  909. width: 40%;
  910. }
  911. .ww50 {
  912. width: 50%;
  913. }
  914. .ww45 {
  915. width: 45%;
  916. }
  917. .tag_box {
  918. padding: 2rpx 10rpx;
  919. margin-right: 12rpx;
  920. background: #e6a23c;
  921. font-size: 22rpx;
  922. color: #fff;
  923. border-radius: 4rpx;
  924. }
  925. }
  926. }
  927. .materialBor {
  928. border: 1rpx solid #157a2c;
  929. }
  930. .content_table2 {
  931. width: 100%;
  932. .row {
  933. width: 100%;
  934. .item {
  935. color: #404446;
  936. font-size: 28rpx;
  937. padding-left: 12rpx;
  938. }
  939. .color157 {
  940. color: $theme-color;
  941. }
  942. .ww30 {
  943. width: 30%;
  944. }
  945. .ww20 {
  946. width: 20%;
  947. }
  948. .ww15 {
  949. width: 15%;
  950. }
  951. .ww25 {
  952. width: 25%;
  953. }
  954. .ww35 {
  955. width: 35%;
  956. }
  957. .ww50 {
  958. width: 50%;
  959. }
  960. .ww10 {
  961. width: 10%;
  962. }
  963. .ww40 {
  964. width: 40%;
  965. }
  966. }
  967. .head {
  968. height: 64rpx;
  969. background: #f7f9fa;
  970. // border-top: 2rpx solid #E3E5E5;
  971. border-left: 2rpx solid #e3e5e5;
  972. box-sizing: border-box;
  973. .item {
  974. height: 64rpx;
  975. line-height: 64rpx;
  976. border-right: 2rpx solid #e3e5e5;
  977. box-sizing: border-box;
  978. font-size: 22rpx;
  979. }
  980. }
  981. .tr {
  982. border-top: 2rpx solid #e3e5e5;
  983. border-left: 2rpx solid #e3e5e5;
  984. .item {
  985. font-size: 24rpx;
  986. min-height: 74rpx;
  987. display: flex;
  988. align-items: center;
  989. border-right: 2rpx solid #e3e5e5;
  990. box-sizing: border-box;
  991. white-space: normal;
  992. word-break: break-all;
  993. }
  994. &:last-child {
  995. border-bottom: 2rpx solid #e3e5e5;
  996. }
  997. .numerate {
  998. font-size: 22rpx;
  999. color: $theme-color;
  1000. }
  1001. }
  1002. }
  1003. .content_num {
  1004. display: flex;
  1005. align-items: center;
  1006. padding: 0 4rpx;
  1007. /deep/ .uni-input-input {
  1008. border: 2rpx solid #f0f8f2;
  1009. box-sizing: border-box;
  1010. background: #f0f8f2;
  1011. color: $theme-color;
  1012. }
  1013. }
  1014. .round {
  1015. width: 32rpx;
  1016. height: 32rpx;
  1017. line-height: 30rpx;
  1018. text-align: center;
  1019. border-radius: 50%;
  1020. background: $theme-color;
  1021. font-size: 24rpx;
  1022. font-style: normal;
  1023. font-weight: 400;
  1024. color: #fff;
  1025. margin-right: 10rpx;
  1026. }
  1027. </style>