songshankun
2023-11-13 e6b7921fc2e2b95e4c2b666b372ad611c08e9d62
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<template>
  <div class="material-details">
    <BaseModal v-model="modelData" :wider="true" @close="closeModal">
      <template #title>物料详情 </template>
      <div class="details-box">
        <div v-if="material" class="details-t">
          <div class="details-t-t">{{ material.materialId }}</div>
          <div class="details-t-b">
            <div class="details-t-b-l">
              <div class="item">物料名称:{{ material.materialName }}</div>
              <div class="item">数量:{{ material.amount }}</div>
              <div class="item">物料规格:{{ material.amount }}</div>
              <div class="item">物料类型:{{ material.amount }}</div>
            </div>
            <!--   TODO:  物料送达缺接口-->
            <BigButton v-if="false" class="btn" bg-color="#03d203f0">已送达</BigButton>
          </div>
        </div>
 
        <!--   TODO:  物料送达缺接口-->
        <div v-if="false" class="details-b">
          <div class="details-b-t">运输详情</div>
 
          <div class="details-b-b">
            <el-scrollbar always class="scroller">
              <el-steps finish-status="success" class="steps" direction="vertical">
                <el-step v-for="(item, index) in materialObj.materialFlow" :key="index" icon="">
                  <template #title>
                    {{ item.label }}
                  </template>
                  <template #description>
                    <div class="details-date">{{ item.date }}</div>
                    <div class="details-name">
                      {{ item.name }}
                      <span>{{ item.deviceName }}</span>
                    </div>
                  </template>
                </el-step>
              </el-steps>
            </el-scrollbar>
          </div>
        </div>
      </div>
    </BaseModal>
  </div>
</template>
<script setup lang="ts">
import { useVModel } from '@vueuse/core'
import BigButton from '@/views/dashboard/components/BigButton.vue'
import type { Material } from '@/api/task'
export interface MaterialDetailsProps {
  material?: Material
  modelValue: boolean
}
const props = withDefaults(defineProps<MaterialDetailsProps>(), {
  material: undefined,
  modelValue: false
})
const emit = defineEmits<{
  'update:modelValue': [show: boolean]
}>()
const modelData = useVModel(props, 'modelValue', emit)
 
function closeModal() {
  modelData.value = false
}
// 假数据
const materialObj = {
  materialFlow: [
    {
      label: '已送达',
      date: '2023-07-11',
      name: '张三',
      deviceName: '设备名称'
    },
    {
      label: '已送达',
      date: '2023-07-11',
      name: '张三',
      deviceName: '设备名称'
    },
    {
      label: '已送达',
      date: '2023-07-11',
      name: '张三',
      deviceName: '设备名称'
    },
    {
      label: '已送达',
      date: '2023-07-11',
      name: '张三',
      deviceName: '设备名称'
    }
  ]
}
</script>
<style scoped lang="scss">
$status-default: #03d203f0;
$status-running: #33ccff;
$status-ready: #13235a;
$status-done: #0dfde6;
.details-box {
  height: 600px;
  .details-t {
    width: 100%;
    padding: 10px 30px;
    height: 100px;
    color: $status-done;
    font-size: 16px;
    .details-t-t {
      font-size: 23px;
      line-height: 30px;
      font-weight: bold;
      margin-bottom: 10px;
    }
    .details-t-b {
      width: 100%;
      height: 90px;
      padding: 0 30px 10px;
      .details-t-b-l {
        float: left;
        width: calc(100% - 110px);
        .item {
          width: 50%;
          float: left;
        }
      }
      .btn {
        width: 110px;
        float: right;
        font-size: 14px;
        height: 35px;
        line-height: 35px;
      }
    }
  }
  .details-b {
    width: calc(100% - 60px);
    padding: 10px 20px;
    background: $status-ready;
    border-radius: 4px;
    margin: 20px 30px 10px;
    height: calc(100% - 140px);
    color: #fff;
    .details-b-t {
      font-size: 17px;
      line-height: 30px;
      height: 30px;
      width: 100%;
      margin-bottom: 20px;
    }
    .details-b-b {
      width: 100%;
      height: calc(100% - 60px);
      overflow-y: auto;
      padding: 0 20px;
      .steps {
        height: 100%;
        .el-step__icon {
          width: 16px;
          height: 16px;
        }
        :deep(.el-step__icon.is-text) {
          border-color: $status-running !important;
        }
        :deep(.el-step__icon-inner) {
          display: none !important;
        }
        .el-step__title {
          line-height: 25px;
          font-size: 18px;
        }
        // .el-step__title.is-process {
        //   color: #a8abb2;
        // }
      }
      .details-date {
        color: #fff;
        font-size: 14px;
        line-height: 20px;
        margin-top: 5px;
      }
      .details-name {
        color: #fff;
        font-size: 14px;
        line-height: 20px;
        margin: 10px 0 20px;
        span {
          margin-left: 15px;
        }
      }
    }
  }
}
 
.scroller {
  padding: 4px 16px;
}
</style>