feat(production-master-data): 新增工艺流程管理完整模块
- 添加工艺流程、流程卡工序的全套CRUD及复制接口 - 新增工艺流程列表页与流程卡详情页的路由和页面组件 - 补充产品、工序分类、工序子类的全量查询接口 - 优化弹窗表单组件,支持字段禁用与focus/blur/change事件回调 - 修复工序单元页面的国际化调用和权限配置问题 - 补充中英文多语言国际化文案 - 新增该模块的功能测试文档
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:title="$t(title)"
|
||||
:visible.sync="visible"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
@@ -14,10 +14,17 @@
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<div class="setting-placeholder">
|
||||
<p>{{ $t(key('setting_placeholder')) }}</p>
|
||||
<el-tag type="warning">{{ type }}</el-tag>
|
||||
<div class="setting-meta">
|
||||
<el-tag v-if="type" type="warning" size="mini">{{ type }}</el-tag>
|
||||
<el-tag v-if="code" type="info" size="mini">{{ code }}</el-tag>
|
||||
</div>
|
||||
<el-input
|
||||
v-model="jsonText"
|
||||
type="textarea"
|
||||
:rows="16"
|
||||
resize="vertical"
|
||||
:placeholder="jsonPlaceholder"
|
||||
/>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">{{ $t(key('cancel')) }}</el-button>
|
||||
@@ -57,18 +64,65 @@ export default {
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
jsonText: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
settingTip () {
|
||||
return this.$t(this.key('setting_tip'))
|
||||
},
|
||||
jsonPlaceholder () {
|
||||
return '{\n "key": "value"\n}'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible: {
|
||||
handler (val) {
|
||||
if (val) {
|
||||
this.resetJsonText()
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
pluginData: {
|
||||
handler () {
|
||||
if (this.visible) {
|
||||
this.resetJsonText()
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resetJsonText () {
|
||||
const data = this.pluginData
|
||||
if (data === undefined || data === null || data === '') {
|
||||
this.jsonText = '{}'
|
||||
return
|
||||
}
|
||||
if (typeof data === 'string') {
|
||||
this.jsonText = data.trim() ? data : '{}'
|
||||
return
|
||||
}
|
||||
this.jsonText = JSON.stringify(data, null, 2)
|
||||
},
|
||||
handleClose () {
|
||||
this.$emit('close')
|
||||
},
|
||||
handleSubmit () {
|
||||
this.$message.success(this.key('operation_success'))
|
||||
this.$emit('close')
|
||||
const raw = (this.jsonText || '').trim()
|
||||
if (!raw) {
|
||||
this.$emit('submit', {})
|
||||
return
|
||||
}
|
||||
try {
|
||||
const parsed = JSON.parse(raw)
|
||||
this.$emit('submit', parsed)
|
||||
} catch (error) {
|
||||
this.$message.error('JSON 格式不正确')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,14 +132,9 @@ export default {
|
||||
.setting-content {
|
||||
padding: 10px 0;
|
||||
}
|
||||
.setting-placeholder {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: #909399;
|
||||
}
|
||||
.setting-placeholder p {
|
||||
margin-bottom: 15px;
|
||||
font-size: 14px;
|
||||
.setting-meta {
|
||||
margin: 16px 0 12px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user