jobBom.vue 8.0 KB

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