三楼抛光仓库配置

This commit is contained in:
2024-10-10 17:39:23 +08:00
parent c3bb7ee6f9
commit bedc4b4f07
14 changed files with 595 additions and 302 deletions

View File

@@ -0,0 +1,57 @@
import request from '@/utils/request'
/**
* 三楼抛光仓库分页查询
* @param {查询条件} data
*/
export function listWmPolishWarehouse(query) {
return request({
url: 'mes/wm/WmPolishWarehouse/list',
method: 'get',
params: query,
})
}
/**
* 新增三楼抛光仓库
* @param data
*/
export function addWmPolishWarehouse(data) {
return request({
url: 'mes/wm/WmPolishWarehouse',
method: 'post',
data: data,
})
}
/**
* 修改三楼抛光仓库
* @param data
*/
export function updateWmPolishWarehouse(data) {
return request({
url: 'mes/wm/WmPolishWarehouse',
method: 'PUT',
data: data,
})
}
/**
* 获取三楼抛光仓库详情
* @param {Id}
*/
export function getWmPolishWarehouse(id) {
return request({
url: 'mes/wm/WmPolishWarehouse/' + id,
method: 'get'
})
}
/**
* 删除三楼抛光仓库
* @param {主键} pid
*/
export function delWmPolishWarehouse(pid) {
return request({
url: 'mes/wm/WmPolishWarehouse/' + pid,
method: 'delete'
})
}

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div ref="chartRef" :class="className" :style="{ height: height, width: width }" />
</template>
@@ -103,4 +103,4 @@ onMounted(() => {
window.onresize = function () {
chart.resize();
};
</script>
</script -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div ref="chartRef" :class="className" :style="{ height: height, width: width }" />
</template>
@@ -86,4 +86,4 @@ onMounted(() => {
window.onresize = function () {
chart.resize();
};
</script>
</script -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div ref="chartRef" :class="className" :style="{ height: height, width: width }" />
</template>
@@ -94,4 +94,4 @@ onMounted(() => {
window.onresize = function () {
chart.resize();
};
</script>
</script -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div ref="chartRef" :class="className" :style="{ height: height, width: width }" />
</template>
@@ -78,4 +78,4 @@ onMounted(() => {
window.onresize = function () {
chart.resize();
};
</script>
</script -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div>
<vxe-table border show-overflow height="400" :row-config="{ isHover: true }" :data="tableData" :scroll-y="{ enabled: true }">
<vxe-column type="seq" width="100"></vxe-column>
@@ -27,4 +27,4 @@ setTimeout(() => {
}, 100);
</script>
<style></style>
<style></style -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div class="num-box">
<div class="main">
<span class="span">
@@ -70,4 +70,4 @@ const props = defineProps({
border-bottom-right-radius: 10px;
background-color: rgba(0, 97, 0, 0.6);
}
</style>
</style -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div class="num-box">
<div class="main">
<span class="span">
@@ -70,4 +70,4 @@ const props = defineProps({
border-bottom-right-radius: 10px;
background-color: rgba(0, 111, 255, 0.6);
}
</style>
</style -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div class="title">
<span class="span">
<slot></slot>
@@ -34,4 +34,4 @@ const props = defineProps({
font-weight: 600;
color: white;
}
</style>
</style -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div class="title">
<span class="span">
<slot></slot>
@@ -35,4 +35,4 @@ const props = defineProps({
font-weight: 600;
color: white;
}
</style>
</style -->>

View File

@@ -1,4 +1,4 @@
<template>
<!-- <template>
<div class="title">
<span class="span"><slot></slot></span>
</div>
@@ -32,4 +32,4 @@ const props = defineProps({
font-weight: 500;
color: white;
}
</style>
</style -->>

View File

@@ -1,98 +1,98 @@
/// ===================== 大屏宽高自定义(百度搜索结果) ============================
import {
getCurrentInstance,
onMounted,
onUnmounted,
ref,
watch
} from 'vue';
const {
proxy
} = getCurrentInstance()
const screenWidth = ref(null)
const screenHeight = ref(null)
onMounted(() => {
proxy.$nextTick(() => {
// 监控屏幕尺寸变化
var bodyStyle = document.createElement('style')
// 这里根据具体的设计稿尺寸来定
bodyStyle.innerHTML = `body{width:1920px; height:1080px!important;}`
document.documentElement.firstElementChild.appendChild(bodyStyle)
screenWidth.value = document.body.clientWidth
screenHeight.value = document.body.clientHeight
window.onresize = () => {
return (() => {
screenWidth.value = document.documentElement.clientWidth
screenHeight.value = document.documentElement.clientHeight
})()
}
document.addEventListener('keydown', (e) => {
if (e.code == 'F11') {
screenWidth.value = document.documentElement.clientWidth
screenHeight.value = document.documentElement.clientHeight
}
})
})
})
watch(
screenWidth,
(newValue, oldValue) => {
// console.log("val", val);
let docWidth = document.documentElement.clientWidth
let docHeight = document.documentElement.clientHeight
var designWidth = 1920, // 这里根据具体的设计稿尺寸来定
designHeight = 1080, // 这里根据具体的设计稿尺寸来定
widthRatio = docWidth / designWidth,
heightRatio = docHeight / designHeight
document.body.style =
`transform:scale(${widthRatio},${heightRatio});transform-origin:left top;overflow: hidden;`
// 应对浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
setTimeout(function() {
var lateWidth = document.documentElement.clientWidth,
lateHeight = document.documentElement.clientHeight
if (lateWidth === docWidth) return
// import {
// getCurrentInstance,
// onMounted,
// onUnmounted,
// ref,
// watch
// } from 'vue';
// const {
// proxy
// } = getCurrentInstance()
// const screenWidth = ref(null)
// const screenHeight = ref(null)
// onMounted(() => {
// proxy.$nextTick(() => {
// // 监控屏幕尺寸变化
// var bodyStyle = document.createElement('style')
// // 这里根据具体的设计稿尺寸来定
// bodyStyle.innerHTML = `body{width:1920px; height:1080px!important;}`
// document.documentElement.firstElementChild.appendChild(bodyStyle)
// screenWidth.value = document.body.clientWidth
// screenHeight.value = document.body.clientHeight
// window.onresize = () => {
// return (() => {
// screenWidth.value = document.documentElement.clientWidth
// screenHeight.value = document.documentElement.clientHeight
// })()
// }
// document.addEventListener('keydown', (e) => {
// if (e.code == 'F11') {
// screenWidth.value = document.documentElement.clientWidth
// screenHeight.value = document.documentElement.clientHeight
// }
// })
// })
// })
// watch(
// screenWidth,
// (newValue, oldValue) => {
// // console.log("val", val);
// let docWidth = document.documentElement.clientWidth
// let docHeight = document.documentElement.clientHeight
// var designWidth = 1920, // 这里根据具体的设计稿尺寸来定
// designHeight = 1080, // 这里根据具体的设计稿尺寸来定
// widthRatio = docWidth / designWidth,
// heightRatio = docHeight / designHeight
// document.body.style =
// `transform:scale(${widthRatio},${heightRatio});transform-origin:left top;overflow: hidden;`
// // 应对浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
// setTimeout(function() {
// var lateWidth = document.documentElement.clientWidth,
// lateHeight = document.documentElement.clientHeight
// if (lateWidth === docWidth) return
widthRatio = lateWidth / designWidth
heightRatio = lateHeight / designHeight
document.body.style = 'transform:scale(' + widthRatio + ',' + heightRatio +
');transform-origin:left top;overflow: hidden;'
}, 0)
}, {
immediate: true,
deep: true
}
)
watch(
screenHeight,
(newValue, oldValue) => {
// console.log("val", val);
let docWidth = document.documentElement.clientWidth
let docHeight = document.documentElement.clientHeight
var designWidth = 1920, // 这里根据具体的设计稿尺寸来定
designHeight = 1080, // 这里根据具体的设计稿尺寸来定
widthRatio = docWidth / designWidth,
heightRatio = docHeight / designHeight
document.body.style =
`transform:scale(${widthRatio},${heightRatio});transform-origin:left top;overflow: hidden;`
// 应对浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
setTimeout(function() {
var lateWidth = document.documentElement.clientWidth,
lateHeight = document.documentElement.clientHeight
if (lateWidth === docWidth) return
// widthRatio = lateWidth / designWidth
// heightRatio = lateHeight / designHeight
// document.body.style = 'transform:scale(' + widthRatio + ',' + heightRatio +
// ');transform-origin:left top;overflow: hidden;'
// }, 0)
// }, {
// immediate: true,
// deep: true
// }
// )
// watch(
// screenHeight,
// (newValue, oldValue) => {
// // console.log("val", val);
// let docWidth = document.documentElement.clientWidth
// let docHeight = document.documentElement.clientHeight
// var designWidth = 1920, // 这里根据具体的设计稿尺寸来定
// designHeight = 1080, // 这里根据具体的设计稿尺寸来定
// widthRatio = docWidth / designWidth,
// heightRatio = docHeight / designHeight
// document.body.style =
// `transform:scale(${widthRatio},${heightRatio});transform-origin:left top;overflow: hidden;`
// // 应对浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
// setTimeout(function() {
// var lateWidth = document.documentElement.clientWidth,
// lateHeight = document.documentElement.clientHeight
// if (lateWidth === docWidth) return
widthRatio = lateWidth / designWidth
heightRatio = lateHeight / designHeight
document.body.style = 'transform:scale(' + widthRatio + ',' + heightRatio +
');transform-origin:left top;overflow: hidden;'
}, 0)
}, {
immediate: true,
deep: true
}
)
window.addEventListener('resize', () => {
window.location.reload()
})
// widthRatio = lateWidth / designWidth
// heightRatio = lateHeight / designHeight
// document.body.style = 'transform:scale(' + widthRatio + ',' + heightRatio +
// ');transform-origin:left top;overflow: hidden;'
// }, 0)
// }, {
// immediate: true,
// deep: true
// }
// )
// window.addEventListener('resize', () => {
// window.location.reload()
// })
/// ================================================================
@@ -101,79 +101,79 @@ window.addEventListener('resize', () => {
/// ===================== AI智能优化自适应结果1.0 ===========================
import {
getCurrentInstance,
onMounted,
onUnmounted,
ref
} from 'vue';
const {
proxy
} = getCurrentInstance();
const screenWidth = ref(null);
const screenHeight = ref(null);
const resizeObserver = new ResizeObserver((entries) => {
if (entries.length > 0) {
const {
width,
height
} = entries[0].contentRect;
// 更新屏幕尺寸
screenWidth.value = width;
screenHeight.value = height;
// import {
// getCurrentInstance,
// onMounted,
// onUnmounted,
// ref
// } from 'vue';
// const {
// proxy
// } = getCurrentInstance();
// const screenWidth = ref(null);
// const screenHeight = ref(null);
// const resizeObserver = new ResizeObserver((entries) => {
// if (entries.length > 0) {
// const {
// width,
// height
// } = entries[0].contentRect;
// // 更新屏幕尺寸
// screenWidth.value = width;
// screenHeight.value = height;
// 调用debounce函数
updateStyleDebounced();
}
});
// debounce函数
const resizeTimeout = ref(null);
// // 调用debounce函数
// updateStyleDebounced();
// }
// });
// // debounce函数
// const resizeTimeout = ref(null);
function debounce(func, wait) {
return function() {
clearTimeout(resizeTimeout.value);
resizeTimeout.value = setTimeout(func, wait);
};
}
// 用于更新页面的transform样式
function updateStyle() {
const docWidth = document.documentElement.clientWidth;
const docHeight = document.documentElement.clientHeight;
const designWidth = 1920; // 设计稿宽度
const designHeight = 1080; // 设计稿高度
const widthRatio = docWidth / designWidth;
const heightRatio = docHeight / designHeight;
document.body.style.transform = `scale(${widthRatio},${heightRatio})`;
document.body.style.transformOrigin = 'left top';
document.body.style.overflow = 'hidden';
// 处理浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
setTimeout(function() {
const lateWidth = document.documentElement.clientWidth;
const lateHeight = document.documentElement.clientHeight;
if (lateWidth !== docWidth) {
const lateWidthRatio = lateWidth / designWidth;
const lateHeightRatio = lateHeight / designHeight;
document.body.style.transform = `scale(${lateWidthRatio},${lateHeightRatio})`;
}
}, 10);
}
const updateStyleDebounced = debounce(updateStyle, 150);
onMounted(() => {
proxy.$nextTick(() => {
// 监控屏幕尺寸变化
resizeObserver.observe(document.documentElement);
// function debounce(func, wait) {
// return function() {
// clearTimeout(resizeTimeout.value);
// resizeTimeout.value = setTimeout(func, wait);
// };
// }
// // 用于更新页面的transform样式
// function updateStyle() {
// const docWidth = document.documentElement.clientWidth;
// const docHeight = document.documentElement.clientHeight;
// const designWidth = 1920; // 设计稿宽度
// const designHeight = 1080; // 设计稿高度
// const widthRatio = docWidth / designWidth;
// const heightRatio = docHeight / designHeight;
// document.body.style.transform = `scale(${widthRatio},${heightRatio})`;
// document.body.style.transformOrigin = 'left top';
// document.body.style.overflow = 'hidden';
// // 处理浏览器全屏切换前后窗口因短暂滚动条问题出现未占满情况
// setTimeout(function() {
// const lateWidth = document.documentElement.clientWidth;
// const lateHeight = document.documentElement.clientHeight;
// if (lateWidth !== docWidth) {
// const lateWidthRatio = lateWidth / designWidth;
// const lateHeightRatio = lateHeight / designHeight;
// document.body.style.transform = `scale(${lateWidthRatio},${lateHeightRatio})`;
// }
// }, 10);
// }
// const updateStyleDebounced = debounce(updateStyle, 150);
// onMounted(() => {
// proxy.$nextTick(() => {
// // 监控屏幕尺寸变化
// resizeObserver.observe(document.documentElement);
// 初始化屏幕尺寸
screenWidth.value = document.documentElement.clientWidth;
screenHeight.value = document.documentElement.clientHeight;
});
});
onUnmounted(() => {
// 清除监听
resizeObserver.disconnect();
// 清除debounce函数中设置的timeout
clearTimeout(resizeTimeout.value);
// resizeObserver.unobserve(document.documentElement);
});
// // 初始化屏幕尺寸
// screenWidth.value = document.documentElement.clientWidth;
// screenHeight.value = document.documentElement.clientHeight;
// });
// });
// onUnmounted(() => {
// // 清除监听
// resizeObserver.disconnect();
// // 清除debounce函数中设置的timeout
// clearTimeout(resizeTimeout.value);
// // resizeObserver.unobserve(document.documentElement);
// });
/// ===============================================================

View File

@@ -0,0 +1,327 @@
<!--
* @Descripttion: (三楼抛光仓库/wm_polish_warehouse)
* @version: (1.0)
* @Author: (admin)
* @Date: (2024-10-10)
* @LastEditors: (admin)
* @LastEditTime: (2024-10-10)
-->
<template>
<div class="app-container">
<!-- :model属性用于表单验证使用 比如下面的el-form-item prop属性用于对表单值进行验证操作 -->
<el-form :model="queryParams" size="small" label-position="right" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch" @submit.native.prevent>
<el-form-item label="库位" prop="location">
<el-input v-model="queryParams.location" placeholder="请输入库位" />
</el-form-item>
<el-form-item label="库位描述" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入库位描述" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 工具区域 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['business:wmpolishwarehouse:add']" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" :disabled="single" v-hasPermi="['business:wmpolishwarehouse:edit']" plain icon="el-icon-edit" size="mini" @click="handleUpdate"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:wmpolishwarehouse:delete']" plain icon="el-icon-delete" size="mini" @click="handleDelete"
>删除</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 数据区域 -->
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row @sort-change="sortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="location" label="库位" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="remark" label="库位描述" align="center" :show-overflow-tooltip="false" />
<el-table-column prop="partCapacity" label="零件容量" align="center" />
<el-table-column prop="tankCapacity" label="箱容量" align="center" />
<el-table-column prop="buildCapacity" label="每幢箱容量" align="center" />
<el-table-column prop="boxPartNum" label="每箱产品数" align="center" />
<el-table-column prop="storePartList" label="存放产品描述" align="center" :show-overflow-tooltip="false" />
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button
size="mini"
v-hasPermi="['business:wmpolishwarehouse:edit']"
type="success"
icon="el-icon-edit"
title="编辑"
@click="handleUpdate(scope.row)"
></el-button>
<el-button
size="mini"
v-hasPermi="['business:wmpolishwarehouse:delete']"
type="danger"
icon="el-icon-delete"
title="删除"
@click="handleDelete(scope.row)"
></el-button>
</template>
</el-table-column>
</el-table>
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改三楼抛光仓库对话框 -->
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open">
<el-form ref="form" :model="form" :rules="rules" :label-width="formLabelWidth">
<el-row :gutter="20">
<el-col :lg="12">
<el-form-item label="库位" prop="location">
<el-input v-model="form.location" placeholder="请输入库位" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="库位描述" prop="remark">
<el-input v-model="form.remark" placeholder="请输入库位描述" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="零件容量" prop="partCapacity">
<el-input v-model="form.partCapacity" placeholder="请输入零件容量" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="箱容量" prop="tankCapacity">
<el-input v-model="form.tankCapacity" placeholder="请输入箱容量" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="每幢箱容量" prop="buildCapacity">
<el-input v-model="form.buildCapacity" placeholder="请输入每幢箱容量" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="每箱产品数" prop="boxPartNum">
<el-input v-model="form.boxPartNum" placeholder="请输入每箱产品数" />
</el-form-item>
</el-col>
<el-col :lg="24">
<el-form-item label="存放产品描述(逗号,分割)" prop="storePartList">
<el-input type="textarea" v-model="form.storePartList" placeholder="请输入存放产品描述" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWmPolishWarehouse, addWmPolishWarehouse, delWmPolishWarehouse, updateWmPolishWarehouse, getWmPolishWarehouse } from '@/api/wmsManagement/wmPolishWarehouse.js'
export default {
name: 'wmpolishwarehouse',
data() {
return {
labelWidth: '100px',
formLabelWidth: '100px',
// 选中id数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 遮罩层
loading: false,
// 显示搜索条件
showSearch: true,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
sort: undefined,
sortType: undefined,
},
// 弹出层标题
title: '',
// 操作类型 1、add 2、edit
opertype: 0,
// 是否显示弹出层
open: false,
// 表单参数
form: {},
columns: [
{ index: 0, key: 'id', label: `主键`, checked: true },
{ index: 1, key: 'location', label: `库位`, checked: true },
{ index: 2, key: 'partCapacity', label: `零件容量`, checked: true },
{ index: 3, key: 'tankCapacity', label: `箱容量`, checked: true },
{ index: 4, key: 'buildCapacity', label: `幢容量`, checked: true },
{ index: 5, key: 'boxPartNum', label: `一箱产品数`, checked: true },
{ index: 6, key: 'storePartList', label: `存放产品描述`, checked: true },
{ index: 7, key: 'createdBy', label: `创建人`, checked: true },
{ index: 8, key: 'createdTime', label: `创建时间`, checked: true },
{ index: 9, key: 'updatedBy', label: `更新人`, checked: false },
{ index: 10, key: 'updatedTime', label: `更新时间`, checked: false },
],
// 数据列表
dataList: [],
// 总记录数
total: 0,
// 提交按钮是否显示
btnSubmitVisible: true,
// 表单校验
rules: {
location: [{ required: true, message: '库位不能为空', trigger: 'blur' }],
},
}
},
created() {
// 列表数据查询
this.getList()
var dictParams = []
},
methods: {
// 查询数据
getList() {
this.loading = true
listWmPolishWarehouse(this.queryParams).then((res) => {
if (res.code == 200) {
this.dataList = res.data.result
this.total = res.data.totalNum
this.loading = false
}
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 重置数据表单
reset() {
this.form = {
id: undefined,
location: undefined,
partCapacity: undefined,
tankCapacity: undefined,
buildCapacity: 10,
boxPartNum: undefined,
storePartList: undefined,
createdBy: undefined,
createdTime: undefined,
updatedBy: undefined,
updatedTime: undefined,
}
this.resetForm('form')
},
// 重置查询操作
resetQuery() {
this.timeRange = []
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
// 自定义排序
sortChange(column) {
if (column.prop == null || column.order == null) {
this.queryParams.sort = undefined
this.queryParams.sortType = undefined
} else {
this.queryParams.sort = column.prop
this.queryParams.sortType = column.order
}
this.handleQuery()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加'
this.opertype = 1
},
/** 删除按钮操作 */
handleDelete(row) {
const Ids = row.id || this.ids
this.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
.then(function () {
return delWmPolishWarehouse(Ids)
})
.then(() => {
this.handleQuery()
this.msgSuccess('删除成功')
})
.catch(() => {})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getWmPolishWarehouse(id).then((res) => {
const { code, data } = res
if (code == 200) {
this.open = true
this.title = '修改数据'
this.opertype = 2
this.form = {
...data,
}
}
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs['form'].validate((valid) => {
if (valid) {
console.log(JSON.stringify(this.form))
if (this.form.id != undefined && this.opertype === 2) {
updateWmPolishWarehouse(this.form)
.then((res) => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
.catch((err) => {
//TODO 错误逻辑
})
} else {
addWmPolishWarehouse(this.form)
.then((res) => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
.catch((err) => {
//TODO 错误逻辑
})
}
}
})
},
},
}
</script>

View File

@@ -9,16 +9,7 @@
<template>
<div class="app-container">
<!-- :model属性用于表单验证使用 比如下面的el-form-item prop属性用于对表单值进行验证操作 -->
<el-form
:model="queryParams"
size="small"
label-position="right"
inline
ref="queryForm"
:label-width="labelWidth"
v-show="showSearch"
@submit.native.prevent
>
<el-form :model="queryParams" size="small" label-position="right" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch" @submit.native.prevent>
<el-form-item label="零件号" prop="partnumber">
<el-input v-model.trim="queryParams.partnumber" placeholder="请输入零件号" clearable />
</el-form-item>
@@ -27,12 +18,7 @@
</el-form-item>
<el-form-item label="类别" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类别" @change="handleQuery">
<el-option
v-for="item in typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="parseInt(item.dictValue)"
></el-option>
<el-option v-for="item in typeOptions" :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
<el-option label="全部" :value="0"></el-option>
</el-select>
</el-form-item>
@@ -58,46 +44,18 @@
<span style="font-size: 18px; font-weight: 600">抛光仓库零件数:{{ partTotal }}</span>
</div>
<!-- 数据区域 -->
<el-table
:data="dataList"
v-loading="loading"
ref="table"
border
highlight-current-row
@sort-change="sortChange"
@selection-change="handleSelectionChange"
>
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row @sort-change="sortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="id" label="主键" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('id')" />
<el-table-column prop="blankNum" label="毛坯号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('blankNum')" />
<el-table-column
min-width="200"
prop="partnumber"
label="零件号"
align="center"
:show-overflow-tooltip="true"
v-if="columns.showColumn('partnumber')"
>
<el-table-column min-width="200" prop="partnumber" label="零件号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('partnumber')">
<template slot-scope="scope">
<el-link type="primary" @click="handleShowInfo(scope.row)">{{ scope.row.partnumber }}</el-link>
</template>
</el-table-column>
<el-table-column
prop="description"
label="产品描述"
align="center"
min-width="300"
:show-overflow-tooltip="true"
v-if="columns.showColumn('description')"
/>
<el-table-column prop="description" label="产品描述" align="center" min-width="300" :show-overflow-tooltip="true" v-if="columns.showColumn('description')" />
<el-table-column prop="color" label="颜色" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('color')" />
<el-table-column
prop="specification"
label="规格"
align="center"
:show-overflow-tooltip="true"
v-if="columns.showColumn('specification')"
/>
<el-table-column prop="specification" label="规格" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('specification')" />
<el-table-column prop="quantity" label="库存数量" align="center" v-if="columns.showColumn('quantity')" />
<el-table-column prop="maxNum" label="最大库存" align="center" v-if="columns.showColumn('maxNum')" />
<el-table-column prop="minNum" label="最小库存" align="center" v-if="columns.showColumn('minNum')" />
@@ -110,22 +68,9 @@
</el-table-column>
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
<el-table-column
prop="createdTime"
label="创建时间"
align="center"
:show-overflow-tooltip="true"
v-if="columns.showColumn('createdTime')"
/>
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
<el-table-column
prop="updatedTime"
label="更新时间"
align="center"
min-width="160px"
:show-overflow-tooltip="true"
v-if="columns.showColumn('updatedTime')"
/>
<el-table-column prop="updatedTime" label="更新时间" align="center" min-width="160px" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
<el-table-column label="操作" align="center" fixed="right" width="200">
<template slot-scope="scope">
<el-button size="mini" type="info" @click="handleShowInfo(scope.row)">记录</el-button>
@@ -134,14 +79,7 @@
</template>
</el-table-column>
</el-table>
<pagination
class="mt10"
background
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 入库出库盘点 -->
<el-dialog :close-on-click-modal="false" :title="title" :lock-scroll="false" :visible.sync="open" @opened="dialogOpened">
@@ -174,28 +112,19 @@
</el-form-item>
<el-form-item v-if="opertype === 3" label="盘点数" prop="quantity">
<el-input-number v-model="form.quantity" :min="0" label="请输入盘点结果"></el-input-number>
<el-button style="margin-left: 5px" @click="handlarAddQuantity" icon="el-icon-plus" circle></el-button>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="零件类别" prop="type">
<el-select v-model="form.type" placeholder="请选择类别">
<el-option
v-for="item in typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="parseInt(item.dictValue)"
></el-option>
<el-option v-for="item in typeOptions" :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="操作时间" prop="actionTime">
<el-date-picker
v-model="form.actionTime"
type="datetime"
:clearable="false"
placeholder="选择日期时间"
></el-date-picker>
<el-date-picker v-model="form.actionTime" type="datetime" :clearable="false" placeholder="选择日期时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="24">
@@ -211,32 +140,13 @@
</div>
</el-dialog>
<!-- 操作记录 -->
<el-dialog
:close-on-click-modal="false"
:title="RecordTitle"
:lock-scroll="false"
:visible.sync="RecordOpen"
@opened="RecordOpened"
width="80%"
destroy-on-close
>
<el-dialog :close-on-click-modal="false" :title="RecordTitle" :lock-scroll="false" :visible.sync="RecordOpen" @opened="RecordOpened" width="80%" destroy-on-close>
<el-form :model="RecordQueryParams" size="small" label-position="right" inline ref="RecordQueryForm" @submit.native.prevent>
<el-form-item label="操作时间" prop="startActionTime">
<el-date-picker
v-model="RecordQueryParams.startActionTime"
type="datetime"
:clearable="true"
placeholder="开始时间"
></el-date-picker>
<el-date-picker v-model="RecordQueryParams.startActionTime" type="datetime" :clearable="true" placeholder="开始时间"></el-date-picker>
</el-form-item>
<el-form-item label="至" prop="endActionTime">
<el-date-picker
v-model="RecordQueryParams.endActionTime"
type="datetime"
:clearable="true"
placeholder="结束时间"
default-time="23:59:59"
></el-date-picker>
<el-date-picker v-model="RecordQueryParams.endActionTime" type="datetime" :clearable="true" placeholder="结束时间" default-time="23:59:59"></el-date-picker>
</el-form-item>
<el-form-item label="工单号" prop="remark">
<el-input v-model.trim="RecordQueryParams.remark" placeholder="请输入工单号" clearable />
@@ -244,12 +154,7 @@
<el-form-item label="类别" prop="changeType">
<el-select v-model="RecordQueryParams.changeType" placeholder="请选择类别" @change="getRecordList">
<el-option label="全部" :value="-1"></el-option>
<el-option
v-for="item in RecordTypeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="parseInt(item.dictValue)"
></el-option>
<el-option v-for="item in RecordTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@@ -273,14 +178,7 @@
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="createdTime" min-width="160" label="创建时间" align="center" :show-overflow-tooltip="true" />
</el-table>
<pagination
class="mt10"
background
:total="RecordTotal"
:page.sync="RecordQueryParams.pageNum"
:limit.sync="RecordQueryParams.pageSize"
@pagination="getRecordList"
/>
<pagination class="mt10" background :total="RecordTotal" :page.sync="RecordQueryParams.pageNum" :limit.sync="RecordQueryParams.pageSize" @pagination="getRecordList" />
</el-dialog>
</div>
</template>
@@ -548,6 +446,17 @@ export default {
this.form.type = row.type
this.form.quantity = row.quantity
},
// 盘点数据计算
handlarAddQuantity() {
this.$prompt('请输入变动数量', '盘点数变动', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
.then(({ value }) => {
this.form.quantity += value * 1
})
.catch(() => {})
},
PartNumberSelect(value) {
this.form.partnumber = value
},