scaleListCom.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <uni-list>
  3. <!-- <checkbox-group name="allpick"> -->
  4. <!-- <label> -->
  5. <view v-for="(item,index) in scaleList " :key="index">
  6. <uni-list-item :showArrow="false">
  7. <template v-if="ischeckbox" v-slot:header>
  8. <checkbox @tap="selchange(item)" style="margin-right: 10px;align-content: center;" value="item.id"
  9. :checked="item.ispick" />
  10. </template>
  11. <template @tap="showView(item)" v-slot:body>
  12. <div class="flex-1 flex">
  13. <image style="width: 130rpx;" mode="widthFix" :src="item.data.Picture"></image>
  14. <div class="flex-1 margin-left-sm">
  15. <div class="font-32">{{item.snCode}}</div>
  16. <div class="font-24">{{'指令号:'+item.data.manuNum}}</div>
  17. <div class="font-24">{{'PO号:'+item.data.poNum}}</div>
  18. </div>
  19. </div>
  20. </template>
  21. <template v-slot:footer>
  22. <div @tap="showView(item)" style="align-content: center;text-align: right;">
  23. <tui-button @click="deletebtn(item)" :size="20" width="74rpx" height="56rpx" type="danger" >删除</tui-button>
  24. </div>
  25. </template>
  26. <template></template>
  27. </uni-list-item>
  28. </view>
  29. <!-- </label> -->
  30. <!-- </checkbox-group> -->
  31. </uni-list>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'scaleListCom',
  36. emits: ['click'],
  37. props: {
  38. scaleList: {
  39. type: Array,
  40. default: []
  41. },
  42. ischeckbox: {
  43. type: Boolean,
  44. default: false
  45. },
  46. },
  47. data() {
  48. return {
  49. select: null
  50. }
  51. },
  52. created() {
  53. if (this.ischeckbox) {
  54. this.setAssetsNOselect()
  55. }
  56. },
  57. methods: {
  58. setAssetsNOselect() {
  59. if (this.ischeckbox) {
  60. this.scaleList.map(v => {
  61. this.$set(v, 'ispick', false)
  62. })
  63. }
  64. },
  65. showView(item) {
  66. this.$tab.navigateTo('/pages/takestock/assetsView/index?id=' + item.id)
  67. },
  68. selchange(item) {
  69. if (!item.ispick) {
  70. this.setAssetsNOselect()
  71. item.ispick = true
  72. this.select = item
  73. } else {
  74. item.ispick = false
  75. this.select = null
  76. }
  77. this.$nextTick(() => {
  78. if (this.ischeckbox) {
  79. this.$emit('getselect', this.select)
  80. }
  81. })
  82. },
  83. deletebtn(item){
  84. this.$emit('delete',item)
  85. }
  86. },
  87. }
  88. </script>
  89. <style>
  90. </style>