semiProductJobBomPL.vue 11 KB

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