Browse Source

多语言

master
ruanqi 4 years ago
parent
commit
0b18c98078
  1. 3
      src/api/base.js
  2. 2
      src/assets/scss/global.scss
  3. 202
      src/views/modules/base/calendar.vue

3
src/api/base.js

@ -32,5 +32,8 @@ export const getCalendarExceptionData = data => createAPI(`/base/getCalendarExce
export const batchSaveCDData = data => createAPI(`/base/batchSaveCDData`,'post',data)
export const getCalendarExceptionShiftData = data => createAPI(`/base/getCalendarExceptionShiftData`,'post',data)
export const updateCESShift = data => createAPI(`/base/updateCESShift`,'post',data)

2
src/assets/scss/global.scss

@ -349,3 +349,5 @@ a:hover{

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

@ -120,6 +120,15 @@
:data="dataList2"
border
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
width="50"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="shiftModal(scope.row)">班次</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList2" :key="index"
:sortable="item.columnSortable"
@ -317,6 +326,74 @@
<el-button type="primary" @click="maintainCalendarFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="班次信息" :close-on-click-modal="false" v-drag :visible.sync="shiftFlag" width="600px" >
<el-table
height="300"
:data="dataList4"
border
style="width: 100%">
<el-table-column
v-for="(item,index) in columnList4" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="50"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editShift(scope.row)">编辑</a>
</template>
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="shiftFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="维护班次" :close-on-click-modal="false" v-drag :visible.sync="updateShiftFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'班次编码:'">
<el-input v-model="newShiftData.shiftno" disabled style="width: 130px" onblur="this.value=this.value.toUpperCase()"></el-input>
</el-form-item>
<el-form-item :label="'班次名称:'">
<el-input v-model="newShiftData.shiftdesc" disabled style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'上班时间:'">
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="newShiftData.startexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'下班时间:'" >
<el-time-picker
format="HH:mm"
style="width: 130px"
v-model="newShiftData.endexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="updateCESShift()">保存</el-button>
<el-button type="primary" @click="updateShiftFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
@ -328,11 +405,99 @@
getCalendarExceptionData,
calendarDatetypeInfo,
batchSaveCDData,
getCalendarExceptionShiftData,
updateCESShift
}from "@/api/base.js"
export default {
name: "calendar",
data () {
return {
newShiftData:{
shiftno:'',
shiftdesc:'',
startexacttime:'',
endexacttime:'',
datetype:'',
id:'',
site:'',
},
updateShiftFlag:false,
shiftFlag:false,
dataList4:[],
columnList4: [
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Shiftno',
tableId: "6038Table2",
tableName: "班次表",
columnProp: "shiftno",
headerAlign: "center",
align: "left",
columnLabel: "班次编码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Shiftdesc',
tableId: "6038Table2",
tableName: "班次表",
columnProp: "shiftdesc",
headerAlign: "center",
align: "left",
columnLabel: "班次名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Startexacttime',
tableId: "6038Table2",
tableName: "班次表",
columnProp: "startexacttime",
headerAlign: "center",
align: "left",
columnLabel: "上班时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 6038,
serialNumber: '6038Table2Endexacttime',
tableId: "6038Table2",
tableName: "班次表",
columnProp: "endexacttime",
headerAlign: "center",
align: "left",
columnLabel: "下班时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false,
columnWidth: 100
}
],
// start
exportData: [],
exportName: "工厂日历"+this.dayjs().format('YYYYMMDDHHmmss'),
@ -1161,6 +1326,43 @@
return s
},
// end
shiftModal(row){
let inData={
site:row.site,
scheduledate:row.scheduledate,
calendarId:row.calendarId
}
getCalendarExceptionShiftData(inData).then(({data}) => {
this.dataList4=data.rows;
this.shiftFlag=true;
})
},
editShift(row){
this.newShiftData=row;
this.updateShiftFlag=true;
},
updateCESShift(){
updateCESShift(this.newShiftData).then(({data}) => {
if(data.code===0){
getCalendarExceptionData(this.CESearchData).then(({data}) => {
this.dataList2 = data.rows
})
this.updateShiftFlag=false;
this.$message({
message: '保存成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
created() {
this.getData()

Loading…
Cancel
Save