palletBom.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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' v-for="(item,index) in palletList" :key='index'>
  8. <view class="item" @click="handleType" v-if="!isDetails">
  9. <view class="lable rx-cc">舟皿类型</view>
  10. <view class="content content_num">
  11. <input class="uni-input" v-model="item.categoryLevelName"></input>
  12. </view>
  13. </view>
  14. <view class="item" @click="handleType" v-if="isDetails">
  15. <view class="lable rx-cc">舟皿类型</view>
  16. <view class="content ">
  17. {{item.name}}
  18. </view>
  19. </view>
  20. <view class="item">
  21. <view class="lable rx-cc">舟皿名称</view>
  22. <view class="content ">
  23. <zxz-uni-data-select :localdata="boatList" v-model="item.categoryId" dataValue='id'
  24. format='{name}-{code}' dataKey="code" filterable :clear='false' v-if="!isDetails"
  25. @change='inputChange'></zxz-uni-data-select>
  26. <view v-if="isDetails">{{item.code }} </view>
  27. </view>
  28. </view>
  29. <view class="item">
  30. <view class="lable rx-cc">舟皿型号</view>
  31. <view class="content">
  32. {{item.modelType}}
  33. </view>
  34. </view>
  35. <view class="item">
  36. <view class="lable rx-cc">舟皿数量</view>
  37. <view class="content content_num">
  38. <input class="uni-input" v-model="item.quantity" type='digit' :disabled="isDetails"></input>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  44. :localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
  45. </view>
  46. </template>
  47. <script>
  48. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  49. import {
  50. treeByPid,
  51. assetPage,
  52. } from '@/api/pda/workOrder.js'
  53. export default {
  54. props: {
  55. palletList: {
  56. type: Array,
  57. default: () => []
  58. }
  59. },
  60. data() {
  61. return {
  62. classificationList: [],
  63. boatList: [],
  64. }
  65. },
  66. created() {
  67. this.getTreeList()
  68. },
  69. methods: {
  70. getTreeList() {
  71. let params = {
  72. ids: [8]
  73. }
  74. treeByPid(params).then(res => {
  75. this.classificationList = res
  76. })
  77. },
  78. confirm(id, name, rootCategoryLevelId) {
  79. this.$set(this.palletList[0], 'categoryLevelId', id[0])
  80. this.$set(this.palletList[0], 'categoryLevelName', name)
  81. this.$set(this.palletList[0], 'rootCategoryLevelId', rootCategoryLevelId)
  82. let param = {
  83. categoryLevelId: id,
  84. pageNum: 1,
  85. size: -1,
  86. }
  87. assetPage(param).then(res => {
  88. this.boatList = res.list
  89. })
  90. },
  91. inputChange(e) {
  92. this.$set(this.palletList[0], 'categoryId', e.id)
  93. this.$set(this.palletList[0], 'code', e.code)
  94. this.$set(this.palletList[0], 'name', e.name)
  95. this.$set(this.palletList[0], 'specification', e.specification)
  96. this.$set(this.palletList[0], 'categoryId', e.id)
  97. this.$set(this.palletList[0], 'brandNum', e.brandNum)
  98. this.$set(this.palletList[0], 'modelType', e.modelType)
  99. this.$set(this.palletList[0], 'quantity', e.quantity)
  100. this.$set(this.palletList[0], 'unit', e.unit)
  101. this.$forceUpdate()
  102. },
  103. handleType() {
  104. this.$refs.treePicker._show()
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .title_box {
  111. margin-top: 20rpx;
  112. .name {
  113. font-size: 28rpx;
  114. font-style: normal;
  115. font-weight: 400;
  116. color: $theme-color;
  117. padding-left: 20rpx;
  118. position: relative;
  119. &:before {
  120. position: absolute;
  121. content: '';
  122. left: 0rpx;
  123. top: 0rpx;
  124. bottom: 0rpx;
  125. width: 4rpx;
  126. height: 28rpx;
  127. background: $theme-color;
  128. margin: auto;
  129. }
  130. }
  131. }
  132. .material {
  133. margin-top: 10rpx;
  134. .content_table {
  135. width: 100%;
  136. border: 2rpx solid $border-color;
  137. .item {
  138. display: flex;
  139. border-bottom: 2rpx solid $border-color;
  140. .lable {
  141. width: 132rpx;
  142. text-align: center;
  143. background-color: #F7F9FA;
  144. font-size: 26rpx;
  145. border-right: 2rpx solid $border-color;
  146. flex-shrink: 0;
  147. }
  148. .lable220 {
  149. width: 220rpx !important;
  150. font-size: 24rpx;
  151. }
  152. .lable150 {
  153. width: 156rpx !important;
  154. font-size: 24rpx;
  155. }
  156. .ww80 {
  157. width: 80rpx;
  158. }
  159. .content {
  160. width: 518rpx;
  161. min-height: 64rpx;
  162. font-size: 28rpx;
  163. line-height: 28rpx;
  164. font-style: normal;
  165. font-weight: 400;
  166. padding: 18rpx 8rpx;
  167. box-sizing: border-box;
  168. word-wrap: break-word;
  169. flex-grow: 1 !important;
  170. .unit {
  171. padding: 0 4rpx;
  172. font-size: 24rpx;
  173. color: #404446;
  174. }
  175. .penalize {
  176. width: 160rpx;
  177. line-height: 60rpx;
  178. background: $theme-color;
  179. font-size: 24rpx;
  180. text-align: center;
  181. color: #fff;
  182. }
  183. }
  184. .content_num {
  185. display: flex;
  186. align-items: center;
  187. padding: 0 4rpx;
  188. /deep/ .uni-input-input {
  189. border: 2rpx solid #F0F8F2;
  190. background: #F0F8F2;
  191. color: $theme-color;
  192. }
  193. }
  194. .pd4 {
  195. padding: 4rpx 8rpx;
  196. }
  197. &:last-child {
  198. border-bottom: none;
  199. }
  200. }
  201. .ww55 {
  202. width: 55%;
  203. }
  204. .ww45 {
  205. width: 45%;
  206. }
  207. }
  208. }
  209. </style>