semiProductJobBomPL.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name"> 报工信息: ({{list.length || 0}})个</view>
  5. </view>
  6. <view :class="['material', it.extInfo.reportWeight && it.extInfo.reportWeight && 'materialBor']"
  7. v-for="(it, idx) in list" :key="it.id + idx">
  8. <view class="content_table">
  9. <view class="item rx-sc">
  10. <view class="rx">
  11. <view class="lable lable190 rx-cc " @click="getDelete2(idx)">
  12. <view class="round">{{idx + 1}}</view>
  13. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="16"
  14. color="#fa3534"></uni-icons>
  15. 物料编码
  16. </view>
  17. <view class="content rx-bc">
  18. <view>{{it.code}} </view>
  19. <view class="tag_box"
  20. v-if="Object.prototype.hasOwnProperty.call(it, 'extInfo') && Object.prototype.hasOwnProperty.call(it.extInfo, 'productionTimes') && Object.prototype.hasOwnProperty.call(it.extInfo.productionTimes,item.currentTaskDiagram.taskId) ">
  21. {{ it.extInfo.productionTimes[item.currentTaskDiagram.taskId]}}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="item rx-sc">
  27. <view class="rx">
  28. <view class="lable lable150 rx-cc ">名称</view>
  29. <view class="content rx-bc">
  30. <view>{{it.name}} <text v-if="[2, 23,9,28].includes(Number(it.rootCategoryLevelId))">
  31. ({{it.rootCategoryLevelId == 2 ? '在制品' : it.rootCategoryLevelId == 23 ? '半成品' : it.rootCategoryLevelId == 9 ? '产品' : it.rootCategoryLevelId == 28 ? '废品' : '' }})
  32. </text> </view>
  33. <view class="tag_box " v-if="it.isCache" style="margin-right: -36rpx;">缓</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="item rx-sc">
  38. <view class="rx">
  39. <view class="lable lable150 rx-cc ">型号</view>
  40. <view class="content rx-sc">
  41. <view>{{it.modelType}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="item rx-sc">
  46. <view class="rx ww50">
  47. <view class="lable lable150 rx-cc ">设备</view>
  48. <view class="content rx-sc">
  49. <view>{{ it.deviceName || it.extInfo.deviceName }}</view>
  50. </view>
  51. </view>
  52. <view class="rx ww50">
  53. <view class="lable lable150 rx-cc ">炉次号</view>
  54. <view class="content content_num ">
  55. <view v-if='isDetails'>{{it.extInfo.heatNumber }}</view>
  56. <input class="uni-input" v-else v-model="it.extInfo.heatNumber"></input>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="item rx-sc">
  61. <view class="rx">
  62. <view class="lable lable190 rx-cc ">{{ it.extInfo.newWeight ? '上道工序总重量' : '物料总重量' }}</view>
  63. <view class="content rx-sc">
  64. <view v-if="it.extInfo.newWeight">{{it.extInfo.newWeight }} / {{it.extInfo.weightUnit}}
  65. </view>
  66. <view v-else> {{ toFixedFn(it.extInfo.weight, it.feedQuantity) }} /
  67. {{it.extInfo.weightUnit }} </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="item rx-sc">
  72. <view class="rx ww50">
  73. <view class="lable lable150 rx-cc ">投料数量</view>
  74. <view class="content content_num ">
  75. <view style="color:#157A2C;">{{it.feedQuantity }}</view>
  76. </view>
  77. </view>
  78. <view class="rx ww50">
  79. <view class="lable lable150 rx-cc ">投料类型</view>
  80. <view class="content rx-sc" style="color:#157A2C;">
  81. <view>批量投料</view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="content_table2">
  87. <view class="head row rx-sc">
  88. <view class="item ww25" style="font-size: 20rpx;">
  89. 合格品数量
  90. </view>
  91. <view class="item ww25">报工总重量/{{it.extInfo.weightUnit}} </view>
  92. <view class="item ww40 rx-bc">
  93. <text>处置</text>
  94. <image v-if='!isDetails' class="icon" @click="handAddListPL(it, idx)"
  95. src="~@/static/pda/add.svg" style="width: 46rpx;height: 46rpx;margin-right: 12rpx;"></image>
  96. </view>
  97. <view class="item ww10 ">
  98. 操作
  99. </view>
  100. </view>
  101. <view class="table">
  102. <view class="tr row rx-sc" v-for="(yy, yyIdx) in it.extInfo.batchReportInfo">
  103. <view class="item ww25 content_num">
  104. <view v-if='isDetails'>{{yy.allFeedQuantity }}</view>
  105. <input class="uni-input" v-else v-model="yy.allFeedQuantity"
  106. @input="blurNum($event,idx, yyIdx)" type='number'></input>
  107. </view>
  108. <view class="item ww25 content_num">
  109. <view v-if='isDetails'>{{yy.allReportWeight }}</view>
  110. <input class="uni-input" v-else v-model="yy.allReportWeight" type='digit'></input>
  111. </view>
  112. <view class="item ww40" v-if='isDetails'>
  113. {{it.extInfo.taskName}}
  114. </view>
  115. <view class="item ww40" v-else>
  116. <zxz-uni-data-select :localdata="stepsList" v-model="yy.taskId" dataValue='taskId'
  117. format='{taskTypeName}' dataKey="taskId" filterable
  118. @change=" e => yy.taskName = e.taskTypeName" :clear='false'></zxz-uni-data-select>
  119. </view>
  120. <view class="item ww10">
  121. <uni-icons v-if='!isDetails' custom-prefix="iconfont" type="icon-shanchu" size="16"
  122. @click="handDel3(idx, yyIdx)" color="#fa3534"></uni-icons>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import {
  132. getTaskInstanceList
  133. } from '@/api/pda/workOrder.js'
  134. export default {
  135. props: {
  136. item: {
  137. type: Object,
  138. default: () => {}
  139. },
  140. list: {
  141. type: Array,
  142. default: () => []
  143. },
  144. isDetails: {
  145. type: Boolean,
  146. default: false
  147. },
  148. equipmentList: {
  149. type: Array,
  150. default: () => []
  151. },
  152. },
  153. watch: {
  154. equipmentList: {
  155. immediate: true,
  156. deep: true,
  157. handler(newVal) {
  158. this.deviceList = newVal
  159. this.changeHeatNumber()
  160. }
  161. },
  162. },
  163. data() {
  164. return {
  165. stepsList: [],
  166. deviceList: []
  167. }
  168. },
  169. created() {
  170. this.getSteps()
  171. },
  172. methods: {
  173. getSteps() {
  174. getTaskInstanceList(this.item.workOrderId).then(res => {
  175. if (this.item.singleReport == 1) {
  176. this.stepsList = res
  177. } else {
  178. this.stepsList = res.filter(f => f.type != 6);
  179. }
  180. })
  181. },
  182. handAddListPL(it, idx) {
  183. this.list[idx].extInfo.batchReportInfo.push({
  184. allFeedQuantity: '',
  185. allReportWeight: '',
  186. taskId: '',
  187. taskName: ''
  188. })
  189. },
  190. handDel3(idx, yyIdx) {
  191. this.list[idx].extInfo.batchReportInfo.splice(yyIdx, 1)
  192. },
  193. blurNum(event, idx, yyIdx) {
  194. let value = event.target.value;
  195. value = value.replace(/\./g, '');
  196. this.$set(this.list[idx].extInfo.batchReportInfo[yyIdx], 'allFeedQuantity', value);
  197. let count = 0
  198. this.list[idx].extInfo.batchReportInfo.forEach(m => {
  199. count = count + Number(m.allFeedQuantity || 0)
  200. })
  201. if (count > this.list[idx].feedQuantity) {
  202. this.$set(this.list[idx].extInfo.batchReportInfo[yyIdx], 'allFeedQuantity', 0)
  203. this.$forceUpdate()
  204. uni.showToast({
  205. title: `投料合格品数不能大于投料数量`,
  206. icon: 'none'
  207. })
  208. }
  209. },
  210. getDelete2(idx) {
  211. uni.showModal({
  212. title: '删除',
  213. content: '是否确实删除此物料!',
  214. confirmText: '确认', //这块是确定按钮的文字
  215. success: rr => {
  216. if (rr.confirm) {
  217. this.list.splice(idx, 1)
  218. }
  219. }
  220. })
  221. },
  222. changeHeatNumber() {
  223. this.deviceList.forEach(f => {
  224. this.list.forEach(o => {
  225. if (o.deviceId && f.instanceId == o.deviceId && this.deviceList.length > 1) {
  226. o.extInfo.heatNumber = f.extInfo.heatNumber
  227. this.$forceUpdate()
  228. } else if (this.deviceList.length == 1) {
  229. o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber
  230. this.$forceUpdate()
  231. }
  232. })
  233. })
  234. },
  235. toFixedFn(weight, num) {
  236. let total = Number(weight) * Number(num)
  237. return total.toFixed(2)
  238. }
  239. }
  240. }
  241. </script>
  242. <style lang="scss" scoped>
  243. .title_box {
  244. margin-top: 20rpx;
  245. .name {
  246. font-size: 28rpx;
  247. font-style: normal;
  248. font-weight: 400;
  249. color: $theme-color;
  250. padding-left: 20rpx;
  251. position: relative;
  252. &:before {
  253. position: absolute;
  254. content: '';
  255. left: 0rpx;
  256. top: 0rpx;
  257. bottom: 0rpx;
  258. width: 4rpx;
  259. height: 28rpx;
  260. background: $theme-color;
  261. margin: auto;
  262. }
  263. }
  264. .btn_box {
  265. .btn {
  266. padding: 0 18rpx;
  267. height: 50rpx;
  268. line-height: 50rpx;
  269. background: $theme-color;
  270. font-size: 26rpx;
  271. font-style: normal;
  272. font-weight: 400;
  273. font-size: 24rpx;
  274. color: #fff;
  275. border-radius: 4rpx;
  276. margin-left: 24rpx;
  277. }
  278. }
  279. }
  280. .material {
  281. margin-top: 16rpx;
  282. border: 1rpx solid transparent;
  283. .content_table {
  284. width: 100%;
  285. border: 2rpx solid $border-color;
  286. box-sizing: border-box;
  287. .item {
  288. display: flex;
  289. border-bottom: 2rpx solid $border-color;
  290. .lable {
  291. width: 132rpx;
  292. text-align: center;
  293. background-color: #F7F9FA;
  294. font-size: 26rpx;
  295. border-right: 2rpx solid $border-color;
  296. flex-shrink: 0;
  297. }
  298. .lable150 {
  299. width: 156rpx !important;
  300. font-size: 24rpx;
  301. }
  302. .lable190 {
  303. width: 200rpx !important;
  304. font-size: 24rpx;
  305. }
  306. .ww80 {
  307. width: 80rpx;
  308. }
  309. .content {
  310. width: 518rpx;
  311. min-height: 64rpx;
  312. font-size: 28rpx;
  313. line-height: 28rpx;
  314. font-style: normal;
  315. font-weight: 400;
  316. padding: 18rpx 8rpx;
  317. box-sizing: border-box;
  318. word-wrap: break-word;
  319. flex-grow: 1 !important;
  320. .unit {
  321. padding: 0 4rpx;
  322. font-size: 24rpx;
  323. color: #404446;
  324. }
  325. .penalize {
  326. width: 160rpx;
  327. line-height: 60rpx;
  328. background: $theme-color;
  329. font-size: 24rpx;
  330. text-align: center;
  331. color: #fff;
  332. }
  333. }
  334. .content_H {
  335. min-height: 92rpx;
  336. }
  337. .pd4 {
  338. padding: 4rpx 8rpx;
  339. }
  340. &:last-child {
  341. border-bottom: none;
  342. }
  343. }
  344. .ww55 {
  345. width: 55%;
  346. }
  347. .ww10 {
  348. width: 10%;
  349. }
  350. .ww40 {
  351. width: 40%;
  352. }
  353. .ww50 {
  354. width: 50%;
  355. }
  356. .ww45 {
  357. width: 45%;
  358. }
  359. .tag_box {
  360. padding: 2rpx 10rpx;
  361. margin-right: 12rpx;
  362. background: #E6A23C;
  363. font-size: 22rpx;
  364. color: #fff;
  365. border-radius: 4rpx;
  366. }
  367. }
  368. }
  369. .materialBor {
  370. border: 1rpx solid #157A2C
  371. }
  372. .content_table2 {
  373. width: 100%;
  374. .row {
  375. width: 100%;
  376. .item {
  377. color: #404446;
  378. font-size: 28rpx;
  379. padding-left: 12rpx;
  380. }
  381. .color157 {
  382. color: $theme-color;
  383. }
  384. .ww30 {
  385. width: 30%;
  386. }
  387. .ww20 {
  388. width: 20%;
  389. }
  390. .ww15 {
  391. width: 15%;
  392. }
  393. .ww25 {
  394. width: 25%;
  395. }
  396. .ww50 {
  397. width: 50%;
  398. }
  399. .ww10 {
  400. width: 10%;
  401. }
  402. .ww40 {
  403. width: 40%;
  404. }
  405. }
  406. .head {
  407. height: 64rpx;
  408. background: #F7F9FA;
  409. // border-top: 2rpx solid #E3E5E5;
  410. border-left: 2rpx solid #E3E5E5;
  411. box-sizing: border-box;
  412. .item {
  413. height: 64rpx;
  414. line-height: 64rpx;
  415. border-right: 2rpx solid #E3E5E5;
  416. box-sizing: border-box;
  417. font-size: 22rpx;
  418. }
  419. }
  420. .tr {
  421. border-top: 2rpx solid #E3E5E5;
  422. border-left: 2rpx solid #E3E5E5;
  423. .item {
  424. font-size: 24rpx;
  425. min-height: 74rpx;
  426. display: flex;
  427. align-items: center;
  428. border-right: 2rpx solid #E3E5E5;
  429. box-sizing: border-box;
  430. white-space: normal;
  431. word-break: break-all;
  432. }
  433. &:last-child {
  434. border-bottom: 2rpx solid #E3E5E5;
  435. }
  436. .numerate {
  437. font-size: 22rpx;
  438. color: $theme-color;
  439. }
  440. }
  441. }
  442. .content_num {
  443. display: flex;
  444. align-items: center;
  445. padding: 0 4rpx;
  446. /deep/ .uni-input-input {
  447. border: 2rpx solid #F0F8F2;
  448. box-sizing: border-box;
  449. background: #F0F8F2;
  450. color: $theme-color;
  451. }
  452. }
  453. .round {
  454. width: 32rpx;
  455. height: 32rpx;
  456. line-height: 30rpx;
  457. text-align: center;
  458. border-radius: 50%;
  459. background: $theme-color;
  460. font-size: 24rpx;
  461. font-style: normal;
  462. font-weight: 400;
  463. color: #fff;
  464. margin-right: 10rpx;
  465. }
  466. </style>