From d82719fb01bcd56c382f35d624b92eecaa5db09b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 17 三月 2026 14:57:06 +0800
Subject: [PATCH] 军泰伟业 1.仓储物流需要加上库位,库位暂时分为外购、自制、委外三种类型 2.生产订单加上库存数量,方便实时查看 3.产品发货后,若部分产品退回,可修改订单发货数量(减去退回的产品数量),若订单产品全部退回,可对发货的订单进行取消撤回操作
---
src/views/basicData/product/index.vue | 780 ++++++++++++++++++++++++++++++++++--------------------------
1 files changed, 442 insertions(+), 338 deletions(-)
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index d496069..24a4659 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -1,396 +1,500 @@
<template>
<div class="app-container product-view">
- <div class="left">
- <div>
- <el-input
- v-model="search"
- style="width: 210px"
- placeholder="杈撳叆鍏抽敭瀛楄繘琛屾悳绱�"
- @change="searchFilter"
- @clear="searchFilter"
+ <div class="main-content">
+ <div class="search-section">
+ <el-form :inline="true" :model="queryForm" class="search-form">
+ <el-form-item label="浜у搧鍚嶇О">
+ <el-input
+ v-model="queryForm.productName"
+ placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
+ clearable
+ style="width: 200px"
+ @keyup.enter="handleSearch"
+ />
+ </el-form-item>
+ <el-form-item label="鍥剧焊缂栧彿">
+ <el-input
+ v-model="queryForm.model"
+ placeholder="璇疯緭鍏ュ浘绾哥紪鍙�"
+ clearable
+ style="width: 200px"
+ @keyup.enter="handleSearch"
+ />
+ </el-form-item>
+ <el-form-item label="浜у搧灞炴��">
+ <el-select
+ v-model="queryForm.productType"
+ placeholder="璇烽�夋嫨浜у搧灞炴��"
+ clearable
+ style="width: 150px"
+ >
+ <el-option label="鑷埗" :value="1" />
+ <el-option label="澶栬喘" :value="2" />
+ <el-option label="濮斿" :value="3" />
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleSearch" icon="Search">
+ 鎼滅储
+ </el-button>
+ <el-button @click="handleReset" icon="Refresh">
+ 閲嶇疆
+ </el-button>
+ </el-form-item>
+ </el-form>
+ <div class="action-buttons">
+ <el-button type="primary" @click="openModelDia('add')" icon="Plus">
+ 鏂板浜у搧
+ </el-button>
+ <el-button type="success" @click="handleImport" icon="Upload">
+ 瀵煎叆
+ </el-button>
+ <el-button type="danger" @click="handleDelete" icon="Delete" plain>
+ 鍒犻櫎
+ </el-button>
+ </div>
+ </div>
+
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ ></PIMTable>
+ </div>
+
+ <FormDialog
+ v-model="modelDia"
+ title="浜у搧淇℃伅"
+ width="500px"
+ @close="closeModelDia"
+ @confirm="submitModelForm"
+ >
+ <el-form
+ :model="modelForm"
+ label-width="100px"
+ :rules="modelRules"
+ ref="modelFormRef"
+ >
+ <el-form-item label="浜у搧鍚嶇О" prop="productName">
+ <el-input
+ v-model="modelForm.productName"
+ placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
clearable
- prefix-icon="Search"
- />
- <el-button type="primary" @click="openProDia('addOne')" style="margin-left: 10px">鏂板浜у搧澶х被</el-button>
- </div>
- <div ref="containerRef">
- <el-tree ref="tree" v-loading="treeLoad" :data="list" @node-click="handleNodeClick"
- :expand-on-click-node="false" default-expand-all
- :default-expanded-keys="expandedKeys" :draggable="true" :filter-node-method="filterNode"
- :props="{ children: 'children', label: 'label' }" highlight-current node-key="id"
- style="height: calc(100vh - 190px);overflow-y: scroll;scrollbar-width: none;">
- <template #default="{ node, data }">
- <div class="custom-tree-node">
- <span>{{ node.label }}</span>
- <div>
- <el-button type="primary" link @click="openProDia('edit', data)">
- 缂栬緫
- </el-button>
- <el-button type="primary" link @click="openProDia('add', data)">
- 娣诲姞浜у搧
- </el-button>
- <el-button
- v-if="!node.childNodes.length"
- style="margin-left: 4px"
- type="danger"
- link
- @click="remove(node, data)"
- >
- 鍒犻櫎
- </el-button>
- </div>
- </div>
- </template>
- </el-tree>
- </div>
- </div>
- <div class="right">
- <div style="margin-bottom: 10px" v-if="isShowButton">
- <el-button type="primary" @click="openModelDia('add')">鏂板瑙勬牸鍨嬪彿</el-button>
- <el-button type="danger" @click="handleDelete" style="margin-left: 10px" plain>鍒犻櫎</el-button>
- </div>
- <PIMTable :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true" :handleSelectionChange="handleSelectionChange"
- :tableLoading="tableLoading" @pagination="pagination" :total="total"></PIMTable>
- </div>
- <el-dialog v-model="productDia" title="浜у搧" width="400px">
- <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
- <el-row :gutter="30">
- <el-col :span="24">
- <el-form-item label="浜у搧鍚嶇О锛�" prop="productName">
- <el-input v-model="form.productName" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" clearable/>
- </el-form-item>
- </el-col>
- </el-row>
+ maxlength="50"
+ show-word-limit
+ />
+ </el-form-item>
+ <el-form-item label="鍥剧焊缂栧彿" prop="model">
+ <el-input
+ v-model="modelForm.model"
+ placeholder="璇疯緭鍏ュ浘绾哥紪鍙�"
+ clearable
+ />
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿" prop="drawingNumber">
+ <el-input
+ v-model="modelForm.drawingNumber"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ clearable
+ />
+ </el-form-item>
+ <el-form-item label="鍗曚綅" prop="unit">
+ <el-input
+ v-model="modelForm.unit"
+ placeholder="璇疯緭鍏ュ崟浣�"
+ clearable
+ />
+ </el-form-item>
+ <el-form-item label="浜у搧灞炴��" prop="productType">
+ <el-select
+ v-model="modelForm.productType"
+ placeholder="璇烽�夋嫨浜у搧灞炴��"
+ clearable
+ style="width: 100%"
+ >
+ <el-option label="鑷埗" :value="1" />
+ <el-option label="澶栬喘" :value="2" />
+ <el-option label="濮斿" :value="3" />
+ </el-select>
+ </el-form-item>
</el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeProDia">鍙栨秷</el-button>
+ </FormDialog>
+
+ <FormDialog
+ v-model="importDia"
+ title="浜у搧瀵煎叆"
+ width="600px"
+ @cancel="importDia = false"
+ @confirm="submitImport"
+ >
+ <el-upload
+ ref="importUploadRef"
+ :limit="1"
+ accept=".xlsx,.xls"
+ :action="importUpload.url"
+ :headers="importUpload.headers"
+ :before-upload="importUpload.beforeUpload"
+ :on-success="importUpload.onSuccess"
+ :on-error="importUpload.onError"
+ :on-progress="importUpload.onProgress"
+ :on-change="importUpload.onChange"
+ :auto-upload="false"
+ drag
+ >
+ <i class="el-icon-upload"></i>
+ <div class="el-upload__text">
+ 灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
</div>
- </template>
- </el-dialog>
- <el-dialog v-model="modelDia" title="瑙勬牸鍨嬪彿" width="400px" @close="closeModelDia">
- <el-form :model="modelForm" label-width="140px" label-position="top" :rules="modelRules" ref="modelFormRef">
- <el-row>
- <el-col :span="24">
- <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="model">
- <el-input v-model="modelForm.model" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" clearable/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="鍗曚綅锛�" prop="unit">
- <el-input v-model="modelForm.unit" placeholder="璇疯緭鍏ュ崟浣�" clearable/>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitModelForm">纭</el-button>
- <el-button @click="closeModelDia">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
+ <template #tip>
+ <div class="el-upload__tip">
+ 浠呮敮鎸� xls/xlsx锛屽ぇ灏忎笉瓒呰繃 10MB銆�
+ <el-button link type="primary" @click="importTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
+ </div>
+ </template>
+ </el-upload>
+ </FormDialog>
</div>
</template>
<script setup>
-import {ref} from "vue";
-import {ElMessageBox} from "element-plus";
+import { ref, reactive } from "vue";
+import { ElMessageBox } from "element-plus";
+import { getToken } from "@/utils/auth.js";
+import { FileUpload } from "@/components/Upload";
+import FormDialog from "@/components/Dialog/FormDialog.vue";
import {
- addOrEditProduct,
addOrEditProductModel,
- delProduct, delProductModel,
- modelList,
- productTreeList
+ delProduct,
+ productListPage,
+ downloadTemplate,
} from "@/api/basicData/product.js";
-const { proxy } = getCurrentInstance()
-const tree = ref(null)
-const containerRef = ref(null)
+import ImportExcel from "./ImportExcel/index.vue";
-const productDia = ref(false)
-const modelDia = ref(false)
-const modelOperationType = ref('')
-const search = ref('')
-const currentId = ref('')
-const currentParentId = ref('')
-const operationType = ref('')
-const treeLoad = ref(false)
-const list = ref([])
-const expandedKeys = ref([])
+const { proxy } = getCurrentInstance();
+const importUploadRef = ref(null);
+
+const modelDia = ref(false);
+const importDia = ref(false);
+const modelOperationType = ref("");
+const tableData = ref([]);
+const tableLoading = ref(false);
+const selectedRows = ref([]);
+const modelFormRef = ref();
+
+const queryForm = reactive({
+ productName: "",
+ model: "",
+ productType: null,
+});
+
+const page = reactive({
+ current: 1,
+ size: 50,
+ total: 0,
+});
+
const tableColumn = ref([
{
- label: '瑙勬牸鍨嬪彿',
- prop: 'model',
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ minWidth: 200,
},
{
- label: '鍗曚綅',
- prop: 'unit',
+ label: "鍥剧焊缂栧彿",
+ prop: "model",
+ minWidth: 150,
+ },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "drawingNumber",
+ minWidth: 150,
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ minWidth: 100,
+ },
+ {
+ label: "浜у搧灞炴��",
+ prop: "productType",
+ width: 100,
+ dataType: "tag",
+ formatData: (v) => ({ "1": "鑷埗", "2": "澶栬喘", "3": "濮斿" }[String(v)] ?? v),
+ formatType: (v) => {
+ const typeMap = { "1": "success", "2": "warning", "3": "info" };
+ return typeMap[String(v)] || "info";
+ },
},
{
dataType: "action",
label: "鎿嶄綔",
- align: 'center',
+ align: "center",
+ width: 100,
operation: [
{
name: "缂栬緫",
type: "text",
clickFun: (row) => {
- openModelDia('edit', row);
+ openModelDia("edit", row);
},
},
],
},
-])
-const tableData = ref([])
-const tableLoading = ref(false)
-const isShowButton = ref(false)
-const total = ref(0)
-const selectedRows = ref([])
-const page = reactive({
- current: 1,
- size: 10,
-})
+]);
+
const data = reactive({
- form: {
- productName: '',
- },
- rules: {
- productName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- },
modelForm: {
- model: '',
- unit: '',
+ productName: "",
+ model: "",
+ unit: "",
+ drawingNumber: "",
+ productType: null,
},
modelRules: {
- model: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+ productName: [
+ { required: true, message: "璇疯緭鍏ヤ骇鍝佸悕绉�", trigger: "blur" },
+ { max: 50, message: "浜у搧鍚嶇О涓嶈兘瓒呰繃50涓瓧绗�", trigger: "blur" },
+ ],
+ model: [{ required: true, message: "璇疯緭鍏ュ浘绾哥紪鍙�", trigger: "blur" }],
+ unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: "blur" }],
+ drawingNumber: [],
+ productType: [{ required: true, message: "璇烽�夋嫨浜у搧灞炴��", trigger: "change" }],
+ },
+});
+const { modelForm, modelRules } = toRefs(data);
+
+const importUpload = reactive({
+ title: "浜у搧瀵煎叆",
+ open: false,
+ url: import.meta.env.VITE_APP_BASE_API + "/basic/product/import",
+ headers: { Authorization: "Bearer " + getToken() },
+ isUploading: false,
+ beforeUpload: (file) => {
+ const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls');
+ const isLt10M = file.size / 1024 / 1024 < 10;
+ if (!isExcel) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢鍙兘鏄� xlsx/xls 鏍煎紡!");
+ return false;
+ }
+ if (!isLt10M) {
+ proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 10MB!");
+ return false;
+ }
+ return true;
+ },
+ onChange: (file, fileList) => {
+ console.log('鏂囦欢鐘舵�佹敼鍙�', file, fileList);
+ },
+ onProgress: (event, file, fileList) => {
+ console.log('涓婁紶涓�...', event.percent);
+ },
+ onSuccess: (response, file, fileList) => {
+ console.log('涓婁紶鎴愬姛', response, file, fileList);
+ importUpload.isUploading = false;
+ if (response.code === 200) {
+ proxy.$modal.msgSuccess("瀵煎叆鎴愬姛");
+ importDia.value = false;
+ if (importUploadRef.value) {
+ importUploadRef.value.clearFiles();
+ }
+ getModelList();
+ } else {
+ proxy.$modal.msgError(response.msg || "瀵煎叆澶辫触");
+ }
+ },
+ onError: (error, file, fileList) => {
+ console.log('涓婁紶澶辫触', error, file, fileList);
+ importUpload.isUploading = false;
+ proxy.$modal.msgError("瀵煎叆澶辫触");
}
-})
-const { form, rules, modelForm, modelRules } = toRefs(data)
-// 鏌ヨ浜у搧鏍�
-const getProductTreeList = () => {
- treeLoad.value = true;
- productTreeList().then(res => {
- list.value = res
- list.value.forEach((a) => {
- expandedKeys.value.push(a.label);
- });
- treeLoad.value = false;
- }).catch(err => {
- treeLoad.value = false;
- })
-}
-// 杩囨护浜у搧鏍�
-const searchFilter = () => {
- proxy.$refs.tree.filter(search.value);
-}
-// 鎵撳紑浜у搧寮规
-const openProDia = (type, data) => {
- operationType.value = type;
- productDia.value = true
- form.value.productName = ''
- if (type === 'edit') {
- form.value.productName = data.productName
- }
-}
-// 鎵撳紑瑙勬牸鍨嬪彿寮规
+});
+
+const handleSearch = () => {
+ page.current = 1;
+ getModelList();
+};
+
+const handleReset = () => {
+ queryForm.productName = "";
+ queryForm.model = "";
+ queryForm.productType = null;
+ page.current = 1;
+ getModelList();
+};
+
const openModelDia = (type, data) => {
modelOperationType.value = type;
- modelDia.value = true
- modelForm.value.model = ''
- modelForm.value.model = ''
- modelForm.value.id = ''
- if (type === 'edit') {
- modelForm.value = {...data}
+ modelDia.value = true;
+ modelForm.value.productName = "";
+ modelForm.value.model = "";
+ modelForm.value.id = "";
+ modelForm.value.unit = "";
+ modelForm.value.drawingNumber = "";
+ modelForm.value.productType = null;
+ if (type === "edit") {
+ modelForm.value = { ...data };
}
-}
-// 鎻愪氦浜у搧鍚嶇О淇敼
-const submitForm = () => {
- proxy.$refs.formRef.validate(valid => {
- if (valid) {
- if (operationType.value === 'add') {
- form.value.parentId = currentId.value
- form.value.id = ''
- } else if (operationType.value === 'addOne') {
- form.value.id = ''
- form.value.parentId = ''
- } else {
- form.value.id = currentId.value
- form.value.parentId = ''
- }
- addOrEditProduct(form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
- closeProDia()
- getProductTreeList()
- })
- }
- })
-}
-// 鍏抽棴浜у搧寮规
-const closeProDia = () => {
- proxy.$refs.formRef.resetFields();
- productDia.value = false;
-}
-// 鍒犻櫎浜у搧
-const remove = (node, data) => {
- let ids = []
- ids.push(data.id)
- ElMessageBox.confirm(
- '閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�',
- '鍒犻櫎鎻愮ず', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- tableLoading.value = true
- delProduct(ids).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
- getProductTreeList()
- }).finally(() => {
- tableLoading.value = false
- })
- }).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
- })
-}
-// 閫夋嫨浜у搧
-const handleNodeClick = (val, node, el) => {
- // 鍒ゆ柇鏄惁涓哄彾瀛愯妭鐐�
- isShowButton.value = !(val.children && val.children.length > 0);
- // 鍙湁鍙跺瓙鑺傜偣鎵嶆墽琛屼互涓嬮�昏緫
- currentId.value = val.id
- currentParentId.value = val.parentId
- getModelList()
-}
+};
-
-// 鎻愪氦瑙勬牸鍨嬪彿淇敼
const submitModelForm = () => {
- proxy.$refs.modelFormRef.validate(valid => {
+ modelFormRef.value.validate((valid) => {
if (valid) {
- modelForm.value.productId = currentId.value
- addOrEditProductModel(modelForm.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
- closeModelDia()
- getModelList()
- })
+ addOrEditProductModel(modelForm.value).then((res) => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeModelDia();
+ getModelList();
+ });
}
- })
-}
-// 鍏抽棴鍨嬪彿寮规
-const closeModelDia = () => {
- proxy.$refs.modelFormRef.resetFields();
- modelDia.value = false;
-}
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection
-}
+ });
+};
-// 鏌ヨ瑙勬牸鍨嬪彿
-const pagination = ({ current, limit }) => {
- page.current = current;
- page.size = limit;
- getModelList()
-}
+const closeModelDia = () => {
+ modelFormRef.value.resetFields();
+ modelDia.value = false;
+};
+
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getModelList();
+};
+
const getModelList = () => {
- tableLoading.value = true
- modelList({id: currentId.value}).then(res => {
- tableLoading.value = false
- tableData.value = res
- })
-}
-// 鍒犻櫎瑙勬牸鍨嬪彿
-const handleDelete = () => {
- let ids = []
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map(item => item.id);
- } else {
- proxy.$modal.msgWarning('璇烽�夋嫨鏁版嵁')
- return
- }
- ElMessageBox.confirm(
- '閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�',
- '鍒犻櫎鎻愮ず', {
- confirmButtonText: '纭',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- }
- ).then(() => {
- tableLoading.value = true
- delProductModel(ids).then(res => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
- getModelList()
- }).finally(() => {
- tableLoading.value = false
- })
+ tableLoading.value = true;
+ productListPage({
+ productName: queryForm.productName.trim(),
+ model: queryForm.model.trim(),
+ productType: queryForm.productType,
+ current: page.current,
+ size: page.size,
+ }).then((res) => {
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ tableLoading.value = false;
}).catch(() => {
- proxy.$modal.msg("宸插彇娑�")
+ tableLoading.value = false;
+ });
+};
+
+const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map((item) => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
-}
-// 璋冪敤tree杩囨护鏂规硶 涓枃鑻辫繃婊�
-const filterNode = (value, data, node) => {
- if (!value) {銆�銆�銆�銆�//濡傛灉鏁版嵁涓虹┖锛屽垯杩斿洖true,鏄剧ず鎵�鏈夌殑鏁版嵁椤�
- return true
+ .then(() => {
+ tableLoading.value = true;
+ delProduct(ids)
+ .then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getModelList();
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
+const handleImport = () => {
+ importDia.value = true;
+ if (importUploadRef.value) {
+ importUploadRef.value.clearFiles();
}
- // 鏌ヨ鍒楄〃鏄惁鏈夊尮閰嶆暟鎹紝灏嗗�煎皬鍐欙紝鍖归厤鑻辨枃鏁版嵁
- let val = value.toLowerCase()
- return chooseNode(val, data, node) // 璋冪敤杩囨护浜屽眰鏂规硶
-}
-// 杩囨护鐖惰妭鐐� / 瀛愯妭鐐� (濡傛灉杈撳叆鐨勫弬鏁版槸鐖惰妭鐐逛笖鑳藉尮閰嶏紝鍒欒繑鍥炶鑺傜偣浠ュ強鍏朵笅鐨勬墍鏈夊瓙鑺傜偣锛涘鏋滃弬鏁版槸瀛愯妭鐐癸紝鍒欒繑鍥炶鑺傜偣鐨勭埗鑺傜偣銆俷ame鏄腑鏂囧瓧绗︼紝enName鏄嫳鏂囧瓧绗�.
-const chooseNode = (value, data, node) => {
- if (data.label.indexOf(value) !== -1) {
- return true
- }
- const level = node.level
- // 濡傛灉浼犲叆鐨勮妭鐐规湰韬氨鏄竴绾ц妭鐐瑰氨涓嶇敤鏍¢獙浜�
- if (level === 1) {
- return false
- }
- // 鍏堝彇褰撳墠鑺傜偣鐨勭埗鑺傜偣
- let parentData = node.parent
- // 閬嶅巻褰撳墠鑺傜偣鐨勭埗鑺傜偣
- let index = 0
- while (index < level - 1) {
- // 濡傛灉鍖归厤鍒扮洿鎺ヨ繑鍥烇紝姝ゅname鍊兼槸涓枃瀛楃锛宔nName鏄嫳鏂囧瓧绗︺�傚垽鏂尮閰嶄腑鑻辨枃杩囨护
- if (parentData.data.label.indexOf(value) !== -1) {
- return true
- }
- // 鍚﹀垯鐨勮瘽鍐嶅線涓婁竴灞傚仛鍖归厤
- parentData = parentData.parent
- index++
- }
- // 娌″尮閰嶅埌杩斿洖false
- return false
-}
-getProductTreeList()
+};
+
+const submitImport = () => {
+ importUploadRef.value.submit();
+};
+
+const importTemplate = () => {
+ proxy.download("/basic/product/downloadTemplate", {}, "浜у搧瀵煎叆妯℃澘.xlsx");
+};
+
+getModelList();
</script>
<style scoped>
.product-view {
- display: flex;
+ padding: 20px;
+ background: #f5f7fa;
+ min-height: 100vh;
}
-.left {
- width: 380px;
- padding: 16px;
+
+.main-content {
background: #ffffff;
+ border-radius: 8px;
+ padding: 24px;
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
-.right {
- width: calc(100% - 380px);
- padding: 16px;
- margin-left: 20px;
- background: #ffffff;
+
+.search-section {
+ margin-bottom: 20px;
+ padding-bottom: 20px;
+ border-bottom: 1px solid #e4e7ed;
}
-.custom-tree-node {
- flex: 1;
+
+.search-form {
display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
align-items: center;
- justify-content: space-between;
- font-size: 14px;
- padding-right: 8px;
}
-</style>
\ No newline at end of file
+
+.search-form :deep(.el-form-item) {
+ margin-bottom: 12px;
+}
+
+.action-buttons {
+ display: flex;
+ gap: 10px;
+ margin-top: 16px;
+}
+
+:deep(.el-dialog__body) {
+ padding: 20px 24px;
+}
+
+:deep(.el-form-item__label) {
+ font-weight: 500;
+ color: #303133;
+}
+
+:deep(.el-input__inner) {
+ border-radius: 4px;
+}
+
+:deep(.el-button) {
+ border-radius: 4px;
+ font-weight: 500;
+}
+
+:deep(.el-upload-dragger) {
+ border-radius: 8px;
+ border: 2px dashed #dcdfe6;
+ transition: all 0.3s;
+}
+
+:deep(.el-upload-dragger:hover) {
+ border-color: #409eff;
+ background-color: #f5f7fa;
+}
+</style>
--
Gitblit v1.9.3