代码更新:
1. 增加间接物料的功能。
This commit is contained in:
parent
a2918c1ac1
commit
ffac5ff1ab
|
|
@ -52,10 +52,22 @@ const deleteGoodsInfo = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键配置间接物料相关信息
|
||||
*/
|
||||
const updateIndirectInfos = (params) => {
|
||||
return request({
|
||||
url: '/goods/updateIndirectInfos',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getGoodsInfoByPage,
|
||||
deleteGoodsInfo,
|
||||
getGoodsInfoByGoodsId,
|
||||
getGoodsInfo,
|
||||
updateGoodsInfo
|
||||
updateGoodsInfo,
|
||||
updateIndirectInfos
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="warning" style="width: 201px; background-color: red; color: #000;" @click="setIndirect()">一键设置间接物料相关信息</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
|
|
@ -192,7 +193,7 @@
|
|||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo } from '@/api/goods.js'
|
||||
import { getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo, updateIndirectInfos } from '@/api/goods.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
|
|
@ -229,6 +230,20 @@ export default {
|
|||
this.search()
|
||||
},
|
||||
methods: {
|
||||
setIndirect() {
|
||||
const request = {}
|
||||
updateIndirectInfos(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('一键设置错误。')
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
<el-row>
|
||||
<el-input v-model="locationIdQuery" style="width: 256px; margin-right: 10px;" placeholder="库位"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="goodsTypeQuery" style="width: 158px; margin-right: 10px;" placeholder="物料类型"
|
||||
:options="goodsTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
|
|
@ -33,6 +35,8 @@
|
|||
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px" />
|
||||
<el-table-column prop="locationStatus" label="状态" :formatter="locationStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="vehicleId" label="料箱" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsType" label="物料类型" fixed="left" :formatter="goodsTypeFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowLocation(scope.row)">编辑</el-button>
|
||||
|
|
@ -115,6 +119,12 @@
|
|||
<el-input v-model="locationFormEntity.vehicleId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料类型" prop="goodsType">
|
||||
<el-select-v2 v-model="locationFormEntity.goodsType" placeholder="选择物料类型"
|
||||
:options="goodsTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
|
@ -138,7 +148,7 @@ import { Search } from '@element-plus/icons-vue'
|
|||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { locationStatusFormatter, locationFormatter } from '@/utils/formatter.js'
|
||||
import { locationStatusFormatter, locationFormatter, jsonFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
|
|
@ -151,6 +161,7 @@ export default {
|
|||
pageSize: 10,
|
||||
total: 0,
|
||||
locationIdQuery: '',
|
||||
goodsTypeQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
locationId: '',
|
||||
|
|
@ -183,7 +194,21 @@ export default {
|
|||
value: 1,
|
||||
label: '占用'
|
||||
},
|
||||
]
|
||||
],
|
||||
goodsTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -195,7 +220,8 @@ export default {
|
|||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
locationId: this.locationIdQuery.trim()
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
}
|
||||
getLocations(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
|
|
@ -225,6 +251,13 @@ export default {
|
|||
return '锁定'
|
||||
}
|
||||
},
|
||||
goodsTypeFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == "间接物料") {
|
||||
return '间接物料'
|
||||
} else {
|
||||
return '直接物料'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.locationIdQuery = ''
|
||||
this.search()
|
||||
|
|
@ -241,7 +274,8 @@ export default {
|
|||
wDepth: row.wDepth,
|
||||
isLock: row.isLock,
|
||||
locationStatus: row.locationStatus,
|
||||
vehicleId: row.vehicleId
|
||||
vehicleId: row.vehicleId,
|
||||
goodsType: row.goodsType == "间接物料" ? "间接物料" : "直接物料",
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
|
@ -257,7 +291,8 @@ export default {
|
|||
wDepth: formData.wDepth,
|
||||
isLock: formData.isLock,
|
||||
locationStatus: formData.locationStatus,
|
||||
vehicleId: formData.vehicleId
|
||||
vehicleId: formData.vehicleId,
|
||||
goodsType: formData.goodsType == "间接物料" ? "间接物料" : "",
|
||||
}
|
||||
updateLocation(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
|
|
@ -278,6 +313,7 @@ export default {
|
|||
exportExcel() {
|
||||
const params = {
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
downloadLocationsExcel(params).then(res => {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
:suffix-icon="Search" />
|
||||
<el-input v-model="locationIdQuery" style="width: 196px; margin-right: 10px;" placeholder="库位"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="goodsTypeQuery" style="width: 158px; margin-right: 10px;" placeholder="物料类型"
|
||||
:options="goodsTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择上架日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" clearable />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
|
|
@ -42,6 +44,8 @@
|
|||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="物料号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsType" label="物料类型" :formatter="goodsTypeFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="totalNum" label="入库数量" min-width="120px" />
|
||||
|
|
@ -165,6 +169,12 @@
|
|||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料类型" prop="goodsType">
|
||||
<el-select-v2 v-model="stockFormEntity.goodsType" placeholder="选择物料类型"
|
||||
:options="goodsTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
|
@ -211,6 +221,7 @@ export default {
|
|||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
locationIdQuery: '',
|
||||
goodsTypeQuery: '',
|
||||
createTimeQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
|
|
@ -286,6 +297,20 @@ export default {
|
|||
}
|
||||
],
|
||||
goodsList: [],
|
||||
goodsTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -348,6 +373,13 @@ export default {
|
|||
return '长时间未使用'
|
||||
}
|
||||
},
|
||||
goodsTypeFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == "间接物料") {
|
||||
return '间接物料'
|
||||
} else {
|
||||
return '直接物料'
|
||||
}
|
||||
},
|
||||
stockStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
|
|
@ -394,6 +426,7 @@ export default {
|
|||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
@ -427,6 +460,7 @@ export default {
|
|||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
goodsType: this.goodsTypeQuery.trim(),
|
||||
createTime: timeFormatter(this.createTimeQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
@ -472,7 +506,8 @@ export default {
|
|||
goodsName: row.goodsName,
|
||||
goodsStatus: row.goodsStatus,
|
||||
remainNum: row.remainNum,
|
||||
totalNum: row.totalNum
|
||||
totalNum: row.totalNum,
|
||||
goodsType: row.goodsType == "间接物料" ? "间接物料" : "直接物料",
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
|
@ -485,7 +520,8 @@ export default {
|
|||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
userName: store.getters.getUserName,
|
||||
goodsType: this.stockFormEntity.goodsType,
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
||||
:options="isEmptyOptions" @change="search()"></el-select-v2>
|
||||
<el-select-v2 v-model="vehicleTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="物料类型" :options="vehicleTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
|
|
@ -30,7 +32,12 @@
|
|||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat" min-width="120px" />
|
||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="vehicleType" label="物料类型" fixed="left" :formatter="vehicleTypeFormat"
|
||||
min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="details" label="绑定关系" :formatter="jsonFormat" min-width="180px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
||||
|
|
@ -71,6 +78,21 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="物料类型" prop="vehicleType">
|
||||
<el-select-v2 v-model="vehicleFormEntity.vehicleType" placeholder="选择物料类型"
|
||||
:options="vehicleTypeOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="绑定关系" prop="details">
|
||||
<el-input type="textarea" :rows="2" v-model="vehicleFormEntity.details" placeholder=""
|
||||
:maxlength="-1" :show-word-limit="false" :autosize="{ minRows: 2, maxRows: 4 }">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
|
|
@ -92,7 +114,7 @@ import { errorBox } from '@/utils/myMessageBox.js'
|
|||
import { ElMessage } from 'element-plus'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter, jsonFormatter } from '@/utils/formatter.js'
|
||||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
||||
import { downloadVehicleExcel } from '@/api/excel.js'
|
||||
|
|
@ -114,6 +136,7 @@ export default {
|
|||
queryKey: '',
|
||||
locationQuery: '',
|
||||
isEmptyQuery: -99,
|
||||
vehicleTypeQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
|
|
@ -143,6 +166,20 @@ export default {
|
|||
label: '空箱'
|
||||
}
|
||||
],
|
||||
vehicleTypeOptions: [
|
||||
{
|
||||
value: "",
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: "直接物料",
|
||||
label: '直接物料'
|
||||
},
|
||||
{
|
||||
value: "间接物料",
|
||||
label: '间接物料'
|
||||
}
|
||||
],
|
||||
// 料箱状态
|
||||
vehicleStatusOptions: [
|
||||
{
|
||||
|
|
@ -177,6 +214,7 @@ export default {
|
|||
isAsc: this.isAsc,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
@ -208,6 +246,13 @@ export default {
|
|||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
vehicleTypeFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == "间接物料") {
|
||||
return '间接物料'
|
||||
} else {
|
||||
return '直接物料'
|
||||
}
|
||||
},
|
||||
isEmptyFormat: (row, column, cellValue, index) => {
|
||||
if (cellValue == 0) {
|
||||
return '带料'
|
||||
|
|
@ -216,6 +261,9 @@ export default {
|
|||
return '空箱'
|
||||
}
|
||||
},
|
||||
jsonFormat: (row, column, cellValue, index) => {
|
||||
return jsonFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.queryKey = ''
|
||||
this.locationQuery = ''
|
||||
|
|
@ -227,6 +275,8 @@ export default {
|
|||
currentLocation: row.currentLocation,
|
||||
isEmpty: row.isEmpty,
|
||||
vehicleStatus: row.vehicleStatus,
|
||||
vehicleType: row.vehicleType == "间接物料" ? "间接物料" : "直接物料",
|
||||
details: jsonFormatter(row.details),
|
||||
lastInTime: row.lastInTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
|
|
@ -237,6 +287,8 @@ export default {
|
|||
currentLocation: formData.currentLocation,
|
||||
isEmpty: formData.isEmpty,
|
||||
vehicleStatus: formData.vehicleStatus,
|
||||
vehicleType: formData.vehicleType,
|
||||
details: formData.details,
|
||||
lastInTime: formData.lastInTime,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
@ -263,6 +315,7 @@ export default {
|
|||
pageSize: this.pageSize,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
vehicleType: this.vehicleTypeQuery.trim(),
|
||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user