Ver código fonte

客户上传

LAPTOP-FO2T5SIU\35838 5 meses atrás
pai
commit
633540d5c6

+ 23 - 75
src/views/customerManagement/component/uploadCost.vue

@@ -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
         }
     }

+ 8 - 4
src/views/parkAssets/parkRoom/index.vue

@@ -398,13 +398,12 @@
                 </el-col>
               </el-row>
               <el-row>
-                <el-col :span="3" class="col-txt"><span>可售状态:</span></el-col>
+                <el-col :span="3" class="col-txt"><span><span><span class="red-asterisk">*</span>可售状态:</span></span></el-col>
                 <el-col :span="21" class="col-input">
-                  <el-form-item>
+                  <el-form-item prop="saleStatus">
                     <el-select
                       v-model="houseForm.saleStatus"
                       placeholder="请选择"
-                      size="small"
                       :disabled="isView"
                       clearable
                     >
@@ -493,8 +492,9 @@ export default {
                 actualShareArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
                 actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
                 // actualLandArea: [{ required: true, trigger: 'blur', message: '请输入实测土地面积' }],
-                roomUse: [{ required: true, trigger: 'blur', message: '请输入用途' }]
+                roomUse: [{ required: true, trigger: 'change', message: '请选择用途' }],
                 // roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }]
+                saleStatus: [{ required: true, trigger: 'change', message: '请选择可售状态' }]
             },
 
             roomId: '',
@@ -622,6 +622,8 @@ export default {
             this.dialogVisible = true
             this.fileList = []
             this.houseTypeOption = []
+            // 可售状态 默认为正常
+            this.$set(this.houseForm, 'saleStatus', '1')
             this.dialogTitle = '新增房间'
         },
         handleEdit: function(val) {
@@ -797,6 +799,8 @@ export default {
                         }
                     })
                     .catch(() => {})
+            } else {
+
             }
         },
         // 上传相关,包括图片、文件

+ 1 - 1
src/views/transactionRecord/refundRecordIndex.vue

@@ -273,7 +273,7 @@ export default {
                 })
                 const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
                     { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
-                const fileName = '款记录导出 ' + new Date().Format('yyyyMMddhhmm')
+                const fileName = '退款记录导出 ' + new Date().Format('yyyyMMddhhmm')
                 this.$outputXlsxFile(this.OutData, OutSize, fileName)
             })
         },