long
2021-08-05 3dcc7cfd77cfdf04a7eeb614e81f378bfe428a67
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<template>
  <div class="app-container">
    <!-- 返回按钮和标题 -->
    <el-page-header class="mb20" :content="objectName+'详情'" @back="$router.go(-1)" />
 
    <div class="group-title">基本信息</div>
    <el-row :gutter="22" class="flex-1">
      <el-col :span="10"><div class="col-tx">公告名称:</div></el-col>
      <el-col :span="10"><div class="col-tx">订单编号:</div></el-col>
      <el-col :span="10"><div class="col-tx">采购企业:</div></el-col>
      <el-col :span="10"><div class="col-tx">到货期限:</div></el-col>
      <el-image :src="detail.headImg" style="width:50px;height:50px;border-radius: 4px" fit="contain" :preview-src-list="[detail.headImg]" />
    </el-row>
 
    <div class="flex">
      <div class="flex-1" />
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            size="small"
            type="primary"
          >重新压缩</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            size="small"
            type="danger"
          >取消订单</el-button>
        </el-col>
      </el-row>
    </div>
 
    <!-- 占位符 -->
    <div style="height: 100px" />
 
    <!-- upload放大图片 -->
    <el-dialog :visible.sync="uploadPreviewVisible" style="text-align:center">
      <img style="max-width:100%" :src="uploadPreviewUrl" alt="">
    </el-dialog>
 
    <back-to-top :visibility-height="300" :back-position="50" transition-name="fade" />
  </div>
</template>
 
<script>
import mixin_Upload from '@/mixins/upload.js'
import BackToTop from '@/components/BackToTop'
export default {
  name: 'Demo',
  components: { BackToTop },
  mixins: [mixin_Upload],
  data() {
    return {
      id: this.$route.query.id || '',
      showSearch: true, // 是否显示搜索区
      keyWord: '', // 搜索区字段,可自行扩展其余字段
 
      // TODO
      objectName: 'xx', // 对象名称,用于删除提示、启用提示、弹窗标题等
 
      // 数据
      detail: '',
 
      // 表单校验
      rules: {}
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    // 初始化
    init() {
      this.getDetail()
    },
 
    // 获取列表
    getDetail() {
      var { id } = this
      this.postFN({
        url: 'admin/student/see',
        params: {
          id: id
        },
        mockData: {
          code: 100,
          msg: '',
          data: {
            allergyData: '["花生"]',
            birthday: '2017-07-13',
            createTime: '2021-06-10 14:49:15',
            dayStatus: 0,
            dayTime: null,
            fatherName: '黄大大',
            headImg: 'https://phitab20.oss-cn-shenzhen.aliyuncs.com/imagesUrl/IMG/5162a280-6ed5-4cfb-bb3c-02fc90d30209.jpg',
            id: 'f8b32dc8c9b711ebb79300163e0133f7',
            inTime: '2021-06-10 00:00:00',
            isDel: 0,
            isUp: 1,
            linkTel1: '15999971794',
            linkTel2: '13631419717',
            motherName: '陈晓晓',
            name: '黄小雯',
            numberNo: '0000010',
            outTime: '2023-07-01 00:00:00',
            remark: '1111',
            schoolClassId: '1',
            sexType: 2,
            status: 0
          }
        }
      }, (inf) => {
        this.detail = inf
      })
    },
 
    // 删除
    handleDelete(item) {
      // 打开二次确认弹窗
      this.$confirm('是否确认删除该' + this.objectName + '?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 确定回调
        // TODO url
        this.postFN({
          url: 'xxx',
          params: {
            id: item.id
          },
          mockData: {
            code: 100,
            msg: '',
            data: {}
          }
        }, () => {
          this.getList()
          this.$messageSuc('删除成功')
        })
      }).catch(() => {})
    },
    // 修改是否上架
    handleUpChange(item) {
      const text = item.isUp === 1 ? '上架' : '下架'
      this.$confirm('确认要' + text + '该' + this.objectName + '吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // TODO url
        this.postFN({
          url: 'xxx',
          params: {
            id: item.id,
            isUp: item.isUp
          },
          mockData: {
            code: 100,
            msg: '',
            data: {}
          }
        }, () => {
          this.$messageSuc(text + '成功')
        }, (res) => {
          item.isUp = item.isUp === 1 ? 0 : 1
          this.$messageError(res.msg)
        })
      }).catch(() => {
        item.isUp = item.isUp === 1 ? 0 : 1
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
.line{
  margin: 20px 0;
  border-bottom: 1px solid #E7E7E7;
}
.group-title{
  margin-bottom: 20px;
  font-size: 18px;
  line-height: 30px;
  color: #000000;
  padding: 10px 0;
  border-bottom: 1px solid #E7E7E7;
  font-weight: bold;
}
.col-tx{
  margin-bottom: 20px;
  line-height: 1.4;
  .light{
    color: #0DB9B4;
  }
  .editbtn{
    padding: 4px 15px;
    font-size: 12px;
    margin-left: 10px;
  }
}
.question-item{
  margin-bottom: 20px;
  .title{
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
  }
  .answer{
    font-size: 14px;
    line-height: 1.4;
    padding: 10px 30px 0;
  }
}
</style>