修改日期时间

This commit is contained in:
shidongli 2024-12-11 16:43:12 +08:00
parent daf9b8a51c
commit 544b0c0ceb

View File

@ -128,27 +128,31 @@
> >
<div class="top"> <div class="top">
<div class="toptop"> <div class="toptop">
<el-radio v-model="item.checked1" :label="1" @change="handleCheckAllChange1($event, item)"> <el-radio
<el-select v-model="item.checked1"
style="width: 123px" :label="1"
v-model="item.routeNodeName" @change="handleCheckAllChange1($event, item)"
@focus="handleFocusone(item)"
> >
<el-option <el-select
v-for="item in parentDictCodelist" style="width: 123px"
:key="item.dictValue" v-model="item.routeNodeName"
:label="item.dictLabel" @focus="handleFocusone(item)"
:value="item.dictValue"
> >
</el-option> <el-option
</el-select> v-for="item in parentDictCodelist"
<el-input :key="item.dictValue"
style="width: 90px" :label="item.dictLabel"
v-model="item.routeNodeDay" :value="item.dictValue"
type="number" >
@focus="handleFocus(item)" </el-option>
></el-input> </el-select>
<span></span> <el-input
style="width: 90px"
v-model="item.routeNodeDay"
type="number"
@focus="handleFocus(item)"
></el-input>
<span></span>
</el-radio> </el-radio>
</div> </div>
<div> <div>
@ -160,23 +164,25 @@
</div> </div>
<div class="top"> <div class="top">
<div class="toptop"> <div class="toptop">
<el-radio v-model="item.checked2" :label="2" @change="handleCheckAllChange2($event, item, index)"> <el-radio
<span style="width: 78px">指定时间</span> v-model="item.checked2"
<el-date-picker :label="2"
format="yyyy-MM-dd HH:mm" @change="handleCheckAllChange2($event, item, index)"
value-format="yyyy-MM-dd HH:mm"
v-model="item.nodePlanTime"
type="datetime"
placeholder="选择日期时间"
:picker-options="pickerOptions"
@input="input(item,index)"
@focus="setCurrentTime(item,index)"
:default-time="currentDate"
ref="datePicker"
> >
</el-date-picker> <span style="width: 78px">指定时间</span>
<el-date-picker
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="item.nodePlanTime"
type="datetime"
placeholder="选择日期时间"
:picker-options="pickerOptions"
@input="input(item, index)"
@focus="setCurrentTime(item, index)"
ref="datePicker"
>
</el-date-picker>
</el-radio> </el-radio>
</div> </div>
</div> </div>
<div class="top"> <div class="top">
@ -186,10 +192,13 @@
style="margin-right: 5px" style="margin-right: 5px"
@change="handleCheckAllChange3($event, item)" @change="handleCheckAllChange3($event, item)"
></el-checkbox> --> ></el-checkbox> -->
<el-radio v-model="item.checked3" :label="3" @change="handleCheckAllChange3($event, item)"> <el-radio
v-model="item.checked3"
:label="3"
@change="handleCheckAllChange3($event, item)"
>
<span>立即执行</span> <span>立即执行</span>
</el-radio> </el-radio>
</div> </div>
</div> </div>
<el-card :class="listindex == index ? 'cards' : ''"> <el-card :class="listindex == index ? 'cards' : ''">
@ -538,8 +547,9 @@ export default {
name: "ManuallyCreatingTasks", name: "ManuallyCreatingTasks",
data() { data() {
return { return {
time:'', // currentDate: '',
datePickerVisible:true, time: '',
datePickerVisible: true,
show: 0, show: 0,
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
@ -549,8 +559,6 @@ export default {
// return time.getTime() > Date.now() - 8.64e7// -8.64e7 // return time.getTime() > Date.now() - 8.64e7// -8.64e7
} }
}, },
heightLine: 0, heightLine: 0,
optionsname: '', optionsname: '',
options: [], options: [],
@ -630,7 +638,7 @@ export default {
}, },
created() { created() {
console.log(this.$route.query,'this.$route.quer') console.log(this.$route.query, 'this.$route.quer')
this.infolist(); this.infolist();
this.infolistword(); this.infolistword();
@ -645,28 +653,28 @@ export default {
this.updata.departmentId = this.$route.query.departmentId; this.updata.departmentId = this.$route.query.departmentId;
this.updata.departmentName = this.$route.query.departmentName; this.updata.departmentName = this.$route.query.departmentName;
this.formInline = this.list[0]; this.formInline = this.list[0];
if(this.$route.query.path=='/patient/signRecord'){ if (this.$route.query.path == '/patient/signRecord') {
this.list[0].checked1=1 this.list[0].checked1 = 1
this.list[0].routeNodeName='AFTER_VISIT_DISCHARGE' this.list[0].routeNodeName = 'AFTER_VISIT_DISCHARGE'
this.list[0].plantype='PLUSDAY' this.list[0].plantype = 'PLUSDAY'
} }
if(this.$route.query.path=="/patient/patientinfoimport" || this.$route.query.path=="/task/Patientmanagement" if (this.$route.query.path == "/patient/patientinfoimport" || this.$route.query.path == "/task/Patientmanagement"
|| this.$route.query.path=="/patient/ImportDetails" || this.$route.query.path == "/patient/ImportDetails"
){ ) {
this.list[0].checked2=2 this.list[0].checked2 = 2
this.list[0].routeNodeName='' this.list[0].routeNodeName = ''
this.list[0].plantype='APPOINT' this.list[0].plantype = 'APPOINT'
} }
}, },
computed: { // computed: {
currentDate() { // currentDate() {
return this.formatDate(new Date()); // return this.formatDate(new Date());
}, // },
}, // },
mounted() { mounted() {
this.getMaxTableHeight() this.getMaxTableHeight()
this.screenChange() this.screenChange()
@ -679,26 +687,26 @@ export default {
}, },
// plantype // plantype
// CURRENT // CURRENT
// APPOINT // APPOINT
// PLUSDAY // PLUSDAY
// 1 // 1
handleFocus(item){ handleFocus(item) {
console.log(item,'item,index') console.log(item, 'item,index')
item.checked1=1 item.checked1 = 1
item.checked2="" item.checked2 = ""
item.checked3="" item.checked3 = ""
item.nodePlanTime = "" item.nodePlanTime = ""
item.timedata = "" item.timedata = ""
item.plantype = "PLUSDAY" item.plantype = "PLUSDAY"
}, },
// 1 // 1
handleFocusone(item){ handleFocusone(item) {
item.checked1=1 item.checked1 = 1
item.checked2="" item.checked2 = ""
item.checked3="" item.checked3 = ""
item.nodePlanTime = "" item.nodePlanTime = ""
item.timedata = "" item.timedata = ""
item.plantype = "PLUSDAY" item.plantype = "PLUSDAY"
@ -706,16 +714,16 @@ export default {
}, },
// 2 // 2
setCurrentTime(item,index) { setCurrentTime(item, index) {
console.log(item,'item,index') console.log(item, 'item,index')
item.checked1="" item.checked1 = ""
item.checked2=2 item.checked2 = 2
item.checked3="" item.checked3 = ""
// item.routeNodeName = "" // item.routeNodeName = ""
item.routeNodeDay = "" item.routeNodeDay = ""
item.plantype = "APPOINT" item.plantype = "APPOINT"
item.timedata = "" item.timedata = ""
}, },
input(item,index){ input(item,index){
this.$forceUpdate() this.$forceUpdate()
@ -734,11 +742,11 @@ export default {
handleCheckAllChange1(e, item) { handleCheckAllChange1(e, item) {
console.log(e, item, 'value') console.log(e, item, 'value')
item.checked2 = "" item.checked2 = ""
item.checked3 = "" item.checked3 = ""
item.checked1 = 1 item.checked1 = 1
item.nodePlanTime = "" item.nodePlanTime = ""
item.timedata = "" item.timedata = ""
item.plantype = "PLUSDAY" item.plantype = "PLUSDAY"
}, },
// //
handleCheckAllChange2(e, item, index) { handleCheckAllChange2(e, item, index) {
@ -747,8 +755,8 @@ export default {
console.log(this.list, 'list') console.log(this.list, 'list')
// item.routeNodeName = "" // item.routeNodeName = ""
item.routeNodeDay = "" item.routeNodeDay = ""
item.plantype = "APPOINT" item.plantype = "APPOINT"
item.timedata = "" item.timedata = ""
}, },
// //
handleCheckAllChange3(e, item) { handleCheckAllChange3(e, item) {
@ -758,15 +766,15 @@ export default {
item.routeNodeDay = "" item.routeNodeDay = ""
console.log(e, item, 'value3') console.log(e, item, 'value3')
let yy = new Date().getFullYear(); let yy = new Date().getFullYear();
let mm = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1); let mm = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1);
let dd = (new Date().getDate()) < 10 ? '0' + (new Date().getDate() + 1) : (new Date().getDate() + 1); let dd = (new Date().getDate()) < 10 ? '0' + (new Date().getDate() + 1) : (new Date().getDate() + 1);
let hh = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours(); let hh = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours();
let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes(); let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes();
let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds(); let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds();
var data = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss var data = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
item.timedata = data item.timedata = data
item.plantype = "CURRENT" item.plantype = "CURRENT"
item.nodePlanTime = "" item.nodePlanTime = ""
}, },
// //
upload() { upload() {
@ -777,38 +785,47 @@ export default {
this.updata.routeNodeList = this.list; this.updata.routeNodeList = this.list;
var newObj = JSON.parse(JSON.stringify(this.updata)); var newObj = JSON.parse(JSON.stringify(this.updata));
newObj.routeNodeList.forEach(e => { newObj.routeNodeList.forEach(e => {
if (e.timedata) { if (e.timedata) {
e.nodePlanTime = e.timedata e.nodePlanTime = e.timedata
}
delete e.timedata; }
delete e.checked1; const dateParts = e.nodePlanTime.split(' ');
delete e.checked2; if (dateParts[1] == "00:00:00") {
delete e.checked3; const date = new Date();
}) const hours = String(date.getHours()).padStart(2, '0');
// var nulllength= newObj.routeNodeList.filter(item => item.routeNodeName=="" || item.routeNodeName==null || item.routeNodeName==undefined); const minutes = String(date.getMinutes()).padStart(2, '0');
// console.log(nulllength,'nulllength') const ss = String(date.getSeconds()).padStart(2, '0');
// if(nulllength.length>0){ e.nodePlanTime = dateParts[0] + ' ' + hours + ':' + minutes + ':' + ss;
// this.$message.error(''); }
// return delete e.timedata;
// } delete e.checked1;
console.log(newObj, 'this.newObj') delete e.checked3;
console.log(this.updata, 'this.updata') })
// return // var nulllength= newObj.routeNodeList.filter(item => item.routeNodeName=="" || item.routeNodeName==null || item.routeNodeName==undefined);
// console.log(nulllength,'nulllength')
// if(nulllength.length>0){
// this.$message.error('');
// return
// }
console.log(newObj, 'this.newObj')
console.log(this.updata, 'this.updata')
// return
signrouteadd(newObj).then((res) => { signrouteadd(newObj).then((res) => {
var message='' var message = ''
if(this.$route.query.path=="/patient/signRecord"){ if (this.$route.query.path == "/patient/signRecord") {
message ='保存成功,即将返回签约列表' message = '保存成功,即将返回签约列表'
}else if(this.$route.query.path=="/patient/patientinfoimport"){ } else if (this.$route.query.path == "/patient/patientinfoimport") {
message ='保存成功,即将返回签约患者列表' message = '保存成功,即将返回签约患者列表'
}else if(this.$route.query.path=="/patient/ImportDetails"){ } else if (this.$route.query.path == "/patient/ImportDetails") {
message ='保存成功,即将返回导入明细列表' message = '保存成功,即将返回导入明细列表'
} }
else if(this.$route.query.path=="/task/Patientmanagement"){ else if (this.$route.query.path == "/task/Patientmanagement") {
message ='保存成功,即将返回创建任务列表' message = '保存成功,即将返回创建任务列表'
} }
this.$notify({ this.$notify({
type: "success", type: "success",
title: "提示", title: "提示",
message: message, message: message,
@ -1301,9 +1318,8 @@ export default {
padding-left: 12px; padding-left: 12px;
} }
} }
::v-deep .el-timeline-item__node--normal{ ::v-deep .el-timeline-item__node--normal {
left: 0px; left: 0px;
} }
::v-deep .el-timeline-item__timestamp { ::v-deep .el-timeline-item__timestamp {
margin: 0 !important; margin: 0 !important;
@ -1335,10 +1351,10 @@ export default {
::v-deep .el-form-item__content { ::v-deep .el-form-item__content {
display: inline-block !important; display: inline-block !important;
} }
::v-deep .el-icon-circle-plus-outline{ ::v-deep .el-icon-circle-plus-outline {
cursor: pointer; cursor: pointer;
} }
::v-deep .el-icon-delete{ ::v-deep .el-icon-delete {
cursor: pointer; cursor: pointer;
} }
</style> </style>