feat:基础数据/产品类型
This commit is contained in:
parent
59d4fdb430
commit
c517f486b6
35
.vscode/settings.json
vendored
35
.vscode/settings.json
vendored
@ -5,9 +5,13 @@
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.formatOnType": true,
|
||||
// 配置eslint适用于vue代码
|
||||
"eslint.validate": ["javascript", "typescript", "vue"],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
"vue"
|
||||
],
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"[scss]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
@ -47,13 +51,30 @@
|
||||
}
|
||||
},
|
||||
"i18n-ally.displayLanguage": "zh-cn",
|
||||
"i18n-ally.enabledParsers": ["json", "js"],
|
||||
"i18n-ally.localesPaths": ["src/i18n/lang", "src/i18n/pages/login", "src/i18n/pages/menu"],
|
||||
"i18n-ally.enabledParsers": [
|
||||
"json",
|
||||
"js"
|
||||
],
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/i18n/lang",
|
||||
"src/i18n/pages/login",
|
||||
"src/i18n/pages/menu"
|
||||
],
|
||||
"i18n-ally.extract.parsers.html": {
|
||||
"attributes": ["text", "title", "alt", "placeholder", "label", "aria-label"],
|
||||
"ignoredTags": ["script", "style"],
|
||||
"attributes": [
|
||||
"text",
|
||||
"title",
|
||||
"alt",
|
||||
"placeholder",
|
||||
"label",
|
||||
"aria-label"
|
||||
],
|
||||
"ignoredTags": [
|
||||
"script",
|
||||
"style"
|
||||
],
|
||||
"vBind": true,
|
||||
"inlineText": true
|
||||
},
|
||||
"i18n-ally.keystyle": "nested"
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询缓存详细
|
||||
export function getCache() {
|
||||
export function getCache(data) {
|
||||
return request({
|
||||
url: '/monitor/cache',
|
||||
method: 'get'
|
||||
url: 'mes/MaterialTypeDict/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//新增
|
||||
export function addCache(data) {
|
||||
return request({
|
||||
url: 'mes/MaterialTypeDict',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//修改
|
||||
export function updateCache(data) {
|
||||
return request({
|
||||
url: 'mes/MaterialTypeDict',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
export function delCache(id) {
|
||||
return request({
|
||||
url: 'mes/MaterialTypeDict/delete/' + id,
|
||||
method: 'post',
|
||||
|
||||
})
|
||||
}
|
||||
@ -6,7 +6,7 @@ import request from '@/utils/request'
|
||||
*/
|
||||
export function listQualityDefectReason(query) {
|
||||
return request({
|
||||
url: 'business/QualityDefectReason/list',
|
||||
url: 'mes/QualityDefectReason/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
@ -18,7 +18,7 @@ export function listQualityDefectReason(query) {
|
||||
*/
|
||||
export function addQualityDefectReason(data) {
|
||||
return request({
|
||||
url: 'business/QualityDefectReason',
|
||||
url: 'mes/QualityDefectReason',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
@ -29,7 +29,7 @@ export function addQualityDefectReason(data) {
|
||||
*/
|
||||
export function updateQualityDefectReason(data) {
|
||||
return request({
|
||||
url: 'business/QualityDefectReason',
|
||||
url: 'mes/QualityDefectReason',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
@ -40,7 +40,7 @@ export function updateQualityDefectReason(data) {
|
||||
*/
|
||||
export function getQualityDefectReason(id) {
|
||||
return request({
|
||||
url: 'business/QualityDefectReason/' + id,
|
||||
url: 'mes/QualityDefectReason/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -51,7 +51,7 @@ export function getQualityDefectReason(id) {
|
||||
*/
|
||||
export function delQualityDefectReason(pid) {
|
||||
return request({
|
||||
url: 'business/QualityDefectReason/delete/' + pid,
|
||||
url: 'mes/QualityDefectReason/delete/' + pid,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
@ -2,14 +2,14 @@ import request from '@/utils/request'
|
||||
//左侧树形结构
|
||||
export function getProcessInfoTree() {
|
||||
return request({
|
||||
url: 'business/ProcessInfo/tree',
|
||||
url: 'mes/ProcessInfo/tree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//详情
|
||||
export function getProcessInfoById(data) {
|
||||
return request({
|
||||
url: `business/OperationInfo/getOperationInfoByProcessCode`,
|
||||
url: `mes/OperationInfo/getOperationInfoByProcessCode`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -17,7 +17,7 @@ export function getProcessInfoById(data) {
|
||||
// 查询
|
||||
export function getProcessInfoList(data) {
|
||||
return request({
|
||||
url: 'business/ProcessInfo/GetProcessInfoCondition',
|
||||
url: 'mes/ProcessInfo/GetProcessInfoCondition',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@ -26,14 +26,14 @@ export function getProcessInfoList(data) {
|
||||
//编辑查看详情
|
||||
export function getProcessInfo(id) {
|
||||
return request({
|
||||
url: `business/ProcessInfo/` + id,
|
||||
url: `mes/ProcessInfo/` + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 添加
|
||||
export function addProcessInfo(data) {
|
||||
return request({
|
||||
url: 'business/ProcessInfo',
|
||||
url: 'mes/ProcessInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -42,7 +42,7 @@ export function addProcessInfo(data) {
|
||||
// 修改
|
||||
export function updateProcessInfo(data) {
|
||||
return request({
|
||||
url: 'business/ProcessInfo',
|
||||
url: 'mes/ProcessInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@ -51,7 +51,7 @@ export function updateProcessInfo(data) {
|
||||
// 删除
|
||||
export function delProcessInfo(data) {
|
||||
return request({
|
||||
url: `business/ProcessInfo/deleteByProcessCode`,
|
||||
url: `mes/ProcessInfo/deleteByProcessCode`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
||||
@ -1,3 +1,299 @@
|
||||
<template>
|
||||
<div>物料类别管理</div>
|
||||
</template>
|
||||
<div>
|
||||
<div>
|
||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch"
|
||||
@submit.prevent>
|
||||
<el-form-item label="物料类型名称" prop="materialTypeName">
|
||||
<el-input v-model.trim="queryParams.materialTypeName" placeholder="请输入物料类型名称" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search')
|
||||
}}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-row :gutter="15" class="mb10">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:processmodeloperation:add']" plain icon="plus"
|
||||
@click="handleAdd">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"
|
||||
:columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="15" class="mb10">
|
||||
</el-row>
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border
|
||||
header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="materialTypeName" label="物料类型名称" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="materialType" label="物料类型编码" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="createName" label="创建人" align="center" />
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="success" size="small" icon="edit" title="编辑"
|
||||
v-hasPermi="['business:processmodeloperation:edit']"
|
||||
@click="handleUpdate(scope.row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除"
|
||||
v-hasPermi="['business:processmodeloperation:delete']"
|
||||
@click="handleDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<el-dialog :title="title" :lock-scroll="false" v-model="open" width="500">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="物料类型名称" prop="materialTypeName">
|
||||
<el-input v-model="form.materialTypeName" placeholder="请输入物料类型名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="物料类型编码" prop="materialType">
|
||||
<el-input v-model="form.materialType" placeholder="请输入物料类型编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="processInformationManagement">
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
// import { getProcessInfoList, getProcessInfoById, addProcessInfo, updateProcessInfo, delProcessInfo } from "@/api/processRouteManagement/processInformationManagement/index"
|
||||
import { getCache, addCache, updateCache, delCache } from "@/api/basicDataManagement/categoryManagement/index"
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { getToken } from '@/utils/auth'
|
||||
const dialogTableVisible = ref(false)
|
||||
const userStore = useUserStore()
|
||||
const userId = userStore.userId
|
||||
const userName = userStore.userName
|
||||
console.log(userStore.userId, 'userStore.userId') //
|
||||
import { ref, reactive, getCurrentInstance } from 'vue';
|
||||
// 使用ref和reactive初始化响应式数据
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const show = ref(false)
|
||||
const dataList = ref([])
|
||||
const open = ref(false)
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
|
||||
|
||||
function getList() {
|
||||
getCache(queryParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
dataList.value = res.data.result
|
||||
total.value = res.data.totalNum
|
||||
console.log(dataList.value, 'dataList.value表格数据');
|
||||
console.log(res, 'res表格数据');
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 列配置
|
||||
const columns = ref([
|
||||
{ visible: true, prop: 'processCode', label: '物料物料类型编码' },
|
||||
{ visible: true, prop: 'processName', label: '物料名称' },
|
||||
{ visible: true, prop: 'operationSeq', label: '工艺顺序号' },
|
||||
{ visible: true, prop: 'workCenter', label: '工作中心/设备/车间' },
|
||||
{ visible: true, prop: 'standardTime', label: '标准工时(分钟)' },
|
||||
{ visible: true, prop: 'description', label: '工艺描述' }
|
||||
])
|
||||
|
||||
const total = ref(0)
|
||||
const detailTotail = ref(0)
|
||||
const queryRef = ref()
|
||||
|
||||
// 模拟工艺路线选项数据
|
||||
const options = ref([
|
||||
{ routingCode: 'ROUTING_001', routingName: '电子产品组装工艺' },
|
||||
{ routingCode: 'ROUTING_002', routingName: '机械零件加工工艺' },
|
||||
{ routingCode: 'ROUTING_003', routingName: '塑料制品成型工艺' }
|
||||
])
|
||||
|
||||
// 模拟工艺数据
|
||||
const mockProcessData = [
|
||||
|
||||
]
|
||||
|
||||
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
queryParams.processCode = null
|
||||
queryParams.processName = null
|
||||
queryParams.pageSize = 10
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 自定义排序
|
||||
function sortChange(column) {
|
||||
// 在实际应用中实现排序逻辑
|
||||
console.log('排序字段:', column.prop, '排序方式:', column.order)
|
||||
}
|
||||
|
||||
// 表单相关
|
||||
const formRef = ref()
|
||||
const title = ref('')
|
||||
|
||||
|
||||
|
||||
const state = reactive({
|
||||
form: {
|
||||
id: null,
|
||||
RoutingCode: '',
|
||||
processCode: '',
|
||||
processName: '',
|
||||
operationSeq: null,
|
||||
workCenter: '',
|
||||
standardTime: null,
|
||||
description: ''
|
||||
},
|
||||
rules: {
|
||||
materialTypeName: [{ required: true, message: '物料名称不能为空', trigger: 'blur' }],
|
||||
materialType: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
operationSeq: [
|
||||
{ required: true, message: '工艺顺序号不能为空', trigger: 'blur' },
|
||||
{ type: 'number', message: '工艺顺序号必须为数字', trigger: 'blur' }
|
||||
],
|
||||
standardTime: [
|
||||
{ required: true, message: '标准工时不能为空', trigger: 'blur' },
|
||||
{ type: 'number', message: '标准工时必须为数字', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
const { form, rules } = toRefs(state)
|
||||
|
||||
// 关闭弹窗
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 重置表单
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
RoutingCode: '',
|
||||
processCode: '',
|
||||
processName: '',
|
||||
operationSeq: null,
|
||||
workCenter: '',
|
||||
standardTime: null,
|
||||
description: ''
|
||||
}
|
||||
proxy.resetForm('formRef')
|
||||
}
|
||||
const opertype = ref(0)
|
||||
// 添加工艺
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加工艺'
|
||||
opertype.value = 1
|
||||
}
|
||||
// 修改工艺
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
form.value = { ...row }
|
||||
open.value = true
|
||||
title.value = '修改工艺'
|
||||
opertype.value = 2
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function submitForm() {
|
||||
let data = {
|
||||
...form.value,
|
||||
userId: userId,
|
||||
userName: userName
|
||||
}
|
||||
proxy.$refs["formRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (opertype.value === 2) {
|
||||
updateCache(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
})
|
||||
getList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addCache(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '新增成功',
|
||||
type: 'success',
|
||||
})
|
||||
}
|
||||
getList()
|
||||
})
|
||||
}
|
||||
open.value = false
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 删除工艺
|
||||
function handleDelete(row) {
|
||||
proxy.$confirm(
|
||||
'确认删除该条数据吗?',
|
||||
'提示',
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||
).then(() => {
|
||||
delCache(row.id).then(res => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({ message: '删除成功', type: 'success' });
|
||||
getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 树节点选择
|
||||
function handlerTreeSelected(id) {
|
||||
queryParams.RoutingCode = id
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
// 初始化加载数据
|
||||
getList()
|
||||
</script>
|
||||
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>产线管理</div>
|
||||
</template>
|
||||
Loading…
x
Reference in New Issue
Block a user