sampleBom.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="content_table2" v-if="item.sampleList.length > 0">
  42. <view class="head row rx-sc">
  43. <view class="item ww15">类型</view>
  44. <view class="item ww20">数量</view>
  45. <view class="item ww55">处置</view>
  46. <view class="item ww15">操作</view>
  47. </view>
  48. <view class="table">
  49. <view class="tr row rx-sc" v-for="(item, index) in item.sampleList" :key='index'>
  50. <view class="item ww15 content_num">
  51. {{ item.selectType == 1 ? '回用' : item.selectType == 2 ? '入库' : '' }}
  52. </view>
  53. <view class="item ww20 content_num">
  54. <input class="uni-input" v-model="item.num"></input>
  55. </view>
  56. <view class="item ww55 content_num">
  57. <zxz-uni-data-select :localdata="warehouseList" v-if='item.selectType != 1'
  58. v-model="item.warehouseId" dataValue='id' dataKey="name" filterable
  59. format='{name}'></zxz-uni-data-select>
  60. </view>
  61. <view class="item ww15">
  62. <view class="left rx-ss" @click="getDelete(index)">
  63. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
  64. color="#fa3534"></uni-icons>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <u-popup :show="show" mode='center' v-if='show' :closeOnClickOverlay='false'>
  72. <view class="popup_box">
  73. <uni-data-select v-model="selectType" :localdata="rangeList"></uni-data-select>
  74. <view class="operate_box rx-sc">
  75. <u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
  76. <u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
  77. </view>
  78. </view>
  79. </u-popup>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. getWarehouseList,
  85. } from '@/api/pda/workOrder.js'
  86. export default {
  87. props: {
  88. item: {
  89. type: Object,
  90. default: () => {}
  91. },
  92. },
  93. data() {
  94. return {
  95. warehouseList: [],
  96. show: false,
  97. selectType: null,
  98. rangeList: [{
  99. value: 1,
  100. text: "回用"
  101. },
  102. {
  103. value: 2,
  104. text: "入库"
  105. }
  106. ]
  107. }
  108. },
  109. created() {
  110. this.getWarehouseListFn()
  111. },
  112. methods: {
  113. getWarehouseListFn() {
  114. getWarehouseList().then(res => {
  115. this.warehouseList = res
  116. })
  117. },
  118. cancel() {
  119. this.selectType = null
  120. this.show = false
  121. },
  122. penalize() {
  123. if (Number(this.item.sampleNum <= 0) ) {
  124. uni.showToast({
  125. icon: 'none',
  126. title: '取样数量要大于0'
  127. })
  128. return false
  129. }
  130. this.show = true
  131. },
  132. save() {
  133. this.show = false
  134. if (this.selectType) {
  135. this.item.sampleList.push({
  136. selectType: this.selectType,
  137. num: null,
  138. warehouseId: null
  139. })
  140. } else {
  141. uni.showToast({
  142. icon: 'none',
  143. title: '请先选项处置方法'
  144. })
  145. }
  146. },
  147. getDelete(idx) {
  148. this.item.sampleList.splice(idx, 1)
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .title_box {
  155. margin-top: 28rpx;
  156. .name {
  157. font-size: 28rpx;
  158. font-style: normal;
  159. font-weight: 400;
  160. color: $theme-color;
  161. padding-left: 20rpx;
  162. position: relative;
  163. &:before {
  164. position: absolute;
  165. content: '';
  166. left: 0rpx;
  167. top: 0rpx;
  168. bottom: 0rpx;
  169. width: 4rpx;
  170. height: 28rpx;
  171. background: $theme-color;
  172. margin: auto;
  173. }
  174. }
  175. .btn_box {
  176. padding: 0 18rpx;
  177. height: 60rpx;
  178. background: $theme-color;
  179. font-size: 26rpx;
  180. font-style: normal;
  181. font-weight: 400;
  182. font-size: 24rpx;
  183. color: #fff;
  184. border-radius: 4rpx;
  185. .scan {
  186. width: 34rpx;
  187. height: 34rpx;
  188. margin-right: 12rpx;
  189. }
  190. }
  191. }
  192. .material {
  193. margin-top: 10rpx;
  194. .content_table {
  195. width: 100%;
  196. border: 2rpx solid $border-color;
  197. .item {
  198. display: flex;
  199. border-bottom: 2rpx solid $border-color;
  200. .lable {
  201. width: 156rpx;
  202. text-align: center;
  203. background-color: #F7F9FA;
  204. font-size: 26rpx;
  205. border-right: 2rpx solid $border-color;
  206. flex-shrink: 0;
  207. }
  208. .lable150 {
  209. width: 156rpx !important;
  210. font-size: 24rpx;
  211. }
  212. .ww80 {
  213. width: 80rpx;
  214. }
  215. .content {
  216. width: 518rpx;
  217. min-height: 64rpx;
  218. font-size: 28rpx;
  219. line-height: 28rpx;
  220. font-style: normal;
  221. font-weight: 400;
  222. padding: 18rpx 8rpx;
  223. box-sizing: border-box;
  224. word-wrap: break-word;
  225. flex-grow: 1 !important;
  226. .unit {
  227. padding: 0 4rpx;
  228. font-size: 24rpx;
  229. color: #404446;
  230. }
  231. .penalize {
  232. width: 200rpx;
  233. line-height: 60rpx;
  234. background: $theme-color;
  235. font-size: 24rpx;
  236. text-align: center;
  237. color: #fff;
  238. }
  239. }
  240. .pd4 {
  241. padding: 4rpx 8rpx;
  242. }
  243. &:last-child {
  244. border-bottom: none;
  245. }
  246. }
  247. .ww55 {
  248. width: 55%;
  249. }
  250. .ww45 {
  251. width: 45%;
  252. }
  253. }
  254. .content_table2 {
  255. width: 100%;
  256. margin-top: 8rpx;
  257. .row {
  258. width: 100%;
  259. .item {
  260. padding: 8rpx 0;
  261. color: #404446;
  262. font-size: 28rpx;
  263. padding-left: 12rpx;
  264. }
  265. .left {
  266. width: 40rpx;
  267. }
  268. .ww30 {
  269. width: 30%;
  270. }
  271. .ww20 {
  272. width: 20%;
  273. }
  274. .ww35 {
  275. width: 35%;
  276. }
  277. .ww55 {
  278. width: 55%;
  279. }
  280. .ww15 {
  281. width: 15%;
  282. }
  283. }
  284. .head {
  285. height: 64rpx;
  286. background: #F7F9FA;
  287. border-top: 2rpx solid #E3E5E5;
  288. border-left: 2rpx solid #E3E5E5;
  289. .item {
  290. height: 64rpx;
  291. line-height: 64rpx;
  292. border-right: 2rpx solid #E3E5E5;
  293. box-sizing: border-box;
  294. }
  295. }
  296. .tr {
  297. border-top: 2rpx solid #E3E5E5;
  298. border-left: 2rpx solid #E3E5E5;
  299. .item {
  300. font-size: 24rpx;
  301. min-height: 78rpx;
  302. display: flex;
  303. align-items: center;
  304. border-right: 2rpx solid #E3E5E5;
  305. box-sizing: border-box;
  306. white-space: normal;
  307. word-break: break-all;
  308. }
  309. &:last-child {
  310. border-bottom: 2rpx solid #E3E5E5;
  311. }
  312. }
  313. }
  314. }
  315. .content_num {
  316. display: flex;
  317. align-items: center;
  318. padding: 0 4rpx;
  319. box-sizing: border-box;
  320. /deep/ .uni-input-input {
  321. border: 2rpx solid #F0F8F2;
  322. min-width: 100rpx;
  323. background: #F0F8F2;
  324. color: $theme-color;
  325. box-sizing: border-box;
  326. }
  327. }
  328. .popup_box {
  329. width: 78vw;
  330. padding: 32rpx;
  331. }
  332. .operate_box {
  333. margin-top: 32rpx;
  334. padding: 10rpx 100rpx;
  335. /deep/ .u-button {
  336. width: 160rpx;
  337. }
  338. }
  339. </style>