inspectionBom.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">质检</view>
  5. </view>
  6. <u-form labelPosition="left" :model="formData" labelWidth="140" labelAlign="left" class="baseForm">
  7. <u-form-item label="质检类型:" class="required-form" prop="assetType">
  8. <zxz-uni-data-select :localdata="typeList" v-model="formData.parentId" dataValue='id' format='{name}'
  9. dataKey="name" filterable></zxz-uni-data-select>
  10. <view class="btn_box rx-cc" @click="add">新增质检</view>
  11. </u-form-item>
  12. </u-form>
  13. <view class="content_table2">
  14. <view class="head row rx-sc">
  15. <view class="item ww35">名称</view>
  16. <view class="item ww45">废品数量</view>
  17. <view class="item ww20">操作</view>
  18. </view>
  19. <view class="table">
  20. <u-list @scrolltolower="scrolltolower" class="z_list">
  21. <view class="tr row rx-sc" v-for="(it, idx) in List" :key='idx'>
  22. <view class="item ww35">
  23. {{ it.name }}
  24. </view>
  25. <view class="item ww45 content_num">
  26. <input class="uni-input" v-model="it.quantity" type="digit"></input>
  27. </view>
  28. <view class="ww20 rx-ac">
  29. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
  30. color="#fa3534"></uni-icons>
  31. <uni-icons custom-prefix="iconfont" type="icon-eye" size="20"
  32. color="#157A2C"></uni-icons>
  33. </view>
  34. </view>
  35. </u-list>
  36. </view>
  37. </view>
  38. <ba-tree-picker ref="treePicker" :selectedData='selectedData' key="verify" :multiple="false"
  39. @select-change="confirm" title="选择分类" :localdata="classificationList" valueKey="id" textKey="name"
  40. childrenKey="children" multiple :selectParent='false' />
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. getTwoTreeByPid,
  46. treeByPid
  47. } from '@/api/pda/workOrder.js'
  48. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  49. export default {
  50. components: {
  51. baTreePicker,
  52. },
  53. data() {
  54. return {
  55. typeList: [],
  56. formData: {
  57. parentId: null
  58. },
  59. classificationList: [],
  60. selectedData: [
  61. '1772569297810362370', '1772569381088268289', '1773270364621639681'
  62. ],
  63. List: []
  64. }
  65. },
  66. created() {
  67. this.getTwoTree()
  68. },
  69. methods: {
  70. getTwoTree() {
  71. getTwoTreeByPid(12).then(res => {
  72. this.typeList = res
  73. })
  74. },
  75. add() {
  76. if (!this.formData.parentId) {
  77. uni.showToast({
  78. icon: 'none',
  79. title: '请先选择质检类型'
  80. })
  81. return false
  82. } else {
  83. let params = {
  84. 'ids': [this.formData.parentId]
  85. }
  86. treeByPid(params).then(res => {
  87. this.classificationList = res[0].children
  88. this.$refs.treePicker._show()
  89. })
  90. }
  91. },
  92. confirm(id, name, list) {
  93. this.List = list
  94. },
  95. scrolltolower() {},
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .title_box {
  101. margin-top: 28rpx;
  102. .name {
  103. font-size: 28rpx;
  104. font-style: normal;
  105. font-weight: 400;
  106. color: $theme-color;
  107. padding-left: 20rpx;
  108. position: relative;
  109. &:before {
  110. position: absolute;
  111. content: '';
  112. left: 0rpx;
  113. top: 0rpx;
  114. bottom: 0rpx;
  115. width: 4rpx;
  116. height: 28rpx;
  117. background: $theme-color;
  118. margin: auto;
  119. }
  120. }
  121. }
  122. .btn_box {
  123. height: 60rpx;
  124. width: 140rpx;
  125. background: $theme-color;
  126. font-size: 26rpx;
  127. font-style: normal;
  128. font-weight: 400;
  129. font-size: 24rpx;
  130. color: #fff;
  131. border-radius: 4rpx;
  132. margin-left: 40rpx;
  133. }
  134. .content_table2 {
  135. width: 100%;
  136. .row {
  137. width: 100%;
  138. .item {
  139. color: #404446;
  140. font-size: 28rpx;
  141. padding-left: 12rpx;
  142. }
  143. .color157 {
  144. color: $theme-color;
  145. }
  146. .ww20 {
  147. width: 20%;
  148. }
  149. .ww35 {
  150. width: 35%;
  151. }
  152. .ww45 {
  153. width: 45%;
  154. }
  155. }
  156. .head {
  157. height: 64rpx;
  158. background: #F7F9FA;
  159. border-top: 2rpx solid #E3E5E5;
  160. border-left: 2rpx solid #E3E5E5;
  161. .item {
  162. height: 64rpx;
  163. line-height: 64rpx;
  164. border-right: 2rpx solid #E3E5E5;
  165. box-sizing: border-box;
  166. }
  167. }
  168. .tr {
  169. border-top: 2rpx solid #E3E5E5;
  170. border-left: 2rpx solid #E3E5E5;
  171. .item {
  172. font-size: 24rpx;
  173. min-height: 64rpx;
  174. display: flex;
  175. align-items: center;
  176. border-right: 2rpx solid #E3E5E5;
  177. box-sizing: border-box;
  178. white-space: normal;
  179. word-break: break-all;
  180. }
  181. &:last-child {
  182. border-bottom: 2rpx solid #E3E5E5;
  183. }
  184. }
  185. }
  186. .content_num {
  187. display: flex;
  188. align-items: center;
  189. padding: 0 4rpx;
  190. /deep/ .uni-input-input {
  191. border: 2rpx solid #F0F8F2;
  192. background: #F0F8F2;
  193. color: $theme-color;
  194. }
  195. }
  196. .z_list {
  197. max-height: 400rpx;
  198. }
  199. </style>