库存冻结功能

This commit is contained in:
yinjinlu-pc\尹金路 2024-09-08 09:59:28 +08:00
parent ca8bcc00b9
commit 8a00d82a45
8 changed files with 165 additions and 5 deletions

View File

@ -42,3 +42,16 @@ export function delArea(areaId) {
method: 'delete'
})
}
//更改库位的冻结状态
export function changeFrozenState(areaId, status) {
const data = {
'areaId': areaId,
'frozenFlag': status
}
return request({
url: '/mes/wm/area',
method: 'put',
data: data
})
}

View File

@ -42,3 +42,16 @@ export function delLocation(locationId) {
method: 'delete'
})
}
//更改库区的冻结状态
export function changeFrozenState(locationId, status) {
const data = {
'locationId': locationId,
'frozenFlag': status
}
return request({
url: '/mes/wm/location',
method: 'put',
data: data
})
}

View File

@ -49,3 +49,16 @@ export function delWarehouse(warehouseId) {
method: 'delete'
})
}
//更改仓库的冻结状态
export function changeFrozenState(warehouseId, status) {
const data = {
'warehouseId': warehouseId,
'frozenFlag': status
}
return request({
url: '/mes/wm/warehouse',
method: 'put',
data: data
})
}

View File

@ -42,3 +42,16 @@ export function delWmstock(materialStockId) {
method: 'delete'
})
}
//更改库存的冻结状态
export function changeFrozenState(materialStockId, status) {
const data = {
'materialStockId': materialStockId,
'frozenFlag': status
}
return request({
url: '/mes/wm/wmstock',
method: 'put',
data: data
})
}

View File

@ -127,6 +127,18 @@
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
</template>
</el-table-column>
<el-table-column label="是否冻结" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.frozenFlag"
active-text="是"
inactive-text="否"
active-value="Y"
inactive-value="N"
@change="handleFrozenChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -245,7 +257,7 @@
</template>
<script>
import { listArea, getArea, delArea, addArea, updateArea } from "@/api/mes/wm/area";
import { listArea, getArea, delArea, addArea, updateArea, changeFrozenState } from "@/api/mes/wm/area";
import {genCode} from "@/api/system/autocode/rule"
export default {
name: "Area",
@ -413,6 +425,20 @@ export default {
}
});
},
/**
* 冻结状态变更
* @param row
*/
handleFrozenChange(row){
let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.areaName + '"库位吗?').then(function() {
return changeFrozenState(row.areaId,row.frozenFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
});
},
/** 删除按钮操作 */
handleDelete(row) {
const areaIds = row.areaId || this.ids;

View File

@ -64,6 +64,18 @@
</el-table-column>
<el-table-column label="库区名称" align="center" prop="locationName" />
<el-table-column label="面积" align="center" prop="area" />
<el-table-column label="是否冻结" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.frozenFlag"
active-text="是"
inactive-text="否"
active-value="Y"
inactive-value="N"
@change="handleFrozenChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -149,7 +161,7 @@
</template>
<script>
import { listLocation, getLocation, delLocation, addLocation, updateLocation } from "@/api/mes/wm/location";
import { listLocation, getLocation, delLocation, addLocation, updateLocation, changeFrozenState} from "@/api/mes/wm/location";
import {genCode} from "@/api/system/autocode/rule"
export default {
name: "Location",
@ -330,6 +342,21 @@ export default {
debugger;
this.$router.push({ path: '/mes/wm/area/index', query: { locationId: locationId || 0 ,optType: this.optType} })
},
/**
* 冻结状态变更
* @param row
*/
handleFrozenChange(row){
let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.locationName + '"库区吗?').then(function() {
return changeFrozenState(row.locationId,row.frozenFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
});
},
//
handleAutoGenChange(autoGenFlag){
if(autoGenFlag){

View File

@ -78,7 +78,19 @@
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="charge" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="是否冻结" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.frozenFlag"
active-text="是"
inactive-text="否"
active-value="Y"
inactive-value="N"
@change="handleFrozenChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="200px" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -175,7 +187,7 @@
</template>
<script>
import { listWarehouse, getWarehouse, delWarehouse, addWarehouse, updateWarehouse } from "@/api/mes/wm/warehouse";
import { listWarehouse, getWarehouse, delWarehouse, addWarehouse, updateWarehouse,changeFrozenState } from "@/api/mes/wm/warehouse";
import {genCode} from "@/api/system/autocode/rule"
export default {
name: "Warehouse",
@ -330,6 +342,22 @@ export default {
}
});
},
/**
* 冻结状态变更
* @param row
*/
handleFrozenChange(row){
let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.warehouseName + '"仓库吗?').then(function() {
return changeFrozenState(row.warehouseId,row.frozenFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
});
},
/** 删除按钮操作 */
handleDelete(row) {
const warehouseIds = row.warehouseId || this.ids;

View File

@ -128,6 +128,18 @@
<span>{{ parseTime(scope.row.expireDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="是否冻结" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.frozenFlag"
active-text="是"
inactive-text="否"
active-value="Y"
inactive-value="N"
@change="handleFrozenChange(scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<pagination
@ -143,7 +155,7 @@
</template>
<script>
import { listWmstock, getWmstock, delWmstock, addWmstock, updateWmstock } from "@/api/mes/wm/wmstock";
import { listWmstock, getWmstock, delWmstock, addWmstock, updateWmstock, changeFrozenState } from "@/api/mes/wm/wmstock";
import { treeselect } from "@/api/mes/md/itemtype";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -231,6 +243,21 @@ export default {
this.itemTypeOptions = response.data;
});
},
/**
* 冻结状态变更
* @param row
*/
handleFrozenChange(row){
let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.materialStockId + '"此库存吗?').then(function() {
return changeFrozenState(row.materialStockId,row.frozenFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
});
},
//
filterNode(value, data) {
if (!value) return true;