From 77d96bbef04f39e154ac8ffe0dbe69f3a412d1ac Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期一, 23 九月 2024 16:39:16 +0800
Subject: [PATCH] 1
---
src/views/console/basic-data/material-warehousing-data/material-storage.vue | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 205 insertions(+), 5 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 2e6a869..2352008 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,19 +1,219 @@
<!--
* @Date: 2024-05-07 22:46:30
* @LastEditors: Sneed
- * @LastEditTime: 2024-05-07 22:46:44
+ * @LastEditTime: 2024-06-16 16:17:13
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/material-warehousing-data/material-storage.vue
-->
<template>
- <div>
- 鐗╂枡瀛樻斁
- </div>
+ <el-main style="height: 100%;">
+ <el-card shadow="never" style="height: 100%;" body-style="height: 100%">
+ <el-containter>
+ <el-header>
+ <import-table style="margin:0 8px" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table>
+ </el-header>
+ <el-main>
+ <el-container>
+ <el-aside width="200px" v-loading="showGrouploading">
+ <el-tree :expand-on-click-node="false" default-expand-all ref="group" node-key="id"
+ :data="treeData" :props="props" @node-click="nodeClick">
+ <template #default="{ node, data }">
+ <span class="custom-tree-node">
+ <span :class="data.isArea ? 'treedisabled' : ''">{{
+ node.label }}</span>
+ </span>
+ </template>
+ </el-tree>
+ </el-aside>
+ <el-container>
+ <el-main v-if="selectNode?.id">
+ <el-row>
+ <el-col :span="4">
+ 搴撲綅缂栧彿: {{ selectNode.warehouseCode }}
+ </el-col>
+ <el-col :span="4">
+ 搴撲綅鍚嶇О: {{ selectNode.warehouseName }}
+ </el-col>
+ <el-col :span="4">
+ 搴撲綅鎻忚堪: {{ selectNode.remark }}
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 10px;">
+ <el-col>
+ <el-button @click="table_add" type="primary"
+ icon="el-icon-plus">娣诲姞鐗╂枡</el-button>
+ </el-col>
+ <el-col style="margin-top: 10px;">
+ <scTable ref="table" @selection-change="handleSelectionChange" row-key="id"
+ border :params="params" :apiObj="apiObj" stripe @dataChange="dataChange">
+ <!-- <el-table-column type="selection" width="55" /> -->
+ <el-table-column prop="materialCode" label="鐗╂枡缂栧彿" />
+ <el-table-column prop="materialName" label="鐗╂枡鍚嶇О" />
+ <el-table-column prop="standardModel" label="瑙勬牸" />
+ <el-table-column prop="unit" label="璁¢噺鍗曚綅" />
+ <el-table-column prop="typeName" label="鐗╂枡绫诲瀷" />
+ <el-table-column prop="stuff" label="鏉愯川" />
+ <el-table-column prop="property" label="鐗╂枡灞炴��">
+ <template #default="scope">
+ {{ this.options.property.find(v => v.value ==
+ scope.row.property)?.label
+ }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="isMustCheckName" label="鏄惁蹇呮">
+ <template #default="scope">
+ {{ scope.row.isMustCheck == 1 ? '鏄�' : '鍚�' }}
+ </template>
+ </el-table-column>
+ <el-table-column prop="lowerLimit" label="棰濆畾搴撳瓨" />
+ <el-table-column prop="upperLimit" label="瀹夊叏搴撳瓨" />
+
+ <el-table-column label="鎿嶄綔" fixed="right" align="left" width="160">
+ <template #default="scope">
+ <el-button-group>
+ <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-main v-else>
+ <el-empty description="" />
+ </el-main>
+ </el-container>
+ </el-container>
+ </el-main>
+ </el-containter>
+ </el-card>
+ <el-dialog v-model="dialogVisible" title="娣诲姞" width="500">
+ <el-select v-model="materialIds">
+ <template #prefix>
+ 鐗╂枡缂栧彿
+ </template>
+ <el-option v-for="item in todoList" :key="item.value" :label="item.code" :value="item.id" />
+ </el-select>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="add">
+ 纭畾
+ </el-button>
+ </div>
+ </template>
+ </el-dialog>
+ </el-main>
</template>
<script>
+import importTable from '@/layout/components/importTable.vue'
export default {
+ components: {
+ importTable,
+ },
+ watch: {
+ selectNode(val) {
+ this.params.wareId = val?.id
+ this.$refs?.table?.reload()
+ }
+ },
+ data() {
+ return {
+ options: {
+ },
+ props: {
+ label: 'name',
+ disabled: 'isArea'
+ },
+ exportUrl: '/api/blade-cps/material-storage/excel/template',
+ uploadUrl: '/api/blade-cps/material-storage/excel/import',
+ treeData: [],
+ selectNode: {},
+ apiObj: {
+ get: async (data) => {
+ let params = {
+ ...data,
+ wareId: this.selectNode.id
+ }
+ return await this.$HTTP.post(`/api/blade-cps/material-storage/page`, {}, { params }).then(res => {
+ return res
+ })
+ }
+ },
+ params: {
+ wareId: ''
+ },
+ todoList: [],
+ dialogVisible: false,
+ materialIds: ''
+ }
+ },
+ created() {
+ this.init()
+ },
+ methods: {
+ init() {
+ this.$HTTP.get(`/api/blade-cps/tray-storage/tree`).then(res => {
+ this.treeData = res.data
+ })
+ this.$HTTP.get(`/api/blade-cps/material-type/list`).then(res => {
+ this.options.typeId = res.data.map(item => ({
+ label: item.name,
+ value: item.id
+ }))
+ })
+ this.$HTTP.get(`/api/blade-system/dict/dictionary?code=material_property`).then(res => {
+ this.options.property = res.data.map(item => ({
+ label: item.dictValue,
+ value: item.dictKey - 0
+ }))
+ })
+ },
+ nodeClick(node) {
+ if (node.isArea) return
+ this.queryInfo(node.id)
+ },
+ queryInfo(id) {
+ this.$HTTP.get(`/api/blade-cps/warehouse-station/get/${id}`).then(res => {
+ this.selectNode = res.data
+ })
+ },
+ table_add() {
+ this.$HTTP.get(`/api/blade-cps/material-storage/material/not-bind`).then(res => {
+ if (res.data?.length > 0) {
+ this.todoList = res.data
+ this.dialogVisible = true
+ } else {
+ this.$message.warning("鏆傛棤鍙坊鍔犵墿鏂�")
+ }
+ })
+ },
+ add() {
+ this.$HTTP.post(`/api/blade-cps/material-storage`, { warehouseStationId: this.selectNode.id, materialIds: [this.materialIds] }).then(res => {
+ this.$message.success("鎿嶄綔鎴愬姛")
+ this.dialogVisible = false
+ this.$refs.table.reload()
+ })
+ },
+ table_del(ids) {
+ this.$HTTP.delete(`/api/blade-cps/material-storage`, ids.map(v => v.id)).then(res => {
+ this.$message.success("鎿嶄綔鎴愬姛")
+ this.$refs.table.reload()
+ })
+ }
+ },
}
</script>
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss" scoped>
+.treedisabled {
+ color: #ccc;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3