Исправила отображение контактов на записи
This commit is contained in:
@@ -64,7 +64,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
protocolData: {
|
||||
date: null,
|
||||
date: "",
|
||||
startTime: null,
|
||||
},
|
||||
};
|
||||
@@ -96,19 +96,27 @@ export default {
|
||||
...mapActions({
|
||||
createProtocol: "createProtocol",
|
||||
}),
|
||||
checkFormat(date) {
|
||||
return date && date?.length === 10 ? date : null;
|
||||
},
|
||||
saveProtocol() {
|
||||
if (
|
||||
!Object.keys(this.protocolData).every((key) => this.protocolData[key])
|
||||
) {
|
||||
)
|
||||
return;
|
||||
}
|
||||
let time = this.protocolData.startTime.split(":");
|
||||
let start = moment(this.protocolData.date).hour(time[0]).minute(time[1]);
|
||||
let start = moment(this.checkFormat(this.protocolData.date))
|
||||
?.hour(time[0])
|
||||
?.minute(time[1]);
|
||||
let createdProtocol = {
|
||||
start: start.isValid() ? start.format() : null,
|
||||
end: start.isValid() ? start.add(30, "m").format() : null,
|
||||
status: null,
|
||||
};
|
||||
if (
|
||||
Object.keys(createdProtocol)?.some((elem) => !createdProtocol?.[elem])
|
||||
)
|
||||
return;
|
||||
createdProtocol.status = null;
|
||||
this.createProtocol(createdProtocol);
|
||||
this.changeShownCreateModal(false);
|
||||
this.createInspection();
|
||||
|
||||
Reference in New Issue
Block a user