手动开单优化
This commit is contained in:
@@ -19,121 +19,152 @@
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
产品bom物料 <el-select
|
||||
v-model="query.material_id"
|
||||
placeholder="产品bom物料"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mateList"
|
||||
:key="item.material_id"
|
||||
:label="item.material_name"
|
||||
:value="item.material_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
配粉序号<el-input
|
||||
v-model="query.seq_no"
|
||||
disabled
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="配粉序号"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
含量(%)<el-input
|
||||
v-model="query.standard_rate"
|
||||
disabled
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="含量%"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="padding-top: 10px;padding-bottom: 10px;">
|
||||
<el-col :span="6">
|
||||
最低库存等级<el-select
|
||||
v-model="query.ivt_level"
|
||||
placeholder="最低库存等级"
|
||||
clearable
|
||||
<div class="head-container">
|
||||
<div >
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
品质类型<el-select
|
||||
v-model="query.quality_scode"
|
||||
placeholder="品质类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_QUALITY_SCODE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
是否可用<el-select
|
||||
v-model="query.is_active"
|
||||
placeholder="是否可用"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_usable"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">搜索</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" />
|
||||
<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 prop="sum_ivt_qty" label="库存重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column prop="need_sum_qty" label="需配重量(KG)" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
</el-table>
|
||||
<el-form-item label="产品bom物料">
|
||||
<el-select
|
||||
v-model="query.material_id"
|
||||
placeholder="产品bom物料"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mateList"
|
||||
:key="item.material_id"
|
||||
:label="item.material_name"
|
||||
:value="item.material_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="query.is_bom" @change="storChange2">参考bom</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="配粉序号">
|
||||
<el-input
|
||||
v-model="query.seq_no"
|
||||
disabled
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="配粉序号"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="含量(%)">
|
||||
<el-input
|
||||
v-model="query.standard_rate"
|
||||
disabled
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="含量%"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最低库存等级">
|
||||
<el-select
|
||||
v-model="query.ivt_level"
|
||||
placeholder="最低库存等级"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_IVT_LEVEL"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品质类型">
|
||||
<el-select
|
||||
v-model="query.quality_scode"
|
||||
placeholder="品质类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_QUALITY_SCODE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用">
|
||||
<el-select
|
||||
v-model="query.is_active"
|
||||
placeholder="是否可用"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_usable"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次号" align="center" />
|
||||
<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 prop="sum_ivt_qty" label="库存重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column prop="need_sum_qty" label="需配重量(KG)" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header} from '@crud/crud'
|
||||
import initformula from "@/api/wms/pf/initformula"
|
||||
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||
import pagination from "@crud/Pagination";
|
||||
import rrOperation from "@crud/RR.operation";
|
||||
import crudOperation from "@crud/CRUD.operation";
|
||||
import initformula from "@/api/wms/pf/initformula";
|
||||
|
||||
export default {
|
||||
name: 'StructIvt',
|
||||
mixins: [header()],
|
||||
components: { pagination, rrOperation, crudOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/initformula/queryivt',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
},
|
||||
query:{
|
||||
is_bom: true, bom_material_id: '', material_id: '', quality_scode: '01', ivt_level: '', is_active: '1', seq_no: '', standard_rate: '',workorder_qty:'0'
|
||||
}
|
||||
})
|
||||
},
|
||||
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_usable'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -147,10 +178,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
queryrow: {},
|
||||
mateList: [],
|
||||
tableDtl:[],
|
||||
query: { material_id: '', quality_scode: '01', ivt_level: '', is_active: '1', seq_no: '', standard_rate: '',workorder_qty:'0' },
|
||||
queryrow: {},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
@@ -168,31 +197,39 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
initformula.getlist({'material_id': this.queryrow.material_id}).then(res => {
|
||||
initformula.getlist({'material_id': this.queryrow.material_id, 'is_bom': true}).then(res => {
|
||||
this.mateList = res
|
||||
if(this.mateList.length != 0){
|
||||
this.query.seq_no = this.mateList[0].seqno
|
||||
this.query.standard_rate = this.mateList[0].standard_rate
|
||||
this.query.ivt_level = this.mateList[0].prior_level
|
||||
this.query.material_id = this.mateList[0].material_id
|
||||
this.crud.query.workorder_qty = this.queryrow.workorder_qty
|
||||
this.crud.query.seq_no = this.mateList[0].seqno
|
||||
this.crud.query.standard_rate = this.mateList[0].standard_rate
|
||||
this.crud.query.ivt_level = this.mateList[0].prior_level
|
||||
this.crud.query.material_id = this.mateList[0].material_id
|
||||
}
|
||||
this.queryStruct()
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
storChange(row) {
|
||||
for (let i = 0; i < this.mateList.length; i++) {
|
||||
const material_id = this.mateList[i].material_id
|
||||
if(material_id===row){
|
||||
if(material_id === row){
|
||||
this.query.seq_no = this.mateList[i].seqno
|
||||
this.query.standard_rate = this.mateList[i].standard_rate
|
||||
this.query.ivt_level = this.mateList[i].prior_level
|
||||
}
|
||||
}
|
||||
},
|
||||
queryStruct() {
|
||||
this.query.workorder_qty = this.queryrow.workorder_qty
|
||||
initformula.queryivt(this.query).then(res => {
|
||||
this.tableDtl = res
|
||||
storChange2(row) {
|
||||
initformula.getlist({'material_id': this.queryrow.material_id, 'is_bom': row}).then(res => {
|
||||
this.mateList = res
|
||||
if(this.mateList.length != 0){
|
||||
this.crud.query.workorder_qty = this.queryrow.workorder_qty
|
||||
this.crud.query.seq_no = this.mateList[0].seqno
|
||||
this.crud.query.standard_rate = this.mateList[0].standard_rate
|
||||
this.crud.query.ivt_level = this.mateList[0].prior_level
|
||||
this.crud.query.material_id = this.mateList[0].material_id
|
||||
}
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
quality_scodeFormat(row, column) {
|
||||
@@ -205,7 +242,7 @@ export default {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
close() {
|
||||
this.query = { material_id: '', quality_scode: '01', ivt_level: '', is_active: '1', seq_no: '', standard_rate: '' }
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
|
||||
Reference in New Issue
Block a user