|
@@ -59,11 +59,11 @@
|
|
|
:data="tableData"
|
|
|
style="width: 100%;"
|
|
|
>
|
|
|
- <el-table-column align="center" label="小区-分期" prop="groupDiscName">
|
|
|
- <template v-slot="scope">
|
|
|
- <span>{{ scope.row.groupNameStr + '-' + scope.row.discNameStr }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+<!-- <el-table-column align="center" label="小区-分期" prop="groupDiscName">-->
|
|
|
+<!-- <template v-slot="scope">-->
|
|
|
+<!-- <span>{{ scope.row.groupNameStr + '-' + scope.row.discNameStr }}</span>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
<el-table-column align="center" label="批次号" prop="batchNumber">
|
|
|
<template v-slot="scope">
|
|
|
<span>{{ scope.row.batchNumberStr }}</span>
|
|
@@ -81,7 +81,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="异常原因" prop="reason">
|
|
|
<template v-slot="scope">
|
|
|
- <span style="color: red">{{ scope.row.reason }}</span>
|
|
|
+ <span style="color: red">{{ scope.row.reasonStr }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -97,7 +97,7 @@
|
|
|
>导入</el-button>
|
|
|
<el-button
|
|
|
v-if="isImport"
|
|
|
- type="primary"
|
|
|
+ type="danger"
|
|
|
:loading="excelFlag"
|
|
|
@click="exportError()"
|
|
|
>
|
|
@@ -218,74 +218,21 @@ export default {
|
|
|
_this.excelFlag = false
|
|
|
})
|
|
|
},
|
|
|
- s2ab(s) {
|
|
|
- var cuf
|
|
|
- var i
|
|
|
- if (typeof ArrayBuffer !== 'undefined') {
|
|
|
- cuf = new ArrayBuffer(s.length)
|
|
|
- var view = new Uint8Array(cuf)
|
|
|
- for (i = 0; i !== s.length; i++) {
|
|
|
- view[i] = s.charCodeAt(i) & 0xFF
|
|
|
- }
|
|
|
- return cuf
|
|
|
- } else {
|
|
|
- cuf = new Array(s.length)
|
|
|
- for (i = 0; i !== s.length; ++i) {
|
|
|
- cuf[i] = s.charCodeAt(i) & 0xFF
|
|
|
- }
|
|
|
- return cuf
|
|
|
- }
|
|
|
- },
|
|
|
downloadTemplate() {
|
|
|
- const outData = []
|
|
|
- const title = []
|
|
|
- title.push('小区名称')
|
|
|
- title.push('分期名称')
|
|
|
- title.push('选房日')
|
|
|
- title.push('批次号')
|
|
|
- title.push('选房号')
|
|
|
- title.push('姓名')
|
|
|
- title.push('身份证号')
|
|
|
- title.push('手机号')
|
|
|
- title.push('关系')
|
|
|
- title.push('顺序号')
|
|
|
- outData.push(title)
|
|
|
- const outSize = []
|
|
|
- title.forEach(item => {
|
|
|
- if (item.length > 4) {
|
|
|
- outSize.push({
|
|
|
- wch: 30
|
|
|
- })
|
|
|
- } else {
|
|
|
- outSize.push({
|
|
|
- wch: 15
|
|
|
- })
|
|
|
- }
|
|
|
+ axios({
|
|
|
+ headers: {
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ },
|
|
|
+ method: 'post',
|
|
|
+ url: constant.BASE_URI + '/CustomerManagementController/downLoadTemplate',
|
|
|
+ responseType: 'blob',
|
|
|
+ data: this.tableData
|
|
|
+ }).then(res => {
|
|
|
+ this.downloadExcel(res.data, '客户导入模版.xlsx')
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err)
|
|
|
})
|
|
|
- const fileName = '导入模版'
|
|
|
- const ws = XLSX.utils.aoa_to_sheet(outData)
|
|
|
- ws['!cols'] = outSize
|
|
|
- ws['!rows'] = []
|
|
|
- const wb = XLSX.utils.book_new()
|
|
|
- XLSX.utils.book_append_sheet(wb, ws, fileName)
|
|
|
- const tmpDown = new Blob([
|
|
|
- this.s2ab(
|
|
|
- XLSXStyle.write(wb, {
|
|
|
- bookType: 'xlsx',
|
|
|
- bookSST: true,
|
|
|
- type: 'binary',
|
|
|
- cellStyles: true
|
|
|
- })
|
|
|
- )
|
|
|
- ])
|
|
|
- const elink = document.createElement('a')
|
|
|
- elink.download = decodeURIComponent(fileName + '.xlsx')
|
|
|
- elink.style.display = 'none'
|
|
|
- elink.href = URL.createObjectURL(tmpDown)
|
|
|
- document.body.appendChild(elink)
|
|
|
- elink.click()
|
|
|
- URL.revokeObjectURL(elink.href) // 释放URL 对象
|
|
|
- document.body.removeChild(elink)
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.dialogVisible = false
|
|
@@ -306,11 +253,12 @@ export default {
|
|
|
document.body.removeChild(elink)
|
|
|
},
|
|
|
getItemJson(item) {
|
|
|
- item.groupNameStr = item.groupName.replace('{', '').replace('}', '')
|
|
|
- item.discNameStr = item.discName ? item.discName.replace('{', '').replace('}', '') : ''
|
|
|
+ // item.groupNameStr = item.groupName.replace('{', '').replace('}', '')
|
|
|
+ // item.discNameStr = item.discName ? item.discName.replace('{', '').replace('}', '') : ''
|
|
|
item.batchNumberStr = item.batchNumber ? item.batchNumber.replace('{', '').replace('}', '') : ''
|
|
|
item.roomSelectionNumberStr = item.roomSelectionNumber ? item.roomSelectionNumber.replace('{', '').replace('}', '') : ''
|
|
|
item.buyerNameStr = item.buyerName ? item.buyerName.replace('{', '').replace('}', '') : ''
|
|
|
+ item.reasonStr = item.reason ? item.reason.replace('{', '').replace('}', '') : ''
|
|
|
return item
|
|
|
}
|
|
|
}
|