修改自动开单(新料、改配)加库存等级查询、排序

This commit is contained in:
zds
2022-06-30 12:26:21 +08:00
parent ae3b341488
commit 805db30284
6 changed files with 151 additions and 82 deletions

View File

@@ -108,6 +108,16 @@
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
>
添加库存物料
</el-button>
<el-button
slot="left"
class="filter-item"
@@ -140,7 +150,7 @@
</template>
</el-table-column>
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150px" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center">
<el-table-column show-overflow-tooltip prop="pcsn" width="120" label="批次号" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.pcsn" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.pcsn }}</span>
@@ -218,6 +228,7 @@
</template>
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @tableChanged2="tableChanged2" />
</el-dialog>
</template>
@@ -225,6 +236,7 @@
<script>
import CRUD, { crud, form } from '@crud/crud'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import AddDtl from '@/views/wms/st/core/outbill/wastewashoutbill/AddDtl'
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
import crudStorattr from '@/api/wms/basedata/st/storattr'
import crudRawAssist from '@/api/wms/st/core/inbill/rawassist'
@@ -245,7 +257,7 @@ const defaultForm = {
}
export default {
name: 'AddDialog',
components: { MaterDialog },
components: { AddDtl, MaterDialog },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
@@ -260,6 +272,7 @@ export default {
materType: '',
materShow: false,
flagnow: false,
dtlShow: false,
nowrow: {},
nowindex: '',
storlist: [],
@@ -354,6 +367,7 @@ export default {
})
},
tableChanged(rows) {
// 插入第一条
const tablemap = new Map()
rows.forEach((item) => {
if (this.form.tableData.length !== 0) {
@@ -364,18 +378,12 @@ export default {
}
}
if (!this.flagnow) {
item.edit = true
item.quality_scode = '02'
item.ivt_level = '01'
item.is_active = '0'
item.edit = false
item.bill_status = '10'
tablemap.set(item.material_id, item)
}
} else {
item.edit = true
item.quality_scode = '02'
item.ivt_level = '01'
item.is_active = '0'
item.edit = false
item.bill_status = '10'
tablemap.set(item.material_id, item)
}
@@ -385,6 +393,13 @@ export default {
}
this.form.detail_count = this.form.tableData.length
},
async queryDtl() {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.dtlShow = true
},
tableChanged2(row) {
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === row.material_id) {

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog
title="到货单物料选择"
title="库存物料选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
@@ -12,40 +12,6 @@
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input
v-model="query.receive_code"
clearable
size="mini"
placeholder="订单编号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.source_bill_code"
clearable
size="mini"
placeholder="到货单号"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<date-range-picker v-model="query.createTime" class="date-item" />
<el-select
v-model="query.status"
clearable
size="mini"
placeholder="单据状态"
class="filter-item"
style="width: 230px;"
>
<el-option
v-for="item in receiveStatusList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-input
v-model="query.search"
clearable
@@ -55,6 +21,30 @@
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-select
v-model="query.is_active"
clearable
size="mini"
placeholder="是否可用"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.is_usable"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<rrOperation />
</div>
<!--表格渲染-->
@@ -67,19 +57,15 @@
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="receive_code" width="150" label="订单编号" />
<el-table-column show-overflow-tooltip prop="base_bill_code" width="150" label="到货单号" />
<el-table-column show-overflow-tooltip prop="source_name" label="供应商" />
<el-table-column show-overflow-tooltip prop="material_code" width="150" label="物料编码" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" />
<el-table-column show-overflow-tooltip prop="receive_qty" :formatter="crud.formatNum3" width="120" label="到货重量" />
<el-table-column show-overflow-tooltip prop="instor_qty" :formatter="crud.formatNum3" label="入库重量" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="检测重量" />
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
<el-table-column show-overflow-tooltip prop="sum_qty" :formatter="crud.formatNum3" width="120" 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-column show-overflow-tooltip prop="status" label="状态" :formatter="stateFormat" />
<el-table-column show-overflow-tooltip prop="input_optname" label="创建人" />
<el-table-column show-overflow-tooltip prop="receive_date" width="120" label="到货日期" />
</el-table>
<!--分页组件-->
<pagination />
@@ -95,15 +81,13 @@
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index'
import crudReceivemst from '@/api/wms/pcs/receivemst'
export default {
name: 'AddDtl',
components: { rrOperation, pagination, DateRangePicker },
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '用户', url: 'api/returnoutbill/addDtl',
query: { receive_code: '', source_bill_code: '', status: '', search: '', mater_type: '' },
return CRUD({ title: '用户', url: 'api/returnoutbill/queryWashDtl',
query: { pcsn: '', search: '', is_active: '' },
optShow: {
add: false,
edit: false,
@@ -112,21 +96,17 @@ export default {
download: false
}})
},
dicts: [ 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable'],
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
receiveStatusList: [],
opendtlParam: '',
rows: []
}
},
@@ -135,36 +115,26 @@ export default {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
created() {
crudReceivemst.getStatus().then(res => {
this.receiveStatusList = res
})
},
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()
},
stateFormat(row, column) {
for (const item of this.receiveStatusList) {
if (item.code === row.status) {
return item.name
}
}
quality_scodeFormat(row) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
ivt_levelFormat(row) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
is_activeFormat(row) {
return this.dict.label.is_usable[row.is_active]
},
submit() {
this.rows = this.$refs.multipleTable.selection