|
@@ -141,28 +141,6 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col> -->
|
|
</el-col> -->
|
|
|
-
|
|
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- :label="type == 2 ? '产品分类' : '资产分类'"
|
|
|
|
|
- prop="categoryLevelId"
|
|
|
|
|
- >
|
|
|
|
|
- <ele-tree-select
|
|
|
|
|
- multiple
|
|
|
|
|
- clearable
|
|
|
|
|
- :disabled="isBindPlan"
|
|
|
|
|
- :data="codeList"
|
|
|
|
|
- @change="codeListValue"
|
|
|
|
|
- v-model="addForm.categoryLevelId"
|
|
|
|
|
- valueKey="id"
|
|
|
|
|
- labelKey="name"
|
|
|
|
|
- :show-checkbox="true"
|
|
|
|
|
- :check-strictly="true"
|
|
|
|
|
- filterable
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="紧急程度" prop="urgent">
|
|
<el-form-item label="紧急程度" prop="urgent">
|
|
|
<DictSelection
|
|
<DictSelection
|
|
@@ -242,7 +220,6 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<HeaderTitle title="盘点物品信息" size="16px">
|
|
<HeaderTitle title="盘点物品信息" size="16px">
|
|
|
<el-select
|
|
<el-select
|
|
|
- style="margin-right: 10px"
|
|
|
|
|
:disabled="isBindPlan"
|
|
:disabled="isBindPlan"
|
|
|
@change="dimensionChange"
|
|
@change="dimensionChange"
|
|
|
v-model="dimension"
|
|
v-model="dimension"
|
|
@@ -251,7 +228,13 @@
|
|
|
<el-option label="物品维度" :value="1"> </el-option>
|
|
<el-option label="物品维度" :value="1"> </el-option>
|
|
|
<el-option label="批次维度" :value="2"> </el-option>
|
|
<el-option label="批次维度" :value="2"> </el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <el-button type="primary" @click="addProducts">添加物品</el-button>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="!isBindPlan"
|
|
|
|
|
+ style="margin-left: 10px"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="addProducts"
|
|
|
|
|
+ >添加物品</el-button
|
|
|
|
|
+ >
|
|
|
</HeaderTitle>
|
|
</HeaderTitle>
|
|
|
<el-table
|
|
<el-table
|
|
|
ref="table"
|
|
ref="table"
|
|
@@ -360,7 +343,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<selectType
|
|
<selectType
|
|
|
:visibleDialog.sync="visibleDialog"
|
|
:visibleDialog.sync="visibleDialog"
|
|
|
- :treeIds="addForm.categoryLevelId"
|
|
|
|
|
|
|
+ :treeIds="productType"
|
|
|
:dimension="dimension"
|
|
:dimension="dimension"
|
|
|
:warehouseId="addForm.warehouseId"
|
|
:warehouseId="addForm.warehouseId"
|
|
|
:selectionIds="selectionIds"
|
|
:selectionIds="selectionIds"
|
|
@@ -385,12 +368,12 @@
|
|
|
import { fieldModel } from '@/api/codeManagement';
|
|
import { fieldModel } from '@/api/codeManagement';
|
|
|
import {
|
|
import {
|
|
|
getRule,
|
|
getRule,
|
|
|
- getProductList,
|
|
|
|
|
getBatchList,
|
|
getBatchList,
|
|
|
getWarehouseList,
|
|
getWarehouseList,
|
|
|
saveStocktakingPlan,
|
|
saveStocktakingPlan,
|
|
|
updateStocktakingPlan,
|
|
updateStocktakingPlan,
|
|
|
- getInventoryDetailById
|
|
|
|
|
|
|
+ getInventoryDetailById,
|
|
|
|
|
+ getCategoryLevelIdByWarehouseId
|
|
|
} from '@/api/ruleManagement/plan';
|
|
} from '@/api/ruleManagement/plan';
|
|
|
import { getUserPage } from '@/api/system/organization';
|
|
import { getUserPage } from '@/api/system/organization';
|
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
@@ -445,13 +428,13 @@
|
|
|
size: 10,
|
|
size: 10,
|
|
|
loadTree: true,
|
|
loadTree: true,
|
|
|
productList: [],
|
|
productList: [],
|
|
|
|
|
+ productType: [],
|
|
|
addForm: {
|
|
addForm: {
|
|
|
code: '', // 计划配置单号
|
|
code: '', // 计划配置单号
|
|
|
planName: '', // 计划配置名称
|
|
planName: '', // 计划配置名称
|
|
|
categoryId: 0, // 类别ID
|
|
categoryId: 0, // 类别ID
|
|
|
autoOrder: 1, // 是否自动派单
|
|
autoOrder: 1, // 是否自动派单
|
|
|
ruleId: '', // 规则名称
|
|
ruleId: '', // 规则名称
|
|
|
- categoryLevelId: [], // 物品Ids
|
|
|
|
|
inventoryType: 1, // 盘点类型
|
|
inventoryType: 1, // 盘点类型
|
|
|
bizTypeId: '', // 盘点仓库Id
|
|
bizTypeId: '', // 盘点仓库Id
|
|
|
bizTypeName: '', // 盘点仓库name
|
|
bizTypeName: '', // 盘点仓库name
|
|
@@ -493,13 +476,6 @@
|
|
|
inventoryType: [
|
|
inventoryType: [
|
|
|
{ required: true, message: '请选择盘点类型', trigger: 'change' }
|
|
{ required: true, message: '请选择盘点类型', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
- // plantId: [
|
|
|
|
|
- // {
|
|
|
|
|
- // required: true,
|
|
|
|
|
- // message: '请选择厂房',
|
|
|
|
|
- // trigger: 'change'
|
|
|
|
|
- // }
|
|
|
|
|
- // ],
|
|
|
|
|
warehouseId: [
|
|
warehouseId: [
|
|
|
{ required: true, message: '请选择盘点仓库', trigger: 'change' }
|
|
{ required: true, message: '请选择盘点仓库', trigger: 'change' }
|
|
|
],
|
|
],
|
|
@@ -511,9 +487,6 @@
|
|
|
],
|
|
],
|
|
|
executorId: [
|
|
executorId: [
|
|
|
{ required: true, message: '请选择选择执行人员', trigger: 'change' }
|
|
{ required: true, message: '请选择选择执行人员', trigger: 'change' }
|
|
|
- ],
|
|
|
|
|
- assetDict: [
|
|
|
|
|
- { required: true, message: '请选择资产分类', trigger: 'change' }
|
|
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
ruleNameList: []
|
|
ruleNameList: []
|
|
@@ -542,15 +515,14 @@
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
res.warehouseId = res.warehouseId > 0 ? res.warehouseId : '';
|
|
res.warehouseId = res.warehouseId > 0 ? res.warehouseId : '';
|
|
|
res.urgent = String(res.urgent);
|
|
res.urgent = String(res.urgent);
|
|
|
- res.categoryLevelId = res.categoryLevelId
|
|
|
|
|
- ? res.categoryLevelId.split(',')
|
|
|
|
|
- : [];
|
|
|
|
|
this.addForm = res;
|
|
this.addForm = res;
|
|
|
this.dimension = res.planConfigDetailVOList[0].batch_no ? 2 : 1;
|
|
this.dimension = res.planConfigDetailVOList[0].batch_no ? 2 : 1;
|
|
|
if (this.addForm.executeGroupId) {
|
|
if (this.addForm.executeGroupId) {
|
|
|
this.getUserList({ groupId: this.addForm.executeGroupId });
|
|
this.getUserList({ groupId: this.addForm.executeGroupId });
|
|
|
}
|
|
}
|
|
|
- this.productList = res.planConfigDetailVOList;
|
|
|
|
|
|
|
+ this.productList = res.planConfigDetailVOList.map(
|
|
|
|
|
+ (item) => item.info
|
|
|
|
|
+ );
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
this.productList = [];
|
|
this.productList = [];
|
|
@@ -560,7 +532,6 @@
|
|
|
categoryId: 0, // 类别ID
|
|
categoryId: 0, // 类别ID
|
|
|
autoOrder: 1, // 是否自动派单
|
|
autoOrder: 1, // 是否自动派单
|
|
|
ruleId: '', // 规则名称
|
|
ruleId: '', // 规则名称
|
|
|
- categoryLevelId: [], // 物品Ids
|
|
|
|
|
inventoryType: 1, // 盘点类型
|
|
inventoryType: 1, // 盘点类型
|
|
|
bizTypeId: '', // 盘点仓库Id
|
|
bizTypeId: '', // 盘点仓库Id
|
|
|
bizTypeName: '', // 盘点仓库name
|
|
bizTypeName: '', // 盘点仓库name
|
|
@@ -639,7 +610,11 @@
|
|
|
this.productList = this.productList.concat(productList);
|
|
this.productList = this.productList.concat(productList);
|
|
|
},
|
|
},
|
|
|
addProducts() {
|
|
addProducts() {
|
|
|
- this.visibleDialog = true;
|
|
|
|
|
|
|
+ if (this.addForm.warehouseId) {
|
|
|
|
|
+ this.visibleDialog = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning('请选择盘点仓库');
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
deleted(row, index) {
|
|
deleted(row, index) {
|
|
|
this.productList.splice(index, 1);
|
|
this.productList.splice(index, 1);
|
|
@@ -653,28 +628,6 @@
|
|
|
checkSelectable(row) {
|
|
checkSelectable(row) {
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
- async getProductList() {
|
|
|
|
|
- let data = null;
|
|
|
|
|
- if (this.dimension == 1) {
|
|
|
|
|
- data = await getProductList({
|
|
|
|
|
- keyWord: this.keyWord,
|
|
|
|
|
- warehouseId: this.type == 2 ? this.addForm?.warehouseId : '',
|
|
|
|
|
- categoryLevelIds: this.addForm?.categoryLevelId.join(','),
|
|
|
|
|
- pageNum: this.page,
|
|
|
|
|
- size: this.size
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- data = await getBatchList({
|
|
|
|
|
- keyWord: this.keyWord,
|
|
|
|
|
- warehouseId: this.type == 2 ? this.addForm?.warehouseId : '',
|
|
|
|
|
- categoryLevelIds: this.addForm?.categoryLevelId.join(','),
|
|
|
|
|
- pageNum: this.page,
|
|
|
|
|
- size: this.size
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- this.total = data.count;
|
|
|
|
|
- this.productList = data.list;
|
|
|
|
|
- },
|
|
|
|
|
// 改变规则名称
|
|
// 改变规则名称
|
|
|
change_ruleId(val) {
|
|
change_ruleId(val) {
|
|
|
this.addForm.ruleName = this.ruleNameList.filter(
|
|
this.addForm.ruleName = this.ruleNameList.filter(
|
|
@@ -746,13 +699,6 @@
|
|
|
(item) => item.id === id
|
|
(item) => item.id === id
|
|
|
)[0].name;
|
|
)[0].name;
|
|
|
},
|
|
},
|
|
|
- // 物品类型选择
|
|
|
|
|
- async codeListValue(val) {
|
|
|
|
|
- if (this.addForm.warehouseId) {
|
|
|
|
|
- console.log('val---------', val);
|
|
|
|
|
- this.addForm.categoryLevelId = val;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
// 获取物品类型列表
|
|
// 获取物品类型列表
|
|
|
async getGoodsList() {
|
|
async getGoodsList() {
|
|
|
const { data } = await getTreeByGroup({ type: this.type });
|
|
const { data } = await getTreeByGroup({ type: this.type });
|
|
@@ -787,6 +733,10 @@
|
|
|
this.addForm.warehouseName = this.warehouseList.filter(
|
|
this.addForm.warehouseName = this.warehouseList.filter(
|
|
|
(item) => item.id === val
|
|
(item) => item.id === val
|
|
|
)[0].name;
|
|
)[0].name;
|
|
|
|
|
+ this.productList = [];
|
|
|
|
|
+ getCategoryLevelIdByWarehouseId({ warehouseId: val }).then((data) => {
|
|
|
|
|
+ this.productType = Array.from(new Set(data));
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
@@ -936,7 +886,6 @@
|
|
|
this.stationOptions = [];
|
|
this.stationOptions = [];
|
|
|
this.type = 2;
|
|
this.type = 2;
|
|
|
}
|
|
}
|
|
|
- this.addForm.categoryLevelId = [];
|
|
|
|
|
this.getGoodsList();
|
|
this.getGoodsList();
|
|
|
},
|
|
},
|
|
|
// 提交
|
|
// 提交
|
|
@@ -1004,12 +953,12 @@
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
let params = {
|
|
let params = {
|
|
|
...this.addForm,
|
|
...this.addForm,
|
|
|
- categoryLevelId: this.addForm.categoryLevelId.join(','),
|
|
|
|
|
details: this.productList.map((item) => {
|
|
details: this.productList.map((item) => {
|
|
|
return {
|
|
return {
|
|
|
batchNo: item.batchNo,
|
|
batchNo: item.batchNo,
|
|
|
categoryId: item.categoryId,
|
|
categoryId: item.categoryId,
|
|
|
- categoryName: item.categoryName
|
|
|
|
|
|
|
+ categoryName: item.categoryName,
|
|
|
|
|
+ info: item
|
|
|
};
|
|
};
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|