singleProductJobBom.vue 28 KB

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