138 lines
3.7 KiB
Vue
138 lines
3.7 KiB
Vue
<template>
|
|
<el-dialog
|
|
title="物料选择"
|
|
append-to-body
|
|
:visible.sync="dialogVisible"
|
|
destroy-on-close
|
|
:show-close="false"
|
|
width="1000px"
|
|
@close="close"
|
|
@open="open"
|
|
>
|
|
<div class="head-container">
|
|
<div>
|
|
<!-- 搜索 -->
|
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
|
<el-input
|
|
v-model="query.material_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"
|
|
/>
|
|
<rrOperation />
|
|
</div>
|
|
</div>
|
|
<!--表格渲染-->
|
|
<el-table
|
|
ref="multipleTable"
|
|
v-loading="crud.loading"
|
|
:data="crud.data"
|
|
style="width: 100%;"
|
|
border
|
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
|
>
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库日期" />
|
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
|
|
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
|
|
<el-table-column show-overflow-tooltip prop="box_no" label="箱号" />
|
|
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" />
|
|
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" />
|
|
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" />
|
|
</el-table>
|
|
<!--分页组件-->
|
|
<pagination />
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
|
<el-button slot="left" type="primary" @click="submit">保存</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import CRUD, { header, presenter } from '@crud/crud'
|
|
import rrOperation from '@crud/RR.operation'
|
|
import pagination from '@crud/Pagination'
|
|
import DateRangePicker from '@/components/DateRangePicker/index'
|
|
|
|
export default {
|
|
name: 'AddDtl',
|
|
components: { rrOperation, pagination, DateRangePicker },
|
|
cruds() {
|
|
return CRUD({ title: '用户', url: 'api/checkoutbill/addDtl', optShow: {
|
|
add: false,
|
|
edit: false,
|
|
del: false,
|
|
reset: true,
|
|
download: false
|
|
}})
|
|
},
|
|
mixins: [presenter(), header()],
|
|
props: {
|
|
dialogShow: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
openParam: {
|
|
type: String
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
dialogVisible: false,
|
|
opendtlParam: '',
|
|
rows: []
|
|
}
|
|
},
|
|
watch: {
|
|
dialogShow: {
|
|
handler(newValue, oldValue) {
|
|
this.dialogVisible = newValue
|
|
}
|
|
},
|
|
openParam: {
|
|
handler(newValue, oldValue) {
|
|
this.opendtlParam = newValue
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|
this.crud.query.mater_type = this.opendtlParam
|
|
},
|
|
close() {
|
|
this.crud.resetQuery(false)
|
|
this.$emit('update:dialogShow', false)
|
|
},
|
|
open() {
|
|
this.crud.query.mater_type = this.opendtlParam
|
|
this.crud.toQuery()
|
|
},
|
|
submit() {
|
|
this.rows = this.$refs.multipleTable.selection
|
|
if (this.rows.length <= 0) {
|
|
this.$message('请先勾选物料')
|
|
return
|
|
}
|
|
this.crud.resetQuery(false)
|
|
this.$emit('update:dialogShow', false)
|
|
this.$emit('tableChanged', this.rows)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|