From f294efb8c01ad8b0704a92d51c14dbd55d898874 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:46 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)
---
src/views/system/dept/index.vue | 111 +++++++++++++++++++++----------------------------------
1 files changed, 42 insertions(+), 69 deletions(-)
diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index e502b4e..c670240 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -2,65 +2,39 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="閮ㄩ棬鍚嶇О" prop="deptName">
- <el-input
- v-model="queryParams.deptName"
- placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�"
- clearable
- @keyup.enter.native="handleQuery"
- />
+ <el-input v-model="queryParams.deptName" placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="鐘舵��" prop="status">
<el-select v-model="queryParams.status" placeholder="閮ㄩ棬鐘舵��" clearable>
- <el-option
- v-for="dict in dict.type.sys_normal_disable"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
+ <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
+ :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ <el-button type="primary" size="mini" @click="handleQuery">鏌ヨ</el-button>
+ <el-button size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['system:dept:add']"
- >鏂板</el-button>
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+ v-hasPermi="['system:dept:add']">鏂板</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="info"
- plain
- icon="el-icon-sort"
- size="mini"
- @click="toggleExpandAll"
- >灞曞紑/鎶樺彔</el-button>
+ <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">灞曞紑/鎶樺彔</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table
- v-if="refreshTable"
- v-loading="loading"
- :data="deptList"
- row-key="deptId"
- :default-expand-all="isExpandAll"
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
- >
+ <el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="deptId"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column prop="deptName" label="閮ㄩ棬鍚嶇О" width="260"></el-table-column>
<el-table-column prop="orderNum" label="鎺掑簭" width="200"></el-table-column>
<el-table-column prop="status" label="鐘舵��" width="100">
<template slot-scope="scope">
- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="200">
@@ -70,28 +44,12 @@
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['system:dept:edit']"
- >淇敼</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-plus"
- @click="handleAdd(scope.row)"
- v-hasPermi="['system:dept:add']"
- >鏂板</el-button>
- <el-button
- v-if="scope.row.parentId != 0"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['system:dept:remove']"
- >鍒犻櫎</el-button>
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
+ v-hasPermi="['system:dept:edit']">淇敼</el-button>
+ <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
+ v-hasPermi="['system:dept:add']">鏂板</el-button>
+ <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete"
+ @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -102,7 +60,8 @@
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">
<el-form-item label="涓婄骇閮ㄩ棬" prop="parentId">
- <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="閫夋嫨涓婄骇閮ㄩ棬" />
+ <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer"
+ placeholder="閫夋嫨涓婄骇閮ㄩ棬" />
</el-form-item>
</el-col>
</el-row>
@@ -139,11 +98,9 @@
<el-col :span="12">
<el-form-item label="閮ㄩ棬鐘舵��">
<el-radio-group v-model="form.status">
- <el-radio
- v-for="dict in dict.type.sys_normal_disable"
- :key="dict.value"
- :label="dict.value"
- >{{dict.label}}</el-radio>
+ <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{
+ dict.label
+ }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@@ -280,6 +237,7 @@
this.title = "娣诲姞閮ㄩ棬";
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
+ this.deptOptions = this.limitTreeDepth(this.deptOptions, 2)
});
},
/** 灞曞紑/鎶樺彔鎿嶄綔 */
@@ -303,11 +261,12 @@
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
this.deptOptions.push(noResultsOptions);
}
+ this.deptOptions = this.limitTreeDepth(this.deptOptions, 2)
});
});
},
/** 鎻愪氦鎸夐挳 */
- submitForm: function() {
+ submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deptId != undefined) {
@@ -328,12 +287,26 @@
},
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
- this.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」锛�').then(function() {
+ this.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」锛�').then(function () {
return delDept(row.deptId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ }).catch(() => { });
+ },
+ // 閫掑綊鍑芥暟锛岀敤浜庨檺鍒舵爲鐨勬繁搴�
+ limitTreeDepth(options, maxDepth, currentDepth = 1) {
+ return options.map(option => {
+ const newOption = { ...option };
+ if (currentDepth < maxDepth && option.children) {
+ // 濡傛灉褰撳墠娣卞害灏忎簬鏈�澶ф繁搴︿笖瀛樺湪瀛愯妭鐐癸紝鍒欓�掑綊澶勭悊瀛愯妭鐐�
+ newOption.children = this.limitTreeDepth(option.children, maxDepth, currentDepth + 1);
+ } else {
+ // 鍚﹀垯绉婚櫎瀛愯妭鐐�
+ delete newOption.children;
+ }
+ return newOption;
+ });
}
}
};
--
Gitblit v1.9.3