singleProductJobBom.vue 29 KB

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