Browse Source

排产日历编辑 2022年11月22日 sxm

master
[li_she] 3 years ago
parent
commit
48859aeb1c
  1. 9
      src/views/modules/base/calendar.vue
  2. 175
      src/views/modules/common/com_work_calendar_out.vue

9
src/views/modules/base/calendar.vue

@ -1474,17 +1474,18 @@ export default {
}) })
}, },
// //
editShiftModal(row) {
async editShiftModal(row) {
await this.getcalendarDatetype()
this.workDateDialog = true this.workDateDialog = true
this.workingCalendar = JSON.parse(JSON.stringify(row)) this.workingCalendar = JSON.parse(JSON.stringify(row))
this.getcalendarDatetype()
}, },
// //
getcalendarDatetype() {
async getcalendarDatetype() {
let dto = { let dto = {
site: this.workingCalendar.site site: this.workingCalendar.site
} }
calendarDatetypeInfo(dto).then(({data}) => {
await calendarDatetypeInfo(dto).then(({data}) => {
this.calendarDatetype = data.rows this.calendarDatetype = data.rows
}) })
}, },

175
src/views/modules/common/com_work_calendar_out.vue

@ -18,15 +18,15 @@
:data="calendarList" :data="calendarList"
border border
style="width: 765px;"> style="width: 765px;">
<!-- <el-table-column
<el-table-column
header-align="center" header-align="center"
align="center" align="center"
width="50" width="50"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="shiftModal(scope.row)">班次</a>
<a type="text" size="small" @click="editShiftModal(scope.row)"> 编辑</a>
</template> </template>
</el-table-column>-->
</el-table-column>
<el-table-column <el-table-column
v-for="(item,index) in columnCalendarOutArray" :key="index" v-for="(item,index) in columnCalendarOutArray" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
@ -50,18 +50,127 @@
<el-button type="primary" @click="closeDialog">关闭</el-button> <el-button type="primary" @click="closeDialog">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="维护班次信息" :close-on-click-modal="false" v-drag :visible.sync="workDateDialog" width="341px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="日历编码">
<el-input v-model="workingCalendar.calendarId" :disabled="true" style="width: 130px;color: red"></el-input>
</el-form-item>
<el-form-item label="日期">
<el-input v-model="workingCalendar.scheduledate" :disabled="true" style="width: 130px;color: red"></el-input>
</el-form-item>
<el-form-item label="工厂编号">
<el-input v-model="workingCalendar.site" :disabled="true" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'工作日类型:'">
<el-select @change="selectDateType" v-model="workingCalendar.datetype" style="width: 130px">
<el-option v-for="(item,index) in calendarDatetype" :key="index"
:label="item.datetype" :value="item.datetype">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'休息时间点1:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime1"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长1:'">
<el-input v-model="workingCalendar.exceptduration1" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点2:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime2"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长2:'">
<el-input v-model="workingCalendar.exceptduration2" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点3:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime3"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长3:'">
<el-input v-model="workingCalendar.exceptduration3" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点4:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime4"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长4:'">
<el-input v-model="workingCalendar.exceptduration4" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点5:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime5"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长5:'">
<el-input v-model="workingCalendar.exceptduration5" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'休息时间点6:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="workingCalendar.exceptexacttime6"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'休息时长6:'">
<el-input v-model="workingCalendar.exceptduration6" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'备注:'">
<el-input v-model="workingCalendar.remark" style="width: 275px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="updateWorkingCalendar()">保存</el-button>
<el-button type="primary" @click="workDateDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
getCalendarExceptionData, getCalendarExceptionData,
updateWorkingCalendar,
calendarDatetypeInfo,
}from "@/api/base.js" }from "@/api/base.js"
export default { export default {
data() { data() {
return { return {
titleCon: '工作日历外', titleCon: '工作日历外',
workDateDialog : false,
calendarList: [], calendarList: [],
workingCalendar: {},
columnCalendarOutArray: [ columnCalendarOutArray: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -367,7 +476,67 @@ export default {
this.calendarList = data.rows this.calendarList = data.rows
}) })
}, },
//
async editShiftModal(row) {
await this.getcalendarDatetype()
this.workDateDialog = true
this.workingCalendar = JSON.parse(JSON.stringify(row))
},
//
async getcalendarDatetype() {
let dto = {
site: this.workingCalendar.site
}
await calendarDatetypeInfo(dto).then(({data}) => {
this.calendarDatetype = data.rows
})
},
//
selectDateType() {
getCalendarDatetypeInfo(this.workingCalendar).then(({data}) => {
if (data && data.code == 0) {
this.workingCalendar.exceptexacttime1 = data.data.exceptexacttime1
this.workingCalendar.exceptduration1 = data.data.exceptduration1
this.workingCalendar.exceptexacttime2 = data.data.exceptexacttime2
this.workingCalendar.exceptduration2 = data.data.exceptduration2
this.workingCalendar.exceptexacttime3 = data.data.exceptexacttime3
this.workingCalendar.exceptduration3 = data.data.exceptduration3
this.workingCalendar.exceptexacttime4 = data.data.exceptexacttime4
this.workingCalendar.exceptduration4 = data.data.exceptduration4
this.workingCalendar.exceptexacttime5 = data.data.exceptexacttime5
this.workingCalendar.exceptduration5 = data.data.exceptduration5
this.workingCalendar.exceptexacttime6 = data.data.exceptexacttime6
this.workingCalendar.exceptduration6 = data.data.exceptduration6
this.workingCalendar.excepttime1 = data.data.excepttime1
this.workingCalendar.excepttime2 = data.data.excepttime2
this.workingCalendar.excepttime3 = data.data.excepttime3
this.workingCalendar.excepttime4 = data.data.excepttime4
this.workingCalendar.excepttime5 = data.data.excepttime5
this.workingCalendar.excepttime6 = data.data.excepttime6
}
})
},
//
updateWorkingCalendar() {
this.workingCalendar.excepttime1 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime1 + ':00').format('H')
this.workingCalendar.excepttime2 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime2 + ':00').format('H')
this.workingCalendar.excepttime3 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime3 + ':00').format('H')
this.workingCalendar.excepttime4 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime4 + ':00').format('H')
this.workingCalendar.excepttime5 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime5 + ':00').format('H')
this.workingCalendar.excepttime6 = this.dayjs(this.workingCalendar.scheduledate + ' ' + this.workingCalendar.exceptexacttime6 + ':00').format('H')
updateWorkingCalendar(this.workingCalendar).then(({data}) => {
if (data && data.code == 0) {
this.$message.success(data.msg)
this.workDateDialog = false
this.refreshPageTable()
} else {
this.$message.warning(data.msg)
}
})
},
}, },

Loading…
Cancel
Save