|
@@ -76,7 +76,6 @@ export default {
|
|
|
const field = header[index]
|
|
|
const importField = importHeader[index]
|
|
|
if (field !== importField) {
|
|
|
- console.log(field, importField)
|
|
|
isHeaderOk = false
|
|
|
break
|
|
|
}
|
|
@@ -108,6 +107,23 @@ export default {
|
|
|
})
|
|
|
return verification
|
|
|
},
|
|
|
+ // tslint:disable-next-line:typedef
|
|
|
+ formatDate2(numb, format = '-', mao = ':') {
|
|
|
+ const time = new Date((numb - 1) * 24 * 3600000 + 1)
|
|
|
+ time.setYear(time.getFullYear() - 70)
|
|
|
+ const year = time.getFullYear() + ''
|
|
|
+ const month = time.getMonth() + 1 + ''
|
|
|
+ const date = time.getDate() - 1 + ''
|
|
|
+
|
|
|
+ const houer = time.getHours() - 8 + ''
|
|
|
+ const minutes = time.getMinutes() + ''
|
|
|
+ const seconds = time.getSeconds() + ''
|
|
|
+ if (format && format.length === 1) {
|
|
|
+ // tslint:disable-next-line:max-line-length
|
|
|
+ return year + format + month + format + date + ' ' + (houer < 10 ? (houer === 0 ? '00' : '0' + houer) : houer) + mao + (minutes < 10 ? (minutes === 0 ? '00' : '0' + minutes) : minutes) + mao + (seconds < 10 ? (seconds === 0 ? '00' : '0' + seconds) : seconds)
|
|
|
+ }
|
|
|
+ return year + (month < 10 ? '0' + month : month) + (date < 10 ? '0' + date : date) + ' ' + (houer < 10 ? '0' + date : date)
|
|
|
+ },
|
|
|
/* 校验导入的联系电话是否合法 **/
|
|
|
validateMobile(mobiles = []) {
|
|
|
const verification = createFieldVerification('联系电话不能为空且必须为手机号或电话号码')
|
|
@@ -140,7 +156,6 @@ export default {
|
|
|
const valuesIsNumber = values.every(value => {
|
|
|
return isnumber(value)
|
|
|
})
|
|
|
- console.log(valuesIsNumber)
|
|
|
if (!valuesIsNumber) {
|
|
|
verification.isValid = false
|
|
|
verification.notValidRows.push(index + 1)
|
|
@@ -242,7 +257,7 @@ export default {
|
|
|
|
|
|
const list = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
|
|
|
...prev,
|
|
|
- [currentKey]: currentKey === PROPERTYS.SEND_TIME ? dayjs(tableItem[currentKey]).format('YYYY-MM-DD HH:mm:ss') : tableItem[currentKey]
|
|
|
+ [currentKey]: currentKey === PROPERTYS.SEND_TIME && !Object.hasOwnProperty.call(tableItem[currentKey], 'length') ? this.formatDate2(tableItem[currentKey]) : tableItem[currentKey]
|
|
|
}), {}))
|
|
|
|
|
|
this.loading = true
|