Browse Source

物料属性

master
han\hanst 3 months ago
parent
commit
3efa3d81ec
  1. 22
      src/api/factory/partAttribute.js
  2. 3
      src/api/warehouse/ifsInventoryInit.js
  3. 3
      src/api/warehouse/labelQuery.js
  4. 5
      src/views/main-navbar.vue
  5. 290
      src/views/modules/factory/partAttribute-add-or-update.vue
  6. 326
      src/views/modules/factory/partAttribute.vue
  7. 215
      src/views/modules/warehouse/ifsInventoryInit.vue
  8. 45
      src/views/modules/warehouse/labelQuery.vue

22
src/api/factory/partAttribute.js

@ -0,0 +1,22 @@
import { createAPI } from "@/utils/httpRequest.js";
// 分页查询料件属性列表
export const getPartAttributeList = data => createAPI('/factory/partAttribute/list', 'post', data)
// 根据站点和料号查询料件属性详情
export const getPartAttributeInfo = data => createAPI('/factory/partAttribute/info', 'get', data)
// 新增料件属性
export const savePartAttribute = data => createAPI('/factory/partAttribute/save', 'post', data)
// 修改料件属性
export const updatePartAttribute = data => createAPI('/factory/partAttribute/update', 'post', data)
// 删除料件属性
export const deletePartAttribute = data => createAPI('/factory/partAttribute/delete', 'post', data)
// 批量删除料件属性
export const batchDeletePartAttribute = data => createAPI('/factory/partAttribute/batchDelete', 'post', data)
// 验证料件属性数据
export const validatePartAttribute = data => createAPI('/factory/partAttribute/validate', 'post', data)

3
src/api/warehouse/ifsInventoryInit.js

