singleProductJobBom.vue 30 KB

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