✨ feat: 移除changeTime,产品和半成品
This commit is contained in:
@@ -55,7 +55,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getProductOptions() {
|
||||
listProduct({ pageNum: 1, pageSize: 1000 }).then(res => {
|
||||
listProduct({ pageNum: 1, pageSize: 1000, type: 'product' }).then(res => {
|
||||
this.productOptions = res.rows || [];
|
||||
});
|
||||
},
|
||||
|
||||
86
klp-ui/src/components/KLPService/SemiSelect/index.vue
Normal file
86
klp-ui/src/components/KLPService/SemiSelect/index.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<el-select
|
||||
v-model="selected"
|
||||
:placeholder="placeholder"
|
||||
:disabled="disabled"
|
||||
filterable
|
||||
clearable
|
||||
@change="onChange"
|
||||
style="width: 100%"
|
||||
:value-key="'productId'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in productOptions"
|
||||
:key="item.productId"
|
||||
:label="`${item.productName}(${item.productCode})`"
|
||||
:value="item.productId"
|
||||
>
|
||||
<div class="option-label">
|
||||
<span class="product-name">{{ item.productName }}</span>
|
||||
<span class="product-code">{{ item.productCode }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProduct } from '@/api/wms/product';
|
||||
|
||||
export default {
|
||||
name: 'SemiSelect',
|
||||
props: {
|
||||
value: [String, null],
|
||||
disabled: Boolean,
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择产品'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
productOptions: [],
|
||||
selected: this.value
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.selected = val;
|
||||
},
|
||||
selected(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getProductOptions();
|
||||
},
|
||||
methods: {
|
||||
getProductOptions() {
|
||||
listProduct({ pageNum: 1, pageSize: 1000, type: 'semi' }).then(res => {
|
||||
this.productOptions = res.rows || [];
|
||||
});
|
||||
},
|
||||
onChange(val) {
|
||||
// 通过val找到item
|
||||
const product = this.productOptions.find(p => p.productId === val);
|
||||
this.$emit('change', product);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.option-label {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.product-name {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.product-code {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
/** 查询库存流水列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
const payload = {
|
||||
const { changeTime, ...payload } = {
|
||||
...this.queryParams,
|
||||
startTime: this.queryParams.changeTime ? this.queryParams.changeTime[0] + ' 00:00:00' : undefined,
|
||||
endTime: this.queryParams.changeTime ? this.queryParams.changeTime[1] + ' 23:59:59' : undefined
|
||||
|
||||
@@ -202,6 +202,12 @@
|
||||
placeholder="请选择产品"
|
||||
@change="onItemChange"
|
||||
/>
|
||||
<SemiSelect
|
||||
v-else-if="form.itemType === ITEM_TYPE.SEMI"
|
||||
v-model="form.itemId"
|
||||
placeholder="请选择半成品"
|
||||
@change="onItemChange"
|
||||
/>
|
||||
<el-input
|
||||
v-else
|
||||
v-model="form.itemId"
|
||||
@@ -239,6 +245,7 @@ import { auditStockIo, updateStockIoStatus, cancelStockIo, getStockIo } from "@/
|
||||
import WarehouseSelect from '@/components/WarehouseSelect';
|
||||
import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect';
|
||||
import ProductSelect from '@/components/KLPService/ProductSelect';
|
||||
import SemiSelect from '@/components/KLPService/SemiSelect';
|
||||
import { ITEM_TYPE } from '@/utils/enums';
|
||||
import {RawMaterialInfo, ProductInfo} from "@/components/KLPService";
|
||||
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||
@@ -251,7 +258,8 @@ export default {
|
||||
ProductSelect,
|
||||
RawMaterialInfo,
|
||||
ProductInfo,
|
||||
BomInfoMini
|
||||
BomInfoMini,
|
||||
SemiSelect
|
||||
},
|
||||
dicts: ['stock_item_type'],
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user