jobBom.vue 9.5 KB

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