semiProductJobBomPL.vue 12 KB

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