修改
This commit is contained in:
parent
4fa549daba
commit
6569d4fd53
35
src/utils/obtainendtime.js
Normal file
35
src/utils/obtainendtime.js
Normal file
@ -0,0 +1,35 @@
|
||||
//获取endtime
|
||||
function obtainendtime(starttime, item) {
|
||||
let currentDate = new Date(starttime)
|
||||
let nextDate
|
||||
console.log(item)
|
||||
if (item.packageTermUnit == '年') {
|
||||
currentDate.setFullYear(currentDate.getFullYear() + Number(item.packageTerm));
|
||||
currentDate.setDate(currentDate.getDate() - 1);
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = checkMonth(currentDate.getDate())
|
||||
nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
} else if (item.packageTermUnit == '月') {
|
||||
currentDate.setMonth(currentDate.getMonth() + Number(item.packageTerm)); // 加一个月
|
||||
currentDate.setDate(currentDate.getDate() - 1); // 减一天
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = checkMonth(currentDate.getDate())
|
||||
nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
} else if (item.packageTermUnit == '日') {
|
||||
currentDate = new Date(currentDate.setDate(currentDate.getDate() + Number(item.packageTerm)));
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = checkMonth(currentDate.getDate())
|
||||
nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
}
|
||||
return nextDate
|
||||
}
|
||||
function checkMonth(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
export { obtainendtime }
|
||||
@ -140,6 +140,7 @@ import {
|
||||
getById
|
||||
} from '@/api/manage/signRecord.js'
|
||||
import { getAge } from "@/utils/age";
|
||||
import { obtainendtime } from "@/utils/obtainendtime";
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
dicts: ['hardware_type'],
|
||||
@ -226,49 +227,13 @@ export default {
|
||||
this.signPackage = { ...this.signPackage, ...resp.data }
|
||||
this.signPackage.serviceStartTime = `${year}-${month}-${day}`
|
||||
this.signPackage.servicePackageId = resp.data.id
|
||||
this.obtainendtime(this.signPackage)
|
||||
this.signPackage.serviceEndTime = obtainendtime(this.signPackage.serviceStartTime, this.signPackage)
|
||||
})
|
||||
})
|
||||
},
|
||||
//获取endtime
|
||||
obtainendtime(item) {
|
||||
if (item.packageTermUnit == '年') {
|
||||
const nextdate = new Date(this.signPackage.serviceStartTime);
|
||||
nextdate.setFullYear(nextdate.getFullYear() + Number(item.packageTerm));
|
||||
nextdate.setDate(nextdate.getDate() - 1);
|
||||
let nextYear = nextdate.getFullYear();
|
||||
let nextMonth = this.checkMonth(nextdate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(nextdate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
} else if (item.packageTermUnit == '月') {
|
||||
const currentDate = new Date(this.signPackage.serviceStartTime);
|
||||
currentDate.setMonth(currentDate.getMonth() + Number(item.packageTerm)); // 加一个月
|
||||
currentDate.setDate(currentDate.getDate() - 1); // 减一天
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = this.checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(currentDate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
} else if (item.packageTermUnit == '日') {
|
||||
let currentDate = new Date(this.signPackage.serviceStartTime)
|
||||
currentDate = new Date(currentDate.setDate(currentDate.getDate() + Number(item.packageTerm)));
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = this.checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(currentDate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
}
|
||||
},
|
||||
checkMonth(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
},
|
||||
//选择开始时间
|
||||
changestarttime(item) {
|
||||
this.obtainendtime(this.signPackage)
|
||||
this.signPackage.serviceEndTime = obtainendtime(item, this.signPackage)
|
||||
},
|
||||
//续约
|
||||
signupload() {
|
||||
@ -297,7 +262,11 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
this.$router.go(-1);
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.push({
|
||||
path: "/patient/signRecord",
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$modal.msgSuccess("签约成功");
|
||||
});
|
||||
@ -318,7 +287,11 @@ export default {
|
||||
},
|
||||
handlePictureCardPreview(file) { },
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.push({
|
||||
path: "/patient/signRecord",
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -131,6 +131,7 @@ import {
|
||||
servicepackageinfo
|
||||
} from '@/api/manage/signRecord.js'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { obtainendtime } from "@/utils/obtainendtime";
|
||||
export default {
|
||||
dicts: ['hardware_type'],
|
||||
name: "newSigning",
|
||||
@ -199,39 +200,7 @@ export default {
|
||||
month >= 1 && month <= 9 ? (month = "0" + month) : "";
|
||||
day >= 0 && day <= 9 ? (day = "0" + day) : "";
|
||||
this.signPackage.serviceStartTime = `${year}-${month}-${day}`
|
||||
if (item.packageTermUnit == '年') {
|
||||
const nextdate = new Date(this.signPackage.serviceStartTime);
|
||||
nextdate.setFullYear(nextdate.getFullYear() + Number(item.packageTerm));
|
||||
nextdate.setDate(nextdate.getDate() - 1);
|
||||
let nextYear = nextdate.getFullYear();
|
||||
let nextMonth = this.checkMonth(nextdate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(nextdate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
} else if (item.packageTermUnit == '月') {
|
||||
const currentDate = new Date(this.signPackage.serviceStartTime);
|
||||
currentDate.setMonth(currentDate.getMonth() + Number(item.packageTerm)); // 加一个月
|
||||
currentDate.setDate(currentDate.getDate() - 1); // 减一天
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = this.checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(currentDate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
} else if (item.packageTermUnit == '日') {
|
||||
let currentDate = new Date(this.signPackage.serviceStartTime)
|
||||
currentDate = new Date(currentDate.setDate(currentDate.getDate() + Number(item.packageTerm)));
|
||||
let nextYear = currentDate.getFullYear();
|
||||
let nextMonth = this.checkMonth(currentDate.getMonth() + 1);// 因日期中的月份表示为0-11,所以要显示正确的月份,需要 + 1
|
||||
let nextday = this.checkMonth(currentDate.getDate())
|
||||
let nextDate = nextYear + "-" + nextMonth + "-" + nextday; // "2019-05"
|
||||
this.signPackage.serviceEndTime = nextDate
|
||||
}
|
||||
},
|
||||
checkMonth(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
this.signPackage.serviceEndTime = obtainendtime(this.signPackage.serviceStartTime, item)
|
||||
},
|
||||
//签约
|
||||
signupload() {
|
||||
@ -253,10 +222,11 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
// this.$router.go(-1);
|
||||
this.$router.push({
|
||||
path: "/patient/signRecord",
|
||||
});
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.push({
|
||||
path: "/patient/signRecord",
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$modal.msgSuccess("签约成功");
|
||||
});
|
||||
@ -287,7 +257,11 @@ export default {
|
||||
handlePictureCardPreview(file) {
|
||||
},
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.push({
|
||||
path: "/patient/signRecord",
|
||||
});
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -411,26 +411,28 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
handlenewsign(row) {
|
||||
this.$router.push({
|
||||
path: "/patient/newSigning",
|
||||
query: {
|
||||
departmentId: row.departmentId,
|
||||
patientName: row.patientName,
|
||||
patientPhone: row.patientPhone,
|
||||
visitMethod: row.visitMethod,
|
||||
signDiagnosis: row.signDiagnosis,
|
||||
visitSerialNumber: row.visitSerialNumber,
|
||||
hospitalAgencyName: row.hospitalAgencyName,
|
||||
hospitalAgencyId: row.hospitalAgencyId,
|
||||
inHospitalNumber: row.inHospitalNumber,
|
||||
departmentName: row.departmentName,
|
||||
paymentStatus: row.paymentStatus,
|
||||
sex: row.sex,
|
||||
age: row.birthDate ? getAge(row.birthDate) : '',
|
||||
patientId: row.patientId,
|
||||
createTime: row.createTime,
|
||||
},
|
||||
});
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.replace({
|
||||
path: "/patient/newSigning",
|
||||
query: {
|
||||
departmentId: row.departmentId,
|
||||
patientName: row.patientName,
|
||||
patientPhone: row.patientPhone,
|
||||
visitMethod: row.visitMethod,
|
||||
signDiagnosis: row.signDiagnosis,
|
||||
visitSerialNumber: row.visitSerialNumber,
|
||||
hospitalAgencyName: row.hospitalAgencyName,
|
||||
hospitalAgencyId: row.hospitalAgencyId,
|
||||
inHospitalNumber: row.inHospitalNumber,
|
||||
departmentName: row.departmentName,
|
||||
paymentStatus: row.paymentStatus,
|
||||
sex: row.sex,
|
||||
age: row.birthDate ? getAge(row.birthDate) : '',
|
||||
patientId: row.patientId,
|
||||
createTime: row.createTime,
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
selectAgencyinfo() {
|
||||
let query = {
|
||||
@ -501,12 +503,14 @@ export default {
|
||||
},
|
||||
//续约
|
||||
handleContinue(row) {
|
||||
this.$router.push({
|
||||
path: "/patient/continueSigning",
|
||||
query: {
|
||||
patientSignRecordId: row.id,
|
||||
},
|
||||
});
|
||||
this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
|
||||
this.$router.replace({
|
||||
path: "/patient/continueSigning",
|
||||
query: {
|
||||
patientSignRecordId: row.id,
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 详情操作 */
|
||||
handleAuthRole(row) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user