fix:辅料库物料清单添加筛选项
This commit is contained in:
parent
90f717c625
commit
ee37dee001
|
@ -1,22 +1,8 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<!-- <div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.warehouse"
|
||||
clearable
|
||||
placeholder="所在仓库"
|
||||
@change="handleQuery"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div> -->
|
||||
<div class="left-panel">
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
|
@ -41,7 +27,7 @@
|
|||
v-if="project_code=='gx'"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="日期" prop="update_time">
|
||||
<el-table-column label="日期" prop="update_time" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料编号">
|
||||
<template #default="scope">
|
||||
|
@ -65,24 +51,29 @@
|
|||
<span v-if="scope.row.material_&&scope.row.material_.model">{{ scope.row.material_.model }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--
|
||||
:filters="unitFilters"
|
||||
:filter-method="filterUnitDate"
|
||||
filter-placement="bottom-end"
|
||||
-->
|
||||
<el-table-column label="单位">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.unit">{{ scope.row.material_.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="安全库存">
|
||||
<el-table-column label="安全库存" sortable>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.count_safe">{{ scope.row.material_.count_safe }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
<el-table-column label="数量" prop="count" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价">
|
||||
<el-table-column label="单价" sortable>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ scope.row.material_.unit_price }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" prop="expiration_date">
|
||||
<el-table-column label="总金额" prop="expiration_date" sortable>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_&&scope.row.material_.unit_price">{{ Number(scope.row.material_.unit_price)*Number(scope.row.count) }}</span>
|
||||
</template>
|
||||
|
@ -137,6 +128,7 @@ export default {
|
|||
apiObj: this.$API.inm.warehouse.batch,
|
||||
params: { count__gte: 1, material__type__in: "40" },
|
||||
selection: [],
|
||||
unitFilters:[],
|
||||
query: {},
|
||||
warehouseOptions: [],
|
||||
wmtype:0,
|
||||
|
@ -148,7 +140,20 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.getWarehouse();
|
||||
this.$nextTick(() => {
|
||||
let datas = this.$refs.table.tableData;
|
||||
that.unitFilters = [];
|
||||
datas.forEach(item => {
|
||||
let unit = item.material_.unit;
|
||||
console.log(unit);
|
||||
if(that.unitFilters.indexOf(unit) >-1){}else{
|
||||
that.unitFilters.push(unit)
|
||||
}
|
||||
});
|
||||
console.log(that.unitFilters);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getWarehouse() {
|
||||
|
@ -156,6 +161,9 @@ export default {
|
|||
this.warehouseOptions = res;
|
||||
});
|
||||
},
|
||||
filterUnitDate(value, row) {
|
||||
return row.单位 === value;
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
|
|
|
@ -7,20 +7,33 @@
|
|||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
v-auth="'material.create'"
|
||||
>新增</el-button
|
||||
>
|
||||
>新增</el-button>
|
||||
<scFileImport
|
||||
:templateUrl="materialTemplate"
|
||||
accept=".xlsx"
|
||||
:apiObj="$API.common.upload"
|
||||
@success="upSuccess"
|
||||
>
|
||||
</scFileImport>
|
||||
></scFileImport>
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="exportM"
|
||||
:loading="exportLoading"
|
||||
>导出</el-button> -->
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-select v-model="query.cate" placeholder="辅料类型" style="width: 150px;">
|
||||
<el-option
|
||||
v-for="item in mCateEnum.list"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
placeholder="名称/编号/规格/型号"
|
||||
style="width: 250px;"
|
||||
clearable
|
||||
></el-input>
|
||||
<el-button
|
||||
|
@ -40,9 +53,9 @@
|
|||
@row-click="rowClick"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料编号" prop="number">
|
||||
<el-table-column label="物料编号" prop="number" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" prop="name">
|
||||
<el-table-column label="物料名称" prop="name" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="specification">
|
||||
</el-table-column>
|
||||
|
@ -57,21 +70,21 @@
|
|||
>隐</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计量单位" prop="unit">
|
||||
<el-table-column label="计量单位" prop="unit" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库位号" prop="bin_number_main">
|
||||
<el-table-column label="仓库位号" prop="bin_number_main" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" prop="cate">
|
||||
</el-table-column>
|
||||
<el-table-column label="安全库存" prop="count_safe">
|
||||
<el-table-column label="安全库存" prop="count_safe" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" prop="unit_price">
|
||||
<el-table-column label="单价" prop="unit_price" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="总价" prop="count_safe">
|
||||
<!-- <el-table-column label="总价" prop="count_safe">
|
||||
<template #default="scope">
|
||||
{{ scope.row.unit_price * scope.row.count }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
v-if="materialType == ''"
|
||||
label="操作"
|
||||
|
@ -121,6 +134,7 @@
|
|||
import scFileImport from "@/components/scFileImport";
|
||||
import saveDialog from "./../mtm/materials_form_gx.vue";
|
||||
import { ElLoading } from "element-plus";
|
||||
import { mCateEnum } from "@/utils/enum.js";
|
||||
|
||||
export default {
|
||||
name: "rparty",
|
||||
|
@ -140,6 +154,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
mCateEnum,
|
||||
project_code : this.$TOOL.data.get("BASE_INFO").base.base_code,
|
||||
materialTemplate: " /media/default/template/material.xlsx",
|
||||
dialog: {
|
||||
|
@ -156,6 +171,7 @@ export default {
|
|||
},
|
||||
materialId: "",
|
||||
materialName: "",
|
||||
exportLoading:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -228,6 +244,18 @@ export default {
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
exportM(){
|
||||
let that = this;
|
||||
// that.$API.mtm.material.list.req({ page:0}).then((res) => {
|
||||
// that.tableData = res;
|
||||
// console.log(that.tableData);
|
||||
// that.exportLoading = true;
|
||||
// setTimeout(() => {
|
||||
// that.$XLSX("#myTable", '物料清单');
|
||||
// that.exportLoading = false;
|
||||
// }, 1000);
|
||||
// })
|
||||
},
|
||||
upSuccess(res, close) {
|
||||
close();
|
||||
const loading = ElLoading.service({
|
||||
|
|
Loading…
Reference in New Issue