jobBom.vue 8.0 KB

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