semiProductJobBomPL.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  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. this.$emit("countNumPl", this.list, idx);
  546. },
  547. blurNum(event, idx, yyIdx) {
  548. let value = event.target.value;
  549. value = value.replace(/\./g, "");
  550. this.$set(
  551. this.list[idx].extInfo.batchReportInfo[yyIdx],
  552. "allFeedQuantity",
  553. value
  554. );
  555. let count = 0;
  556. this.list[idx].extInfo.batchReportInfo.forEach((m) => {
  557. count = count + Number(m.allFeedQuantity || 0);
  558. });
  559. let count2 = 0;
  560. this.list[idx].extInfo.notBatchReportInfo.forEach((m) => {
  561. count2 = count2 + Number(m.allFeedQuantity || 0);
  562. });
  563. this.keyYes = false;
  564. if (Number(count + count2) > this.list[idx].feedQuantity) {
  565. this.$set(
  566. this.list[idx].extInfo.batchReportInfo[yyIdx],
  567. "allFeedQuantity",
  568. 0
  569. );
  570. this.$forceUpdate();
  571. this.keyYes = true;
  572. uni.showToast({
  573. title: `投料数不能大于投料数量`,
  574. icon: "none",
  575. });
  576. this.$emit("countNumPl", this.list, idx);
  577. } else {
  578. this.keyYes = true;
  579. this.$emit("countNumPl", this.list, idx);
  580. }
  581. },
  582. blurWeight(it, idx, yyIdx) {
  583. this.$emit("countNumPl", this.list, idx);
  584. },
  585. blurWeight2(it, idx, yyIdx) {
  586. this.$emit("countNumPl", this.list, idx);
  587. },
  588. blurNum2(event, idx, yyIdx) {
  589. // let value = event.target.value;
  590. // value = value.replace(/\./g, '');
  591. // this.$set(this.list[idx].extInfo.notBatchReportInfo[yyIdx], 'allFeedQuantity', value);
  592. let count = 0;
  593. this.list[idx].extInfo.batchReportInfo.forEach((m) => {
  594. count = count + Number(m.allFeedQuantity || 0);
  595. });
  596. let count2 = 0;
  597. this.list[idx].extInfo.notBatchReportInfo.forEach((m) => {
  598. count2 = count2 + Number(m.allFeedQuantity || 0);
  599. });
  600. this.keyNo = false;
  601. if (Number(count + count2) > this.list[idx].feedQuantity) {
  602. this.$set(
  603. this.list[idx].extInfo.notBatchReportInfo[yyIdx],
  604. "allFeedQuantity",
  605. 0
  606. );
  607. this.$nextTick(() => {
  608. // this.$set(this.list[idx].extInfo.notBatchReportInfo[yyIdx], 'allFeedQuantity', 0)
  609. });
  610. this.keyNo = true;
  611. this.$forceUpdate();
  612. uni.showToast({
  613. title: `投料数不能大于投料数量`,
  614. icon: "none",
  615. });
  616. this.$emit("countNumPl", this.list, idx);
  617. } else {
  618. this.keyNo = true;
  619. this.$emit("countNumPl", this.list, idx);
  620. }
  621. },
  622. getDelete2(idx) {
  623. uni.showModal({
  624. title: "删除",
  625. content: "是否确实删除此物料!",
  626. confirmText: "确认", //这块是确定按钮的文字
  627. success: (rr) => {
  628. if (rr.confirm) {
  629. this.list.splice(idx, 1);
  630. }
  631. },
  632. });
  633. },
  634. selectValBatch(e, item, idx, bidx) {
  635. let obj = this.deviceList.find(
  636. (f) => f.id || f.instanceId == e.instanceId
  637. );
  638. //设备名称
  639. this.$set(
  640. this.list[idx].extInfo.batchReportInfo[bidx],
  641. "deviceName",
  642. obj.name
  643. );
  644. //炉次号
  645. this.$set(
  646. this.list[idx].extInfo.batchReportInfo[bidx],
  647. "heatNumber",
  648. obj.extInfo.heatNumber
  649. );
  650. //设备id
  651. this.$set(
  652. this.list[idx].extInfo.batchReportInfo[bidx],
  653. "deviceId",
  654. obj.id || obj.instanceId
  655. );
  656. this.$forceUpdate();
  657. },
  658. selectValNoBatch(e, item, idx, bidx) {
  659. let obj = this.deviceList.find(
  660. (f) => f.id || f.instanceId == e.instanceId
  661. );
  662. //设备名称
  663. this.$set(
  664. this.list[idx].extInfo.notBatchReportInfo[bidx],
  665. "deviceName",
  666. obj.name
  667. );
  668. //炉次号
  669. this.$set(
  670. this.list[idx].extInfo.notBatchReportInfo[bidx],
  671. "heatNumber",
  672. obj.extInfo.heatNumber
  673. );
  674. //设备id
  675. this.$set(
  676. this.list[idx].extInfo.notBatchReportInfo[bidx],
  677. "deviceId",
  678. obj.id || obj.instanceId
  679. );
  680. console.log("456", this.list[idx].extInfo.notBatchReportInfo[bidx]);
  681. this.$forceUpdate();
  682. },
  683. handAddListPL4(it, idx) {
  684. let deviceid = "";
  685. if (this.deviceList.length > 0) {
  686. deviceid = this.deviceList[0].id || this.deviceList[0].instanceId;
  687. }
  688. this.list[idx].extInfo.notBatchReportInfo.push({
  689. allFeedQuantity: "",
  690. allReportWeight: "",
  691. notType: "",
  692. taskId: "",
  693. taskName: "",
  694. notReason: "",
  695. deviceId: deviceid ? deviceid : "",
  696. deviceName:
  697. this.deviceList.length > 0 ? this.deviceList[0].deviceName : "",
  698. heatNumber:
  699. this.deviceList.length > 0
  700. ? this.deviceList[0].extInfo.heatNumber
  701. : "",
  702. });
  703. this.$forceUpdate();
  704. },
  705. handDel4(idx, yyIdx) {
  706. this.list[idx].extInfo.notBatchReportInfo.splice(yyIdx, 1);
  707. this.$emit("countNumPl", this.list, idx);
  708. this.$forceUpdate();
  709. },
  710. handLoad() {
  711. this.$forceUpdate();
  712. },
  713. changeHeatNumber() {
  714. console.log(this.list, "PLList22222");
  715. this.deviceList.forEach((f) => {
  716. this.list.forEach((o, index) => {
  717. // o.deviceId &&
  718. // f.instanceId == o.deviceId &&
  719. if (this.deviceList.length > 1) {
  720. // o.extInfo.heatNumber = f.extInfo.heatNumber;
  721. this.$set(
  722. this.list[index].extInfo,
  723. "heatNumber",
  724. f.extInfo.heatNumber
  725. );
  726. //碳谷合格分批设备炉次号
  727. o.extInfo.batchReportInfo.map((report, ridx) => {
  728. if (report.deviceId == f.instanceId) {
  729. this.$set(
  730. this.list[index].extInfo.batchReportInfo[ridx],
  731. "heatNumber",
  732. f.extInfo.heatNumber
  733. );
  734. }
  735. });
  736. o.extInfo.notBatchReportInfo.map((noReport, noidx) => {
  737. if (noReport.deviceId == f.instanceId) {
  738. this.$set(
  739. this.list[index].extInfo.notBatchReportInfo[noidx],
  740. "heatNumber",
  741. f.extInfo.heatNumber
  742. );
  743. }
  744. });
  745. this.$forceUpdate();
  746. } else if (this.deviceList.length == 1) {
  747. o["deviceId"] = this.deviceList[0].id;
  748. // o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber;
  749. this.$set(
  750. this.list[index].extInfo,
  751. "heatNumber",
  752. this.deviceList[0].extInfo.heatNumber
  753. );
  754. //碳谷合格分批设备炉次号
  755. o.extInfo.batchReportInfo.map((report, ridx) => {
  756. this.$set(
  757. this.list[index].extInfo.batchReportInfo[ridx],
  758. "deviceId",
  759. this.deviceList[0].instanceId
  760. );
  761. this.$set(
  762. this.list[index].extInfo.batchReportInfo[ridx],
  763. "heatNumber",
  764. this.deviceList[0].extInfo.heatNumber
  765. );
  766. this.$set(
  767. this.list[index].extInfo.batchReportInfo[ridx],
  768. "deviceName",
  769. this.deviceList[0].extInfo.name
  770. );
  771. });
  772. //碳谷合格分批设备炉次号
  773. o.extInfo.notBatchReportInfo.map((noReport, noidx) => {
  774. this.$set(
  775. this.list[index].extInfo.notBatchReportInfo[noidx],
  776. "deviceId",
  777. this.deviceList[0].instanceId
  778. );
  779. this.$set(
  780. this.list[index].extInfo.notBatchReportInfo[noidx],
  781. "heatNumber",
  782. this.deviceList[0].extInfo.heatNumber
  783. );
  784. this.$set(
  785. this.list[index].extInfo.notBatchReportInfo[noidx],
  786. "deviceName",
  787. this.deviceList[0].extInfo.name
  788. );
  789. });
  790. this.$forceUpdate();
  791. }
  792. });
  793. });
  794. },
  795. toFixedFn(weight, num) {
  796. let total = Number(weight) * Number(num);
  797. return total.toFixed(2);
  798. },
  799. },
  800. };
  801. </script>
  802. <style lang="scss" scoped>
  803. .title_box {
  804. margin-top: 20rpx;
  805. .name {
  806. font-size: 28rpx;
  807. font-style: normal;
  808. font-weight: 400;
  809. color: $theme-color;
  810. padding-left: 20rpx;
  811. position: relative;
  812. &:before {
  813. position: absolute;
  814. content: "";
  815. left: 0rpx;
  816. top: 0rpx;
  817. bottom: 0rpx;
  818. width: 4rpx;
  819. height: 28rpx;
  820. background: $theme-color;
  821. margin: auto;
  822. }
  823. }
  824. .btn_box {
  825. .btn {
  826. padding: 0 18rpx;
  827. height: 50rpx;
  828. line-height: 50rpx;
  829. background: $theme-color;
  830. font-size: 26rpx;
  831. font-style: normal;
  832. font-weight: 400;
  833. font-size: 24rpx;
  834. color: #fff;
  835. border-radius: 4rpx;
  836. margin-left: 24rpx;
  837. }
  838. }
  839. }
  840. .material {
  841. margin-top: 16rpx;
  842. border: 1rpx solid transparent;
  843. .content_table {
  844. width: 100%;
  845. border: 2rpx solid $border-color;
  846. box-sizing: border-box;
  847. .item {
  848. display: flex;
  849. border-bottom: 2rpx solid $border-color;
  850. .lable {
  851. width: 132rpx;
  852. text-align: center;
  853. background-color: #f7f9fa;
  854. font-size: 26rpx;
  855. border-right: 2rpx solid $border-color;
  856. flex-shrink: 0;
  857. }
  858. .lable150 {
  859. width: 156rpx !important;
  860. font-size: 24rpx;
  861. }
  862. .lable190 {
  863. width: 230rpx !important;
  864. font-size: 24rpx;
  865. }
  866. .ww80 {
  867. width: 80rpx;
  868. }
  869. .content {
  870. width: 500rpx;
  871. min-height: 64rpx;
  872. font-size: 28rpx;
  873. line-height: 28rpx;
  874. font-style: normal;
  875. font-weight: 400;
  876. padding: 18rpx 8rpx;
  877. box-sizing: border-box;
  878. word-wrap: break-word;
  879. flex-grow: 1 !important;
  880. .unit {
  881. padding: 0 4rpx;
  882. font-size: 24rpx;
  883. color: #404446;
  884. }
  885. .penalize {
  886. width: 160rpx;
  887. line-height: 60rpx;
  888. background: $theme-color;
  889. font-size: 24rpx;
  890. text-align: center;
  891. color: #fff;
  892. }
  893. }
  894. .content_H {
  895. min-height: 92rpx;
  896. }
  897. .pd4 {
  898. padding: 4rpx 8rpx;
  899. }
  900. &:last-child {
  901. border-bottom: none;
  902. }
  903. }
  904. .ww55 {
  905. width: 55%;
  906. }
  907. .ww10 {
  908. width: 10%;
  909. }
  910. .ww40 {
  911. width: 40%;
  912. }
  913. .ww50 {
  914. width: 50%;
  915. }
  916. .ww45 {
  917. width: 45%;
  918. }
  919. .tag_box {
  920. padding: 2rpx 10rpx;
  921. margin-right: 12rpx;
  922. background: #e6a23c;
  923. font-size: 22rpx;
  924. color: #fff;
  925. border-radius: 4rpx;
  926. }
  927. }
  928. }
  929. .materialBor {
  930. border: 1rpx solid #157a2c;
  931. }
  932. .content_table2 {
  933. width: 100%;
  934. .row {
  935. width: 100%;
  936. .item {
  937. color: #404446;
  938. font-size: 28rpx;
  939. padding-left: 12rpx;
  940. }
  941. .color157 {
  942. color: $theme-color;
  943. }
  944. .ww30 {
  945. width: 30%;
  946. }
  947. .ww20 {
  948. width: 20%;
  949. }
  950. .ww15 {
  951. width: 15%;
  952. }
  953. .ww25 {
  954. width: 25%;
  955. }
  956. .ww35 {
  957. width: 35%;
  958. }
  959. .ww50 {
  960. width: 50%;
  961. }
  962. .ww10 {
  963. width: 10%;
  964. }
  965. .ww40 {
  966. width: 40%;
  967. }
  968. }
  969. .head {
  970. height: 64rpx;
  971. background: #f7f9fa;
  972. // border-top: 2rpx solid #E3E5E5;
  973. border-left: 2rpx solid #e3e5e5;
  974. box-sizing: border-box;
  975. .item {
  976. height: 64rpx;
  977. line-height: 64rpx;
  978. border-right: 2rpx solid #e3e5e5;
  979. box-sizing: border-box;
  980. font-size: 22rpx;
  981. }
  982. }
  983. .tr {
  984. border-top: 2rpx solid #e3e5e5;
  985. border-left: 2rpx solid #e3e5e5;
  986. .item {
  987. font-size: 24rpx;
  988. min-height: 74rpx;
  989. display: flex;
  990. align-items: center;
  991. border-right: 2rpx solid #e3e5e5;
  992. box-sizing: border-box;
  993. white-space: normal;
  994. word-break: break-all;
  995. }
  996. &:last-child {
  997. border-bottom: 2rpx solid #e3e5e5;
  998. }
  999. .numerate {
  1000. font-size: 22rpx;
  1001. color: $theme-color;
  1002. }
  1003. }
  1004. }
  1005. .content_num {
  1006. display: flex;
  1007. align-items: center;
  1008. padding: 0 4rpx;
  1009. /deep/ .uni-input-input {
  1010. border: 2rpx solid #f0f8f2;
  1011. box-sizing: border-box;
  1012. background: #f0f8f2;
  1013. color: $theme-color;
  1014. }
  1015. }
  1016. .round {
  1017. width: 32rpx;
  1018. height: 32rpx;
  1019. line-height: 30rpx;
  1020. text-align: center;
  1021. border-radius: 50%;
  1022. background: $theme-color;
  1023. font-size: 24rpx;
  1024. font-style: normal;
  1025. font-weight: 400;
  1026. color: #fff;
  1027. margin-right: 10rpx;
  1028. }
  1029. </style>