oneJobBom.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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 " v-for="(it, idx) in list" :key="idx">
  7. <view class="content_table">
  8. <view class="item rx-sc">
  9. <view class="rx">
  10. <view class="lable lable190 rx-cc ">
  11. <view class="round">{{idx + 1}}</view>物料编码
  12. </view>
  13. <view class="content rx-sc">
  14. <view>{{it.code}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="item rx-sc">
  19. <view class="rx">
  20. <view class="lable lable150 rx-cc ">名称</view>
  21. <view class="content rx-sc">
  22. <view>{{it.name}}</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-sc">
  30. <view>{{it.modelType}}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="item rx-sc">
  35. <view class="rx ww50 ">
  36. <view class="lable lable150 rx-cc ">物料代号</view>
  37. <view class="content content_num">
  38. <input class="uni-input" v-model="it.extInfo.materielCode"></input>
  39. </view>
  40. </view>
  41. <view class="rx ww50">
  42. <view class="lable lable150 rx-cc ">客户代号</view>
  43. <view class="content content_num">
  44. <input class="uni-input" v-model="it.extInfo.clientCode"></input>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="item rx-sc">
  49. <view class="rx ww50 ">
  50. <view class="lable lable150 rx-cc ">刻码</view>
  51. <view class="content content_num ">
  52. <input class="uni-input" v-model="it.extInfo.engrave"></input>
  53. </view>
  54. </view>
  55. <view class="rx ww50">
  56. <view class="lable lable150 rx-cc ">位置</view>
  57. <view class="content content_num">
  58. <input class="uni-input" v-model="it.extInfo.position"></input>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="content_table2">
  64. <view class="head row rx-sc">
  65. <view class="item ww25">物料重量Kg</view>
  66. <view class="item ww25">报工重量kg</view>
  67. <view class="item ww25">质检结果</view>
  68. <view class="item ww25">处置</view>
  69. </view>
  70. <view class="table">
  71. <view class="tr row rx-sc">
  72. <view class="item ww25">{{it.extInfo.weight}}</view>
  73. <view class="item ww25 content_num">
  74. <input class="uni-input" v-model="it.extInfo.reportWeight"></input>
  75. </view>
  76. <view class="item ww25" @click="openNumerate(it, idx)">
  77. <view class="numerate">点击计算</view>
  78. </view>
  79. <view class="item ww25">
  80. {{it.extInfo.deal }}
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <u-popup :show="show" mode='center' v-if='show' :closeOnClickOverlay='false'>
  87. <view class="popup_box">
  88. <view class="content_table2">
  89. <view class="head row rx-sc">
  90. <view class="item ww25">物料重量Kg</view>
  91. <view class="item ww25">坯体密度</view>
  92. <view class="item ww30">产品密度系数</view>
  93. <view class="item ww20">标准</view>
  94. </view>
  95. <view class="table">
  96. <view class="tr row rx-sc" v-for="(item, index) in rowIt" :key='index'>
  97. <view class="item ww25 rx-bc">
  98. <view>{{item.deal}}</view>
  99. <view>{{item.weight}}</view>
  100. </view>
  101. <view class="item ww25 content_num">
  102. <input class="uni-input" v-model="item.billet" type="digit" @input="changeInp(item, index)"></input>
  103. </view>
  104. <view class="item ww30 content_num" >
  105. <input class="uni-input" v-model="item.density" type="digit" @input="changeInp(item, index)"></input>
  106. </view>
  107. <view class="item ww20">
  108. {{item.result}}
  109. </view>
  110. </view>
  111. </view>
  112. <view class="reportWeight">报工重量: {{reportWeight}}</view>
  113. </view>
  114. <view class="operate_box rx-sc">
  115. <u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
  116. <u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
  117. </view>
  118. </view>
  119. </u-popup>
  120. </view>
  121. </template>
  122. <script>
  123. import {
  124. getTaskInstanceList
  125. } from '@/api/pda/workOrder.js'
  126. export default {
  127. props: {
  128. item: {
  129. type: Object,
  130. default: () => {}
  131. },
  132. list: {
  133. type: Array,
  134. default: () => []
  135. }
  136. },
  137. watch: {
  138. },
  139. data() {
  140. return {
  141. classificationList: [],
  142. stepsList: [],
  143. positionList: [{
  144. id: '1',
  145. name: '内'
  146. },
  147. {
  148. id: '2',
  149. name: '中'
  150. },
  151. {
  152. id: '1',
  153. name: '外'
  154. }
  155. ],
  156. inspectionList: [{
  157. id: '1',
  158. name: '合格'
  159. },
  160. {
  161. id: '2',
  162. name: '不合格'
  163. },
  164. ],
  165. show: false,
  166. rowIt: [],
  167. reportWeight: 0,
  168. }
  169. },
  170. created() {
  171. this.getSteps()
  172. },
  173. methods: {
  174. getSteps() {
  175. console.log(this.item)
  176. getTaskInstanceList(this.item.workOrderId).then(res => {
  177. this.stepsList = res
  178. })
  179. },
  180. openNumerate(row, idx) {
  181. if(!row.extInfo.reportWeight) {
  182. uni.showToast({
  183. icon:'none',
  184. title: '请先输入报工重量'
  185. })
  186. return false
  187. }
  188. this.reportWeight = row.extInfo.reportWeight
  189. this.rowIt = [
  190. {
  191. weight: row.extInfo.weight,
  192. billet: 0.45,
  193. density: 0.7,
  194. result: (Number(row.extInfo.weight) / 0.45 * 0.7).toFixed(2),
  195. deal: 'PIP',
  196. idx
  197. },
  198. {
  199. weight: row.extInfo.weight,
  200. billet: 0.46,
  201. density: 1.1,
  202. result: (Number(row.extInfo.weight) / 0.6* 1.1).toFixed(2) ,
  203. deal: '粗车',
  204. idx
  205. },
  206. {
  207. weight: row.extInfo.weight,
  208. billet: 0.47,
  209. density: 1.6,
  210. result: (Number(row.extInfo.weight) / 0.47 * 1.6).toFixed(2),
  211. deal: '高温',
  212. idx
  213. }
  214. ]
  215. this.show = true
  216. },
  217. changeInp(item,index) {
  218. this.rowIt[index]['result'] = (Number(item.weight) / item.billet * item.density).toFixed(2)
  219. },
  220. cancel() {
  221. this.show = false
  222. this.rowIt = []
  223. this.reportWeight = 0
  224. },
  225. save() {
  226. let _idx = this.rowIt[0].idx
  227. let _deal = null
  228. if(this.reportWeight >= this.rowIt[0].result && this.reportWeight < this.rowIt[1].result) {
  229. _deal = this.rowIt[0].deal
  230. } else if(this.reportWeight >= this.rowIt[1].result && this.reportWeight < this.rowIt[2].result) {
  231. _deal = this.rowIt[1].deal
  232. } else if(this.reportWeight >= this.rowIt[2].result ) {
  233. _deal = this.rowIt[2].deal
  234. }
  235. if(_deal) {
  236. this.list[_idx].extInfo.deal = _deal
  237. }
  238. this.cancel()
  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. }
  266. .material {
  267. margin-top: 10rpx;
  268. .content_table {
  269. width: 100%;
  270. border: 2rpx solid $border-color;
  271. .item {
  272. display: flex;
  273. border-bottom: 2rpx solid $border-color;
  274. .lable {
  275. width: 132rpx;
  276. text-align: center;
  277. background-color: #F7F9FA;
  278. font-size: 26rpx;
  279. border-right: 2rpx solid $border-color;
  280. flex-shrink: 0;
  281. }
  282. .lable150 {
  283. width: 156rpx !important;
  284. font-size: 24rpx;
  285. }
  286. .lable190 {
  287. width: 190rpx !important;
  288. font-size: 24rpx;
  289. }
  290. .ww80 {
  291. width: 80rpx;
  292. }
  293. .content {
  294. width: 518rpx;
  295. min-height: 64rpx;
  296. font-size: 28rpx;
  297. line-height: 28rpx;
  298. font-style: normal;
  299. font-weight: 400;
  300. padding: 18rpx 8rpx;
  301. box-sizing: border-box;
  302. word-wrap: break-word;
  303. flex-grow: 1 !important;
  304. .unit {
  305. padding: 0 4rpx;
  306. font-size: 24rpx;
  307. color: #404446;
  308. }
  309. .penalize {
  310. width: 160rpx;
  311. line-height: 60rpx;
  312. background: $theme-color;
  313. font-size: 24rpx;
  314. text-align: center;
  315. color: #fff;
  316. }
  317. }
  318. .content_H {
  319. min-height: 92rpx;
  320. }
  321. .pd4 {
  322. padding: 4rpx 8rpx;
  323. }
  324. &:last-child {
  325. border-bottom: none;
  326. }
  327. }
  328. .ww55 {
  329. width: 55%;
  330. }
  331. .ww50 {
  332. width: 50%;
  333. }
  334. .ww45 {
  335. width: 45%;
  336. }
  337. }
  338. }
  339. .content_table2 {
  340. width: 100%;
  341. .row {
  342. width: 100%;
  343. .item {
  344. color: #404446;
  345. font-size: 28rpx;
  346. padding-left: 12rpx;
  347. }
  348. .color157 {
  349. color: $theme-color;
  350. }
  351. .ww20 {
  352. width: 20%;
  353. }
  354. .ww35 {
  355. width: 35%;
  356. }
  357. .ww25 {
  358. width: 25%;
  359. }
  360. .ww30 {
  361. width: 30%;
  362. }
  363. }
  364. .head {
  365. height: 64rpx;
  366. background: #F7F9FA;
  367. border-top: 2rpx solid #E3E5E5;
  368. border-left: 2rpx solid #E3E5E5;
  369. .item {
  370. height: 64rpx;
  371. line-height: 64rpx;
  372. border-right: 2rpx solid #E3E5E5;
  373. box-sizing: border-box;
  374. }
  375. }
  376. .tr {
  377. border-top: 2rpx solid #E3E5E5;
  378. border-left: 2rpx solid #E3E5E5;
  379. .item {
  380. font-size: 24rpx;
  381. min-height: 74rpx;
  382. display: flex;
  383. align-items: center;
  384. border-right: 2rpx solid #E3E5E5;
  385. box-sizing: border-box;
  386. white-space: normal;
  387. word-break: break-all;
  388. }
  389. &:last-child {
  390. border-bottom: 2rpx solid #E3E5E5;
  391. }
  392. .numerate {
  393. font-size: 22rpx;
  394. color: $theme-color;
  395. }
  396. }
  397. }
  398. .content_num {
  399. display: flex;
  400. align-items: center;
  401. padding: 0 4rpx;
  402. /deep/ .uni-input-input {
  403. border: 2rpx solid #F0F8F2;
  404. background: #F0F8F2;
  405. color: $theme-color;
  406. }
  407. }
  408. .round {
  409. width: 32rpx;
  410. height: 32rpx;
  411. line-height: 32rpx;
  412. text-align: center;
  413. border-radius: 50%;
  414. background: $theme-color;
  415. font-size: 24rpx;
  416. font-style: normal;
  417. font-weight: 400;
  418. color: #fff;
  419. margin-right: 18rpx;
  420. }
  421. .popup_box {
  422. width: 94vw;
  423. padding: 16rpx 12rpx;
  424. box-sizing: border-box;
  425. }
  426. .operate_box {
  427. margin-top: 32rpx;
  428. padding: 10rpx 100rpx;
  429. /deep/ .u-button {
  430. width: 160rpx;
  431. }
  432. }
  433. .reportWeight{
  434. font-size: 24rpx;
  435. font-style: normal;
  436. font-weight: 400;
  437. margin-top: 12rpx;
  438. }
  439. </style>