From 634248cb0df2832a88ceeac6b5ef04ee4f83741c Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期五, 10 五月 2024 23:17:36 +0800
Subject: [PATCH] 仓库
---
src/views/console/basic-data/material-warehousing-data/material-storage.vue | 5
src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue | 178 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 176 insertions(+), 7 deletions(-)
diff --git a/src/views/console/basic-data/material-warehousing-data/material-storage.vue b/src/views/console/basic-data/material-warehousing-data/material-storage.vue
index f7b8050..c3212dc 100644
--- a/src/views/console/basic-data/material-warehousing-data/material-storage.vue
+++ b/src/views/console/basic-data/material-warehousing-data/material-storage.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-05-07 22:46:30
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-10 22:28:37
+ * @LastEditTime: 2024-05-10 22:46:32
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/material-warehousing-data/material-storage.vue
-->
<template>
@@ -18,7 +18,7 @@
@node-click="nodeClick"></el-tree>
</el-aside>
<el-container>
- <el-main v-if="selectNode.id">
+ <el-main v-if="selectNode?.id">
<el-row>
<el-col :span="4">
搴撲綅缂栧彿: {{ selectNode.warehouseCode }}
@@ -154,7 +154,6 @@
init() {
this.$HTTP.get(`/api/blade-cps/tray-storage/tree`).then(res => {
this.treeData = res.data
- this.nodeClick(res.data?.[0])
})
this.$HTTP.get(`/api/blade-cps/material-type/list`).then(res => {
this.options.typeId = res.data.map(item => ({
diff --git a/src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue b/src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue
index 17d9f8d..da8827c 100644
--- a/src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue
+++ b/src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue
@@ -1,18 +1,188 @@
<!--
* @Date: 2024-05-07 22:51:22
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-07 22:51:49
+ * @LastEditTime: 2024-05-10 23:16:26
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/material-warehousing-data/reservoir-location/reservoir-location.vue
-->
<template>
- <div>
- 搴撳尯搴撲綅
- </div>
+ <el-main style="height: 100%;">
+ <el-card shadow="never" style="height: 100%;" body-style="height: 100%">
+ <el-container>
+ <el-aside width="200px" v-loading="showGrouploading">
+ <el-container>
+ <el-main>
+ <el-tree default-expand-all ref="group" node-key="id" :data="treeData" :props="props"
+ @node-click="nodeClick" highlight-current :current-node-key="params.areaId"></el-tree>
+ </el-main>
+ <el-footer>
+ <el-button @click="addArea" type="primary" icon="el-icon-plus" size="small">娣诲姞搴撳尯</el-button>
+ </el-footer>
+ </el-container>
+ </el-aside>
+ <el-container>
+ <el-header>
+ <el-button @click="table_add" type="primary" icon="el-icon-plus"></el-button>
+ <!-- <el-button type="primary">瀵煎叆</el-button> -->
+ <import-table style="margin:0 8px" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table>
+ <el-button type="primary" @click="getExport">瀵煎嚭</el-button>
+ <el-popconfirm width="220" title="纭畾灏嗛�夋嫨鐨勬暟鎹垹闄�" @confirm="table_del([scope.row], '0')">
+ <template #reference>
+ <el-button :disabled="selection.length == 0" type="danger" plain
+ icon="el-icon-delete"></el-button>
+ </template>
+ </el-popconfirm>
+ <el-input style="width: 240px;margin-left: auto;" v-model="params.keyWord"
+ placeholder="璇疯緭鍏ユ绱㈠唴瀹�"></el-input>
+ <el-button @click="search" style="margin-left: 8px;" type="primary"
+ icon="el-icon-search"></el-button>
+ </el-header>
+ <el-main>
+ <el-row style="margin-top: 10px;">
+ <el-col style="margin-top: 10px;">
+ <scTable ref="table" row-key="id" border @selection-change="handleSelectionChange"
+ :params="params" :apiObj="apiObj" stripe @dataChange="dataChange">
+ <el-table-column type="selection" width="55" />
+ <el-table-column prop="warehouseCode" label="搴撲綅缂栧彿" />
+ <el-table-column prop="warehouseName" label="搴撲綅鍚嶇О" />
+ <el-table-column prop="remark" label="澶囨敞" />
+ <el-table-column prop="warehouseAreaName" label="鎵�灞炲簱鍖哄悕绉�" />
+ <el-table-column prop="warehouseAreaCode" label="鎵�灞炲簱鍖虹紪鍙�" />
+ <el-table-column label="鎿嶄綔" fixed="right" align="left" width="160">
+ <template #default="scope">
+ <el-button-group>
+ <el-button text type="primary" size="small"
+ @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
+ <el-popconfirm width="220" title="纭畾灏嗛�夋嫨鐨勬暟鎹垹闄�"
+ @confirm="table_del([scope.row], '0')">
+ <template #reference>
+ <el-button text type="primary" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-popconfirm>
+ </el-button-group>
+ </template>
+ </el-table-column>
+ </scTable>
+ </el-col>
+
+ </el-row>
+ </el-main>
+ </el-container>
+ </el-container>
+ </el-card>
+ <el-dialog v-model="areaVisible" title="娣诲姞" width="500">
+ <el-form :model="form" :rules="rules" ref="dialogForm" label-width="120px" label-position="center">
+ <el-form-item label="搴撳尯缂栧彿" prop="code">
+ <el-input v-model="form.code" />
+ </el-form-item>
+ <el-form-item label="搴撳尯鍚嶇О" prop="name">
+ <el-input v-model="form.name" />
+ </el-form-item>
+ </el-form>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="saveArea">
+ 纭畾
+ </el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </el-main>
</template>
<script>
+import importTable from '@/layout/components/importTable.vue'
export default {
+ components: {
+ importTable,
+ },
+ data() {
+ return {
+ treeData: [],
+ props: {
+ label: 'label'
+ },
+ areaVisible: false,
+ params: {
+ areaId: 1,
+ keyword: ''
+ },
+ form: {},
+ rules: {
+ name: [
+ { required: true, message: '蹇呭~' }
+ ],
+ code: [
+ { required: true, message: '蹇呭~' }
+ ],
+ },
+ exportUrl: '/api/blade-cps/warehouse-station/export-template',
+ uploadUrl: '/api/blade-cps/warehouse-station/import-station',
+ selection: [],
+ apiObj: {
+ get: async (data) => {
+ let params = {
+ ...data,
+ ...this.params,
+ }
+ return await this.$HTTP.get(`/api/blade-cps/warehouse-station/page`, {}, { params }).then(res => {
+ return res
+ })
+ }
+ },
+ }
+ },
+ mounted() {
+ this.init()
+ },
+ methods: {
+ init() {
+ this.$HTTP.get(`/api/blade-cps/warehouse-area/tree`).then(res => {
+ this.treeData = res.data
+ this.nodeClick(res.data?.[0])
+ })
+ },
+ nodeClick(node) {
+ this.params.areaId = node.id
+ this.$refs?.table?.reload(this.params)
+ },
+ addArea() {
+ this.form = {}
+ this.areaVisible = true
+ },
+ saveArea() {
+ this.$refs.dialogForm.validate(async (valid) => {
+ if (valid) {
+ this.$HTTP.post(`/api/blade-cps/warehouse-area/insert`, { ...this.form, parentId: 1 }).then(res => {
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.areaVisible = false
+ this.init()
+ })
+ }
+ })
+ },
+ search() {
+ this.$refs.table.reload()
+ },
+ table_add() {
+ },
+ table_del() {
+
+ },
+ table_edit() {
+
+ },
+ handleSelectionChange(selection) {
+ this.selection = selection
+ },
+ getExport() {
+ this.$HTTP.post(`/api/blade-cps/warehouse-station/export-station`, { ...this.params }).then(res => {
+ if (res.code == 200) {
+ window.open(res.data.link);
+ }
+ }).catch(() => { })
+ },
+ },
}
</script>
--
Gitblit v1.9.3