增加导入导出
This commit is contained in:
parent
2fb5341550
commit
03fc862fbd
|
|
@ -78,11 +78,11 @@
|
|||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
>
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="queryParams.areaId"
|
||||
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
|
|
@ -141,40 +141,41 @@
|
|||
@click="handleBatchDel"
|
||||
>批量删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-col :span="1.5">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:show-file-list="false"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
size="mini"
|
||||
>批量导入
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" plain
|
||||
:disabled="multiple"
|
||||
@click="handleBatchEdit"
|
||||
@click="handleBatchEdit"
|
||||
>批量修改类别
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:show-file-list="false"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
size="mini"
|
||||
>批量导入
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="importTemplate"
|
||||
@click="importTemplate"
|
||||
>模板下载
|
||||
</el-button>
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
|
@ -186,22 +187,22 @@
|
|||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原料编码" align="center" key="materialCode" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="原料编码" align="center" key="materialCode" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="原料名称" align="center" key="materialName" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="原料类别" align="center" key="materialTypeName" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" key="unitName" prop="unitName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="所属区域" align="center" key="areaName" prop="areaName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="原料类别" align="center" key="materialTypeName" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" key="unitName" prop="unitName" :show-overflow-tooltip="true" width="120"/>
|
||||
<el-table-column label="所属区域" align="center" key="areaName" prop="areaName" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column label="原料规格" align="center" key="size" prop="size" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="原料税率" align="center" key="taxRate" prop="taxRate" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.taxRate">{{ scope.row.taxRate }}%</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原料进价(元)" align="center" key="unitPrice" prop="unitPrice" :show-overflow-tooltip="true" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="营养信息名称" align="center" key="nutritionName" prop="nutritionName" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="条码" align="center" key="barCode" prop="barCode" :show-overflow-tooltip="true" width="150"/> -->
|
||||
|
|
@ -249,13 +250,13 @@
|
|||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="form.areaId" :disabled="isEditType"
|
||||
:options="treeAreaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
}" clearable>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="原料类别" prop="materialTypeName">
|
||||
|
|
@ -266,8 +267,8 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
<el-button @click="open=false">取 消</el-button>
|
||||
|
|
@ -278,20 +279,20 @@
|
|||
<!-- 批量修改原料类别对话框 -->
|
||||
<el-dialog title="批量修改原料类别" :visible.sync="openEdit"
|
||||
width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="editForm" :model="editForm" :rules="editRules" label-width="120px">
|
||||
<el-form ref="editForm" :model="editForm" :rules="editRules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="原料名称" prop="materialTypeName">
|
||||
<el-input v-model="editForm.materialTypeName" placeholder="请输入原料名称" :readonly="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="新类别" prop="categroyId">
|
||||
<el-cascader v-model="editForm.categroyId"
|
||||
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: true,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'categoryName'
|
||||
|
|
@ -355,7 +356,7 @@ export default {
|
|||
pageSize: 10,
|
||||
areaId:null,
|
||||
materialName:"",
|
||||
materialCode:"",
|
||||
materialCode:"",
|
||||
categoryIdList:[]
|
||||
},
|
||||
// 总条数
|
||||
|
|
@ -371,7 +372,7 @@ export default {
|
|||
form: {
|
||||
materialTypeName: "",
|
||||
parentId: "",
|
||||
goodsType: "",
|
||||
goodsType: "",
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
|
@ -383,7 +384,7 @@ export default {
|
|||
},
|
||||
]
|
||||
},
|
||||
parentId: undefined,
|
||||
parentId: undefined,
|
||||
treeAreaOptions:[],//区域树
|
||||
batchIds:[],
|
||||
multipleSelection:[],
|
||||
|
|
@ -402,13 +403,13 @@ export default {
|
|||
]
|
||||
},
|
||||
//导入参数
|
||||
upload: {
|
||||
upload: {
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/smart-canteen/api/v1/menumaterial/batch/import/material',
|
||||
url: process.env.VUE_APP_BASE_API + '/smart-canteen/ims_order_goods/import/commodity',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
@ -436,18 +437,18 @@ export default {
|
|||
systemMaterialTreeApi(param).then((response) => {
|
||||
this.treeOptions = response.data;
|
||||
this.addLevel(this.treeOptions)
|
||||
console.log("this.treeOptions",this.treeOptions)
|
||||
if(this.treeOptions && this.treeOptions.length > 0){
|
||||
console.log("this.treeOptions",this.treeOptions)
|
||||
if(this.treeOptions && this.treeOptions.length > 0){
|
||||
this.getList();
|
||||
} else {
|
||||
} else {
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
addLevel(nodes, level = 0) {
|
||||
nodes.forEach(node => {
|
||||
node.level = level; // 设置当前节点的层级
|
||||
if (node.children) { // 如果节点有子节点,递归处理子节点
|
||||
node.level = level; // 设置当前节点的层级
|
||||
if (node.children) { // 如果节点有子节点,递归处理子节点
|
||||
this.addLevel(node.children, level + 1);
|
||||
}
|
||||
});
|
||||
|
|
@ -457,19 +458,19 @@ export default {
|
|||
console.log(data)
|
||||
// this.handleQuery();
|
||||
},
|
||||
handleCheckChange(data, checked, indeterminate) {
|
||||
handleCheckChange(data, checked, indeterminate) {
|
||||
this.handleQuery();
|
||||
},
|
||||
/* 树节点增加 */
|
||||
appendTreeNode(data) {
|
||||
this.isEditType=false;
|
||||
this.isEditType=false;
|
||||
this.form={}
|
||||
this.resetForm("form");
|
||||
this.$set(this.form,"parentId",data.id)
|
||||
this.$set(this.form,"goodsType",data.categoryType)
|
||||
this.open = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
},
|
||||
/* 树节点修改 */
|
||||
editTreeNode(data) {
|
||||
this.isEditType=true;
|
||||
|
|
@ -480,7 +481,7 @@ export default {
|
|||
};
|
||||
this.$set(this.form,"materialTypeId",data.id)
|
||||
this.$set(this.form,"materialTypeName",data.categoryName)
|
||||
this.$set(this.form,"goodsType",data.categoryType)
|
||||
this.$set(this.form,"goodsType",data.categoryType)
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
},
|
||||
|
|
@ -517,7 +518,7 @@ export default {
|
|||
this.getTreeData();
|
||||
this.$refs.materialDialog.getTypeTreeData();
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
addMaterialTypeApi(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
|
|
@ -528,7 +529,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
@ -551,8 +552,8 @@ export default {
|
|||
"pageNum": this.queryParams.pageNum,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"materialName": this.queryParams.materialName,
|
||||
"materialCode": this.queryParams.materialCode,
|
||||
"goodsType": 1,
|
||||
"materialCode": this.queryParams.materialCode,
|
||||
"goodsType": 1,
|
||||
"materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
|
||||
}
|
||||
getMaterialListApi(params).then((response) => {
|
||||
|
|
@ -564,7 +565,7 @@ export default {
|
|||
//新增修改弹窗-区域树
|
||||
getAreaTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeAreaOptions = response.data;
|
||||
this.treeAreaOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
|
|
@ -576,7 +577,7 @@ export default {
|
|||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.title = "修改";
|
||||
this.dialogVisible = true;
|
||||
this.dialogVisible = true;
|
||||
// 在显示对话框后,可以通过 $refs 访问子组件方法设置表单数据
|
||||
this.$nextTick(() => {
|
||||
// 假设子组件提供了 setFormData 方法
|
||||
|
|
@ -604,7 +605,7 @@ export default {
|
|||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
handleDelete(row) {
|
||||
if (Number(row.hasInventory) === 1) {
|
||||
this.$modal.msgWarning("该物料仍有库存,无法删除!");
|
||||
return;
|
||||
|
|
@ -619,7 +620,7 @@ export default {
|
|||
this.getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
handleSelectionChange(selection){
|
||||
this.multipleSelection = selection
|
||||
this.batchIds = []
|
||||
|
|
@ -641,7 +642,7 @@ export default {
|
|||
removeMaterialApi({"materialId":this.batchIds.join(",")}).then(response => {
|
||||
this.getList();
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
});
|
||||
},
|
||||
//批量修改
|
||||
|
|
@ -651,7 +652,7 @@ export default {
|
|||
},
|
||||
handleSubmitEdit(){
|
||||
this.$refs["editForm"].validate(valid => {
|
||||
if (valid) {
|
||||
if (valid) {
|
||||
let param = {
|
||||
materialIdList:this.batchIds,
|
||||
categroyId:this.editForm.categroyId
|
||||
|
|
@ -673,10 +674,10 @@ export default {
|
|||
this.upload.isUploading = true
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$modal.msgSuccess("后台导入中,请稍后刷新列表!");
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList()
|
||||
},
|
||||
|
||||
|
|
@ -687,7 +688,7 @@ export default {
|
|||
downloadFileByUrl(url)
|
||||
},
|
||||
|
||||
|
||||
|
||||
// getParentName(list, id) {
|
||||
// try {
|
||||
// list.forEach((e) => {
|
||||
|
|
@ -702,7 +703,7 @@ export default {
|
|||
// });
|
||||
// } catch (error) {}
|
||||
// },
|
||||
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleImportCancel">取 消</el-button>
|
||||
<el-button @click="handleImportCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitUpload" :loading="uploading">开始上传</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="queryParams.areaId"
|
||||
:options="treeOptions" :filterable="true" style="width: 240px;" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
|
|
@ -18,43 +18,44 @@
|
|||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="货品类别" prop="materialTypeIds">
|
||||
<el-cascader v-model="queryParams.materialTypeIds"
|
||||
:options="materialTreeOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
multiple: true,
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'categoryName'
|
||||
value:'id',label:'categoryName'
|
||||
}" collapse-tags>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="货品名称" prop="materialName">
|
||||
<el-input
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入货品名称"
|
||||
clearable maxlength="30"
|
||||
style="width: 240px"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="条码" prop="barCode">
|
||||
<el-input
|
||||
<el-input
|
||||
v-model="queryParams.barCode"
|
||||
placeholder="请输入条码"
|
||||
clearable maxlength="30"
|
||||
style="width: 240px"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button icon="el-icon-button" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -68,14 +69,14 @@
|
|||
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" width="100"/>
|
||||
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true" width="120">
|
||||
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.salesMode==1">按份</span>
|
||||
<span v-if="scope.row.salesMode==2">称重</span>
|
||||
<span v-if="!scope.row.salesMode">/</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="货品仓库" align="center" prop="warehouseName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="当前库存数" align="center" prop="materialNum" :show-overflow-tooltip="true" width="120"/>
|
||||
<!-- <el-table-column label="库存金额" align="center" prop="totalPrice" :show-overflow-tooltip="true" width="120">
|
||||
|
|
@ -94,17 +95,17 @@
|
|||
</el-table-column>
|
||||
<!-- <el-table-column label="总库存数" align="center" prop="totalNum" :show-overflow-tooltip="true" width="120"/> -->
|
||||
<!-- <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>配置库存</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>批次详情</el-button>
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>批次详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
|
|
@ -122,16 +123,16 @@
|
|||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="最小库存:" prop="minNum">
|
||||
<el-input
|
||||
<el-input
|
||||
v-model="form.minNum"
|
||||
type="text" clearable
|
||||
placeholder="请输入最小库存"
|
||||
maxlength="7" @input="(v)=>(form.minNum=v.replace(/[^\d]/g,''))"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大库存:" prop="maxNum">
|
||||
<el-input v-model="form.maxNum"
|
||||
type="text" clearable
|
||||
type="text" clearable
|
||||
placeholder="请输入最大库存"
|
||||
maxlength="7" @input="(v)=>(form.maxNum=v.replace(/[^\d]/g,''))"
|
||||
/>
|
||||
|
|
@ -145,7 +146,7 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
import { systemAreaTreeApi } from "@/api/base/stall";
|
||||
// import { supplierQualificationWarningPageApi } from "@/api/foodManage/supplierManage";
|
||||
import { drpWareHousePageApi,systemMaterialTreeApi,getStockMaterialListApi,editStockMaterialApi } from "@/api/foodManage/stockManage";
|
||||
|
|
@ -175,16 +176,16 @@ export default {
|
|||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
areaId: null,
|
||||
warehouseId: null,
|
||||
materialTypeIds: [],
|
||||
materialName: "",
|
||||
barCode: "",
|
||||
warehouseId: null,
|
||||
materialTypeIds: [],
|
||||
materialName: "",
|
||||
barCode: "",
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -199,28 +200,28 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created() {
|
||||
this.getTreeData();
|
||||
this.getMaterialTree()
|
||||
this.getMaterialTree()
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
//区域树
|
||||
getTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeOptions = response.data;
|
||||
this.treeOptions = response.data;
|
||||
});
|
||||
},
|
||||
//选中区域-查询食堂
|
||||
handleAreaChange(e){
|
||||
handleAreaChange(e){
|
||||
this.getWareHouseData()
|
||||
},
|
||||
},
|
||||
/** 查询货品下拉结构 */
|
||||
getWareHouseData() {
|
||||
getWareHouseData() {
|
||||
drpWareHousePageApi({ areaId:this.queryParams.areaId }).then((response) => {
|
||||
this.wareHouseOptions = response.rows||[];
|
||||
this.$set(this.queryParams,'warehouseId',null)
|
||||
});
|
||||
this.$set(this.queryParams,'warehouseId',null)
|
||||
});
|
||||
},
|
||||
/** 查询货品类别下拉树结构 */
|
||||
getMaterialTree() {
|
||||
|
|
@ -228,24 +229,24 @@ export default {
|
|||
// goodsType:1
|
||||
}
|
||||
systemMaterialTreeApi(param).then((response) => {
|
||||
this.materialTreeOptions = response.data;
|
||||
this.materialTreeOptions = response.data;
|
||||
});
|
||||
},
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
areaId: null,
|
||||
warehouseId: null,
|
||||
materialTypeIds: [],
|
||||
materialName: "",
|
||||
barCode: "",
|
||||
warehouseId: null,
|
||||
materialTypeIds: [],
|
||||
materialName: "",
|
||||
barCode: "",
|
||||
}
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
|
|
@ -254,11 +255,11 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"warehouseId": this.queryParams.warehouseId,
|
||||
"materialTypeIds": this.queryParams.materialTypeIds,
|
||||
"warehouseId": this.queryParams.warehouseId,
|
||||
"materialTypeIds": this.queryParams.materialTypeIds,
|
||||
"materialName": this.queryParams.materialName
|
||||
}
|
||||
getStockMaterialListApi(param).then(response => {
|
||||
|
|
@ -266,11 +267,11 @@ export default {
|
|||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
/** 配置库存按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form = Object.assign({}, row)
|
||||
this.form = Object.assign({}, row)
|
||||
this.open = true;
|
||||
this.title = "配置库存";
|
||||
},
|
||||
|
|
@ -287,19 +288,24 @@ export default {
|
|||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (valid) {
|
||||
editStockMaterialApi(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('smart-canteen/api/v1/drpinventory/export', {
|
||||
...this.queryParams
|
||||
}, `货品库存${new Date().getDate()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue