Files
longdianningxing/lms/nladmin-ui/src/views/wms/pdm/sub/MaterDialog.vue

256 lines
6.4 KiB
Vue
Raw Normal View History

2024-03-11 17:42:45 +08:00
<template>
<el-dialog
title="木箱选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
2024-06-30 18:10:59 +08:00
width="1100px"
2024-03-11 17:42:45 +08:00
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
2024-06-25 19:06:07 +08:00
placeholder="输入关键词搜索"
2024-03-11 17:42:45 +08:00
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<div style="margin-bottom: 10px" />
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" />
2024-06-30 18:10:59 +08:00
<el-table-column prop="material_code" label="木箱规格" :min-width="flexWidth('material_code',crud.data,'木箱规格')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
2024-06-25 19:06:07 +08:00
<el-table-column prop="box_length" label="木箱长度" />
<el-table-column prop="box_width" label="木箱宽度" />
<el-table-column prop="box_high" label="木箱高度" />
2024-07-20 11:25:26 +08:00
<el-table-column prop="ivt_num" label="木箱库存数" />
2024-06-25 19:06:07 +08:00
<el-table-column prop="num" label="最大装卷数" />
2024-03-11 17:42:45 +08:00
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
2024-06-25 19:06:07 +08:00
<el-dialog
:visible.sync="dialogVisible1"
2024-06-30 18:10:59 +08:00
width="35%"
2024-06-25 19:06:07 +08:00
append-to-body
@close="dialogVisible1 = false"
>
<template v-slot:title>
<span class="warning-text1">提醒</span>
</template>
<br>
<br>
<span class="warning-text">
请仔细核对子卷与木箱规格是否匹配
<br>
<br>
2024-06-30 18:10:59 +08:00
<span class="red-text">木箱规格为{{ this.materialName }}</span>
2024-06-25 19:06:07 +08:00
<br>
<br>
<span class="red-text">子卷规格为{{ this.paperTubeDescription }}</span>
2024-06-25 19:06:07 +08:00
<br>
<br>
2024-06-30 18:10:59 +08:00
点击确定后将立即生成空木箱出库任务无法更改
2024-06-25 19:06:07 +08:00
</span>
<br>
<br>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false">取消</el-button>
<el-button type="primary" @click="confirmSubmit">确定</el-button>
</span>
</el-dialog>
2024-03-11 17:42:45 +08:00
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudMaterattr from '@/views/wms/pdm/sub/materattr'
export default {
name: 'MaterDialog',
components: { rrOperation, pagination },
cruds() {
return CRUD({
title: '木箱规格',
optShow: {},
2024-06-25 19:06:07 +08:00
url: 'api/pdmBiSubpackagerelation/queryBoxSpec',
idField: 'box_id',
sort: 'material_name,desc',
query: { material_id: '' },
2024-03-11 17:42:45 +08:00
crudMethod: { ...crudMaterattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object
2024-06-25 19:06:07 +08:00
},
paperTubeDescription: {
type: String,
default: ''
2024-07-20 11:25:26 +08:00
},
boxType: {
type: String,
default: ''
2024-03-11 17:42:45 +08:00
}
},
data() {
return {
2024-06-30 18:10:59 +08:00
materialName: '',
2024-03-11 17:42:45 +08:00
classes: [],
dialogVisible: false,
2024-06-25 19:06:07 +08:00
dialogVisible1: false,
2024-03-11 17:42:45 +08:00
sect: {},
checkrow: {},
rows: [],
dialogDis: true,
lock: ''
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
this.sect = newValue
}
}
},
methods: {
/**
* 接受父组件传值
* @param msg
*/
getMsg(msg) {
this.dialogDis = msg
this.lock = '00'
},
[CRUD.HOOK.beforeRefresh]() {
this.query.lock = this.lock
return true
},
open() {
if (this.sect) {
this.query.sect = this.sect
if (this.sect.length === 1) {
this.query.stor_id = this.sect[0]
this.query.sect_id = ''
}
if (this.sect.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sect.length === 2) {
this.query.stor_id = this.sect[0]
this.query.sect_id = this.sect[1]
}
}
this.query.is_lock = '1'
this.query.lock = this.lock
this.query.is_used = '1'
2024-07-20 11:25:26 +08:00
this.query.search = this.boxType
2024-03-11 17:42:45 +08:00
this.crud.toQuery()
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
debugger
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
2024-06-30 18:10:59 +08:00
this.crud.notify('请选择木箱信息!', CRUD.NOTIFICATION_TYPE.WARNING)
2024-03-11 17:42:45 +08:00
return
}
2024-06-30 18:10:59 +08:00
this.materialName = this.rows[0].material_name
2024-06-25 19:06:07 +08:00
this.dialogVisible1 = true
},
confirmSubmit() {
2024-06-30 18:10:59 +08:00
debugger
2024-06-25 19:06:07 +08:00
this.dialogVisible1 = false
2024-03-11 17:42:45 +08:00
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.checkrow)
}
}
}
</script>
2024-06-25 19:06:07 +08:00
<style scoped>
.warning-text {
color: black;
text-align: left;
font-size: 18px;
display: block;
}
.red-text {
color: red;
text-align: left;
font-size: 17px;
font-weight: bold;
}
.warning-text1 {
color: orange;
text-align: left;
font-size: 19px;
display: block;
font-weight: bold;
}
</style>