提交
This commit is contained in:
326
src/views/information/construction/index.vue
Normal file
326
src/views/information/construction/index.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" >
|
||||
<el-form-item label="施工队名称" prop="teamName">
|
||||
<el-input
|
||||
v-model="queryParams.teamName"
|
||||
placeholder="请输入施工队名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:construction:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:construction:edit']"
|
||||
>修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:construction:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- v-hasPermi="['information:pcdedetail:import']" -->
|
||||
<el-button type="primary" plain icon="Upload" @click="handleImport" >导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:construction:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="constructionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="主键ID" align="center" prop="id" /> -->
|
||||
<el-table-column label="施工队名称" align="center" prop="teamName" />
|
||||
<!-- <el-table-column label="施工队编号" align="center" prop="teamCode" /> -->
|
||||
|
||||
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:construction:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:construction:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改施工队信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="constructionRef" :model="form" :rules="rules" >
|
||||
<el-form-item label="施工队名称" prop="teamName">
|
||||
<el-input v-model="form.teamName" placeholder="请输入施工队名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="施工队编号" prop="teamCode">
|
||||
<el-input v-model="form.teamCode" placeholder="请输入施工队编号" />
|
||||
</el-form-item> -->
|
||||
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Construction">
|
||||
import { listConstruction, getConstruction, delConstruction, addConstruction, updateConstruction } from "@/api/information/construction";
|
||||
import { getToken } from "@/utils/auth";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const constructionList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
teamName: null,
|
||||
teamCode: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null,
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
teamName: [
|
||||
{ required: true, message: "施工队名称不能为空", trigger: "blur" }
|
||||
],
|
||||
// teamCode: [
|
||||
// { required: true, message: "施工队编号不能为空", trigger: "blur" }
|
||||
// ],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询施工队信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listConstruction(queryParams.value).then(response => {
|
||||
constructionList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
teamName: null,
|
||||
// teamCode: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null,
|
||||
isDelete: null
|
||||
};
|
||||
proxy.resetForm("constructionRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加施工队信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getConstruction(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改施工队信息";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["constructionRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateConstruction(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addConstruction(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除施工队信息编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delConstruction(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
const upload = reactive({
|
||||
open: false,
|
||||
title: "",
|
||||
isUploading: false,
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/information/construction/importData"
|
||||
});
|
||||
|
||||
function handleImport() {
|
||||
upload.title = "施工队信息导入";
|
||||
upload.open = true;
|
||||
}
|
||||
|
||||
function handleFileUploadProgress(event, file, fileList) {
|
||||
upload.isUploading = true;
|
||||
}
|
||||
|
||||
function handleFileSuccess(response, file, fileList) {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert(`<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>${response.msg}</div>`, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
getList();
|
||||
}
|
||||
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/construction/export', {
|
||||
...queryParams.value
|
||||
}, `construction_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
336
src/views/information/delivery/index.vue
Normal file
336
src/views/information/delivery/index.vue
Normal file
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" label-width="68px">
|
||||
<el-row >
|
||||
<el-col :span="6">
|
||||
<el-form-item label="物料编号" prop="wlNo">
|
||||
<el-input
|
||||
v-model="queryParams.wlNo"
|
||||
placeholder="请输入物料编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" >
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['document:mtd:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['document:mtd:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['document:mtd:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['document:mtd:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Upload"
|
||||
@click="handleImport"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mtdList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物料编号" align="center" prop="wlNo" />
|
||||
<el-table-column label="物料描述" align="center" prop="wlMs" />
|
||||
<el-table-column label="计量单位" align="center" prop="dw" />
|
||||
<el-table-column label="单件重量(kg)" align="center" prop="weightKg" />
|
||||
<el-table-column label="单件体积(立方米)" align="center" prop="volumeM3" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['document:mtd:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['document:mtd:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物料字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="700px" append-to-body>
|
||||
<el-form ref="mtdRef" :model="form" :rules="rules" label-width="150px">
|
||||
<el-form-item label="物料编号" prop="wlNo">
|
||||
<el-input v-model="form.wlNo" placeholder="请输入物料编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述" prop="wlMs">
|
||||
<el-input v-model="form.wlMs" placeholder="请输入物料描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位" prop="dw">
|
||||
<el-input v-model="form.dw" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单件重量(kg)" prop="weightKg">
|
||||
<el-input v-model="form.weightKg" placeholder="请输入单件重量(kg)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单件体积(立方米)" prop="volumeM3">
|
||||
<el-input v-model="form.volumeM3" placeholder="请输入单件体积(立方米)" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog title="导入" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Mtd">
|
||||
import { listMtd, getMtd, delMtd, addMtd, updateMtd } from "@/api/information/deliery"
|
||||
import { getToken } from "@/utils/auth";
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const mtdList = ref([])
|
||||
const open = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const title = ref("")
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
wlNo: null,
|
||||
wlMs: null,
|
||||
dw: null,
|
||||
weightKg: null,
|
||||
volumeM3: null,
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
wlNo: [
|
||||
{ required: true, message: "物料编号不能为空", trigger: "blur" }
|
||||
],
|
||||
weightKg: [
|
||||
{ required: true, message: "单件重量不能为空", trigger: "blur" }
|
||||
],
|
||||
volumeM3: [
|
||||
{ required: true, message: "单件体积不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
//文件上传--供应计划导入
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/information/delivery/importData"
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
/** 查询物料字典列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMtd(queryParams.value).then(response => {
|
||||
mtdList.value = response.rows
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
wlNo: null,
|
||||
wlMs: null,
|
||||
dw: null,
|
||||
weightKg: null,
|
||||
volumeM3: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
isDelete: null
|
||||
}
|
||||
proxy.resetForm("mtdRef")
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = "添加物料字典"
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _id = row.id || ids.value
|
||||
getMtd(_id).then(response => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = "修改物料字典"
|
||||
})
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["mtdRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMtd(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMtd(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value
|
||||
proxy.$modal.confirm('是否确认删除物料字典编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delMtd(_ids)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('/information/delivery/export', {
|
||||
...queryParams.value
|
||||
}, `mtd_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
// 导入
|
||||
function handleImport(){
|
||||
upload.open = true;
|
||||
}
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
};
|
||||
getList()
|
||||
</script>
|
||||
411
src/views/information/device/index.vue
Normal file
411
src/views/information/device/index.vue
Normal file
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-header style="display: flex;align-items: center;justify-content: space-between;background-color: #9ebee5;">
|
||||
<div>当前设备信息</div>
|
||||
<el-button type="primary" plain @click="boundDevice">{{ deviceStatus ? '更换设备' : '绑定设备' }}</el-button>
|
||||
</el-header>
|
||||
|
||||
|
||||
<div style="display: flex;">
|
||||
<div style="width: 300px;display: flex;flex-direction: column;align-items: center;padding: 30px 0;">
|
||||
<el-avatar :size="100" :src="avatar" />
|
||||
</div>
|
||||
<div style="width: 300px;font-size: 18px;padding: 30px 0;">
|
||||
<div>
|
||||
设备IP:{{ deviceInfo.ipAddress || "暂无" }}
|
||||
</div>
|
||||
<div style="margin-top: 20px;">
|
||||
设备端口:{{ deviceInfo.port || "暂无" }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 300px;font-size: 18px;padding: 30px 0;">
|
||||
<div>
|
||||
所属仓库:{{ deviceInfo.warehouseName || "暂无" }}
|
||||
</div>
|
||||
<div style="margin-top: 20px;">
|
||||
所属场景:{{ deviceInfo.sceneName || "暂无" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" label-width="68px">
|
||||
<el-row :gutter="40">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设备IP" prop="ipAddress">
|
||||
<el-input
|
||||
v-model="queryParams.ipAddress"
|
||||
placeholder="请输入设备IP地址"
|
||||
clearable
|
||||
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设备端口" prop="port">
|
||||
<el-input
|
||||
v-model="queryParams.port"
|
||||
placeholder="请输入设备端口"
|
||||
clearable
|
||||
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属仓库" prop="warehouseCode">
|
||||
<el-cascader :options="warehouseData" v-model="queryParams.warehouseCode" :props="{children: 'children', label: 'warehouseName', value: 'warehouseCode'}" clearable />
|
||||
<!-- <el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable >
|
||||
<el-option v-for="dict in warehouseData" :key="dict.id" :label="dict.warehouseName" :value="dict.warehouseCode" />
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:device:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:device:edit']"
|
||||
>修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:device:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:device:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="设备ID" align="center" prop="deviceId" /> -->
|
||||
<el-table-column label="设备IP地址" align="center" prop="ipAddress" />
|
||||
<el-table-column label="设备端口" align="center" prop="port" />
|
||||
<el-table-column label="所属仓库" align="center" prop="warehouseId">
|
||||
<template #default="scope">
|
||||
{{ scope.row.parentWarehouseName + '-' + scope.row.warehouseName }}
|
||||
<!-- {{ warehouseData.filter(x=>x.warehouseCode==scope.row.warehouseId).length>0 ? warehouseData.filter(x=>x.warehouseCode==scope.row.warehouseId)[0].warehouseName:""}} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="场景" align="center" >
|
||||
<template #default="scope">
|
||||
{{ sceneData.filter(x=>x.sceneCode==scope.row.sceneId).length>0 ? sceneData.filter(x=>x.sceneCode==scope.row.sceneId)[0].sceneName : ""}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:device:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:device:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设备信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="deviceRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设备IP" prop="ipAddress">
|
||||
<el-input v-model="form.ipAddress" placeholder="请输入设备IP地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备端口" prop="port">
|
||||
<el-input v-model="form.port" placeholder="请输入设备端口" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库" prop="warehouseCode">
|
||||
<el-cascader :options="warehouseData" style="width: 100%;" v-model="form.warehouseCode" :props="{children: 'children', label: 'warehouseName', value: 'warehouseCode'}" />
|
||||
<!-- <el-select v-model="form.warehouseId" placeholder="请选择仓库" clearable >
|
||||
<el-option v-for="dict in warehouseData" :key="dict.id" :label="dict.warehouseName" :value="dict.warehouseCode" />
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="场景" prop="sceneId">
|
||||
<el-select v-model="form.sceneId" placeholder="请选择场景" clearable >
|
||||
<el-option v-for="dict in sceneData" :key="dict.id" :label="dict.sceneName" :value="dict.sceneCode" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Device">
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/information/device";
|
||||
import {warehouseDict, warehouseAll} from "@/api/information/warehouseinfo";
|
||||
import {listScene} from "@/api/information/scene";
|
||||
import avatar from "@/assets/images/avatar.jpg"
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
|
||||
const deviceObj = ref({
|
||||
deviceId: 0,
|
||||
ipAddress: 0,
|
||||
port: 0,
|
||||
warehouseCode: 0,
|
||||
});
|
||||
const deviceStatus = ref(false)
|
||||
// 获取缓存数据
|
||||
const deviceInfo = ref({})
|
||||
if (localStorage.getItem("deviceInfo")) {
|
||||
deviceStatus.value = true
|
||||
deviceInfo.value = JSON.parse(localStorage.getItem("deviceInfo"))
|
||||
} else {
|
||||
deviceStatus.value = false
|
||||
}
|
||||
// 选择设备
|
||||
const boundDevice = () => {
|
||||
if (ids.value.length > 1) {
|
||||
ElMessage({ message: '只能选择一个设备信息', type: 'error' })
|
||||
} else if (ids.value.length == 1) {
|
||||
let obj = JSON.parse(JSON.stringify(deviceObj.value))
|
||||
deviceInfo.value = JSON.parse(JSON.stringify(obj))
|
||||
localStorage.setItem("deviceInfo", JSON.stringify(obj))
|
||||
deviceStatus.value = true
|
||||
} else {
|
||||
ElMessage({ message: '请选择一个设备信息', type: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
const deviceList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const warehouseData = ref([]) //仓库下拉列表
|
||||
const sceneData = ref([]) //场景下拉列表
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ipAddress: null,
|
||||
port: null,
|
||||
warehouseCode: [],
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
ipAddress: [
|
||||
{ required: true, message: "设备IP不能为空", trigger: "blur" }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: "设备端口不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseCode: [
|
||||
{ required: true, message: "所属仓库不能为空", trigger: "blur" }
|
||||
],
|
||||
sceneId:[
|
||||
{ required: true, message: "场景不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设备信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDevice(queryParams.value).then(response => {
|
||||
deviceList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//所属仓库
|
||||
function warehouseFun(){
|
||||
//所属仓库下拉数据
|
||||
warehouseAll().then(response=>{
|
||||
warehouseData.value = response.data
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
deviceId: null,
|
||||
ipAddress: null,
|
||||
port: null,
|
||||
warehouseCode: null,
|
||||
parentWarehouseCode: null,
|
||||
sceneId: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
isDelete: null
|
||||
};
|
||||
proxy.resetForm("deviceRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
if (queryParams.value.warehouseCode.length == 0) {
|
||||
queryParams.value.parentWarehouseCode = null
|
||||
queryParams.value.warehouseCode = null
|
||||
} else {
|
||||
queryParams.value.parentWarehouseCode = queryParams.value.warehouseCode[0]
|
||||
queryParams.value.warehouseCode = queryParams.value.warehouseCode[1]
|
||||
}
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
queryParams.value.warehouseCode = []
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.deviceId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
deviceObj.value = JSON.parse(JSON.stringify(selection[0]))
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加设备信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _deviceId = row.deviceId || ids.value
|
||||
getDevice(_deviceId).then(response => {
|
||||
form.value = response.data;
|
||||
form.value.warehouseCode = [form.value.parentWarehouseCode, form.value.warehouseCode]
|
||||
open.value = true;
|
||||
title.value = "修改设备信息";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["deviceRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.warehouseCode.length) {
|
||||
form.value.parentWarehouseCode = form.value.warehouseCode[0]
|
||||
form.value.warehouseCode = form.value.warehouseCode[1]
|
||||
} else {
|
||||
form.value.parentWarehouseCode = null
|
||||
form.value.warehouseCode = null
|
||||
}
|
||||
if (form.value.deviceId != null) {
|
||||
updateDevice(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDevice(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _deviceIds = row.deviceId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除?').then(function() {
|
||||
return delDevice(_deviceIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/device/export', {
|
||||
...queryParams.value
|
||||
}, `device_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
//获取仓库下拉列表
|
||||
function warehouseList(){
|
||||
warehouseDict().then(response=>{
|
||||
warehouseData.value = response.data
|
||||
})
|
||||
}
|
||||
//场景下拉列表
|
||||
function sceneList(){
|
||||
let params = {pageNum:1,pageSize:50}
|
||||
listScene(params).then(response=>{
|
||||
sceneData.value = response.rows
|
||||
})
|
||||
}
|
||||
|
||||
getList();
|
||||
// warehouseList(); //库房
|
||||
sceneList(); //场景
|
||||
warehouseFun();
|
||||
</script>
|
||||
283
src/views/information/materialtype/index.vue
Normal file
283
src/views/information/materialtype/index.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="物资类型编码" prop="typeCode">
|
||||
<el-input
|
||||
v-model="queryParams.typeCode"
|
||||
placeholder="请输入物资类型编码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物资类型名称" prop="typeName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入物资类型名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:materialtype:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:materialtype:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:materialtype:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:materialtype:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="materialtypeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物资类型编码" align="center" prop="typeCode" />
|
||||
<el-table-column label="物资类型名称" align="center" prop="typeName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:materialtype:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:materialtype:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物资类型对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="materialtypeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="物资类型编码" prop="typeCode">
|
||||
<el-input v-model="form.typeCode" placeholder="请输入物资类型编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物资类型名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入物资类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序值" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Materialtype">
|
||||
import { listMaterialtype, getMaterialtype, delMaterialtype, addMaterialtype, updateMaterialtype } from "@/api/information/materialtype";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const materialtypeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeCode: null,
|
||||
typeName: null,
|
||||
status: null,
|
||||
sort: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
},
|
||||
rules: {
|
||||
typeCode: [
|
||||
{ required: true, message: "物资类型编码不能为空", trigger: "blur" }
|
||||
],
|
||||
typeName: [
|
||||
{ required: true, message: "物资类型名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询物资类型列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listMaterialtype(queryParams.value).then(response => {
|
||||
materialtypeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
typeCode: null,
|
||||
typeName: null,
|
||||
status: null,
|
||||
sort: null,
|
||||
remark: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
};
|
||||
proxy.resetForm("materialtypeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加物资类型";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getMaterialtype(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改物资类型";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["materialtypeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMaterialtype(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addMaterialtype(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除物资类型编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delMaterialtype(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/materialtype/export', {
|
||||
...queryParams.value
|
||||
}, `materialtype_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
405
src/views/information/mtd/index.vue
Normal file
405
src/views/information/mtd/index.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="物料号" prop="mid">
|
||||
<el-input
|
||||
v-model="queryParams.mid"
|
||||
placeholder="请输入物料号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述" prop="desMat">
|
||||
<el-input
|
||||
v-model="queryParams.desMat"
|
||||
placeholder="请输入物料描述"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料组" prop="grp">
|
||||
<el-input
|
||||
v-model="queryParams.grp"
|
||||
placeholder="请输入物料组"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unt">
|
||||
<el-input
|
||||
v-model="queryParams.unt"
|
||||
placeholder="请输入单位"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大类" prop="btpe">
|
||||
<el-input
|
||||
v-model="queryParams.btpe"
|
||||
placeholder="请输入大类"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中类" prop="mtpe">
|
||||
<el-input
|
||||
v-model="queryParams.mtpe"
|
||||
placeholder="请输入中类"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小类" prop="stpe">
|
||||
<el-input
|
||||
v-model="queryParams.stpe"
|
||||
placeholder="请输入小类"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:mtd:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:mtd:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:mtd:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleImport"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:mtd:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Refresh"
|
||||
@click="handleRenew"
|
||||
>更新字典(从供应计划更新)</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mtdList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物料号" align="center" prop="mid" />
|
||||
<el-table-column label="物料描述" align="center" prop="desMat" width="465" />
|
||||
<el-table-column label="物料组" align="center" prop="grp" />
|
||||
<el-table-column label="单位" align="center" prop="unt" />
|
||||
<el-table-column label="单价" align="center" prop="uprc" />
|
||||
<el-table-column label="大类" align="center" prop="btpe" />
|
||||
<el-table-column label="中类" align="center" prop="mtpe" />
|
||||
<el-table-column label="小类" align="center" prop="stpe" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:mtd:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:mtd:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物料字典对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="mtdRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="物料号" prop="mid">
|
||||
<el-input v-model="form.mid" placeholder="请输入物料号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述" prop="desMat">
|
||||
<el-input v-model="form.desMat" placeholder="请输入物料描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料组" prop="grp">
|
||||
<el-input v-model="form.grp" placeholder="请输入物料组" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unt">
|
||||
<el-input v-model="form.unt" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单价" prop="uprc">
|
||||
<el-input v-model="form.uprc" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大类" prop="btpe">
|
||||
<el-input v-model="form.btpe" placeholder="请输入大类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="中类" prop="mtpe">
|
||||
<el-input v-model="form.mtpe" placeholder="请输入中类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小类" prop="stpe">
|
||||
<el-input v-model="form.stpe" placeholder="请输入小类" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Mtd">
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { listMtd, getMtd, delMtd, addMtd, updateMtd,mtdRenew } from "@/api/information/mtd";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const mtdList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
mid: null,
|
||||
desMat: null,
|
||||
grp: null,
|
||||
unt: null,
|
||||
uprc: null,
|
||||
btpe: null,
|
||||
mtpe: null,
|
||||
stpe: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
//文件上传--供应计划导入
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/information/mtd/importData"
|
||||
});
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 查询物料字典列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listMtd(queryParams.value).then(response => {
|
||||
mtdList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
mid: null,
|
||||
desMat: null,
|
||||
grp: null,
|
||||
unt: null,
|
||||
uprc: null,
|
||||
btpe: null,
|
||||
mtpe: null,
|
||||
stpe: null
|
||||
};
|
||||
proxy.resetForm("mtdRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加物料字典";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _Id = row.id || ids.value
|
||||
getMtd(_Id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改物料字典";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["mtdRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMtd(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addMtd(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _Ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除物料字典编号为"' + _Ids + '"的数据项?').then(function() {
|
||||
return delMtd(_Ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/mtd/export', {
|
||||
...queryParams.value
|
||||
}, `mtd_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
//导入
|
||||
function handleImport(){
|
||||
upload.title = "物料字典导入";
|
||||
upload.open = true;
|
||||
}
|
||||
/** 提交上传文件 */
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
};
|
||||
//从供应计划更新物料字典
|
||||
function handleRenew(){
|
||||
loading.value = true;
|
||||
mtdRenew().then(response=>{
|
||||
// console.log(response)
|
||||
proxy.$modal.msgSuccess(response.msg);
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
260
src/views/information/outtype/index.vue
Normal file
260
src/views/information/outtype/index.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" >
|
||||
<el-form-item label="出库类型名称" prop="typeName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入出库类型名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:outtype:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:outtype:edit']"
|
||||
>修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:outtype:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:outtype:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="outtypeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
|
||||
<el-table-column label="出库类型名称" align="center" prop="typeName" />
|
||||
<el-table-column label="出库类型编号" align="center" prop="typeCode" />
|
||||
|
||||
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:outtype:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:outtype:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改出库类型对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="outtypeRef" :model="form" :rules="rules" >
|
||||
<el-form-item label="出库类型名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入出库类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类型编号" prop="typeCode">
|
||||
<el-input v-model="form.typeCode" placeholder="请输入出库类型编号" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Outtype">
|
||||
import { listOuttype, getOuttype, delOuttype, addOuttype, updateOuttype } from "@/api/information/outtype";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const outtypeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeName: null,
|
||||
typeCode: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null,
|
||||
isDelete: null
|
||||
},
|
||||
rules: {
|
||||
typeName: [
|
||||
{ required: true, message: "出库类型名称不能为空", trigger: "blur" }
|
||||
],
|
||||
typeCode: [
|
||||
{ required: true, message: "出库类型编号不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询出库类型列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listOuttype(queryParams.value).then(response => {
|
||||
outtypeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
typeName: null,
|
||||
typeCode: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null,
|
||||
isDelete: null
|
||||
};
|
||||
proxy.resetForm("outtypeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加出库类型";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getOuttype(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改出库类型";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["outtypeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateOuttype(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addOuttype(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除出库类型编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delOuttype(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/outtype/export', {
|
||||
...queryParams.value
|
||||
}, `outtype_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
398
src/views/information/pcdedetail/index.vue
Normal file
398
src/views/information/pcdedetail/index.vue
Normal file
@@ -0,0 +1,398 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<!-- 搜索项 -->
|
||||
<el-form-item label="库位编号" prop="pcode">
|
||||
<el-input v-model="queryParams.pcode" placeholder="请输入库位编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属场景" prop="scene">
|
||||
<el-select v-model="queryParams.scene" placeholder="请选择所属场景" style="width: 200px" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in sceneOptions"
|
||||
:key="item.id"
|
||||
:label="item.sceneName"
|
||||
:value="item.sceneCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属大库" prop="parentWarehouseCode">
|
||||
<!-- <el-input v-model="queryParams.warehouseName" placeholder="请输入所属仓库" clearable @keyup.enter="handleQuery" /> -->
|
||||
<el-select v-model="queryParams.parentWarehouseCode" placeholder="请选择所属大库" style="width: 200px" clearable filterable @change="selectBigWarehouse" @clear="clearFun">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseCode"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属小库" prop="warehouseCode">
|
||||
<el-select v-model="queryParams.warehouseCode" placeholder="请选择所属小库" style="width: 200px" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in warehouseList"
|
||||
:key="item.warehouseCode"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="queryParams.warehouseName" placeholder="请输入所属仓库" clearable @keyup.enter="handleQuery" /> -->
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="编码后ID" prop="encodedId">
|
||||
<el-input v-model="queryParams.encodedId" placeholder="请输入编码后ID" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['information:pcdedetail:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['information:pcdedetail:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['information:pcdedetail:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- v-hasPermi="['information:pcdedetail:import']" -->
|
||||
<el-button type="primary" plain icon="Upload" @click="handleImport" >导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['information:pcdedetail:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pcdedetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="主键ID" align="center" prop="id" />-->
|
||||
<el-table-column label="库位编号" align="center" prop="pcode" />
|
||||
<!-- <el-table-column label="所属场景" align="center" prop="scene" />-->
|
||||
<el-table-column label="所属场景" align="center" prop="sceneName" />
|
||||
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" />
|
||||
<el-table-column label="所属小库" align="center" prop="warehouseName" />
|
||||
<el-table-column label="编码后ID" align="center" width="200" prop="encodedId" />
|
||||
<el-table-column label="标签" align="center" prop="tag" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="修改时间" align="center" prop="updatedAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:pcdedetail:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:pcdedetail:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="pcdedetailRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="库位编号" prop="pcode">
|
||||
<el-input v-model="form.pcode" placeholder="请输入库位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库" prop="warehouse">
|
||||
<!-- <el-select v-model="form.warehouse" placeholder="请选择所属仓库" clearable filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.id"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select> -->
|
||||
<el-cascader :options="warehouseOptions" style="width: 100%;" @change="warehouseChange" v-model="form.warehouse" :props="{children: 'children', label: 'warehouseName', value: 'warehouseCode'}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属场景" prop="scene">
|
||||
<el-select v-model="form.scene" placeholder="请选择所属场景" clearable filterable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in sceneOptions"
|
||||
:key="item.id"
|
||||
:label="item.sceneName"
|
||||
:value="item.sceneCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tag">
|
||||
<el-input v-model="form.tag" placeholder="请输入标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Pcdedetail">
|
||||
import {
|
||||
listPcdedetail,
|
||||
getPcdedetail,
|
||||
delPcdedetail,
|
||||
addPcdedetail,
|
||||
updatePcdedetail,
|
||||
getAllScenes
|
||||
} from "@/api/information/pcdedetail";
|
||||
import { warehouseDict, warehouseAll,listWarehouseinfo } from "@/api/information/warehouseinfo";
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const pcdedetailList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const sceneOptions = ref([]);
|
||||
const warehouseOptions = ref([]);
|
||||
const warehouseList = ref([]);
|
||||
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pcode: null,
|
||||
scene: null,
|
||||
warehouseName: null,
|
||||
encodedId: null,
|
||||
tag: null,
|
||||
remark: null,
|
||||
isDelete: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null,
|
||||
warehouseCode: null, //小库
|
||||
parentWarehouseCode: null //大仓
|
||||
},
|
||||
rules: {
|
||||
pcode: [{ required: true, message: "库位编号不能为空", trigger: "blur" }],
|
||||
scene: [{ required: true, message: "所属场景不能为空", trigger: "blur" }],
|
||||
warehouse: [{ required: true, message: "所属仓库不能为空", trigger: "blur" }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const upload = reactive({
|
||||
open: false,
|
||||
title: "",
|
||||
isUploading: false,
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/information/pcdedetail/importData"
|
||||
});
|
||||
|
||||
function handleImport() {
|
||||
upload.title = "库位明细导入";
|
||||
upload.open = true;
|
||||
}
|
||||
|
||||
function handleFileUploadProgress(event, file, fileList) {
|
||||
upload.isUploading = true;
|
||||
}
|
||||
|
||||
function handleFileSuccess(response, file, fileList) {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
proxy.$refs["uploadRef"].handleRemove(file);
|
||||
proxy.$alert(`<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>${response.msg}</div>`, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
getList();
|
||||
}
|
||||
|
||||
function submitFileForm() {
|
||||
proxy.$refs["uploadRef"].submit();
|
||||
}
|
||||
|
||||
//级联选择器改变事件
|
||||
function warehouseChange(val) {
|
||||
warehouseOptions.value.forEach(item => {
|
||||
if (item.warehouseCode === val[0]) {
|
||||
form.value.parentWarehouseName = item.warehouseName;
|
||||
}
|
||||
item.children.forEach(child => {
|
||||
if (child.warehouseCode === val[1]) {
|
||||
form.value.warehouseName = child.warehouseName;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function selectBigWarehouse(val){
|
||||
warehouseOptions.value.filter(item => {
|
||||
if (item.warehouseCode === val) {
|
||||
warehouseList.value = item.children;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function clearFun(){
|
||||
warehouseList.value = [];
|
||||
queryParams.parentWarehouseCode = null
|
||||
queryParams.value.warehouseCode = null
|
||||
// queryParams.value.warehouseName = null
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
//获取列表数据
|
||||
listPcdedetail(queryParams.value).then(response => {
|
||||
pcdedetailList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
//获取所属场景下拉数据
|
||||
getAllScenes().then(res => {
|
||||
sceneOptions.value = res.data || [];
|
||||
});
|
||||
//获取所属仓库下拉数据
|
||||
warehouseAll().then(res => {
|
||||
warehouseOptions.value = res.data || [];
|
||||
});
|
||||
// listWarehouseinfo({pageNum:1,pageSize:20}).then(res => {
|
||||
// warehouseList.value = res.rows || [];
|
||||
// })
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
pcode: null,
|
||||
scene: null,
|
||||
warehouse: [],
|
||||
encodedId: null,
|
||||
tag: null,
|
||||
remark: null,
|
||||
isDelete: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null
|
||||
};
|
||||
proxy.resetForm("pcdedetailRef");
|
||||
}
|
||||
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加库位明细";
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value;
|
||||
getPcdedetail(_id).then(response => {
|
||||
form.value = response.data;
|
||||
form.value.warehouse = [form.value.parentWarehouseCode, form.value.warehouseCode]
|
||||
open.value = true;
|
||||
title.value = "修改库位明细";
|
||||
});
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["pcdedetailRef"].validate(valid => {
|
||||
if (valid) {
|
||||
let obj = JSON.parse(JSON.stringify(form.value));
|
||||
obj.parentWarehouseCode = obj.warehouse[0]
|
||||
obj.warehouseCode = obj.warehouse[1]
|
||||
if (form.value.id != null) {
|
||||
updatePcdedetail(obj).then(() => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addPcdedetail(obj).then(() => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm(`是否确认删除库位明细编号为"${_ids}"的数据项?`).then(() => delPcdedetail(_ids)).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download("information/pcdedetail/export", { ...queryParams.value }, `pcdedetail_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
|
||||
</script>
|
||||
326
src/views/information/print/index.vue
Normal file
326
src/views/information/print/index.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<!-- 搜索项 -->
|
||||
<el-form-item label="库位编号" prop="pcode">
|
||||
<el-input v-model="queryParams.pcode" placeholder="请输入库位编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属场景" prop="scene">
|
||||
<el-select v-model="queryParams.scene" placeholder="请选择所属场景" style="width: 200px" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in sceneOptions"
|
||||
:key="item.id"
|
||||
:label="item.sceneName"
|
||||
:value="item.sceneCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属大库" prop="parentWarehouseCode">
|
||||
<el-select v-model="queryParams.parentWarehouseCode" placeholder="请选择所属大库" style="width: 200px" clearable filterable @change="selectBigWarehouse" @clear="clearFun">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseCode"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属小库" prop="warehouseCode">
|
||||
<el-select v-model="queryParams.warehouseCode" placeholder="请选择所属小库" style="width: 200px" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in warehouseList"
|
||||
:key="item.warehouseCode"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleBatchPrint" :disabled="multiple">批量打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" @click="handleHandPrint" >手动打印</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pcdedetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="库位编号" align="center" prop="pcode" />
|
||||
<el-table-column label="所属场景" align="center" prop="sceneName" />
|
||||
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" />
|
||||
<el-table-column label="所属小库" align="center" prop="warehouseName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleOnePrint(scope.row)" >打印</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="pcdedetailRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="库位编号" prop="pcode">
|
||||
<el-input v-model="form.pcode" placeholder="请输入库位编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属仓库" prop="warehouse">
|
||||
<el-select v-model="form.warehouse" placeholder="请选择所属仓库" clearable filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.id"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属场景" prop="scene">
|
||||
<el-select v-model="form.scene" placeholder="请选择所属场景" clearable filterable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in sceneOptions"
|
||||
:key="item.id"
|
||||
:label="item.sceneName"
|
||||
:value="item.sceneCode"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tag">
|
||||
<el-input v-model="form.tag" placeholder="请输入标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="print">
|
||||
import {listPcdedetail,getAllScenes} from "@/api/information/pcdedetail";
|
||||
import {printFun} from "@/api/information/print";
|
||||
import { warehouseDict, warehouseAll} from "@/api/information/warehouseinfo";
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { isEmpty } from "element-plus/es/utils/types.mjs";
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const pcdedetailList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const sceneOptions = ref([]);
|
||||
const warehouseOptions = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pcode: null,
|
||||
scene: null,
|
||||
warehouseName: null,
|
||||
encodedId: null,
|
||||
tag: null,
|
||||
remark: null,
|
||||
isDelete: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form } = toRefs(data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const warehouseList = ref([]);
|
||||
|
||||
function selectBigWarehouse(val){
|
||||
warehouseOptions.value.filter(item => {
|
||||
if (item.warehouseCode === val) {
|
||||
warehouseList.value = item.children;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
//获取列表数据
|
||||
listPcdedetail(queryParams.value).then(response => {
|
||||
pcdedetailList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
//获取所属场景下拉数据
|
||||
getAllScenes().then(res => {
|
||||
sceneOptions.value = res.data || [];
|
||||
});
|
||||
//获取所属仓库下拉数据
|
||||
// warehouseDict().then(res => {
|
||||
// warehouseOptions.value = res.data || [];
|
||||
// });
|
||||
warehouseAll().then(res => {
|
||||
warehouseOptions.value = res.data || [];
|
||||
});
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
pcode: null,
|
||||
scene: null,
|
||||
warehouse: null,
|
||||
encodedId: null,
|
||||
tag: null,
|
||||
remark: null,
|
||||
isDelete: null,
|
||||
createdBy: null,
|
||||
createdAt: null,
|
||||
updatedBy: null,
|
||||
updatedAt: null
|
||||
};
|
||||
proxy.resetForm("pcdedetailRef");
|
||||
}
|
||||
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
//批量打印
|
||||
function handleBatchPrint() {
|
||||
const dataInfo = {
|
||||
printType:1,
|
||||
ids:ids.value
|
||||
}
|
||||
// console.log(dataInfo)
|
||||
// return
|
||||
printFun(dataInfo).then(response=>{
|
||||
if(response == '打印成功'){
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
//单个打印
|
||||
function handleOnePrint(row) {
|
||||
const dataInfo = {
|
||||
printType:1,
|
||||
ids:[row.id]
|
||||
}
|
||||
// console.log(dataInfo)
|
||||
// return
|
||||
printFun(dataInfo).then(response=>{
|
||||
if(response == '打印成功'){
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
//输入内容 手动打印
|
||||
function handleHandPrint(){
|
||||
ElMessageBox.prompt('请输入打印内容', '', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputErrorMessage: '打印内容不能为空',
|
||||
inputValidator(value) {
|
||||
if (!value) {
|
||||
return '打印内容不能为空';
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(({ value }) => {
|
||||
const dataInfo = {
|
||||
printType:2,
|
||||
printStr:value
|
||||
}
|
||||
printFun(dataInfo).then(response=>{
|
||||
if(response == '打印成功'){
|
||||
proxy.$modal.msgSuccess("打印成功");
|
||||
}
|
||||
})
|
||||
// ElMessage({
|
||||
// type: 'success',
|
||||
// message: `Your email is:${value}`,
|
||||
// })
|
||||
})
|
||||
.catch(() => {
|
||||
// ElMessage({
|
||||
// type: 'info',
|
||||
// message: 'Input canceled',
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["pcdedetailRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updatePcdedetail(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addPcdedetail(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getList();
|
||||
|
||||
</script>
|
||||
|
||||
248
src/views/information/scene/index.vue
Normal file
248
src/views/information/scene/index.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="场景编号" prop="sceneCode">
|
||||
<el-input
|
||||
v-model="queryParams.sceneCode"
|
||||
placeholder="请输入场景编号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场景名称" prop="sceneName">
|
||||
<el-input
|
||||
v-model="queryParams.sceneName"
|
||||
placeholder="请输入场景名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:scene:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:scene:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:scene:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:scene:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="sceneList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="场景编号" align="center" prop="sceneCode" />
|
||||
<el-table-column label="场景名称" align="center" prop="sceneName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:scene:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:scene:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改场景编号对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="sceneRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="场景编号" prop="sceneCode">
|
||||
<el-input v-model="form.sceneCode" placeholder="请输入场景编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场景名称" prop="sceneName">
|
||||
<el-input v-model="form.sceneName" placeholder="请输入场景名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Scene">
|
||||
import { listScene, getScene, delScene, addScene, updateScene } from "@/api/information/scene";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const sceneList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sceneCode: null,
|
||||
sceneName: null
|
||||
},
|
||||
rules: {
|
||||
sceneCode: [
|
||||
{ required: true, message: "场景编号不能为空", trigger: "blur" }
|
||||
],
|
||||
sceneName: [
|
||||
{ required: true, message: "场景名称不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询场景编号列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listScene(queryParams.value).then(response => {
|
||||
sceneList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
sceneCode: null,
|
||||
sceneName: null
|
||||
};
|
||||
proxy.resetForm("sceneRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加场景编号";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getScene(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改场景编号";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["sceneRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateScene(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addScene(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除场景编号编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delScene(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/scene/export', {
|
||||
...queryParams.value
|
||||
}, `scene_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
399
src/views/information/warehouseinfo/index.vue
Normal file
399
src/views/information/warehouseinfo/index.vue
Normal file
@@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="大库编码" prop="parentWarehouseCode">
|
||||
<el-input
|
||||
v-model="queryParams.parentWarehouseCode"
|
||||
placeholder="请输入大库编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="打库名称" prop="parentWarehouseName">
|
||||
<el-input
|
||||
v-model="queryParams.parentWarehouseName"
|
||||
placeholder="请输入大库名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小库编码" prop="warehouseCode">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseCode"
|
||||
placeholder="请输入小库编码"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小库名称" prop="warehouseName">
|
||||
<el-input
|
||||
v-model="queryParams.warehouseName"
|
||||
placeholder="请输入小库名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="仓库地址" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
placeholder="请输入仓库地址"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="状态" prop="warehouseId">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 200px">
|
||||
<el-option v-for="dict in statusList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="排序值" prop="sort">
|
||||
<el-input
|
||||
v-model="queryParams.sort"
|
||||
placeholder="请输入排序值"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" prop="createdAt">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.createdAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedAt">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.updatedAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['information:warehouseinfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['information:warehouseinfo:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['information:warehouseinfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['information:warehouseinfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="warehouseinfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="大库编码" align="center" prop="parentWarehouseCode" />
|
||||
<el-table-column label="大库名称" align="center" prop="parentWarehouseName" />
|
||||
<el-table-column label="小库编码" align="center" prop="warehouseCode" />
|
||||
<el-table-column label="小库名称" align="center" prop="warehouseName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="dictTagData()" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="创建时间" align="center" prop="createdAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:warehouseinfo:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:warehouseinfo:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改仓库信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="warehouseinfoRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="大库编码" prop="parentWarehouseCode">
|
||||
<el-input v-model="form.parentWarehouseCode" placeholder="请输入大库编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大库名称" prop="parentWarehouseName">
|
||||
<el-select v-model="form.parentWarehouseName" placeholder="请选择状态" clearable @change="changeWarehouse">
|
||||
<el-option v-for="dict in parentWarehouseList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="小库编码" prop="warehouseCode">
|
||||
<el-input v-model="form.warehouseCode" placeholder="请输入仓库编码" :disabled="!form.parentWarehouseName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小库名称" prop="warehouseName">
|
||||
<el-input v-model="form.warehouseName" placeholder="请输入仓库名称" :disabled="!form.parentWarehouseName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态" clearable>
|
||||
<el-option v-for="dict in statusList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="仓库地址" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入仓库地址" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="排序值" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序值" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="createdAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedAt">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedAt"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Warehouseinfo">
|
||||
import { listWarehouseinfo, getWarehouseinfo, delWarehouseinfo, addWarehouseinfo, updateWarehouseinfo } from "@/api/information/warehouseinfo";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const warehouseinfoList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const statusList = ref([
|
||||
{ value: 0, label: '禁用', elTagType: "danger", elTagClass: null },
|
||||
{ value: 1, label: '启用', elTagType: "primary", elTagClass: null }
|
||||
])
|
||||
//大库
|
||||
const parentWarehouseList = ref([
|
||||
{ value: '贾庵子仓库', label: '贾庵子仓库' },
|
||||
{ value: '贾庵子应急物资储备仓库', label: '贾庵子应急物资储备仓库' },
|
||||
{ value: '贾庵子南库', label: '贾庵子南库' }
|
||||
])
|
||||
|
||||
const dictTagData = () => {
|
||||
return statusList.value.map(item => ({
|
||||
...item,
|
||||
value: String(item.value)
|
||||
}));
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
// address: null,
|
||||
status: null,
|
||||
sort: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
},
|
||||
rules: {
|
||||
warehouseCode: [
|
||||
{ required: true, message: "仓库编码不能为空", trigger: "blur" }
|
||||
],
|
||||
warehouseName: [
|
||||
{ required: true, message: "仓库名称不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询仓库信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listWarehouseinfo(queryParams.value).then(response => {
|
||||
warehouseinfoList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
warehouseCode: null,
|
||||
warehouseName: null,
|
||||
// address: null,
|
||||
status: null,
|
||||
// sort: null,
|
||||
remark: null,
|
||||
// createdAt: null,
|
||||
// updatedAt: null
|
||||
};
|
||||
proxy.resetForm("warehouseinfoRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加仓库信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getWarehouseinfo(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改仓库信息";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["warehouseinfoRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateWarehouseinfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addWarehouseinfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除仓库信息编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delWarehouseinfo(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('information/warehouseinfo/export', {
|
||||
...queryParams.value
|
||||
}, `warehouseinfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
function changeWarehouse(id){
|
||||
if(!id){
|
||||
form.value.warehouseCode = null
|
||||
form.value.warehouseName = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
271
src/views/information/warehousingtype/index.vue
Normal file
271
src/views/information/warehousingtype/index.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="入库类型编码" prop="typeCode" class="form-item-no-wrap">
|
||||
<el-input
|
||||
v-model="queryParams.typeCode"
|
||||
placeholder="请输入入库类型编码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型名称" prop="typeName" class="form-item-no-wrap">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入入库类型名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status" class="form-item-no-wrap">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option v-for="dict in statusList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['information:warehousingtype:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['information:warehousingtype:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['information:warehousingtype:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['information:warehousingtype:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="warehousingtypeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" />
|
||||
<el-table-column label="入库类型编码" align="center" prop="typeCode" />
|
||||
<el-table-column label="入库类型名称" align="center" prop="typeName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="dictTagData()" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['information:warehousingtype:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['information:warehousingtype:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改入库类型对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="warehousingtypeRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="入库类型编码" prop="typeCode">
|
||||
<el-input v-model="form.typeCode" placeholder="请输入入库类型编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入入库类型名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-item-no-wrap {
|
||||
white-space: nowrap;
|
||||
margin-right: 10px;
|
||||
:deep(.el-form-item__label) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script setup name="Warehousingtype">
|
||||
import { listWarehousingtype, getWarehousingtype, delWarehousingtype, addWarehousingtype, updateWarehousingtype } from "@/api/information/warehousingtype";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const warehousingtypeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeCode: null,
|
||||
typeName: null,
|
||||
status: null
|
||||
},
|
||||
rules: {
|
||||
typeCode: [
|
||||
{ required: true, message: "入库类型编码不能为空", trigger: "blur" }
|
||||
],
|
||||
typeName: [
|
||||
{ required: true, message: "入库类型名称不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
const statusList = ref([
|
||||
{ value: 0, label: '禁用', elTagType: "danger", elTagClass: null },
|
||||
{ value: 1, label: '启用', elTagType: "primary", elTagClass: null }
|
||||
])
|
||||
|
||||
const dictTagData = () => {
|
||||
return statusList.value.map(item => ({
|
||||
...item,
|
||||
value: String(item.value)
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listWarehousingtype(queryParams.value).then(response => {
|
||||
warehousingtypeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
typeCode: null,
|
||||
typeName: null,
|
||||
status: null,
|
||||
sort: null,
|
||||
remark: null,
|
||||
createdAt: null,
|
||||
updatedAt: null
|
||||
};
|
||||
proxy.resetForm("warehousingtypeRef");
|
||||
}
|
||||
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加入库类型";
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value;
|
||||
getWarehousingtype(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改入库类型";
|
||||
});
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
proxy.$refs["warehousingtypeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateWarehousingtype(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addWarehousingtype(form.value).then(() => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除入库类型编号为"' + _ids + '"的数据项?').then(() => {
|
||||
return delWarehousingtype(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
proxy.download('information/warehousingtype/export', {
|
||||
...queryParams.value
|
||||
}, `warehousingtype_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
Reference in New Issue
Block a user