(no commit message provided)
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -288,10 +288,11 @@ const onMaterialSelected = (val: number) => {
|
||||
// 弹窗相关
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const dialogStatus = ref<'create' | 'update'>('create')
|
||||
const formRef = ref<FormInstance>()
|
||||
const form = reactive({
|
||||
id: 0,
|
||||
base_id: 0,
|
||||
base_id: undefined as number | undefined,
|
||||
material_name: '',
|
||||
spec_model: '',
|
||||
category: '',
|
||||
@ -303,8 +304,7 @@ const form = reactive({
|
||||
})
|
||||
const rules = reactive<FormRules>({
|
||||
base_id: [
|
||||
{ required: true, message: '请选择基础物料', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, message: '物料ID必须大于0', trigger: 'blur' }
|
||||
{ required: true, message: '请选择基础物料', trigger: 'change' }
|
||||
],
|
||||
sale_price: [
|
||||
{ required: true, message: '请输入售价', trigger: 'blur' },
|
||||
@ -317,17 +317,25 @@ const rules = reactive<FormRules>({
|
||||
|
||||
const handleAdd = () => {
|
||||
dialogTitle.value = '新增服务'
|
||||
dialogStatus.value = 'create'
|
||||
Object.assign(form, {
|
||||
id: 0,
|
||||
base_id: 0,
|
||||
base_id: undefined as number | undefined,
|
||||
material_name: '',
|
||||
spec_model: '',
|
||||
category: '',
|
||||
unit: '',
|
||||
material_type: '',
|
||||
sale_price: 0,
|
||||
provider_name: '',
|
||||
description: ''
|
||||
})
|
||||
materialOptions.value = []
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const handleEdit = (row: ServiceItem) => {
|
||||
dialogTitle.value = '编辑服务'
|
||||
dialogStatus.value = 'update'
|
||||
Object.assign(form, {
|
||||
id: row.id,
|
||||
base_id: row.base_id,
|
||||
|
||||
Reference in New Issue
Block a user