sampleBom.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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">
  9. <view class="lable rx-cc">工序名称</view>
  10. <view class="content">
  11. {{item.diagramLast.taskTypeName}}
  12. </view>
  13. </view>
  14. <view class="item rx-sc">
  15. <view class="rx ww55 ">
  16. <view class="lable rx-cc">数量</view>
  17. <view class="content rx-sc">
  18. <view>{{item.formedNum}}</view>
  19. <view class="unit">{{item.unit}}</view>
  20. </view>
  21. </view>
  22. <view class="rx ww45">
  23. <view class="lable rx-cc ww80">重量</view>
  24. <view class="content content_num">
  25. <view>{{item.formedWeight}}</view>
  26. <view class="unit">{{item.weightUnit}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="item">
  31. <view class="lable rx-cc">取样数量</view>
  32. <view class="content content_num rx-sc">
  33. <input class="uni-input" v-model="item.sampleNum" type='digit'
  34. @blur='item.sampleNum > item.formedNum ? item.sampleNum = item.formedNum : item.sampleNum'></input>
  35. <view class="unit">{{item.unit}}</view>
  36. <view class="penalize" @click="penalize">处置
  37. {{Number(item.sampleNum || 0) - Number(item.recoveryNum || 0) }}</view>
  38. </view>
  39. </view>
  40. <view class="item">
  41. <view class="lable rx-cc">回收数量</view>
  42. <view class="content content_num rx-sc">
  43. <input class="uni-input" v-model="item.recoveryNum" type='digit'
  44. @blur='item.recoveryNum > item.sampleNum ? item.recoveryNum = item.sampleNum : item.recoveryNum'></input>
  45. <view class="unit">{{item.unit}}</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="content_table2" v-if="item.sampleList.length > 0">
  50. <view class="head row rx-sc">
  51. <view class="item ww30">数量</view>
  52. <view class="item ww55">处置</view>
  53. <view class="item ww15">操作</view>
  54. </view>
  55. <view class="table">
  56. <view class="tr row rx-sc" v-for="(item, index) in item.sampleList" :key='index'>
  57. <view class="item ww30 content_num">
  58. <input class="uni-input" v-model="item.num"></input>
  59. </view>
  60. <view class="item ww55 content_num">
  61. <zxz-uni-data-select :localdata="warehouseList" v-model="item.warehouseId" dataValue='id'
  62. dataKey="name" filterable format='{name}' ></zxz-uni-data-select>
  63. </view>
  64. <view class="item ww15">
  65. <view class="left rx-ss" @click="getDelete(index)">
  66. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
  67. color="#fa3534"></uni-icons>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. getWarehouseList,
  79. } from '@/api/pda/workOrder.js'
  80. export default {
  81. props: {
  82. item: {
  83. type: Object,
  84. default: () => {}
  85. },
  86. },
  87. data() {
  88. return {
  89. warehouseList: []
  90. }
  91. },
  92. created() {
  93. this.getWarehouseListFn()
  94. },
  95. methods: {
  96. getWarehouseListFn() {
  97. getWarehouseList().then(res => {
  98. this.warehouseList = res
  99. })
  100. },
  101. penalize() {
  102. if (Number(this.item.sampleNum || 0) - Number(this.item.recoveryNum || 0) <= 0) {
  103. uni.showToast({
  104. icon: 'none',
  105. title: '处置数量不能小于等于0'
  106. })
  107. return false
  108. }
  109. this.item.sampleList.push({
  110. num: null,
  111. warehouseId: null
  112. })
  113. },
  114. getDelete(idx) {
  115. this.item.sampleList.splice(idx, 1)
  116. },
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .title_box {
  122. margin-top: 28rpx;
  123. .name {
  124. font-size: 28rpx;
  125. font-style: normal;
  126. font-weight: 400;
  127. color: $theme-color;
  128. padding-left: 20rpx;
  129. position: relative;
  130. &:before {
  131. position: absolute;
  132. content: '';
  133. left: 0rpx;
  134. top: 0rpx;
  135. bottom: 0rpx;
  136. width: 4rpx;
  137. height: 28rpx;
  138. background: $theme-color;
  139. margin: auto;
  140. }
  141. }
  142. .btn_box {
  143. padding: 0 18rpx;
  144. height: 60rpx;
  145. background: $theme-color;
  146. font-size: 26rpx;
  147. font-style: normal;
  148. font-weight: 400;
  149. font-size: 24rpx;
  150. color: #fff;
  151. border-radius: 4rpx;
  152. .scan {
  153. width: 34rpx;
  154. height: 34rpx;
  155. margin-right: 12rpx;
  156. }
  157. }
  158. }
  159. .material {
  160. margin-top: 10rpx;
  161. .content_table {
  162. width: 100%;
  163. border: 2rpx solid $border-color;
  164. .item {
  165. display: flex;
  166. border-bottom: 2rpx solid $border-color;
  167. .lable {
  168. width: 156rpx;
  169. text-align: center;
  170. background-color: #F7F9FA;
  171. font-size: 26rpx;
  172. border-right: 2rpx solid $border-color;
  173. flex-shrink: 0;
  174. }
  175. .lable150 {
  176. width: 156rpx !important;
  177. font-size: 24rpx;
  178. }
  179. .ww80 {
  180. width: 80rpx;
  181. }
  182. .content {
  183. width: 518rpx;
  184. min-height: 64rpx;
  185. font-size: 28rpx;
  186. line-height: 28rpx;
  187. font-style: normal;
  188. font-weight: 400;
  189. padding: 18rpx 8rpx;
  190. box-sizing: border-box;
  191. word-wrap: break-word;
  192. flex-grow: 1 !important;
  193. .unit {
  194. padding: 0 4rpx;
  195. font-size: 24rpx;
  196. color: #404446;
  197. }
  198. .penalize {
  199. width: 200rpx;
  200. line-height: 60rpx;
  201. background: $theme-color;
  202. font-size: 24rpx;
  203. text-align: center;
  204. color: #fff;
  205. }
  206. }
  207. .pd4 {
  208. padding: 4rpx 8rpx;
  209. }
  210. &:last-child {
  211. border-bottom: none;
  212. }
  213. }
  214. .ww55 {
  215. width: 55%;
  216. }
  217. .ww45 {
  218. width: 45%;
  219. }
  220. }
  221. .content_table2 {
  222. width: 100%;
  223. margin-top: 8rpx;
  224. .row {
  225. width: 100%;
  226. .item {
  227. padding: 8rpx 0;
  228. color: #404446;
  229. font-size: 28rpx;
  230. padding-left: 12rpx;
  231. }
  232. .left {
  233. width: 40rpx;
  234. }
  235. .ww30 {
  236. width: 30%;
  237. }
  238. .ww55 {
  239. width: 55%;
  240. }
  241. .ww15 {
  242. width: 15%;
  243. }
  244. }
  245. .head {
  246. height: 64rpx;
  247. background: #F7F9FA;
  248. border-top: 2rpx solid #E3E5E5;
  249. border-left: 2rpx solid #E3E5E5;
  250. .item {
  251. height: 64rpx;
  252. line-height: 64rpx;
  253. border-right: 2rpx solid #E3E5E5;
  254. box-sizing: border-box;
  255. }
  256. }
  257. .tr {
  258. border-top: 2rpx solid #E3E5E5;
  259. border-left: 2rpx solid #E3E5E5;
  260. .item {
  261. font-size: 24rpx;
  262. min-height: 64rpx;
  263. display: flex;
  264. align-items: center;
  265. border-right: 2rpx solid #E3E5E5;
  266. box-sizing: border-box;
  267. white-space: normal;
  268. word-break: break-all;
  269. }
  270. &:last-child {
  271. border-bottom: 2rpx solid #E3E5E5;
  272. }
  273. }
  274. }
  275. }
  276. .content_num {
  277. display: flex;
  278. align-items: center;
  279. padding: 0 4rpx;
  280. /deep/ .uni-input-input {
  281. border: 2rpx solid #F0F8F2;
  282. width: 260rpx;
  283. background: #F0F8F2;
  284. color: $theme-color;
  285. }
  286. }
  287. </style>