ProductText.vue
4.46 KB
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
<template>
<BasicModal
v-bind="$attrs"
destroyOnClose
@register="register"
title="生产指标书"
width="500px"
:height="80"
wrapClassName="h-[340px]"
@visible-change="handleShow"
:footer="null"
>
<div class="container">
<div v-if="isShow1 == true" style="margin-top: 50px; text-align: center">
<RadioGroup v-model:value="choose" :options="options" />
</div>
<div class="showPdf" v-if="isShow2 == true" style="margin-top: 35px; text-align: center">
<!-- <img src="/pdf.png" /> -->
<FilePptOutlined :style="{ fontSize: '20px' }" class="FilePptOutlined" />
<div style="margin-top: 1px; margin-left: 10px">生产指标书</div>
<EyeOutlined :style="{ fontSize: '20px' }" class="EyeOutlined" @click="handlePdf" />
</div>
<div class="bottom">
<a-button type="primary" @click="handleProduct" className="ml-4" v-if="isShow1 == true"
>生成</a-button
>
<a-button
type="primary"
@click="handleExport"
className="ml-4"
:loading="exportLoading"
v-if="isShow1 == false"
>发送</a-button
>
<a-button type="primary" @click="handleCancel" className="ml-4" style="margin-left: 6px"
>取消</a-button
>
</div>
</div>
</BasicModal>
</template>
<script lang="ts">
import { defineComponent, ref, computed } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { RadioGroup } from 'ant-design-vue';
import { EyeOutlined, FilePptOutlined } from '@ant-design/icons-vue';
import { createImgPreview } from '@/components/Preview';
export default defineComponent({
components: { BasicModal, RadioGroup, EyeOutlined, FilePptOutlined },
setup(props) {
const loading = ref(true);
const exportLoading = ref(false);
const info = ref();
const choose = ref(); //选择公司
const isShow1 = ref(true); //选择公司页面
const isShow2 = ref(false); //生成PDF页面
const pdf = ref(['/pdf.png']);
const [register, { setModalProps, closeModal }] = useModalInner();
const options = computed(() => {
// 运营总监-基本信息,跟单,质检
return [
{ label: '青岛翱特逸格饰品有限公司', value: '1' },
{ label: ' 青岛吉庆天成饰品有限公司', value: '2' },
];
});
function handleCancel() {
loading.value = true;
choose.value = '';
setModalProps({ loading: false, confirmLoading: false });
isShow1.value = true;
isShow2.value = false;
closeModal();
}
function handleShow(visible: boolean) {
if (visible) {
loading.value = true;
choose.value = '';
setModalProps({ loading: false, confirmLoading: false });
isShow1.value = true;
isShow2.value = false;
}
}
function handleProduct() {
if (choose.value == '1' || choose.value == '2') {
isShow1.value = false;
isShow2.value = true;
}
//此处设置接口传递选择的公司值
}
function handlePdf() {
// 可以使用createImgPreview返回的 PreviewActions 来控制预览逻辑,实现类似幻灯片、自动旋转之类的骚操作
// createImgPreview({
// imageList: pdf.value,
// defaultWidth: 500,
// rememberState: true,
// maskClosable: true,
// });
console.log(123);
}
async function handleExport() {
closeModal();
}
return {
register,
loading,
choose,
handleShow,
handleCancel,
info,
handleExport,
handleProduct,
handlePdf,
exportLoading,
isShow1,
isShow2,
options,
pdf,
};
},
});
</script>
<style scoped>
/* .container {
position: relative;
}
.bottom {
position: absolute;
bottom: 0;
} */
.container {
display: flex;
flex-direction: column;
min-height: 20vh;
}
.bottom {
margin-top: auto;
margin-left: auto;
margin-right: 20px;
}
.showPdf {
border: 2px solid;
border-color: #d8d8d8;
border-radius: 5px;
height: 30px;
position: relative;
display: flex;
}
.FilePptOutlined {
margin-top: 3px;
margin-left: 30px;
}
.EyeOutlined {
margin-top: 3px;
margin-left: 290px;
}
</style>