Commit 2e121744 authored by renjintao's avatar renjintao

Merge branch 'portal' of git.mes123.com:zhouyx/mes-ui into portal

parents 0099d2fb 65b2e67c
......@@ -154,152 +154,171 @@ export default {
]
}
},
created() {
this.getWeekTypeListFn()
this.tableHeight = window.innerHeight - 230
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
//获取公休日数组
getweekList() {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
console.log(res.result)
this.weekTypeList = res.result
})
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
getWeekTypeListFn() {
Api.getsetweek().then((res) => {
if (res.success) {
this.getweekList()
this.weekType = res.result.weekendTypeName
} else {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
this.weekTypeList.map((v) => {
if ((v.isvalid = 1)) {
this.weekType = v.weekendTypeName
} else {
this.weekType = 0
}
})
})
}
})
},
//获取公休日数组
getweekList() {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
//设置公休日
radioChange(a) {
console.log(a)
let datArray = this.weekTypeList
datArray.map(u => {
if (a == u.weekendTypeName) {
this.weekTypeid = u.id
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
})
},
//设置公休日
radioChange(a) {
let datArray = this.weekTypeList
datArray.map(u => {
if (a == u.title) {
this.weekTypeid = u.id
}
})
let id = this.weekTypeid
Api.setweek({
id: id
}).then((res) => {
})
let id = this.weekTypeid
Api.setweek({
id: id
}).then((res) => {
if (res.success) {
this.weekFlag = true
} else {
this.weekFlag = false
console.log('设置失败')
}
})
},
addOk() {
this.$refs.grid.load()
this.addModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
},
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
getWeekTypeListFn() {
Api.getsetweek().then((res) => {
if (res.success) {
this.getweekList()
this.weekType = res.result.weekendTypeName
} else {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
this.weekTypeList.map((v) => {
if ((v.isvalid = 1)) {
this.weekType = v.weekendTypeName
} else {
this.weekType = 0
}
})
})
}
})
},
//获取公休日数组
getweekList() {
let parmse = {
conditions: [],
isDesc: true,
pageSize: 10
}
Api.getWeekTypeList(parmse).then((res) => {
this.weekTypeList = res.result
})
},
//设置公休日
radioChange(a) {
let datArray = this.weekTypeList
datArray.map(u => {
if (a == u.title) {
this.weekTypeid = u.id
}
})
let id = this.weekTypeid
Api.setweek({
id: id
}).then((res) => {
if (res.success) {
this.weekFlag = true
} else {
this.weekFlag = false
console.log('设置失败')
}
})
},
addOk() {
this.$refs.grid.load()
this.addModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_overtime:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
restType:'关联节假日',
holidayId:'',
holidayTitle:'',
holidayStartendTime:'',
status:'',
}
*/
let vkey = 'calendar_overtime' + '.' + key
return this.$t(vkey) || key
}
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
},
l(key) {
/*
calendar_overtime:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
restType:'关联节假日',
holidayId:'',
holidayTitle:'',
holidayStartendTime:'',
status:'',
}
*/
let vkey = 'calendar_overtime' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
......
......@@ -149,7 +149,9 @@ export default {
},
watch: {
v() {
console.log(v)
this.entity = this.$u.clone(this.v);
this.selectAry();
},
},
};
......
......@@ -21,7 +21,7 @@
<div class="footer02" v-if="footerModel">
<span class="span">
已选择
<b class="span02">{{selectedRows.length}}</b>
<b class="span02">{{ selectedRows.length }}</b>
</span>
<Button @click="deleteMore" class="span ml20">
<Icon type="md-close" />批量删除
......@@ -37,221 +37,246 @@
<p>确定删除?</p>
</Modal>
<Modal v-model="deletelMore" title="批量删除" @on-ok="cancel" @on-cancel="cancel">
<p>确定删除这{{selectedRows.length}}项么?</p>
<p>确定删除这{{ selectedRows.length }}项么?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
import Api from "./api";
import Add from "./add";
import Edit from "./edit";
import Detail from "./detail";
import Search from "./search";
export default {
name: 'list',
name: "list",
components: {
Add,
Edit,
Detail,
Search
Search,
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op: 'title,calendarClassTitle',
op: "title,calendarClassTitle",
value: null
}
},
},
addModal: false,
editModal: false,
deletelModal: false,
selectedRows: [], //表格选中项
tableHeight: '',
tableHeight: "",
footerModel: false,
deletelMore: false,
curId: 0,
columns: [
// { type: 'selection', width: 70, align: 'center'},
{
key: 'calId',
title: this.l('calId'),
key: "id",
title: this.l("id"),
hide: true,
align: "left"
},
{
key: "calId",
title: this.l("calId"),
high: true,
align: 'left'
align: "left",
},
{
key: 'calName',
title: this.l('calName'),
key: "calName",
title: this.l("calName"),
high: true,
align: 'left'
align: "left",
},
{
key: 'shiftName',
title: this.l('shiftName'),
key: "shiftName",
title: this.l("shiftName"),
high: true,
align: 'left'
align: "left",
},
{
key: 'mesShiftWorkSchedIds',
title: this.l('mesShiftWorkSchedIds'),
key: "mesShiftWorkSchedIds",
title: this.l("mesShiftWorkSchedIds"),
hide: true,
align: 'left'
align: "left",
},
{
key: 'workingLong',
title: this.l('workingLong'),
key: "workingLong",
title: this.l("workingLong"),
high: true,
align: 'left'
align: "left",
},
{
key: 'creationTime',
title: this.l('creationTime'),
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: 'left'
align: "left",
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: 'left',
type: 'user'
align: "left",
},
{
title: '操作',
key: 'id',
title: "操作",
key: "id",
width: 140,
align: 'center',
align: "center",
render: (h, params) => {
return h('div', {
class: 'action'
return h("div", {
class: "action"
}, [
h(
'op', {
"op", {
attrs: {
oprate: 'edit'
oprate: "edit"
},
on: {
click: () => this.edit(params.row.id)
}
},
},
'编辑'
"编辑"
),
h(
'op', {
"op", {
attrs: {
oprate: 'remove'
oprate: "remove"
},
on: {
click: () => this.remove(params.row.id)
}
},
},
'删除'
)
])
}
}
]
}
"删除"
),
]);
},
},
],
};
},
created() {
this.tableHeight = window.innerHeight - 230
// this.$refs.addModal.entity = {}
this.tableHeight = window.innerHeight - 230;
},
mounted() {
window.onresize = () => { ///浏览器窗口大小变化
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.tableHeight = window.screenHeight - 230
})()
}
window.screenHeight = window.innerHeight;
this.tableHeight = window.screenHeight - 230;
})();
};
},
async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.$refs.addModal.entity = {}
this.editModal = false
this.curId = 0
this.$refs.grid.load();
this.addModal = false;
this.$refs.addModal.entity = {};
this.editModal = false;
this.curId = 0;
},
addFn() {
this.addModal = true
this.$refs.addmodal.entity = {}
this.addModal = true;
this.$refs.addmodal.entity = {};
this.$refs.addModal.selectAry();
},
search() {
this.$refs.grid.reload(this.easySearch)
this.$refs.grid.reload(this.easySearch);
},
edit(id) {
this.editModal = true
this.curId = id
this.editModal = true;
this.curId = id;
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.$refs.addModal.entity = {}
this.editModal = false
this.curId = 0
},
addFn() {
this.addModal = true
this.$refs.addmodal.entity = {}
},
search() {
this.$refs.grid.reload(this.easySearch)
},
edit(id) {
this.editModal = true
this.curId = id
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.$refs.addModal.entity = {}
this.detailModal = false
this.editModal = false
this.deletedlModal = false
this.deletelMore = false
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection
this.footerModel = selection.length > 0
},
deleteMore() {
this.deletelMore = true
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.$refs.addModal.entity = {};
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
this.deletelMore = false;
},
//多选处理--表格选择项变化方法
selectionChange(selection) {
this.selectedRows = selection;
this.footerModel = selection.length > 0;
},
deleteMore() {
this.deletelMore = true;
},
l(key) {
/*
calendar_work:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
calendarClassId:'关联班次',
calendarClassTitle:'',
calendarClassStart:'',
calendarClassEnd:'',
workHours:'工作时长',
}
*/
let vkey = "calendar_work" + "." + key;
return this.$t(vkey) || key;
},
},
l(key) {
/*
calendar_work:{
id:'',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'日历名称',
calendarClassId:'关联班次',
calendarClassTitle:'',
calendarClassStart:'',
calendarClassEnd:'',
workHours:'工作时长',
}
*/
let vkey = 'calendar_work' + '.' + key
return this.$t(vkey) || key
}
}
}
};
</script>
<style lang="less">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment