jobBom.vue 7.7 KB

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