semiProductJobBomPL.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  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. console.log(this.deviceList)
  213. this.deviceList.forEach(f => {
  214. this.list.forEach(o => {
  215. if (o.deviceId && f.instanceId == o.deviceId && this.deviceList.length > 1) {
  216. o.extInfo.heatNumber = f.extInfo.heatNumber
  217. this.$forceUpdate()
  218. } else if (this.deviceList.length == 1) {
  219. o.extInfo.heatNumber = this.deviceList[0].extInfo.heatNumber
  220. this.$forceUpdate()
  221. }
  222. })
  223. })
  224. },
  225. }
  226. }
  227. </script>
  228. <style lang="scss" scoped>
  229. .title_box {
  230. margin-top: 20rpx;
  231. .name {
  232. font-size: 28rpx;
  233. font-style: normal;
  234. font-weight: 400;
  235. color: $theme-color;
  236. padding-left: 20rpx;
  237. position: relative;
  238. &:before {
  239. position: absolute;
  240. content: '';
  241. left: 0rpx;
  242. top: 0rpx;
  243. bottom: 0rpx;
  244. width: 4rpx;
  245. height: 28rpx;
  246. background: $theme-color;
  247. margin: auto;
  248. }
  249. }
  250. .btn_box {
  251. .btn {
  252. padding: 0 18rpx;
  253. height: 50rpx;
  254. line-height: 50rpx;
  255. background: $theme-color;
  256. font-size: 26rpx;
  257. font-style: normal;
  258. font-weight: 400;
  259. font-size: 24rpx;
  260. color: #fff;
  261. border-radius: 4rpx;
  262. margin-left: 24rpx;
  263. }
  264. }
  265. }
  266. .material {
  267. margin-top: 16rpx;
  268. border: 1rpx solid transparent;
  269. .content_table {
  270. width: 100%;
  271. border: 2rpx solid $border-color;
  272. box-sizing: border-box;
  273. .item {
  274. display: flex;
  275. border-bottom: 2rpx solid $border-color;
  276. .lable {
  277. width: 132rpx;
  278. text-align: center;
  279. background-color: #F7F9FA;
  280. font-size: 26rpx;
  281. border-right: 2rpx solid $border-color;
  282. flex-shrink: 0;
  283. }
  284. .lable150 {
  285. width: 156rpx !important;
  286. font-size: 24rpx;
  287. }
  288. .lable190 {
  289. width: 200rpx !important;
  290. font-size: 24rpx;
  291. }
  292. .ww80 {
  293. width: 80rpx;
  294. }
  295. .content {
  296. width: 518rpx;
  297. min-height: 64rpx;
  298. font-size: 28rpx;
  299. line-height: 28rpx;
  300. font-style: normal;
  301. font-weight: 400;
  302. padding: 18rpx 8rpx;
  303. box-sizing: border-box;
  304. word-wrap: break-word;
  305. flex-grow: 1 !important;
  306. .unit {
  307. padding: 0 4rpx;
  308. font-size: 24rpx;
  309. color: #404446;
  310. }
  311. .penalize {
  312. width: 160rpx;
  313. line-height: 60rpx;
  314. background: $theme-color;
  315. font-size: 24rpx;
  316. text-align: center;
  317. color: #fff;
  318. }
  319. }
  320. .content_H {
  321. min-height: 92rpx;
  322. }
  323. .pd4 {
  324. padding: 4rpx 8rpx;
  325. }
  326. &:last-child {
  327. border-bottom: none;
  328. }
  329. }
  330. .ww55 {
  331. width: 55%;
  332. }
  333. .ww10 {
  334. width: 10%;
  335. }
  336. .ww40 {
  337. width: 40%;
  338. }
  339. .ww50 {
  340. width: 50%;
  341. }
  342. .ww45 {
  343. width: 45%;
  344. }
  345. .tag_box {
  346. padding: 2rpx 10rpx;
  347. margin-right: 12rpx;
  348. background: #E6A23C;
  349. font-size: 22rpx;
  350. color: #fff;
  351. border-radius: 4rpx;
  352. }
  353. }
  354. }
  355. .materialBor {
  356. border: 1rpx solid #157A2C
  357. }
  358. .content_table2 {
  359. width: 100%;
  360. .row {
  361. width: 100%;
  362. .item {
  363. color: #404446;
  364. font-size: 28rpx;
  365. padding-left: 12rpx;
  366. }
  367. .color157 {
  368. color: $theme-color;
  369. }
  370. .ww30 {
  371. width: 30%;
  372. }
  373. .ww20 {
  374. width: 20%;
  375. }
  376. .ww15 {
  377. width: 15%;
  378. }
  379. .ww25 {
  380. width: 25%;
  381. }
  382. .ww50 {
  383. width: 50%;
  384. }
  385. .ww10 {
  386. width: 10%;
  387. }
  388. .ww40 {
  389. width: 40%;
  390. }
  391. }
  392. .head {
  393. height: 64rpx;
  394. background: #F7F9FA;
  395. // border-top: 2rpx solid #E3E5E5;
  396. border-left: 2rpx solid #E3E5E5;
  397. box-sizing: border-box;
  398. .item {
  399. height: 64rpx;
  400. line-height: 64rpx;
  401. border-right: 2rpx solid #E3E5E5;
  402. box-sizing: border-box;
  403. font-size: 22rpx;
  404. }
  405. }
  406. .tr {
  407. border-top: 2rpx solid #E3E5E5;
  408. border-left: 2rpx solid #E3E5E5;
  409. .item {
  410. font-size: 24rpx;
  411. min-height: 74rpx;
  412. display: flex;
  413. align-items: center;
  414. border-right: 2rpx solid #E3E5E5;
  415. box-sizing: border-box;
  416. white-space: normal;
  417. word-break: break-all;
  418. }
  419. &:last-child {
  420. border-bottom: 2rpx solid #E3E5E5;
  421. }
  422. .numerate {
  423. font-size: 22rpx;
  424. color: $theme-color;
  425. }
  426. }
  427. }
  428. .content_num {
  429. display: flex;
  430. align-items: center;
  431. padding: 0 4rpx;
  432. /deep/ .uni-input-input {
  433. border: 2rpx solid #F0F8F2;
  434. box-sizing: border-box;
  435. background: #F0F8F2;
  436. color: $theme-color;
  437. }
  438. }
  439. .round {
  440. width: 32rpx;
  441. height: 32rpx;
  442. line-height: 30rpx;
  443. text-align: center;
  444. border-radius: 50%;
  445. background: $theme-color;
  446. font-size: 24rpx;
  447. font-style: normal;
  448. font-weight: 400;
  449. color: #fff;
  450. margin-right: 10rpx;
  451. }
  452. </style>