@ -8,3 +8,6 @@ export const createHandlingUnits = data => createAPI(`ifsInventoryInit/createHan
// 打印标签
export const printLabel = data => createAPI('/label/setting/printLabel','post',data)
// 修改已打印数量
export const updatePrintQty = data => createAPI(`ifsInventoryInit/updatePrintQty`, 'POST', data)

3
src/api/warehouse/labelQuery.js

@ -5,3 +5,6 @@ export const getHandlingUnitLabelList = data => createAPI('/warehouse/labelQuery
// 重打标签
export const reprintLabel = data => createAPI('/warehouse/labelQuery/reprintLabel', 'POST', data)
// 删除标签
export const deleteLabel = data => createAPI('/warehouse/labelQuery/deleteLabel', 'POST', data)

5
src/views/main-navbar.vue

@ -29,6 +29,7 @@
@change="handleSiteChange"
placeholder="选择工厂"
class="factory-select"
popper-class="factory-select-dropdown"
size="small">
<el-option
v-for="item in siteList"
@ -531,8 +532,8 @@ export default {
}
}
//
.el-select-dropdown {
// - 使popper-class
.factory-select-dropdown {
.el-select-dropdown__item {
&:hover {
background-color: rgba(64, 158, 255, 0.1);

290
src/views/modules/factory/partAttribute-add-or-update.vue

@ -0,0 +1,290 @@
<template>
<el-dialog
:title="!originalPartNo ? '新增料件属性' : '修改料件属性'"
:close-on-click-modal="false"
:visible.sync="visible"
width="500px">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
<el-form-item label="工厂/站点" prop="site">
<el-input v-model="dataForm.site" placeholder="工厂/站点" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="料号" prop="partNo">
<el-input
v-model="dataForm.partNo"
placeholder="请输入料号"
:disabled="!!originalPartNo"
maxlength="100"
show-word-limit>
</el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="是否进立库" prop="isInWh">
<el-radio-group v-model="dataForm.isInWh">
<el-radio label="Y"></el-radio>
<el-radio label="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否机械手臂拣选" prop="isRobotPick">
<el-radio-group v-model="dataForm.isRobotPick">
<el-radio label="Y"></el-radio>
<el-radio label="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否常用" prop="isCommonlyUsed">
<el-radio-group v-model="dataForm.isCommonlyUsed">
<el-radio label="Y"></el-radio>
<el-radio label="N"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="重量(kg)" prop="weight">
<el-input
v-model="dataForm.weight"
placeholder="请输入重量"
:precision="3"
:min="0"
:max="999999"
style="width: 100%">
</el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="长度(mm)" prop="length">
<el-input
v-model="dataForm.length"
placeholder="请输入长度"
:precision="2"
:min="0"
:max="999999"
style="width: 100%">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="宽度(mm)" prop="width">
<el-input
v-model="dataForm.width"
placeholder="请输入宽度"
:precision="2"
:min="0"
:max="999999"
style="width: 100%">
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="高度(mm)" prop="height">
<el-input
v-model="dataForm.height"
placeholder="请输入高度"
:precision="2"
:min="0"
:max="999999"
style="width: 100%">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="直径(mm)" prop="diameter">
<el-input
v-model="dataForm.diameter"
placeholder="请输入直径"
:precision="2"
:min="0"
:max="999999"
style="width: 100%">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="submitLoading">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPartAttributeInfo, savePartAttribute, updatePartAttribute } from '@/api/factory/partAttribute'
export default {
data() {
return {
visible: false,
submitLoading: false,
originalPartNo: '', //
dataForm: {
site: '',
partNo: '',
isInWh: 'N',
isRobotPick: 'N',
isCommonlyUsed: 'N',
weight: null,
length: null,
width: null,
height: null,
diameter: null
},
dataRule: {
site: [
{ required: true, message: '工厂/站点不能为空', trigger: 'blur' },
{ max: 50, message: '工厂/站点长度不能超过50个字符', trigger: 'blur' }
],
partNo: [
{ required: true, message: '料号不能为空', trigger: 'blur' },
{ max: 100, message: '料号长度不能超过100个字符', trigger: 'blur' }
],
isInWh: [
{ required: true, message: '请选择是否进立库', trigger: 'change' }
],
isRobotPick: [
{ required: true, message: '请选择是否机械手臂拣选', trigger: 'change' }
],
isCommonlyUsed: [
{ required: true, message: '请选择是否常用', trigger: 'change' }
],
weight: [
{ type: 'number', min: 0, message: '重量不能为负数', trigger: 'blur' }
],
length: [
{ type: 'number', min: 0, message: '长度不能为负数', trigger: 'blur' }
],
width: [
{ type: 'number', min: 0, message: '宽度不能为负数', trigger: 'blur' }
],
height: [
{ type: 'number', min: 0, message: '高度不能为负数', trigger: 'blur' }
],
diameter: [
{ type: 'number', min: 0, message: '直径不能为负数', trigger: 'blur' }
]
}
}
},
methods: {
init(site, partNo) {
this.visible = true
this.originalPartNo = partNo || ''
//
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
//
this.dataForm.site = site || localStorage.getItem('site') || ''
this.dataForm.isInWh = 'N'
this.dataForm.isRobotPick = 'N'
this.dataForm.isCommonlyUsed = 'N'
if (site && partNo) {
//
this.getInfo(site, partNo)
}
})
},
//
getInfo(site, partNo) {
getPartAttributeInfo({ site, partNo }).then(({ data }) => {
if (data && data.code === 0 && data.data) {
const info = data.data
this.dataForm.site = info.site
this.dataForm.partNo = info.partNo
this.dataForm.isInWh = info.isInWh || 'N'
this.dataForm.isRobotPick = info.isRobotPick || 'N'
this.dataForm.isCommonlyUsed = info.isCommonlyUsed || 'N'
this.dataForm.weight = info.weight
this.dataForm.length = info.length
this.dataForm.width = info.width
this.dataForm.height = info.height
this.dataForm.diameter = info.diameter
} else {
this.$message.error(data.msg || '获取料件属性信息失败')
}
}).catch(() => {
this.$message.error('获取料件属性信息失败')
})
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.submitLoading = true
const submitData = { ...this.dataForm }
// null
if (submitData.weight === null || submitData.weight === '') {
delete submitData.weight
}
if (submitData.length === null || submitData.length === '') {
delete submitData.length
}
if (submitData.width === null || submitData.width === '') {
delete submitData.width
}
if (submitData.height === null || submitData.height === '') {
delete submitData.height
}
if (submitData.diameter === null || submitData.diameter === '') {
delete submitData.diameter
}
const apiCall = this.originalPartNo ? updatePartAttribute : savePartAttribute
apiCall(submitData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg || (this.originalPartNo ? '修改成功' : '新增成功'))
this.visible = false
this.$emit('refreshDataList')
} else {
this.$message.error(data.msg || (this.originalPartNo ? '修改失败' : '新增失败'))
}
this.submitLoading = false
}).catch(() => {
this.$message.error(this.originalPartNo ? '修改失败' : '新增失败')
this.submitLoading = false
})
}
})
}
}
}
</script>
<style scoped>
.el-form-item {
margin-bottom: 20px;
}
.dialog-footer {
text-align: right;
}
.el-input-number {
width: 100%;
}
</style>

326
src/views/modules/factory/partAttribute.vue

@ -0,0 +1,326 @@
<template>
<div class="mod-config">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" class="query-form">
<el-form-item label="料号">
<el-input
v-model="queryForm.partNo"
placeholder="请输入料号"
style="width: 160px;"
clearable>
</el-input>
</el-form-item>
<el-form-item label="是否进立库">
<el-select v-model="queryForm.isInWh" placeholder="请选择" style="width: 120px;" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否机械手臂拣选">
<el-select v-model="queryForm.isRobotPick" placeholder="请选择" style="width: 160px;" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否常用">
<el-select v-model="queryForm.isCommonlyUsed" placeholder="请选择" style="width: 120px;" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-top: 20px;">
<el-button @click="getDataList()" type="primary" icon="el-icon-search">查询</el-button>
<el-button @click="resetQuery()" type="default" icon="el-icon-refresh">重置</el-button>
<el-button
@click="addOrUpdateHandle()"
type="success"
icon="el-icon-plus">
新增
</el-button>
<el-button
@click="deleteHandle()"
type="danger"
icon="el-icon-delete"
:disabled="dataListSelections.length <= 0">
批量删除
</el-button>
</el-form-item>
</el-form>
<!-- 数据表格 -->
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%; margin-bottom: 15px;"
:height="tableHeight">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="site" label="工厂/站点" header-align="center" align="center" width="100"></el-table-column>
<el-table-column prop="partNo" label="料号" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="isInWh" label="是否进立库" header-align="center" align="center" width="120">
<template slot-scope="scope">
{{ scope.row.isInWh === 'Y' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="isRobotPick" label="是否机械手臂拣选" header-align="center" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.isRobotPick === 'Y' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="isCommonlyUsed" label="是否常用" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.isCommonlyUsed === 'Y' ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="weight" label="重量(kg)" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.weight || '-' }}
</template>
</el-table-column>
<el-table-column prop="length" label="长度(mm)" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.length || '-' }}
</template>
</el-table-column>
<el-table-column prop="width" label="宽度(mm)" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.width || '-' }}
</template>
</el-table-column>
<el-table-column prop="height" label="高度(mm)" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.height || '-' }}
</template>
</el-table-column>
<el-table-column prop="diameter" label="直径(mm)" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.diameter || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<a
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.site, scope.row.partNo)">
修改
</a>
<a
type="text"
size="small"
@click="deleteHandle(scope.row.site, scope.row.partNo)">
删除
</a>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import { getPartAttributeList, deletePartAttribute, batchDeletePartAttribute } from '@/api/factory/partAttribute'
import AddOrUpdate from './partAttribute-add-or-update'
export default {
data() {
return {
queryForm: {
partNo: '',
isInWh: '',
isRobotPick: '',
isCommonlyUsed: ''
},
dataList: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
tableHeight: 500
}
},
components: {
AddOrUpdate
},
activated() {
this.getDataList()
this.calculateTableHeight()
},
mounted() {
this.getDataList()
this.calculateTableHeight()
window.addEventListener('resize', this.calculateTableHeight)
},
beforeDestroy() {
window.removeEventListener('resize', this.calculateTableHeight)
},
methods: {
//
calculateTableHeight() {
this.$nextTick(() => {
const windowHeight = window.innerHeight
const otherHeight = 280 //
this.tableHeight = windowHeight - otherHeight
})
},
//
getDataList() {
this.dataListLoading = true
const params = {
page: this.pageIndex,
size: this.pageSize,
site: localStorage.getItem('site'),
...this.queryForm
}
getPartAttributeList(params).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list || []
this.totalPage = data.page.totalCount || 0
} else {
this.dataList = []
this.totalPage = 0
this.$message.error(data.msg || '查询失败')
}
this.dataListLoading = false
}).catch(() => {
this.dataList = []
this.totalPage = 0
this.dataListLoading = false
this.$message.error('查询失败')
})
},
//
resetQuery() {
this.queryForm = {
partNo: '',
isInWh: '',
isRobotPick: '',
isCommonlyUsed: ''
}
this.pageIndex = 1
this.getDataList()
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle(val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle(site, partNo) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(site, partNo)
})
},
//
deleteHandle(site, partNo) {
if (site && partNo) {
//
this.$confirm(`确定要删除料号为"${partNo}"的料件属性吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deletePartAttribute({ site, partNo }).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg || '删除成功')
this.getDataList()
} else {
this.$message.error(data.msg || '删除失败')
}
}).catch(() => {
this.$message.error('删除失败')
})
})
} else {
//
if (this.dataListSelections.length <= 0) {
this.$message.warning('请选择要删除的数据')
return
}
this.$confirm(`确定要删除选中的${this.dataListSelections.length}条料件属性吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const deleteList = this.dataListSelections.map(item => ({
site: item.site,
partNo: item.partNo
}))
batchDeletePartAttribute(deleteList).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg || '删除成功')
this.getDataList()
} else {
this.$message.error(data.msg || '删除失败')
}
}).catch(() => {
this.$message.error('删除失败')
})
})
}
}
}
}
</script>
<style scoped>
.query-form {
background: #f5f5f5;
padding: 15px;
border-radius: 4px;
margin-bottom: 15px;
}
.query-form .el-form-item {
margin-bottom: 10px;
}
</style>

215
src/views/modules/warehouse/ifsInventoryInit.vue

@ -101,14 +101,35 @@
align="center"
label="未打印数量">
</el-table-column>
<el-table-column
prop="manufactureDate"
header-align="center"
align="center"
label="生产日期"
min-width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.manufactureDate) }}
</template>
</el-table-column>
<el-table-column
prop="expiredDate"
header-align="center"
align="center"
label="失效日期"
min-width="120">
<template slot-scope="scope">
{{ formatDate(scope.row.expiredDate) }}
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
width="200"
label="操作">
<template slot-scope="scope">
<a type="text" @click="createHuHandle(scope.row)">创建HU</a>
<a type="text" @click="editPrintQtyHandle(scope.row)" style="color: #409EFF;">修改已打印数量</a>
</template>
</el-table-column>
</el-table>
@ -123,6 +144,75 @@
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 修改已打印数量弹窗 -->
<el-dialog
title="修改已打印数量"
:visible.sync="editPrintQtyVisible"
width="400px"
:close-on-click-modal="false">
<el-form :model="editPrintQtyForm" ref="editPrintQtyForm" :rules="editPrintQtyRules" class="edit-print-qty-form">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料编码" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.partNo" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次号" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.batchNo" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="库位" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.locationId" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="WDR" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.wdr" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="现有库存" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.qtyOnHand" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="当前已打印" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.currentPrintQty" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="未打印数量" class="form-item-vertical">
<el-input v-model="editPrintQtyForm.unPrintQty" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="已打印数量" prop="newPrintQty" class="form-item-vertical">
<el-input
v-model="editPrintQtyForm.newPrintQty"
:min="0"
:max="editPrintQtyForm.qtyOnHand"
:precision="0"
style="width: 100%"
placeholder="请输入已打印数量">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="editPrintQtyVisible = false">取消</el-button>
<el-button type="primary" @click="editPrintQtySubmit()" :loading="editPrintQtyLoading">确定修改</el-button>
</div>
</el-dialog>
<!-- 创建HU弹窗 -->
<el-dialog
title="创建HandlingUnit"
@ -211,7 +301,7 @@
</template>
<script>
import { getInventoryStockList, createHandlingUnits, printLabel } from '@/api/warehouse/ifsInventoryInit'
import { getInventoryStockList, createHandlingUnits, printLabel, updatePrintQty } from '@/api/warehouse/ifsInventoryInit'
export default {
data () {
@ -221,7 +311,7 @@ export default {
batchNo: '',
locationId: '',
descriptionLike: '',
minUnPrintQty: 0
minUnPrintQty: ''
},
dataList: [],
pageIndex: 1,
@ -230,6 +320,26 @@ export default {
height: 500,
dataListLoading: false,
dataListSelections: [],
editPrintQtyVisible: false,
editPrintQtyLoading: false,
editPrintQtyForm: {
site: '',
warehouseId: '',
partNo: '',
batchNo: '',
locationId: '',
wdr: '',
qtyOnHand: 0,
currentPrintQty: 0,
unPrintQty: 0,
newPrintQty: 0
},
editPrintQtyRules: {
newPrintQty: [
{ required: true, message: '新的已打印数量不能为空', trigger: 'blur' },
{ type: 'number', min: 0, message: '已打印数量不能小于0', trigger: 'blur' }
]
},
createHuVisible: false,
createHuLoading: false,
createHuForm: {
@ -303,6 +413,67 @@ export default {
selectionChangeHandle (val) {
this.dataListSelections = val
},
//
editPrintQtyHandle (row) {
this.editPrintQtyVisible = true
this.editPrintQtyForm = {
site: row.site,
warehouseId: row.warehouseId,
partNo: row.partNo,
batchNo: row.batchNo,
locationId: row.locationId,
wdr: row.wdr,
qtyOnHand: row.qtyOnHand,
currentPrintQty: row.printQty || 0,
unPrintQty: row.unPrintQty || 0,
newPrintQty: row.printQty || 0
}
this.$nextTick(() => {
this.$refs['editPrintQtyForm'].clearValidate()
})
},
//
editPrintQtySubmit () {
this.$refs['editPrintQtyForm'].validate((valid) => {
if (valid) {
//
if (this.editPrintQtyForm.newPrintQty > this.editPrintQtyForm.qtyOnHand) {
this.$message.error('已打印数量不能超过现有库存')
return
}
this.editPrintQtyLoading = true
const updateData = {
site: this.editPrintQtyForm.site,
warehouseId: this.editPrintQtyForm.warehouseId,
partNo: this.editPrintQtyForm.partNo,
batchNo: this.editPrintQtyForm.batchNo,
locationId: this.editPrintQtyForm.locationId,
wdr: this.editPrintQtyForm.wdr,
newPrintQty: this.editPrintQtyForm.newPrintQty
}
updatePrintQty(updateData).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '修改已打印数量成功',
type: 'success',
duration: 1500
})
this.editPrintQtyVisible = false
this.getDataList()
} else {
this.$message.error(data.msg || '修改已打印数量失败')
}
this.editPrintQtyLoading = false
}).catch(() => {
this.editPrintQtyLoading = false
})
}
})
},
// HU
createHuHandle (row) {
this.createHuVisible = true
@ -414,6 +585,23 @@ export default {
}
this.pageIndex = 1
this.getDataList()
},
//
formatDate(date) {
if (!date) return '--'
const d = new Date(date)
if (isNaN(d.getTime())) return '--'
// 1900-01-01--
if (d.getFullYear() === 1900 && d.getMonth() === 0 && d.getDate() === 1) {
return '--'
}
const year = d.getFullYear()
const month = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
}
}
@ -424,6 +612,27 @@ export default {
margin-bottom: 15px;
}
/* 修改已打印数量表单样式 */
.edit-print-qty-form .form-item-vertical {
margin-bottom: 20px;
}
.edit-print-qty-form .form-item-vertical .el-form-item__label {
display: block;
text-align: left;
padding: 0 0 8px 0;
line-height: 1.5;
font-weight: 500;
}
.edit-print-qty-form .form-item-vertical .el-form-item__content {
margin-left: 0 !important;
}
.edit-print-qty-form .el-row {
margin-bottom: 0;
}
/* 创建HU表单样式 */
.create-hu-form .form-item-vertical {
margin-bottom: 20px;

45
src/views/modules/warehouse/labelQuery.vue

@ -66,16 +66,20 @@
</template>
</el-table-column>
<el-table-column label="操作" min-width="100" fixed="right">
<el-table-column label="操作" min-width="150" fixed="right">
<template slot-scope="scope">
<a
@click="reprintLabel(scope.row)"
type="primary"
:loading="scope.row.printing">
重打标签
</a>
<a
@click="deleteLabel(scope.row)"
type="danger"
style="color: #f56c6c;">
删除
</a>
</template>
</el-table-column>
</el-table>
@ -94,7 +98,7 @@
</template>
<script>
import { getHandlingUnitLabelList, reprintLabel } from '@/api/warehouse/labelQuery'
import { getHandlingUnitLabelList, reprintLabel, deleteLabel } from '@/api/warehouse/labelQuery'
import { searchSysLanguagePackList, saveUserFavorite, searchUserFavorite } from '@/api/sysLanguage'
export default {
@ -203,7 +207,8 @@ export default {
userId: localStorage.getItem('userName'),
username: localStorage.getItem('userName'),
site: localStorage.getItem('site'),
unitId: row.unitId
unitId: row.unitId,
labelType:printLabelType
}
const { data } = await reprintLabel(printRequest)
@ -225,6 +230,36 @@ export default {
}
},
//
deleteLabel(row) {
this.$confirm(`确定要删除单元ID为 ${row.unitId} 的标签吗?此操作不可恢复!`, '删除确认', {
confirmButtonText: '确定删除',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
try {
this.dataListLoading = true
const { data } = await deleteLabel({
site: localStorage.getItem('site'),
unitId: row.unitId
})
if (data && data.code === 0) {
this.$message.success('删除成功')
//
this.getDataList()
} else {
this.$message.error(data.msg || '删除失败')
}
} catch (error) {
this.$message.error('删除失败:' + error.message)
} finally {
this.dataListLoading = false
}
}).catch(() => {
//
})
},
//
sizeChangeHandle(val) {
this.pageSize = val

Loading…
Cancel
Save