DEVICE_IN_TABLE.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="device-in-table">
  3. <view class="head flex justify-between items-center">
  4. <view class="title">设备入库时间</view>
  5. </view>
  6. <u-input v-model="inOutTime" type="select" :border="true" placeholder="请选择入库时间" @click="show = true" />
  7. <u-calendar v-model="show" mode="date" @change="change"></u-calendar>
  8. <view class="head flex justify-between items-center m-t-24rpx">
  9. <view class="title">设备入库登记</view>
  10. <u-button type="primary" plain @click="open" size="mini">新增</u-button>
  11. </view>
  12. <u-popup v-model="showPopup" mode="bottom" :mask-close-able="false" :closeable="true" :border-radius="28">
  13. <view class="form-box">
  14. <view class="f-item">
  15. <view class="label">
  16. <text class="red">*</text>
  17. <text class="text">设备编号</text>
  18. <u-input v-model="deviceStr" type="select" :border="true" placeholder="请选择设备" @click="showSelect1 = true" />
  19. <u-select v-model="showSelect1" :list="deviceList" @confirm="confirm"></u-select>
  20. </view>
  21. </view>
  22. </view>
  23. </u-popup>
  24. </view>
  25. </template>
  26. <script>
  27. import { deviceCanIn } from '@/api/sop'
  28. export default {
  29. name: 'DEVICEINTABLE',
  30. computed: {
  31. deviceStr() {
  32. return this.deviceList.find((item) => item.value == this.deviceItemInfo.deviceNo)?.label || ''
  33. }
  34. },
  35. data() {
  36. return {
  37. inOutTime: '',
  38. list: [],
  39. show: false,
  40. showPopup: false,
  41. showSelect1: false,
  42. deviceList: [],
  43. deviceItemInfo: {
  44. deviceNo: '', //设备编号
  45. deviceModel: '',
  46. supplierName: '', //供应商
  47. deviceStatus: '', //运行状态
  48. scanCount: '', //总扫描量
  49. location: '', //当前所在地
  50. address: '', //发往地
  51. basePhotoPath: '' //拍照
  52. }
  53. }
  54. },
  55. mounted() {
  56. deviceCanIn().then((res) => {
  57. res = [
  58. {
  59. deviceNo: 1,
  60. deviceModel: '周大福',
  61. supplierName: '似懂非懂',
  62. deviceStatus: 'NORMAL',
  63. scanCount: 20,
  64. location: '武汉',
  65. address: '北京',
  66. basePhotoPath: ''
  67. }
  68. ]
  69. this.deviceList = res.map((item) => {
  70. item.value = item.deviceNo
  71. item.label = item.deviceModel
  72. return item
  73. })
  74. })
  75. },
  76. methods: {
  77. open() {
  78. this.showPopup = true
  79. },
  80. add() {
  81. // this.list.push({
  82. // deviceNo: '', //设备编号
  83. // supplierName: '', //供应商
  84. // deviceStatus: '', //运行状态
  85. // scanCount: '', //总扫描量
  86. // location: '', //当前所在地
  87. // address: '', //发往地
  88. // basePhotoPath: '' //拍照
  89. // })
  90. },
  91. change(obj) {
  92. this.inOutTime = obj.result
  93. },
  94. confirm(arr) {
  95. this.deviceItemInfo.deviceNo = arr[0].value
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .device-in-table {
  102. .form-box {
  103. padding: 24rpx;
  104. padding-top: 80rpx;
  105. }
  106. .head {
  107. .title {
  108. color: #595959;
  109. font-size: 28rpx;
  110. height: 60rpx;
  111. margin-bottom: 10rpx;
  112. }
  113. }
  114. }
  115. </style>