Merge branch 'bonus-jyy-smart-canteen' of http://192.168.0.75:3000/bonus/bonus-ui into bonus-jyy-smart-canteen
This commit is contained in:
commit
af993f60f7
|
|
@ -1370,7 +1370,11 @@
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal
|
if (Number(row.hasInventory) === 1) {
|
||||||
|
this.$modal.msgWarning("该物料仍有库存,无法删除!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$modal
|
||||||
.confirm("是否确认删除数据项?")
|
.confirm("是否确认删除数据项?")
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return removeMenuDishesApi({dishesId:row.dishesId});
|
return removeMenuDishesApi({dishesId:row.dishesId});
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="原料单位" prop="unitId">
|
<el-form-item label="原料单位" prop="unitId">
|
||||||
<el-select v-model="form.unitId" filterable placeholder="请选择原料单位" style="width: 100%">
|
<el-select v-model="form.unitId" placeholder="请选择原料单位" style="width: 100%">
|
||||||
<el-option v-for="item in this.unitOptions"
|
<el-option v-for="item in this.unitOptions"
|
||||||
:key="item.unitId"
|
:key="item.unitId"
|
||||||
:label="item.unitName"
|
:label="item.unitName"
|
||||||
|
|
@ -242,7 +242,7 @@ export default {
|
||||||
materialName: '',//原料名称
|
materialName: '',//原料名称
|
||||||
areaId: null,//所属区域
|
areaId: null,//所属区域
|
||||||
materialTypeId: null,//原料类别
|
materialTypeId: null,//原料类别
|
||||||
salesMode: '2',//计量类型
|
salesMode: '1',//计量类型
|
||||||
unitId: '',//原料单位
|
unitId: '',//原料单位
|
||||||
unitPrice: '',//原料进价(元)
|
unitPrice: '',//原料进价(元)
|
||||||
barCode: '',//条码
|
barCode: '',//条码
|
||||||
|
|
@ -417,6 +417,11 @@ export default {
|
||||||
//选中营养信息
|
//选中营养信息
|
||||||
chosenNutrition(){
|
chosenNutrition(){
|
||||||
console.log("选中营养信息",this.form.nutritionId)
|
console.log("选中营养信息",this.form.nutritionId)
|
||||||
|
if (!this.form.nutritionId) {
|
||||||
|
// 清空选择时重置为默认值
|
||||||
|
this.resetNutritionTable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
getNutritionInfo({nutritionId: this.form.nutritionId}).then((response) => {
|
getNutritionInfo({nutritionId: this.form.nutritionId}).then((response) => {
|
||||||
if(response.data){
|
if(response.data){
|
||||||
this.form.menuMaterialNutritionDTO = response.data
|
this.form.menuMaterialNutritionDTO = response.data
|
||||||
|
|
@ -560,7 +565,7 @@ export default {
|
||||||
materialName: '',//原料名称
|
materialName: '',//原料名称
|
||||||
areaId: null,//所属区域
|
areaId: null,//所属区域
|
||||||
materialTypeId: null,//原料类别
|
materialTypeId: null,//原料类别
|
||||||
salesMode: '2',//计量类型
|
salesMode: '1',//计量类型
|
||||||
unitId: '',//原料单位
|
unitId: '',//原料单位
|
||||||
unitPrice: '',//原料进价(元)
|
unitPrice: '',//原料进价(元)
|
||||||
barCode: '',//条码
|
barCode: '',//条码
|
||||||
|
|
|
||||||
|
|
@ -387,6 +387,7 @@ export default {
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
treeAreaOptions:[],//区域树
|
treeAreaOptions:[],//区域树
|
||||||
batchIds:[],
|
batchIds:[],
|
||||||
|
multipleSelection:[],
|
||||||
openEdit:false,
|
openEdit:false,
|
||||||
editForm:{
|
editForm:{
|
||||||
materialTypeName:"",
|
materialTypeName:"",
|
||||||
|
|
@ -605,18 +606,26 @@ export default {
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal
|
if (Number(row.hasInventory) === 1) {
|
||||||
|
this.$modal.msgWarning("该物料仍有库存,无法删除!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$modal
|
||||||
.confirm("是否确认删除数据项?")
|
.confirm("是否确认删除数据项?")
|
||||||
.then(function () {
|
.then(() => {
|
||||||
return removeMaterialApi({"materialId":row.materialId});
|
// 使用箭头函数保持 this 上下文
|
||||||
|
return removeMaterialApi({ materialId: row.materialId });
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {
|
||||||
|
// 用户取消或异常
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleSelectionChange(selection){
|
handleSelectionChange(selection){
|
||||||
|
this.multipleSelection = selection
|
||||||
this.batchIds = []
|
this.batchIds = []
|
||||||
this.batchIds = selection.map((item) => item.materialId)
|
this.batchIds = selection.map((item) => item.materialId)
|
||||||
this.editForm.categoryNames = "";
|
this.editForm.categoryNames = "";
|
||||||
|
|
@ -626,7 +635,13 @@ export default {
|
||||||
},
|
},
|
||||||
// 批量删除
|
// 批量删除
|
||||||
handleBatchDel(){
|
handleBatchDel(){
|
||||||
console.log(this.batchIds)
|
// 检查是否存在仍有库存的物料
|
||||||
|
const hasInventoryItems = this.multipleSelection.filter(item => Number(item.hasInventory) === 1);
|
||||||
|
if (hasInventoryItems.length > 0) {
|
||||||
|
const names = hasInventoryItems.map(item => item.materialName || item.materialId).join("、");
|
||||||
|
this.$modal.msgWarning(`以下物料仍有库存,无法删除原料名称:${names}的数据`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
removeMaterialApi({"materialId":this.batchIds.join(",")}).then(response => {
|
removeMaterialApi({"materialId":this.batchIds.join(",")}).then(response => {
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
this.$refs.multipleTable.clearSelection()
|
this.$refs.multipleTable.clearSelection()
|
||||||
|
|
|
||||||
|
|
@ -583,6 +583,10 @@ export default {
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
if (Number(row.hasInventory) === 1) {
|
||||||
|
this.$modal.msgWarning("该物料仍有库存,无法删除!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm("是否确认删除数据项?")
|
.confirm("是否确认删除数据项?")
|
||||||
.then(function () {
|
.then(function () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue