This commit is contained in:
2024-03-20 11:31:50 +08:00
parent 4fa549daba
commit 6569d4fd53
4 changed files with 90 additions and 104 deletions

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

View File

@ -140,6 +140,7 @@ import {
getById getById
} from '@/api/manage/signRecord.js' } from '@/api/manage/signRecord.js'
import { getAge } from "@/utils/age"; import { getAge } from "@/utils/age";
import { obtainendtime } from "@/utils/obtainendtime";
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
dicts: ['hardware_type'], dicts: ['hardware_type'],
@ -226,49 +227,13 @@ export default {
this.signPackage = { ...this.signPackage, ...resp.data } this.signPackage = { ...this.signPackage, ...resp.data }
this.signPackage.serviceStartTime = `${year}-${month}-${day}` this.signPackage.serviceStartTime = `${year}-${month}-${day}`
this.signPackage.servicePackageId = resp.data.id 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) { changestarttime(item) {
this.obtainendtime(this.signPackage) this.signPackage.serviceEndTime = obtainendtime(item, this.signPackage)
}, },
// //
signupload() { signupload() {
@ -297,7 +262,11 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
}).then(() => { }).then(() => {
this.$router.go(-1); this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/patient/signRecord",
});
})
}).catch(() => { }).catch(() => {
this.$modal.msgSuccess("签约成功"); this.$modal.msgSuccess("签约成功");
}); });
@ -318,7 +287,11 @@ export default {
}, },
handlePictureCardPreview(file) { }, handlePictureCardPreview(file) { },
goback() { goback() {
this.$router.go(-1); this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/patient/signRecord",
});
})
}, },
} }
}; };

View File

@ -131,6 +131,7 @@ import {
servicepackageinfo servicepackageinfo
} from '@/api/manage/signRecord.js' } from '@/api/manage/signRecord.js'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { obtainendtime } from "@/utils/obtainendtime";
export default { export default {
dicts: ['hardware_type'], dicts: ['hardware_type'],
name: "newSigning", name: "newSigning",
@ -199,39 +200,7 @@ export default {
month >= 1 && month <= 9 ? (month = "0" + month) : ""; month >= 1 && month <= 9 ? (month = "0" + month) : "";
day >= 0 && day <= 9 ? (day = "0" + day) : ""; day >= 0 && day <= 9 ? (day = "0" + day) : "";
this.signPackage.serviceStartTime = `${year}-${month}-${day}` this.signPackage.serviceStartTime = `${year}-${month}-${day}`
if (item.packageTermUnit == '年') { this.signPackage.serviceEndTime = obtainendtime(this.signPackage.serviceStartTime, item)
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;
}, },
// //
signupload() { signupload() {
@ -253,10 +222,11 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'success' type: 'success'
}).then(() => { }).then(() => {
// this.$router.go(-1); this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({ this.$router.push({
path: "/patient/signRecord", path: "/patient/signRecord",
}); });
})
}).catch(() => { }).catch(() => {
this.$modal.msgSuccess("签约成功"); this.$modal.msgSuccess("签约成功");
}); });
@ -287,7 +257,11 @@ export default {
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
}, },
goback() { goback() {
this.$router.go(-1); this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
this.$router.push({
path: "/patient/signRecord",
});
})
}, },
} }
}; };

View File

@ -411,26 +411,28 @@ export default {
this.getList(); this.getList();
}, },
handlenewsign(row) { handlenewsign(row) {
this.$router.push({ this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
path: "/patient/newSigning", this.$router.replace({
query: { path: "/patient/newSigning",
departmentId: row.departmentId, query: {
patientName: row.patientName, departmentId: row.departmentId,
patientPhone: row.patientPhone, patientName: row.patientName,
visitMethod: row.visitMethod, patientPhone: row.patientPhone,
signDiagnosis: row.signDiagnosis, visitMethod: row.visitMethod,
visitSerialNumber: row.visitSerialNumber, signDiagnosis: row.signDiagnosis,
hospitalAgencyName: row.hospitalAgencyName, visitSerialNumber: row.visitSerialNumber,
hospitalAgencyId: row.hospitalAgencyId, hospitalAgencyName: row.hospitalAgencyName,
inHospitalNumber: row.inHospitalNumber, hospitalAgencyId: row.hospitalAgencyId,
departmentName: row.departmentName, inHospitalNumber: row.inHospitalNumber,
paymentStatus: row.paymentStatus, departmentName: row.departmentName,
sex: row.sex, paymentStatus: row.paymentStatus,
age: row.birthDate ? getAge(row.birthDate) : '', sex: row.sex,
patientId: row.patientId, age: row.birthDate ? getAge(row.birthDate) : '',
createTime: row.createTime, patientId: row.patientId,
}, createTime: row.createTime,
}); },
});
})
}, },
selectAgencyinfo() { selectAgencyinfo() {
let query = { let query = {
@ -501,12 +503,14 @@ export default {
}, },
// //
handleContinue(row) { handleContinue(row) {
this.$router.push({ this.$store.dispatch('tagsView/delView', this.$route).then(({ visitedViews }) => {
path: "/patient/continueSigning", this.$router.replace({
query: { path: "/patient/continueSigning",
patientSignRecordId: row.id, query: {
}, patientSignRecordId: row.id,
}); },
});
})
}, },
/** 详情操作 */ /** 详情操作 */
handleAuthRole(row) { handleAuthRole(row) {