mayf
2024-09-03 a71eaa5c42f8f56312a29b04748ce333e0eb9c6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<template>
  <el-card class="location-item">
    <div class="location-item__main">
      <div class="location-item__title text-overflow-1">
        <div>{{ info.code }}</div>
        <div v-if="info.used && info.orderDTO" class="h-130 py-10">
          <div class="text-12 text-primary">
            {{ info.orderDTO.orderNo }}
          </div>
          <div
            v-if="info.items && info.items.length > 0"
            class="flex items-center mt-10"
          >
            <div class="text-subTitle text-12 flex-1 text-overflow-1">
              {{ info.items[0].flowerName
              }}<span class="ml-8">{{ info.items[0].flowerLevelStr }}</span
              ><span class="ml-8">{{ info.items[0].flowerColor }}</span
              ><span class="ml-8">{{ info.items[0].flowerUnit }}</span
              >×{{ info.items[0].num }}
            </div>
            <el-popover placement="bottom" trigger="hover">
              <el-table :data="info.items">
                <el-table-column
                  prop="flowerName"
                  label="商品名称"
                ></el-table-column>
                <el-table-column
                  prop="flowerLevelStr"
                  label="级别"
                ></el-table-column>
                <el-table-column
                  prop="flowerColor"
                  label="颜色"
                ></el-table-column>
                <el-table-column
                  property="flowerUnit"
                  label="规格"
                ></el-table-column>
                <el-table-column
                  property="supplierName"
                  label="供应商名称"
                ></el-table-column>
              </el-table>
              <el-button slot="reference" type="text" class="p-0 ml-4"
                >查看更多</el-button
              >
            </el-popover>
          </div>
          <div class="text-subTitle text-12 mt-10 text-overflow-1">
            {{ info.orderDTO.customer
            }}<span class="ml-8">{{ info.orderDTO.customerTel }}</span>
          </div>
          <el-tooltip
            v-if="info.orderDTO.customerAddress"
            class="item"
            effect="dark"
            :content="`${info.orderDTO.customerProvince || ''}${
              info.orderDTO.customerCity || ''
            }${info.orderDTO.customerRegion || ''}${
              info.orderDTO.customerAddress || ''
            }`"
            placement="top-start"
          >
            <div class="text-subTitle text-12 mt-10 text-overflow-1">
              {{ info.orderDTO.customerProvince }}{{ info.orderDTO.customerCity
              }}{{ info.orderDTO.customerRegion
              }}{{ info.orderDTO.customerAddress }}
            </div>
          </el-tooltip>
        </div>
        <div
          v-else
          class="h-130 flex items-center justify-center text-primary cursor-pointer"
          @click="onAddOrder"
        >
          <i class="el-icon-circle-plus-outline mr-6"></i>
          添加订单
        </div>
      </div>
    </div>
    <div class="location-item__bottom">
      <div class="location-item__area">
        {{ info.warehouseName }}
      </div>
      <div>
        <el-tooltip class="item" effect="dark" content="编辑">
          <i class="el-icon-edit" @click="editItem"></i>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="删除">
          <i class="el-icon-delete is-delete" @click="deleteItem"></i>
        </el-tooltip>
      </div>
    </div>
  </el-card>
</template>
 
<script>
export default {
  props: {
    info: {
      type: Object,
      default: () => ({}),
    },
  },
  methods: {
    editItem() {
      this.$emit('edit')
    },
    deleteItem() {
      this.$emit('delete')
    },
    onAddOrder() {
      this.$emit('addOrder')
    },
  },
}
</script>
 
<style lang="scss" scoped>
.location-item {
  position: relative;
  margin-bottom: 20px;
  &__main {
    padding-top: 20px;
  }
  &__title {
    font-size: 16px;
    color: $main-title-color;
    font-weight: bold;
  }
  &__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee;
    height: 50px;
    i {
      font-size: 18px;
      font-weight: normal;
      padding: 0 6px;
      cursor: pointer;
      margin-left: 8px;
      &.is-delete {
        color: $danger-color;
      }
    }
  }
  &__area {
    font-size: 14px;
    color: $main-title-color;
  }
}
::v-deep {
  .el-card {
    &__body {
      padding-top: 0;
      padding-bottom: 0;
    }
  }
}
</style>