1
This commit is contained in:
parent
723214df73
commit
cf48d11678
@ -4,16 +4,21 @@
|
|||||||
<view class="background"></view>
|
<view class="background"></view>
|
||||||
<!-- <uni-card margin="0" :is-shadow="true"> -->
|
<!-- <uni-card margin="0" :is-shadow="true"> -->
|
||||||
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules" ref="wForm" errorType="border-bottom" class="demo-ruleForm">
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" :rules="rules" ref="wForm" errorType="border-bottom" class="demo-ruleForm">
|
||||||
<u-form-item required label="开始时间:" prop="START_TIME" borderBottom @click="showCheckDate1 = true;" v-if="isAdd==1">
|
<u-form-item label="班次:" prop="Nav_Class.NAME" @click="handleChangeMonitor('Nav_Class')" borderBottom>
|
||||||
<u--input required v-model="model.START_TIME" disabled disabledColor="#fff" placeholder="请选择开始时间" border="none" inputAlign="right" fontSize="14px"></u--input>
|
<u--input disabledColor="#fff" v-model="(model.Nav_Class||{}).NAME" disabled placeholder="请选择班次" suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px"
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
customStyle="margin:0px;display:flex;padding:3px 0px" border="none" inputAlign="right">
|
||||||
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item required label="结束时间:" prop="END_TIME" borderBottom @click="showCheckDate2 = true;" v-if="isAdd==1">
|
<u-form-item label="上班时间" prop="CHECKDATETIME" borderBottom @click="showCheckDate(1)">
|
||||||
<u--input required v-model="model.END_TIME" disabled disabledColor="#fff" placeholder="请选择结束时间" border="none" inputAlign="right" fontSize="14px"></u--input>
|
<u--input disabled disabledColor="#fff" v-model="model.START_TIME" placeholder="请选择上班时间" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||||||
<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12"></u-icon>
|
<u-icon style="margin-left: 4px;" name="arrow-down" size="12"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="主持人:" prop="Nav_User.NAME" @click="handleChangeMonitor(model.Nav_User)" borderBottom>
|
<u-form-item label="下班时间" prop="ENDTIME" borderBottom @click="showCheckDate(2)">
|
||||||
<u--input disabledColor="#fff" v-model="model.Nav_User.NAME" disabled placeholder="请选择主持人" suffixIcon="arrow-right" suffixIconStyle="font-size:12px" fontSize="14px"
|
<u--input disabled disabledColor="#fff" v-model="model.END_TIME" placeholder="请选择下班时间" border="none" inputAlign="right" fontSize="14px"></u--input>
|
||||||
|
<u-icon style="margin-left: 4px;" name="arrow-down" size="12"></u-icon>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="主持人:" prop="Nav_User.NAME" @click="handleChangeMonitor('Nav_User')" borderBottom>
|
||||||
|
<u--input disabledColor="#fff" v-model="(model.Nav_User||{}).NAME" disabled placeholder="请选择主持人" suffixIcon="arrow-right" suffixIconStyle="font-size:12px" fontSize="14px"
|
||||||
customStyle="margin:0px;display:flex;padding:3px 0px" border="none" inputAlign="right">
|
customStyle="margin:0px;display:flex;padding:3px 0px" border="none" inputAlign="right">
|
||||||
</u--input>
|
</u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@ -73,8 +78,8 @@
|
|||||||
<button type="default" @click="submit('SaveAndNotify')"
|
<button type="default" @click="submit('SaveAndNotify')"
|
||||||
style="margin-left: 5px;background-color: #3d4b70;color: #fff;width: 50%;height: 40px;display: flex;align-items: center;justify-content: center;font-size: 14px;">提交</button>
|
style="margin-left: 5px;background-color: #3d4b70;color: #fff;width: 50%;height: 40px;display: flex;align-items: center;justify-content: center;font-size: 14px;">提交</button>
|
||||||
</view>
|
</view>
|
||||||
<u-datetime-picker :show="showCheckDate1" mode="datetime" v-model=START_TIME @confirm="handleCheckDate1" @close="showCheckDate1 = false;" @cancel="showCheckDate1 = false;"></u-datetime-picker>
|
<u-datetime-picker :show="dateTimePickerInfo.showCheckDate" v-model='dateTimePickerInfo.defaultDateTime' @confirm="handleCheckDate" @close="dateTimePickerInfo.showCheckDate = false"
|
||||||
<u-datetime-picker :show="showCheckDate2" mode="datetime" v-model=END_TIME @confirm="handleCheckDate2" @close="showCheckDate2 = false;" @cancel="showCheckDate2 = false;"></u-datetime-picker>
|
@cancel="dateTimePickerInfo.showCheckDate = false" :mode="dateTimePickerInfo.mode"></u-datetime-picker>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -98,7 +103,8 @@
|
|||||||
getTeamUsers
|
getTeamUsers
|
||||||
} from '../../../../services/apply/FOServices/FOServices';
|
} from '../../../../services/apply/FOServices/FOServices';
|
||||||
import {
|
import {
|
||||||
getUserLists
|
getUserLists,
|
||||||
|
getClassLists,
|
||||||
} from '../../../../services/safe';
|
} from '../../../../services/safe';
|
||||||
|
|
||||||
import config from '../../../../config/common'
|
import config from '../../../../config/common'
|
||||||
@ -156,8 +162,14 @@
|
|||||||
TaskID: '',
|
TaskID: '',
|
||||||
isLoadOK: false,
|
isLoadOK: false,
|
||||||
showDelModalIndex: undefined,
|
showDelModalIndex: undefined,
|
||||||
showCheckDate1: false,
|
dateTimePickerInfo: {
|
||||||
showCheckDate2: false,
|
showCheckDate: false,
|
||||||
|
dataIndex: undefined,
|
||||||
|
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
||||||
|
value: '',
|
||||||
|
name: '',
|
||||||
|
mode: ''
|
||||||
|
},
|
||||||
isAdd: 0,
|
isAdd: 0,
|
||||||
START_TIME: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
START_TIME: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
||||||
END_TIME: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
END_TIME: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
||||||
@ -193,6 +205,29 @@
|
|||||||
DEAL_STATUS: 0,
|
DEAL_STATUS: 0,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
showCheckDate(dataIndex) {
|
||||||
|
// let date = new Date()
|
||||||
|
// this.dateTimePickerInfo.showCheckDate = true
|
||||||
|
this.dateTimePickerInfo = {
|
||||||
|
showCheckDate: true,
|
||||||
|
defaultDateTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd hh:MM:ss'),
|
||||||
|
dataIndex: dataIndex,
|
||||||
|
mode: dataIndex == 3 ? 'date' : 'datetime'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//隐藏控件 显示时间
|
||||||
|
handleCheckDate(e) {
|
||||||
|
|
||||||
|
if (this.dateTimePickerInfo.dataIndex == 1) {
|
||||||
|
this.model.START_TIME = uni.$u.timeFormat(e.value,
|
||||||
|
'yyyy-mm-dd hh:MM:ss')
|
||||||
|
} else if (this.dateTimePickerInfo.dataIndex == 2) {
|
||||||
|
this.model.END_TIME = uni.$u.timeFormat(e.value,
|
||||||
|
'yyyy-mm-dd hh:MM:ss')
|
||||||
|
}
|
||||||
|
this.dateTimePickerInfo.showCheckDate = false
|
||||||
|
|
||||||
|
},
|
||||||
handleDelRowBefore(index, item) {
|
handleDelRowBefore(index, item) {
|
||||||
if (item.USER_ID == "") {
|
if (item.USER_ID == "") {
|
||||||
this.model.Nav_Users.splice(index, 1)
|
this.model.Nav_Users.splice(index, 1)
|
||||||
@ -216,12 +251,8 @@
|
|||||||
handleSearchMonitor(val, pageIndex) {
|
handleSearchMonitor(val, pageIndex) {
|
||||||
const orgId = uni.getStorageSync('orgId')
|
const orgId = uni.getStorageSync('orgId')
|
||||||
const json = initFilter(orgId, "", "NAME", '', pageIndex)
|
const json = initFilter(orgId, "", "NAME", '', pageIndex)
|
||||||
extendInclude(json, "Nav_Department")
|
|
||||||
extendRule(json, 'ENABLE_STATUS', 1, '0')
|
extendRule(json, 'ENABLE_STATUS', 1, '0')
|
||||||
if(orgId === '8b3c41aa-51b1-7ce9-1879-248a038c1b5c')
|
|
||||||
{
|
|
||||||
extendRule(json, 'DEPARTMENT_ID', 1, uni.getStorageSync('appInfo')?.User?.DEPARTMENT_ID)
|
|
||||||
}
|
|
||||||
if (val !== 'init') {
|
if (val !== 'init') {
|
||||||
const tempGroup = initFilterGroup(false);
|
const tempGroup = initFilterGroup(false);
|
||||||
extendGroupRule(tempGroup, 'NAME', 9, val)
|
extendGroupRule(tempGroup, 'NAME', 9, val)
|
||||||
@ -231,25 +262,60 @@
|
|||||||
if (pageIndex) {
|
if (pageIndex) {
|
||||||
json.Start = (pageIndex - 1) * 20;
|
json.Start = (pageIndex - 1) * 20;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
getUserLists(json).then(res => {
|
this.currentOperateMonitor == 'Nav_User'
|
||||||
if (res.IsSuccessful) {
|
) {
|
||||||
this.monitorLists = res.Data.map(i => {
|
extendInclude(json, "Nav_Department")
|
||||||
return {
|
if (orgId === '8b3c41aa-51b1-7ce9-1879-248a038c1b5c') {
|
||||||
...i,
|
extendRule(json, 'DEPARTMENT_ID', 1, uni.getStorageSync('appInfo')?.User?.DEPARTMENT_ID)
|
||||||
name: i.NAME,
|
|
||||||
code: i.CODE
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.curTotalMonitor = res.TotalCount
|
|
||||||
}
|
}
|
||||||
})
|
getUserLists(json).then(res => {
|
||||||
|
if (res.IsSuccessful) {
|
||||||
|
this.monitorLists = res.Data.map(i => {
|
||||||
|
return {
|
||||||
|
...i,
|
||||||
|
name: i.NAME,
|
||||||
|
code: i.CODE
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.curTotalMonitor = res.TotalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (this.currentOperateMonitor == 'Nav_Class') {
|
||||||
|
extendInclude(json, 'Nav_ClassDetail');
|
||||||
|
getClassLists(json).then(res => {
|
||||||
|
if (res.IsSuccessful) {
|
||||||
|
this.monitorLists = res.Data.map(i => {
|
||||||
|
return {
|
||||||
|
...i,
|
||||||
|
name: i.NAME,
|
||||||
|
code: i.CODE
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.curTotalMonitor = res.TotalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
handleSelectedMonitor(val) {
|
handleSelectedMonitor(val) {
|
||||||
this.showPopupMonitor = false
|
this.showPopupMonitor = false
|
||||||
|
|
||||||
|
if (this.currentOperateMonitor == 'Nav_User') {
|
||||||
|
this.model.Nav_User = val
|
||||||
|
this.model.USER_ID = val.ID
|
||||||
|
} else if (this.currentOperateMonitor == 'Nav_Class') {
|
||||||
|
this.model.Nav_Class = val
|
||||||
|
this.model.CLASS_ID = val.ID
|
||||||
|
let DATE_TIME = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd')
|
||||||
|
let start = uni.$u.timeFormat(val.Nav_ClassDetail[0].STARTTIME, 'hh:MM:ss')
|
||||||
|
let end = uni.$u.timeFormat(val.Nav_ClassDetail[0].ENDTIME, 'hh:MM:ss')
|
||||||
|
this.model.START_TIME = DATE_TIME + ' ' + start
|
||||||
|
this.model.END_TIME = DATE_TIME + ' ' + end
|
||||||
|
|
||||||
|
}
|
||||||
this.currentOperateMonitor = val
|
this.currentOperateMonitor = val
|
||||||
this.model.Nav_User = val
|
|
||||||
this.model.USER_ID = val.ID
|
|
||||||
},
|
},
|
||||||
handleClosePopupMonitor() {
|
handleClosePopupMonitor() {
|
||||||
this.showPopupMonitor = false
|
this.showPopupMonitor = false
|
||||||
@ -372,28 +438,36 @@
|
|||||||
submit(type) {
|
submit(type) {
|
||||||
const ele = this.$refs
|
const ele = this.$refs
|
||||||
ele['wForm'].validate().then(res => {
|
ele['wForm'].validate().then(res => {
|
||||||
this.model.RATE = type;
|
this.modelEdit = JSON.parse(JSON.stringify(this.model))
|
||||||
|
const startTime = new Date(this.modelEdit.START_TIME).getTime();
|
||||||
|
const endTime = new Date(this.modelEdit.END_TIME).getTime();
|
||||||
|
if (endTime <= startTime) {
|
||||||
|
uni.$showErrorInfo('下班时间必须大于上班时间');
|
||||||
|
return; // 终止提交流程
|
||||||
|
}
|
||||||
|
this.modelEdit.RATE = type;
|
||||||
if (this.TaskID != "") {
|
if (this.TaskID != "") {
|
||||||
this.model.TaskID = this.TaskID;
|
this.modelEdit.TaskID = this.TaskID;
|
||||||
}
|
}
|
||||||
if (this.model.ORG_ID == "") {
|
if (this.modelEdit.ORG_ID == "") {
|
||||||
this.model.ORG_ID = this.ORG_ID;
|
this.modelEdit.ORG_ID = this.ORG_ID;
|
||||||
}
|
}
|
||||||
if (this.model.USER_ID == "") {
|
if (this.modelEdit.USER_ID == "") {
|
||||||
this.model.USER_ID = uni.getStorageSync('appInfo').User.ID;
|
this.modelEdit.USER_ID = uni.getStorageSync('appInfo').User.ID;
|
||||||
}
|
}
|
||||||
this.model.Nav_Users.forEach(item => {
|
this.modelEdit.Nav_Users.forEach(item => {
|
||||||
item.Nav_User = null;
|
item.Nav_User = null;
|
||||||
});
|
});
|
||||||
this.model.Nav_Files.forEach(item => {
|
this.modelEdit.Nav_Files.forEach(item => {
|
||||||
if (item.PRE_SHIFT_MEETING_RECORD_ID == undefined) {
|
if (item.PRE_SHIFT_MEETING_RECORD_ID == undefined) {
|
||||||
item.PRE_SHIFT_MEETING_RECORD_ID = this.model.ID;
|
item.PRE_SHIFT_MEETING_RECORD_ID = this.modelEdit.ID;
|
||||||
}
|
}
|
||||||
if (item.ORG_ID == undefined) {
|
if (item.ORG_ID == undefined) {
|
||||||
item.ORG_ID = this.model.ORG_ID;
|
item.ORG_ID = this.modelEdit.ORG_ID;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getRequest(this.model, "/FO/FOPreShiftMeetingRecord/FullUpdate").then(res => {
|
delete this.modelEdit.Nav_Class
|
||||||
|
getRequest(this.modelEdit, "/FO/FOPreShiftMeetingRecord/FullUpdate").then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
uni.$showMsgFunc('操作成功!', () => {
|
uni.$showMsgFunc('操作成功!', () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user