jobBom.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">报工信息</view>
  5. </view>
  6. <view class="material ">
  7. <view class="content_table">
  8. <view class="item rx-sc">
  9. <view class="rx ">
  10. <view class="lable lable220 rx-cc ">上道工序生产数量</view>
  11. <view class="content ">
  12. {{ item.formedNumLast}}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="item rx-sc">
  17. <view class="rx ww55 ">
  18. <view class="lable lable150 rx-cc ">要求生产数量</view>
  19. <view class="content rx-sc">
  20. <view>{{item.formingNum}}</view>
  21. <view class="unit">{{item.unit}}</view>
  22. </view>
  23. </view>
  24. <view class="rx ww45">
  25. <view class="lable rx-cc ww80">重量</view>
  26. <view class="content content_num">
  27. <view>{{item.formingWeight}}</view>
  28. <view class="unit">{{item.weightUnit}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="item rx-sc">
  33. <view class="rx ww55 ">
  34. <view class="lable lable150 rx-cc ">合格品数量</view>
  35. <view class="content content_num">
  36. <input class="uni-input" v-model="item.workReportInfo.formedNum" @blur="blurNum" @input="blurNum"
  37. type="digit"></input>
  38. <view class="unit">{{item.unit}}</view>
  39. </view>
  40. </view>
  41. <view class="rx ww45">
  42. <view class="lable rx-cc ww80">重量</view>
  43. <view class="content content_num">
  44. <input class="uni-input" v-model="item.workReportInfo.formedWeight" type="digit"></input>
  45. <view class="unit">{{item.weightUnit}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="item rx-sc" v-for="(not,notIndex) in notFormedList" :key='notIndex'>
  50. <view class="rx ww55 ">
  51. <view class="lable lable150 rx-cc ">不合格数量</view>
  52. <view class="content content_num">
  53. <input class="uni-input" v-model="not.notFormedNum" type="digit" @blur="blurNum"></input>
  54. <view class="unit">{{item.unit}}</view>
  55. </view>
  56. </view>
  57. <view class="rx ww45">
  58. <view class="lable rx-cc ww80">重量</view>
  59. <view class="content content_num">
  60. <input class="uni-input" v-model="not.notFormedWeight" type="digit"></input>
  61. <view class="unit">{{item.weightUnit}}</view>
  62. <view class="penalize" v-if='!isDetails'
  63. :style="{ background: not.warehouseId ? '#FFA07A' : ''}" @click="penalize">处置</view>
  64. <view class="penalize" v-if='isDetails'
  65. :style="{ background: not.warehouseId ? '#FFA07A' : ''}"
  66. @click="handleView(item.warehouseName)">查看</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class='content_table' v-for="(item,index) in palletList" :key='index'>
  72. <view class="item" @click="handleType">
  73. <view class="lable rx-cc">舟皿类型</view>
  74. <view class="content content_num">
  75. <input class="uni-input" v-model="item.categoryLevelName"></input>
  76. </view>
  77. </view>
  78. <view class="item">
  79. <view class="lable rx-cc">舟皿名称</view>
  80. <view class="content ">
  81. <zxz-uni-data-select :localdata="boatList" v-model="item.categoryId" dataValue='id'
  82. format='{name}-{code}' dataKey="code" filterable :clear='false'
  83. @change='inputChange'></zxz-uni-data-select>
  84. </view>
  85. </view>
  86. <view class="item">
  87. <view class="lable rx-cc">舟皿型号</view>
  88. <view class="content">
  89. {{item.modelType}}
  90. </view>
  91. </view>
  92. <view class="item">
  93. <view class="lable rx-cc">舟皿数量</view>
  94. <view class="content content_num">
  95. <input class="uni-input" v-model="item.quantity" type='digit'></input>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  101. :localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
  102. </view>
  103. </template>
  104. <script>
  105. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  106. import {
  107. treeByPid,
  108. pageeLedgerMain,
  109. assetPage,
  110. } from '@/api/pda/workOrder.js'
  111. import {
  112. number
  113. } from 'echarts'
  114. export default {
  115. props: {
  116. item: {
  117. type: Object,
  118. default: () => {}
  119. },
  120. notFormed: {
  121. type: Array,
  122. default: () => []
  123. },
  124. isDetails: {
  125. type: Boolean,
  126. default: false
  127. },
  128. palletList: {
  129. type: Array,
  130. default: () => []
  131. }
  132. },
  133. watch: {
  134. notFormed: {
  135. immediate: true,
  136. deep: true,
  137. handler(newVal) {
  138. console.log(newVal)
  139. this.notFormedList = newVal
  140. }
  141. }
  142. },
  143. data() {
  144. return {
  145. classificationList: [],
  146. boatList: [],
  147. notFormedList: []
  148. }
  149. },
  150. created() {
  151. this.getTreeList()
  152. },
  153. methods: {
  154. getTreeList() {
  155. let params = {
  156. ids: [8]
  157. }
  158. treeByPid(params).then(res => {
  159. this.classificationList = res
  160. })
  161. },
  162. confirm(id, name, rootCategoryLevelId) {
  163. this.$set(this.palletList[0], 'categoryLevelId', id[0])
  164. this.$set(this.palletList[0], 'categoryLevelName', name)
  165. this.$set(this.palletList[0], 'rootCategoryLevelId', rootCategoryLevelId)
  166. let param = {
  167. categoryLevelId: id,
  168. pageNum: 1,
  169. size: -1,
  170. }
  171. assetPage(param).then(res => {
  172. this.boatList = res.list
  173. })
  174. },
  175. inputChange(e) {
  176. this.$set(this.palletList[0], 'categoryId', e.id)
  177. this.$set(this.palletList[0], 'code', e.code)
  178. this.$set(this.palletList[0], 'name', e.name)
  179. this.$set(this.palletList[0], 'specification', e.specification)
  180. this.$set(this.palletList[0], 'categoryId', e.id)
  181. this.$set(this.palletList[0], 'brandNum', e.brandNum)
  182. this.$set(this.palletList[0], 'modelType', e.modelType)
  183. this.$set(this.palletList[0], 'quantity', e.quantity)
  184. this.$set(this.palletList[0], 'unit', e.unit)
  185. this.$forceUpdate()
  186. },
  187. handleType() {
  188. this.$refs.treePicker._show()
  189. },
  190. penalize() {
  191. this.$emit('penalize', null)
  192. },
  193. handleView(name) {
  194. uni.showToast({
  195. icon: 'none',
  196. title: name || '未设置'
  197. })
  198. },
  199. blurNum() {
  200. let total = Number(this.item.workReportInfo.formedNum) + Number(this.notFormedList[0].notFormedNum)
  201. this.$emit('modeNum', total)
  202. if(this.item.singleWeight) {
  203. let weight = Number(this.item.workReportInfo.formedNum) * Number(this.item.singleWeight) * Number(this.item.weightMultiple)
  204. weight = parseFloat(weight.toFixed(2))
  205. this.$set(this.item.workReportInfo, 'formedWeight', weight)
  206. this.$forceUpdate()
  207. } else {
  208. uni.showToast({
  209. title: '没有单重,维护主数据净重',
  210. })
  211. }
  212. },
  213. }
  214. }
  215. </script>
  216. <style lang="scss" scoped>
  217. .title_box {
  218. margin-top: 20rpx;
  219. .name {
  220. font-size: 28rpx;
  221. font-style: normal;
  222. font-weight: 400;
  223. color: $theme-color;
  224. padding-left: 20rpx;
  225. position: relative;
  226. &:before {
  227. position: absolute;
  228. content: '';
  229. left: 0rpx;
  230. top: 0rpx;
  231. bottom: 0rpx;
  232. width: 4rpx;
  233. height: 28rpx;
  234. background: $theme-color;
  235. margin: auto;
  236. }
  237. }
  238. }
  239. .material {
  240. margin-top: 10rpx;
  241. .content_table {
  242. width: 100%;
  243. border: 2rpx solid $border-color;
  244. .item {
  245. display: flex;
  246. border-bottom: 2rpx solid $border-color;
  247. .lable {
  248. width: 132rpx;
  249. text-align: center;
  250. background-color: #F7F9FA;
  251. font-size: 26rpx;
  252. border-right: 2rpx solid $border-color;
  253. flex-shrink: 0;
  254. }
  255. .lable220 {
  256. width: 220rpx !important;
  257. font-size: 24rpx;
  258. }
  259. .lable150 {
  260. width: 156rpx !important;
  261. font-size: 24rpx;
  262. }
  263. .ww80 {
  264. width: 80rpx;
  265. }
  266. .content {
  267. width: 518rpx;
  268. min-height: 64rpx;
  269. font-size: 28rpx;
  270. line-height: 28rpx;
  271. font-style: normal;
  272. font-weight: 400;
  273. padding: 18rpx 8rpx;
  274. box-sizing: border-box;
  275. word-wrap: break-word;
  276. flex-grow: 1 !important;
  277. .unit {
  278. padding: 0 4rpx;
  279. font-size: 24rpx;
  280. color: #404446;
  281. }
  282. .penalize {
  283. width: 160rpx;
  284. line-height: 60rpx;
  285. background: $theme-color;
  286. font-size: 24rpx;
  287. text-align: center;
  288. color: #fff;
  289. }
  290. }
  291. .content_num {
  292. display: flex;
  293. align-items: center;
  294. padding: 0 4rpx;
  295. /deep/ .uni-input-input {
  296. border: 2rpx solid #F0F8F2;
  297. background: #F0F8F2;
  298. color: $theme-color;
  299. }
  300. }
  301. .pd4 {
  302. padding: 4rpx 8rpx;
  303. }
  304. &:last-child {
  305. border-bottom: none;
  306. }
  307. }
  308. .ww55 {
  309. width: 55%;
  310. }
  311. .ww45 {
  312. width: 45%;
  313. }
  314. }
  315. }
  316. </style>