<template>
|
<el-dialog
|
width="1200px"
|
title="班次选择"
|
top="5vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
class="stock-dialog"
|
>
|
<el-table
|
:data="dataList"
|
ref="table"
|
max-height="600"
|
:header-cell-style="{ background: '#f5f7fa' }"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55"> </el-table-column>
|
<el-table-column label="工作站编号" prop="workstationNo" align="center" />
|
<el-table-column
|
label="工作站名称"
|
prop="workstationName"
|
align="center"
|
/>
|
<el-table-column
|
label="工作站类型"
|
prop="workstationType"
|
align="center"
|
/>
|
<el-table-column label="班次编号" prop="dutyNo" align="center" />
|
<el-table-column label="班次" prop="shiftName" align="center" />
|
<el-table-column label="班组" prop="crewName" align="center" />
|
<el-table-column label="班次开始时间" prop="startTime" align="center" />
|
<el-table-column label="班次结束时间" prop="endTime" align="center" />
|
<el-table-column label="备注" prop="remark" align="center" />
|
</el-table>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">取 消</el-button>
|
<el-button type="primary" @click="saveSelectRow">确 定</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
<script>
|
import { getUnsubmitWorkstation, batchSubmit } from '@/api/product/dutyrecord'
|
import { mapGetters } from 'vuex'
|
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
paramObj: {
|
type: Object,
|
default: () => {}
|
}
|
},
|
data() {
|
return {
|
ids: [],
|
multipleSelection: [],
|
innerVisible: false,
|
dataList: []
|
}
|
},
|
computed: {
|
...mapGetters(['permissions'])
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.$nextTick(() => {
|
this.getData()
|
})
|
}
|
}
|
},
|
methods: {
|
saveSelectRow() {
|
if (this.multipleSelection.length) {
|
const customerOrderIds = []
|
this.multipleSelection.forEach((item) => {
|
customerOrderIds.push(item.id)
|
})
|
batchSubmit(customerOrderIds).then((res) => {
|
this.$emit('listenToWorkStationSaveEvent')
|
})
|
|
this.innerVisible = false
|
} else {
|
this.$message.warning('请选择班次')
|
}
|
},
|
// 获取数据列表
|
getData() {
|
getUnsubmitWorkstation(this.paramObj).then((res) => {
|
this.dataList = res.data.data
|
this.$nextTick(() => {
|
this.dataList.forEach((e) => {
|
this.$refs.table.toggleRowSelection(e, true)
|
})
|
})
|
})
|
},
|
handleSelectionChange(val) {
|
this.multipleSelection = val
|
}
|
}
|
}
|
</script>
|