refactor(wms): 清理无用代码并优化格式
删除废弃的BOM相关组件和文件 优化仓库组件代码格式和样式 移除注释掉的BOM面板引用 统一表单元素格式 清理冗余样式代码
This commit is contained in:
@@ -1,263 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<KLPTable v-loading="loading" :data="bomItemList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="属性名称" align="center" prop="attrKey">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.attrKey }}</span>
|
|
||||||
<span v-if="scope.row.remark">
|
|
||||||
<el-tooltip :content="scope.row.remark" placement="top">
|
|
||||||
<i class="el-icon-info"></i>
|
|
||||||
</el-tooltip>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="属性值" align="center" prop="attrValue" />
|
|
||||||
<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
|
|
||||||
<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)"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</KLPTable>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改参数 明细,存放属性–值对话框 -->
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="属性名称" prop="attrKey">
|
|
||||||
<el-input v-model="form.attrKey" placeholder="请输入属性名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="属性值" prop="attrValue">
|
|
||||||
<el-input v-model="form.attrValue" placeholder="请输入属性值" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listBomItem, getBomItem, delBomItem, addBomItem, updateBomItem } from "@/api/wms/bomItem";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "BomItem",
|
|
||||||
dicts: ['common_swicth'],
|
|
||||||
props: {
|
|
||||||
bomId: [String, Number],
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 按钮loading
|
|
||||||
buttonLoading: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 参数 明细,存放属性–值表格数据
|
|
||||||
bomItemList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
bomId: this.bomId,
|
|
||||||
attrKey: undefined,
|
|
||||||
attrValue: undefined,
|
|
||||||
isEnabled: undefined,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
bomId: this.bomId,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询参数 明细,存放属性–值列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listBomItem(this.queryParams).then(response => {
|
|
||||||
this.bomItemList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
itemId: undefined,
|
|
||||||
bomId: this.bomId,
|
|
||||||
attrKey: undefined,
|
|
||||||
attrValue: undefined,
|
|
||||||
remark: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.itemId)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加参数 明细,存放属性–值";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.loading = true;
|
|
||||||
this.reset();
|
|
||||||
const itemId = row.itemId || this.ids
|
|
||||||
getBomItem(itemId).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改参数 明细,存放属性–值";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.buttonLoading = true;
|
|
||||||
if (this.form.itemId != null) {
|
|
||||||
updateBomItem(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addBomItem(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const itemIds = row.itemId || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除参数 明细,存放属性–值编号为"' + itemIds + '"的数据项?').then(() => {
|
|
||||||
this.loading = true;
|
|
||||||
return delBomItem(itemIds);
|
|
||||||
}).then(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
this.$store.dispatch('category/getBomMap');
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('wms/bomItem/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `bomItem_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,243 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="bom-container">
|
|
||||||
<!-- 当没有传入id时显示创建按钮 -->
|
|
||||||
<div v-if="!id" class="create-bom">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
:loading="createLoading"
|
|
||||||
:disabled="createLoading"
|
|
||||||
@click="handleCreate"
|
|
||||||
class="create-button"
|
|
||||||
>
|
|
||||||
<template v-if="!createLoading">
|
|
||||||
<i class="el-icon-plus"></i> 创建参数
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
创建中...
|
|
||||||
</template>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 当传入id时显示数据区域 -->
|
|
||||||
<div v-else class="bom-details">
|
|
||||||
<div v-if="loading" class="loading-indicator">
|
|
||||||
加载中...
|
|
||||||
<div class="spinner"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="error" class="error-message">
|
|
||||||
加载失败: {{ error }}
|
|
||||||
<button @click="fetchData" class="retry-button">重试</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="data && !loading">
|
|
||||||
<el-form label-width="100px">
|
|
||||||
<el-form-item label="参数名称">
|
|
||||||
<el-input v-model="info.bomName" @blur="handleUpdateBom"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="参数编码">
|
|
||||||
<el-input v-model="info.bomCode" @blur="handleUpdateBom"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<BomItem :bomId="id" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { addBom, updateBom, getBom } from '@/api/wms/bom';
|
|
||||||
import { listBomItem } from '@/api/wms/bomItem';
|
|
||||||
import { updateProduct } from '@/api/wms/product';
|
|
||||||
import { updateRawMaterial } from '@/api/wms/rawMaterial';
|
|
||||||
|
|
||||||
import BomItem from './BomItem.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
id: [String, Number], // 支持字符串或数字类型的ID
|
|
||||||
itemId: [String, Number],
|
|
||||||
type: String // 可选类型参数
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
BomItem
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
error: null,
|
|
||||||
data: null,
|
|
||||||
info: {},
|
|
||||||
createLoading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
id: {
|
|
||||||
immediate: true, // 组件创建时立即执行
|
|
||||||
handler(newVal) {
|
|
||||||
if (newVal) {
|
|
||||||
console.log('侦听到变化')
|
|
||||||
this.fetchBomDetails();
|
|
||||||
} else {
|
|
||||||
// 没有ID时重置数据
|
|
||||||
this.data = null;
|
|
||||||
this.error = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async fetchBomDetails() {
|
|
||||||
try {
|
|
||||||
this.loading = true;
|
|
||||||
this.error = null;
|
|
||||||
|
|
||||||
// 实际项目中替换为真实API调用
|
|
||||||
const response = await listBomItem({
|
|
||||||
bomId: this.id
|
|
||||||
})
|
|
||||||
this.data = response.rows;
|
|
||||||
|
|
||||||
const response2 = await getBom(this.id)
|
|
||||||
this.info = response2.data;
|
|
||||||
} catch (err) {
|
|
||||||
this.error = err.message || '请求失败,请重试';
|
|
||||||
console.error('获取参数详情失败:', err);
|
|
||||||
} finally {
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async handleCreate() {
|
|
||||||
// 防止重复点击
|
|
||||||
if (this.createLoading) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.createLoading = true;
|
|
||||||
const bomResponse = await addBom({
|
|
||||||
bomName: (this.type == 'product' ? '产品参数' : '原材料参数') + new Date().getTime(),
|
|
||||||
bomCode: (this.type == 'product' ? 'P' : 'R') + new Date().getTime()
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$message.success('创建参数成功');
|
|
||||||
const bomData = bomResponse.data;
|
|
||||||
|
|
||||||
// 根据类型更新产品/原材料
|
|
||||||
if (this.type == 'product' && this.itemId) {
|
|
||||||
await updateProduct({
|
|
||||||
productId: this.itemId,
|
|
||||||
bomId: bomData.bomId
|
|
||||||
});
|
|
||||||
} else if (this.type == 'raw_material' && this.itemId) {
|
|
||||||
await updateRawMaterial({
|
|
||||||
rawMaterialId: this.itemId,
|
|
||||||
bomId: bomData.bomId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.$store.dispatch('category/getBomMap');
|
|
||||||
|
|
||||||
// 触发事件
|
|
||||||
this.$emit('addBom', bomData);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('创建失败:', error);
|
|
||||||
this.$message.error(`创建失败: ${error.message || '未知错误'}`);
|
|
||||||
} finally {
|
|
||||||
this.createLoading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleUpdateBom() {
|
|
||||||
this.$message.warning('正在更新参数...');
|
|
||||||
updateBom({
|
|
||||||
bomId: this.id,
|
|
||||||
bomName: this.info.bomName,
|
|
||||||
bomCode: this.info.bomCode
|
|
||||||
}).then(_ => {
|
|
||||||
this.$message.success('更新参数成功');
|
|
||||||
this.$store.dispatch('category/getBomMap');
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchData() {
|
|
||||||
// 重试获取数据
|
|
||||||
if (this.id) this.fetchBomDetails();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.create-bom {
|
|
||||||
text-align: center;
|
|
||||||
padding: 40px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-button {
|
|
||||||
background-color: #4CAF50;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 12px 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background-color 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-button:hover {
|
|
||||||
background-color: #388E3C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-indicator {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 20px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
border: 3px solid rgba(0,0,0,0.1);
|
|
||||||
border-radius: 50%;
|
|
||||||
border-top-color: #3498db;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-message {
|
|
||||||
padding: 20px;
|
|
||||||
background-color: #ffebee;
|
|
||||||
color: #d32f2f;
|
|
||||||
border-radius: 4px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.retry-button {
|
|
||||||
padding: 8px 16px;
|
|
||||||
background-color: #f44336;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
width: 120px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bom-info {
|
|
||||||
margin-top: 20px;
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
border-radius: 4px;
|
|
||||||
border-left: 4px solid #2196F3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bom-info p {
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -93,8 +93,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="位置" prop="position">
|
<el-form-item label="位置" prop="position">
|
||||||
<el-radio-group v-model="form.position">
|
<el-radio-group v-model="form.position">
|
||||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value"
|
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||||
:label="dict.value">{{ dict.label }}</el-radio-button>
|
dict.label }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="长度坐标" prop="lengthCoord">
|
<el-form-item label="长度坐标" prop="lengthCoord">
|
||||||
@@ -102,14 +102,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="缺陷代码" prop="defectCode">
|
<el-form-item label="缺陷代码" prop="defectCode">
|
||||||
<el-radio-group v-model="form.defectCode">
|
<el-radio-group v-model="form.defectCode">
|
||||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value"
|
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||||
:label="dict.value">{{ dict.label }}</el-radio-button>
|
dict.label }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="程度" prop="degree">
|
<el-form-item label="程度" prop="degree">
|
||||||
<el-radio-group v-model="form.degree">
|
<el-radio-group v-model="form.degree">
|
||||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value"
|
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||||
:label="dict.value">{{ dict.label }}</el-radio-button>
|
dict.label }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
@@ -127,8 +127,8 @@
|
|||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="判级" prop="judgeLevel">
|
<el-form-item label="判级" prop="judgeLevel">
|
||||||
<el-radio-group v-model="form.judgeLevel">
|
<el-radio-group v-model="form.judgeLevel">
|
||||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_level" :key="dict.value"
|
<el-radio-button v-for="dict in dict.type.coil_abnormal_level" :key="dict.value" :label="dict.value">{{
|
||||||
:label="dict.value">{{ dict.label }}</el-radio-button>
|
dict.label }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -3,21 +3,17 @@
|
|||||||
<!-- 搜索栏 -->
|
<!-- 搜索栏 -->
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
<el-form-item label="钢卷号" prop="currentCoilNo">
|
<el-form-item label="钢卷号" prop="currentCoilNo">
|
||||||
<el-input
|
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入钢卷号" clearable
|
||||||
v-model="queryParams.currentCoilNo"
|
@keyup.enter.native="handleQuery" />
|
||||||
placeholder="请输入钢卷号"
|
</el-form-item>
|
||||||
clearable
|
<el-form-item label="操作类型" prop="actionType">
|
||||||
@keyup.enter.native="handleQuery"
|
<el-select v-model="queryParams.actionType" placeholder="请选择操作类型">
|
||||||
/>
|
<el-option v-for="item in dict.type.action_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="只看待操作" prop="actionStatus">
|
||||||
|
<el-switch @change="switchActionStatus" v-model="queryParams.actionSwitch" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作类型" prop="actionType">
|
|
||||||
<el-select v-model="queryParams.actionType" placeholder="请选择操作类型">
|
|
||||||
<el-option v-for="item in dict.type.action_type" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="只看待操作" prop="actionStatus">
|
|
||||||
<el-switch @change="switchActionStatus" v-model="queryParams.actionSwitch"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<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 icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@@ -27,45 +23,22 @@
|
|||||||
<!-- 工具栏 -->
|
<!-- 工具栏 -->
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||||
type="danger"
|
@click="handleDelete">删除</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-refresh" size="mini" @click="handleRefresh"
|
||||||
type="warning"
|
:disabled="buttonLoading" v-loading="buttonLoading">刷新</el-button>
|
||||||
plain
|
|
||||||
icon="el-icon-refresh"
|
|
||||||
size="mini"
|
|
||||||
@click="handleRefresh"
|
|
||||||
:disabled="buttonLoading"
|
|
||||||
v-loading="buttonLoading"
|
|
||||||
>刷新</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
<el-table
|
<el-table v-loading="loading" :data="actionList" @selection-change="handleSelectionChange"
|
||||||
v-loading="loading"
|
:row-class-name="tableRowClassName">
|
||||||
:data="actionList"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
:row-class-name="tableRowClassName"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||||
|
|
||||||
@@ -75,15 +48,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作类型" align="center" prop="actionType" width="160" >
|
<el-table-column label="操作类型" align="center" prop="actionType" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.actionType===5">移库操作已在移动端完成</span>
|
<span v-if="scope.row.actionType === 5">移库操作已在移动端完成</span>
|
||||||
<span v-else-if="scope.row.actionType===4">发货操作已在移动端完成</span>
|
<span v-else-if="scope.row.actionType === 4">发货操作已在移动端完成</span>
|
||||||
<span v-else-if="scope.row.actionType===401">入库操作</span>
|
<span v-else-if="scope.row.actionType === 401">入库操作</span>
|
||||||
<span v-else-if="scope.row.actionType===402">发货操作</span>
|
<span v-else-if="scope.row.actionType === 402">发货操作</span>
|
||||||
<span v-else-if="scope.row.actionType===403">移库操作</span>
|
<span v-else-if="scope.row.actionType === 403">移库操作</span>
|
||||||
<span v-else-if="scope.row.actionType===404">通过库区编辑钢卷</span>
|
<span v-else-if="scope.row.actionType === 404">通过库区编辑钢卷</span>
|
||||||
<dict-tag v-else :options='dict.type.action_type' :value="scope.row.actionType "></dict-tag>
|
<dict-tag v-else :options='dict.type.action_type' :value="scope.row.actionType"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@@ -136,59 +109,27 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- 待处理状态显示操作按钮 -->
|
<!-- 待处理状态显示操作按钮 -->
|
||||||
<template v-if="scope.row.actionStatus === 0">
|
<template v-if="scope.row.actionStatus === 0">
|
||||||
<el-button
|
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleProcess(scope.row)"
|
||||||
size="mini"
|
v-loading="buttonLoading" :disabled="buttonLoading">操作</el-button>
|
||||||
type="primary"
|
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleProcess(scope.row)"
|
|
||||||
v-loading="buttonLoading"
|
|
||||||
:disabled="buttonLoading"
|
|
||||||
>操作</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 处理中状态显示继续按钮 -->
|
<!-- 处理中状态显示继续按钮 -->
|
||||||
<template v-else-if="scope.row.actionStatus === 1">
|
<template v-else-if="scope.row.actionStatus === 1">
|
||||||
<el-button
|
<el-button size="mini" type="warning" icon="el-icon-edit" @click="handleProcess(scope.row)"
|
||||||
size="mini"
|
:disabled="buttonLoading" v-loading="buttonLoading">继续</el-button>
|
||||||
type="warning"
|
<el-button size="mini" type="info" icon="el-icon-close" @click="handleCancel(scope.row)">取消</el-button>
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleProcess(scope.row)"
|
|
||||||
:disabled="buttonLoading"
|
|
||||||
v-loading="buttonLoading"
|
|
||||||
>继续</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="info"
|
|
||||||
icon="el-icon-close"
|
|
||||||
@click="handleCancel(scope.row)"
|
|
||||||
>取消</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 已完成或已取消状态显示删除按钮 -->
|
<!-- 已完成或已取消状态显示删除按钮 -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-button
|
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改对话框 -->
|
<!-- 添加或修改对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
|
||||||
@@ -202,12 +143,8 @@
|
|||||||
<div class="card-section" v-if="splitTypes.length > 0">
|
<div class="card-section" v-if="splitTypes.length > 0">
|
||||||
<div class="section-title">分条操作</div>
|
<div class="section-title">分条操作</div>
|
||||||
<div class="action-cards-row">
|
<div class="action-cards-row">
|
||||||
<div
|
<div v-for="item in splitTypes" :key="item.value" class="action-card split-card"
|
||||||
v-for="item in splitTypes"
|
:class="{ 'active': form.actionType == item.value }" @click="form.actionType = parseInt(item.value)">
|
||||||
:key="item.value"
|
|
||||||
class="action-card split-card"
|
|
||||||
:class="{ 'active': form.actionType == item.value }"
|
|
||||||
@click="form.actionType = parseInt(item.value)">
|
|
||||||
<div class="card-icon">
|
<div class="card-icon">
|
||||||
<i :class="getActionIcon(item.value)"></i>
|
<i :class="getActionIcon(item.value)"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -218,17 +155,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 其他操作区 -->
|
<!-- 其他操作区 -->
|
||||||
<div class="card-section" v-if="otherTypes.length > 0">
|
<div class="card-section" v-if="otherTypes.length > 0">
|
||||||
<div class="section-title">其他操作</div>
|
<div class="section-title">其他操作</div>
|
||||||
<div class="action-cards-row">
|
<div class="action-cards-row">
|
||||||
<div
|
<div v-for="item in otherTypes" :key="item.value" class="action-card"
|
||||||
v-for="item in otherTypes"
|
:class="{ 'active': form.actionType == item.value }" @click="form.actionType = parseInt(item.value)">
|
||||||
:key="item.value"
|
|
||||||
class="action-card"
|
|
||||||
:class="{ 'active': form.actionType == item.value }"
|
|
||||||
@click="form.actionType = parseInt(item.value)">
|
|
||||||
<div class="card-icon">
|
<div class="card-icon">
|
||||||
<i :class="getActionIcon(item.value)"></i>
|
<i :class="getActionIcon(item.value)"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -253,7 +186,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm" :disabled="buttonLoading" v-loading="buttonLoading">确 定</el-button>
|
<el-button type="primary" @click="submitForm" :disabled="buttonLoading" v-loading="buttonLoading">确
|
||||||
|
定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -464,7 +398,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$message.success('删除成功');
|
this.$message.success('删除成功');
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
/** 处理操作 - 跳转到对应页面 */
|
/** 处理操作 - 跳转到对应页面 */
|
||||||
handleProcess(row) {
|
handleProcess(row) {
|
||||||
@@ -485,17 +419,17 @@ export default {
|
|||||||
|
|
||||||
// 根据操作类型跳转到不同页面
|
// 根据操作类型跳转到不同页面
|
||||||
let path = '';
|
let path = '';
|
||||||
|
|
||||||
// 分条操作:100-199
|
// 分条操作:100-199
|
||||||
if (actionType >= 100 && actionType <= 199) {
|
if (actionType >= 100 && actionType <= 199) {
|
||||||
path = '/wms/split';
|
path = '/wms/split';
|
||||||
}
|
}
|
||||||
// 合卷操作:200-299
|
// 合卷操作:200-299
|
||||||
else if (actionType == 200) {
|
else if (actionType == 200) {
|
||||||
path = '/wms/merge';
|
path = '/wms/merge';
|
||||||
}
|
}
|
||||||
// 其他操作类型
|
// 其他操作类型
|
||||||
else{
|
else {
|
||||||
path = '/wms/typing';
|
path = '/wms/typing';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,7 +474,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$message.success('操作已取消');
|
this.$message.success('操作已取消');
|
||||||
this.getList();
|
this.getList();
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
/** 刷新列表 */
|
/** 刷新列表 */
|
||||||
handleRefresh() {
|
handleRefresh() {
|
||||||
@@ -552,8 +486,8 @@ export default {
|
|||||||
// 每30秒自动刷新一次(用于移动端扫码后自动更新列表)
|
// 每30秒自动刷新一次(用于移动端扫码后自动更新列表)
|
||||||
this.refreshTimer = setInterval(() => {
|
this.refreshTimer = setInterval(() => {
|
||||||
|
|
||||||
// 只在查看待处理状态时自动刷新
|
// 只在查看待处理状态时自动刷新
|
||||||
this.getList();
|
this.getList();
|
||||||
}, 30000);
|
}, 30000);
|
||||||
},
|
},
|
||||||
/** 表格行样式 */
|
/** 表格行样式 */
|
||||||
@@ -653,15 +587,15 @@ export default {
|
|||||||
/* 操作类型卡片样式 */
|
/* 操作类型卡片样式 */
|
||||||
.action-type-cards {
|
.action-type-cards {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.card-section {
|
.card-section {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -670,18 +604,18 @@ export default {
|
|||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
border-left: 3px solid #409eff;
|
border-left: 3px solid #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分条操作区域的特殊样式
|
// 分条操作区域的特殊样式
|
||||||
.card-section:first-child .section-title {
|
.card-section:first-child .section-title {
|
||||||
border-left-color: #e6a23c;
|
border-left-color: #e6a23c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-cards-row {
|
.action-cards-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-card {
|
.action-card {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -693,50 +627,50 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: #409eff;
|
border-color: #409eff;
|
||||||
box-shadow: 0 2px 12px 0 rgba(64, 158, 255, 0.15);
|
box-shadow: 0 2px 12px 0 rgba(64, 158, 255, 0.15);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
border-color: #409eff;
|
border-color: #409eff;
|
||||||
background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
|
background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
|
||||||
box-shadow: 0 2px 12px 0 rgba(64, 158, 255, 0.3);
|
box-shadow: 0 2px 12px 0 rgba(64, 158, 255, 0.3);
|
||||||
|
|
||||||
.card-icon {
|
.card-icon {
|
||||||
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
|
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.split-card {
|
&.split-card {
|
||||||
&.active {
|
&.active {
|
||||||
background: linear-gradient(135deg, #fff3e0 0%, #fff8f0 100%);
|
background: linear-gradient(135deg, #fff3e0 0%, #fff8f0 100%);
|
||||||
border-color: #e6a23c;
|
border-color: #e6a23c;
|
||||||
|
|
||||||
.card-icon {
|
.card-icon {
|
||||||
background: linear-gradient(135deg, #e6a23c 0%, #f0ad4e 100%);
|
background: linear-gradient(135deg, #e6a23c 0%, #f0ad4e 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
color: #e6a23c;
|
color: #e6a23c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: #e6a23c;
|
border-color: #e6a23c;
|
||||||
box-shadow: 0 2px 12px 0 rgba(230, 162, 60, 0.15);
|
box-shadow: 0 2px 12px 0 rgba(230, 162, 60, 0.15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-icon {
|
.card-icon {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
@@ -750,11 +684,11 @@ export default {
|
|||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-content {
|
.card-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -762,7 +696,7 @@ export default {
|
|||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-desc {
|
.card-desc {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
|
|||||||
@@ -259,9 +259,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="参数" @close="bomDialogVisible = false" :visible.sync="bomDialogVisible" width="600px" append-to-body>
|
<!-- <el-dialog title="参数" @close="bomDialogVisible = false" :visible.sync="bomDialogVisible" width="600px" append-to-body>
|
||||||
<BomPanel :id="bomId" type="product" @addBom="handleAddBom" :itemId="itemId" />
|
<BomPanel :id="bomId" type="product" @addBom="handleAddBom" :itemId="itemId" />
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ import { listProduct, getProduct, delProduct, addProduct, updateProduct } from "
|
|||||||
import CategorySelect from '@/components/KLPService/CategorySelect';
|
import CategorySelect from '@/components/KLPService/CategorySelect';
|
||||||
import CategoryRenderer from '@/components/KLPService/Renderer/CategoryRenderer.vue';
|
import CategoryRenderer from '@/components/KLPService/Renderer/CategoryRenderer.vue';
|
||||||
import UserSelect from '@/components/KLPService/UserSelect';
|
import UserSelect from '@/components/KLPService/UserSelect';
|
||||||
import BomPanel from '../bom/components/BomPanel.vue';
|
// import BomPanel from '../bom/components/BomPanel.vue';
|
||||||
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
import BomInfoMini from '@/components/KLPService/Renderer/BomInfoMini.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -279,7 +279,7 @@ export default {
|
|||||||
CategorySelect,
|
CategorySelect,
|
||||||
CategoryRenderer,
|
CategoryRenderer,
|
||||||
UserSelect,
|
UserSelect,
|
||||||
BomPanel,
|
// BomPanel,
|
||||||
BomInfoMini
|
BomInfoMini
|
||||||
},
|
},
|
||||||
dicts: ['common_swicth'],
|
dicts: ['common_swicth'],
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
const layerData = layerMap[layer];
|
const layerData = layerMap[layer];
|
||||||
const totalGrid = layerData.maxRow * layerData.maxColumn;
|
const totalGrid = layerData.maxRow * layerData.maxColumn;
|
||||||
layerData.emptyCount = Math.max(0, totalGrid - layerData.warehouses.length);
|
layerData.emptyCount = Math.max(0, totalGrid - layerData.warehouses.length);
|
||||||
|
|
||||||
// 按行号+列号排序
|
// 按行号+列号排序
|
||||||
layerData.warehouses.sort((a, b) => {
|
layerData.warehouses.sort((a, b) => {
|
||||||
if (a.parsedInfo.row !== b.parsedInfo.row) {
|
if (a.parsedInfo.row !== b.parsedInfo.row) {
|
||||||
@@ -253,6 +253,7 @@ export default {
|
|||||||
// 分层容器样式
|
// 分层容器样式
|
||||||
.layers-container {
|
.layers-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
.layer-section {
|
.layer-section {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid-wrapper">
|
<div class="grid-wrapper">
|
||||||
<!-- 核心滚动容器:列标尺 + 网格区域共享滚动条 -->
|
|
||||||
<div class="grid-scroll-container" ref="scrollContainerRef">
|
<div class="grid-scroll-container" ref="scrollContainerRef">
|
||||||
<!-- 滚动内容容器:列标尺 + 行标尺+网格 -->
|
|
||||||
<div class="scroll-content">
|
<div class="scroll-content">
|
||||||
<!-- 列标尺(顶部) -->
|
<!-- 列标尺(顶部) -->
|
||||||
<div class="col-ruler">
|
<div class="col-ruler">
|
||||||
@@ -357,16 +355,4 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹窗样式优化
|
|
||||||
::v-deep(.el-descriptions) {
|
|
||||||
.el-descriptions-item__label {
|
|
||||||
font-weight: 500;
|
|
||||||
color: #606266;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-descriptions-item__content {
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
@@ -4,23 +4,15 @@
|
|||||||
<div class="layout-container">
|
<div class="layout-container">
|
||||||
<!-- 左侧树形结构 -->
|
<!-- 左侧树形结构 -->
|
||||||
<div class="tree-container" v-loading="treeLoading">
|
<div class="tree-container" v-loading="treeLoading">
|
||||||
<el-tree
|
<el-tree ref="warehouseTreeRef" :data="warehouseTree" :props="treeProps" node-key="actualWarehouseId"
|
||||||
ref="warehouseTreeRef"
|
@node-click="handleNodeClick" :expand-on-click-node="false" highlight-current class="warehouse-tree"
|
||||||
:data="warehouseTree"
|
:disabled="isSwitching">
|
||||||
:props="treeProps"
|
|
||||||
node-key="actualWarehouseId"
|
|
||||||
@node-click="handleNodeClick"
|
|
||||||
:expand-on-click-node="false"
|
|
||||||
highlight-current
|
|
||||||
class="warehouse-tree"
|
|
||||||
:disabled="isSwitching"
|
|
||||||
>
|
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧仓库信息区域 - 替换为 Bird 组件 -->
|
<!-- 右侧仓库信息区域 - 替换为 Bird 组件 -->
|
||||||
<div class="warehouse-container" v-if="selectedNodeId" v-loading="rightLoading"
|
<div class="warehouse-container" v-if="selectedNodeId" v-loading="rightLoading" element-loading-text="加载中..."
|
||||||
element-loading-text="加载中..." element-loading-spinner="el-icon-loading">
|
element-loading-spinner="el-icon-loading">
|
||||||
<WarehouseBird :warehouse-list="warehouseList" @open-init-dialog="openInitDialog" />
|
<WarehouseBird :warehouse-list="warehouseList" @open-init-dialog="openInitDialog" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -39,16 +31,10 @@
|
|||||||
<div class="selector-tip">
|
<div class="selector-tip">
|
||||||
拖动/点击选择网格范围(当前:{{ initForm.rowCount || 0 }}行 × {{ initForm.columnCount || 0 }}列)
|
拖动/点击选择网格范围(当前:{{ initForm.rowCount || 0 }}行 × {{ initForm.columnCount || 0 }}列)
|
||||||
</div>
|
</div>
|
||||||
<div class="grid-selector"
|
<div class="grid-selector" @mousemove="handleGridHover" @click="confirmGridSelect"
|
||||||
@mousemove="handleGridHover"
|
@mouseleave="resetGridHover">
|
||||||
@click="confirmGridSelect"
|
|
||||||
@mouseleave="resetGridHover">
|
|
||||||
<div v-for="row in 40" :key="`grid-row-${row}`" class="grid-selector-row">
|
<div v-for="row in 40" :key="`grid-row-${row}`" class="grid-selector-row">
|
||||||
<div
|
<div v-for="col in 10" :key="`grid-col-${col}`" class="grid-selector-cell" :class="{
|
||||||
v-for="col in 10"
|
|
||||||
:key="`grid-col-${col}`"
|
|
||||||
class="grid-selector-cell"
|
|
||||||
:class="{
|
|
||||||
hovered: row <= hoverRow && col <= hoverCol,
|
hovered: row <= hoverRow && col <= hoverCol,
|
||||||
selected: row <= initForm.rowCount && col <= initForm.columnCount
|
selected: row <= initForm.rowCount && col <= initForm.columnCount
|
||||||
}">
|
}">
|
||||||
@@ -154,7 +140,7 @@ export default {
|
|||||||
this.rightLoading = true;
|
this.rightLoading = true;
|
||||||
this.selectedNodeId = node.actualWarehouseId;
|
this.selectedNodeId = node.actualWarehouseId;
|
||||||
this.selectedNode = node;
|
this.selectedNode = node;
|
||||||
|
|
||||||
this.getWarehouseList(node.actualWarehouseId)
|
this.getWarehouseList(node.actualWarehouseId)
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.rightLoading = false;
|
this.rightLoading = false;
|
||||||
@@ -308,13 +294,6 @@ export default {
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
.warehouse-tree {
|
|
||||||
--el-tree-text-color: #303133;
|
|
||||||
--el-tree-node-hover-bg-color: #e8f4ff;
|
|
||||||
--el-tree-current-bg-color: #409eff;
|
|
||||||
--el-tree-current-text-color: #fff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.warehouse-container {
|
.warehouse-container {
|
||||||
@@ -354,7 +333,6 @@ export default {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
border: 1px solid #e6e6e6;
|
border: 1px solid #e6e6e6;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
cursor: crosshair;
|
|
||||||
|
|
||||||
.grid-selector-row {
|
.grid-selector-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -384,8 +362,4 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep(.el-form-item) {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user