palletBom.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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. isDetails: {
  60. type: Boolean,
  61. default: false
  62. }
  63. },
  64. data() {
  65. return {
  66. classificationList: [],
  67. boatList: [],
  68. }
  69. },
  70. created() {
  71. this.getTreeList()
  72. },
  73. methods: {
  74. getTreeList() {
  75. let params = {
  76. ids: [8]
  77. }
  78. treeByPid(params).then(res => {
  79. this.classificationList = res
  80. })
  81. },
  82. confirm(id, name, rootCategoryLevelId) {
  83. this.$set(this.palletList[0], 'categoryLevelId', id[0])
  84. this.$set(this.palletList[0], 'categoryLevelName', name)
  85. this.$set(this.palletList[0], 'rootCategoryLevelId', rootCategoryLevelId)
  86. let param = {
  87. categoryLevelId: id,
  88. pageNum: 1,
  89. size: -1,
  90. }
  91. assetPage(param).then(res => {
  92. this.boatList = res.list
  93. })
  94. },
  95. inputChange(e) {
  96. this.$set(this.palletList[0], 'categoryId', e.id)
  97. this.$set(this.palletList[0], 'code', e.code)
  98. this.$set(this.palletList[0], 'name', e.name)
  99. this.$set(this.palletList[0], 'specification', e.specification)
  100. this.$set(this.palletList[0], 'categoryId', e.id)
  101. this.$set(this.palletList[0], 'brandNum', e.brandNum)
  102. this.$set(this.palletList[0], 'modelType', e.modelType)
  103. this.$set(this.palletList[0], 'quantity', e.quantity)
  104. this.$set(this.palletList[0], 'unit', e.unit)
  105. this.$forceUpdate()
  106. },
  107. handleType() {
  108. this.$refs.treePicker._show()
  109. },
  110. },
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .title_box {
  115. margin-top: 20rpx;
  116. .name {
  117. font-size: 28rpx;
  118. font-style: normal;
  119. font-weight: 400;
  120. color: $theme-color;
  121. padding-left: 20rpx;
  122. position: relative;
  123. &:before {
  124. position: absolute;
  125. content: '';
  126. left: 0rpx;
  127. top: 0rpx;
  128. bottom: 0rpx;
  129. width: 4rpx;
  130. height: 28rpx;
  131. background: $theme-color;
  132. margin: auto;
  133. }
  134. }
  135. }
  136. .material {
  137. margin-top: 10rpx;
  138. .content_table {
  139. width: 100%;
  140. border: 2rpx solid $border-color;
  141. .item {
  142. display: flex;
  143. border-bottom: 2rpx solid $border-color;
  144. .lable {
  145. width: 132rpx;
  146. text-align: center;
  147. background-color: #F7F9FA;
  148. font-size: 26rpx;
  149. border-right: 2rpx solid $border-color;
  150. flex-shrink: 0;
  151. }
  152. .lable220 {
  153. width: 220rpx !important;
  154. font-size: 24rpx;
  155. }
  156. .lable150 {
  157. width: 156rpx !important;
  158. font-size: 24rpx;
  159. }
  160. .ww80 {
  161. width: 80rpx;
  162. }
  163. .content {
  164. width: 518rpx;
  165. min-height: 64rpx;
  166. font-size: 28rpx;
  167. line-height: 28rpx;
  168. font-style: normal;
  169. font-weight: 400;
  170. padding: 18rpx 8rpx;
  171. box-sizing: border-box;
  172. word-wrap: break-word;
  173. flex-grow: 1 !important;
  174. .unit {
  175. padding: 0 4rpx;
  176. font-size: 24rpx;
  177. color: #404446;
  178. }
  179. .penalize {
  180. width: 160rpx;
  181. line-height: 60rpx;
  182. background: $theme-color;
  183. font-size: 24rpx;
  184. text-align: center;
  185. color: #fff;
  186. }
  187. }
  188. .content_num {
  189. display: flex;
  190. align-items: center;
  191. padding: 0 4rpx;
  192. /deep/ .uni-input-input {
  193. border: 2rpx solid #F0F8F2;
  194. background: #F0F8F2;
  195. color: $theme-color;
  196. }
  197. }
  198. .pd4 {
  199. padding: 4rpx 8rpx;
  200. }
  201. &:last-child {
  202. border-bottom: none;
  203. }
  204. }
  205. .ww55 {
  206. width: 55%;
  207. }
  208. .ww45 {
  209. width: 45%;
  210. }
  211. }
  212. }
  213. </style>