zhangwei
3 天以前 4176d3b696a2bcf44829b5b646f5b678b8877c23
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<script lang="ts" name="fBS_CusExtend" setup>
import { ref, reactive, onMounted } from "vue";
import { formatDate } from '/@/utils/formatTime';
import { useFBS_CusExtendApi } from '/@/api/Customer/fBS_CusExtend';
 
//父级传递来的函数,用于回调
const emit = defineEmits(["reloadTable"]);
const fBS_CusExtendApi = useFBS_CusExtendApi();
 
const state = reactive({
    title: '',
    loading: false,
    showDialog: false,
    ruleForm: {} as any,
    stores: {},
    dropdownData: {} as any,
    enterpriseList:[],
    roleList:[],
    shenheList:[],
    srcList:[] 
});
 
// 页面加载时
onMounted(async () => {
});
 
// 打开弹窗
const openDialog = async (row: any, title: string, qiyeList: any,roleList: any,shenheList: any) => {
    state.roleList = roleList
    state.enterpriseList = qiyeList
    state.shenheList = shenheList
    state.title = title;
    row = row ?? {  };
    state.ruleForm = row.id ? await fBS_CusExtendApi.detail(row.id).then(res => res.data.result) : JSON.parse(JSON.stringify(row));
    // state.ruleForm.enterpriseType = state.ruleForm.enterpriseType.split(",");
    state.showDialog = true;
};
 
// 关闭弹窗
const closeDialog = () => {
    emit("reloadTable");
    state.showDialog = false;
};
 
// 提交
const submit = async (val:any) => {
    let values = state.ruleForm;
    await fBS_CusExtendApi.changeSteps(values.id,val);
    closeDialog();
};
const showPreview = ref(false)
const showImg = (name: string|number) => {
   showPreview.value=true
   state.srcList = [state.ruleForm[name]]
};
//将属性或者函数暴露给父组件
defineExpose({ openDialog });
</script>
<template>
    <div class="fBS_CusExtend-container">
        <el-dialog v-model="state.showDialog" :width="'80%'" draggable :close-on-click-modal="false">
            <template #header>
                <div style="color: #fff">
                    <span>{{ state.title }}</span>
                </div>
            </template>
            <div class="mb10">
                <el-row :gutter="10" justify="end">
                    <span>审核状态:</span>
                    <el-col :span="4">
                        <el-select
                            v-model="state.ruleForm.steps"
                            disabled
                            placeholder="请选择"
                        >
                            <el-option
                            v-for="item in state.shenheList"
                            :key="item.key"
                            :label="item.description=='未通过'?'不通过':item.description"
                            :value="item.value"
                            />
                        </el-select>
                        </el-col>
                        <!-- <el-col :span="1"><el-button type="primary">审核</el-button></el-col> -->
                </el-row>
            </div>
            <el-descriptions class="margin-top" title="" :column="3" border>
                <el-descriptions-item :span="3">
                    <template #label>
                    <div class="cell-item">交易主体</div>
                    </template>
                    <!-- {{ state.ruleForm.transactionName }} -->
                    <span v-for="(item, index) in state.roleList" :key="index">
                                            <span v-if="item.code == state.ruleForm.transactionCode">{{ item.name }}</span>
                                            </span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">企业名称</div>
                    </template>
                    {{ state.ruleForm.enterpriseName }}
                    <span @click="showImg('businessLicense')">
                    <el-link type="primary" underline>查看营业执照</el-link>
                    </span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">统一社会信用代码</div>
                    </template>
                    {{ state.ruleForm.unifiedSocialCreditCode }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">注册资金</div>
                    </template>
                    {{ state.ruleForm.registeredCapital }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                    <template #label>
                    <div class="cell-item">企业类型</div>
                    </template>
                    {{ state.ruleForm.enterpriseType }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">住所地</div>
                    </template>
                    {{ state.ruleForm.residence }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">联系电话</div>
                    </template>
                    {{ state.ruleForm.legalRepresentativePhone }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">成立时间</div>
                    </template>
                    {{ formatDate(new Date(state.ruleForm.establishmentTime), 'YYYY-mm-dd') }}
                </el-descriptions-item>
                <el-descriptions-item :span="2">
                    <template #label>
                    <div class="cell-item">电子邮箱</div>
                    </template>
                    {{ state.ruleForm.enterpriseEmail }}
                </el-descriptions-item>
                <el-descriptions-item :span="3" label-width="100">
                    <template #label>
                    <div class="cell-item">主营业务</div>
                    </template>
                    {{ state.ruleForm.mainBusiness }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">法定代表人</div>
                    </template>
                    {{ state.ruleForm.legalRepresentativeName }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">身份证</div>
                    </template>
                    {{ state.ruleForm.legalRepresentativeIdNumber }}
                    <span @click="showImg('legalRepresentativeIdCard')">
                    <el-link type="primary" underline>查看身份证</el-link>
                    </span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">联系电话</div>
                    </template>
                    {{ state.ruleForm.legalRepresentativePhone }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">业务经办人</div>
                    </template>
                    {{ state.ruleForm.operatorName }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">身份证</div>
                    </template>
                    <el-image-viewer
                        v-if="showPreview"
                        :url-list="state.srcList"
                        show-progress
                        @close="showPreview = false"
                    />
                    {{ state.ruleForm.operatorIdNumber }}
                    <span style="margin-right: auto" @click="showImg('operatorIdCard')">
                    <el-link type="primary" underline>查看身份证</el-link>
                    </span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">联系电话</div>
                    </template>
                    {{ state.ruleForm.operatorPhone }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">开户银行</div>
                    </template>
                    {{ state.ruleForm.bankName }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template #label>
                    <div class="cell-item">银行账号</div>
                    </template>
                    {{ state.ruleForm.bankAccount }}
                </el-descriptions-item>
                </el-descriptions>
                
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="() => state.showDialog = false">取 消</el-button>
                    <el-button @click="submit(2)" type="primary" v-reclick="1000">通过审核</el-button>
                    <el-button @click="submit(3)" type="warning" v-reclick="1000">不通过审核</el-button>
                </span>
            </template>
        </el-dialog>
    </div>
</template>
<style lang="scss" scoped>
:deep(.el-select), :deep(.el-input-number) {
  width: 100%;
}
</style>