162 lines
4.4 KiB
Vue
162 lines
4.4 KiB
Vue
<template>
|
||
<el-dialog
|
||
title="物料新增"
|
||
append-to-body
|
||
:visible.sync="dialogVisible"
|
||
destroy-on-close
|
||
width="1000px"
|
||
@close="close"
|
||
@open="open"
|
||
>
|
||
<div class="head-container">
|
||
<div v-if="crud.props.searchToggle">
|
||
<!-- 搜索 -->
|
||
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd" />
|
||
<el-input
|
||
v-model="query.storagevehicle_code"
|
||
clearable
|
||
size="mini"
|
||
placeholder="载具编码"
|
||
style="width: 200px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
<el-input
|
||
v-model="query.pcsn"
|
||
clearable
|
||
size="mini"
|
||
placeholder="批次号"
|
||
style="width: 200px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
<el-input
|
||
v-model="query.material_code"
|
||
clearable
|
||
size="mini"
|
||
placeholder="物料编码"
|
||
style="width: 230px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
<rrOperation />
|
||
</div>
|
||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||
<crudOperation />
|
||
<!--表格渲染-->
|
||
<el-table
|
||
ref="multipleTable"
|
||
v-loading="crud.loading"
|
||
:data="crud.data"
|
||
style="width: 100%;"
|
||
@selection-change="crud.selectionChangeHandler"
|
||
>
|
||
<el-table-column type="selection" width="55" />
|
||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="载具编码" />
|
||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||
<el-table-column width="200" prop="pcsn" label="批次号" />
|
||
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
|
||
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
|
||
</el-table>
|
||
<!--分页组件-->
|
||
<pagination />
|
||
</div>
|
||
|
||
<span slot="footer" class="dialog-footer">
|
||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||
<el-button type="primary" @click="submit">确 定</el-button>
|
||
</span>
|
||
</el-dialog>
|
||
</template>
|
||
|
||
<script>
|
||
|
||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||
import rrOperation from '@crud/RR.operation'
|
||
import crudOperation from '@crud/CRUD.operation'
|
||
import pagination from '@crud/Pagination'
|
||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||
import group, { getAllGroupInfo } from '@/views/wms/basedata/group/group.js'
|
||
|
||
const start = new Date()
|
||
export default {
|
||
name: 'AddDtl',
|
||
components: { crudOperation, rrOperation, pagination, DateRangePicker, group },
|
||
cruds() {
|
||
return CRUD({
|
||
title: '用户',
|
||
url: '/api/in/rawAssist/getBillDtl',
|
||
crudMethod: {},
|
||
optShow: {
|
||
reset: true
|
||
}
|
||
})
|
||
},
|
||
mixins: [presenter(), header(), crud()],
|
||
props: {
|
||
dialogShow: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
opendtlParam: {
|
||
type: Object
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
dialogVisible: false,
|
||
rows: [],
|
||
tableData: []
|
||
}
|
||
},
|
||
watch: {
|
||
dialogShow: {
|
||
handler(newValue, oldValue) {
|
||
this.dialogVisible = newValue
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
[CRUD.HOOK.beforeRefresh]() {
|
||
this.crud.query.bill_type = '000101'
|
||
return true
|
||
},
|
||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||
if (columnIndex === 0) {
|
||
if (rowIndex % 2 === 0) {
|
||
return {
|
||
rowspan: 2,
|
||
colspan: 1
|
||
}
|
||
} else {
|
||
return {
|
||
rowspan: 0,
|
||
colspan: 0
|
||
}
|
||
}
|
||
}
|
||
},
|
||
open() {
|
||
this.crud.toQuery()
|
||
},
|
||
close() {
|
||
this.$emit('update:dialogShow', false)
|
||
},
|
||
submit() {
|
||
this.$emit('update:dialogShow', false)
|
||
this.rows = this.$refs.multipleTable.selection
|
||
console.log('获取的rows:')
|
||
console.log(this.rows)
|
||
this.$emit('tableChanged', this.rows)
|
||
group.getAllGroupInfo(this.rows).then(res => {
|
||
this.rows = res.content
|
||
this.$emit('tableChanged', this.rows)
|
||
})
|
||
// this.form = this.$options.data().form
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|