batchProductJobBom.vue 31 KB

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