|
|
|
|
@ -196,6 +196,35 @@
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="是否样品" prop="isSample">
|
|
|
|
|
<el-switch v-model="formData.isSample" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<template v-if="formData.isSample">
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="样品分类" prop="sampleCategory">
|
|
|
|
|
<el-select v-model="formData.sampleCategory" clearable placeholder="请选择样品分类" class="w-1/1">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.BIT_SAMPLE_CATEGORY)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="所属事业部" prop="bizUnit">
|
|
|
|
|
<el-input v-model="formData.bizUnit" placeholder="请输入所属事业部" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="客户名称" prop="customerName">
|
|
|
|
|
<el-input v-model="formData.customerName" placeholder="请输入客户名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</template>
|
|
|
|
|
<el-col v-if="formType === 'update'" :span="24">
|
|
|
|
|
<div class="flex items-start gap-20px">
|
|
|
|
|
<el-form-item :label="t('FactoryModeling.ProductInformation.qrcode')" prop="qrcodeUrl" class="flex-1">
|
|
|
|
|
@ -405,7 +434,7 @@ import { PackagingSchemeApi } from '@/api/erp/stock/packagingScheme'
|
|
|
|
|
import { SupplierApi } from '@/api/erp/purchase/supplier'
|
|
|
|
|
import { CommonStatusEnum } from '@/utils/constants'
|
|
|
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
/** ERP 产品 表单 */
|
|
|
|
|
defineOptions({ name: 'ProductForm' })
|
|
|
|
|
@ -460,6 +489,11 @@ const formData = ref({
|
|
|
|
|
categoryId: undefined,
|
|
|
|
|
unitId: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
isSample: false,
|
|
|
|
|
sampleCategory: undefined,
|
|
|
|
|
bizUnit: undefined,
|
|
|
|
|
customerId: undefined,
|
|
|
|
|
customerName: undefined,
|
|
|
|
|
standard: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
expiryDay: undefined,
|
|
|
|
|
@ -934,14 +968,20 @@ const supplierList = ref<any[]>([])
|
|
|
|
|
|
|
|
|
|
let openRequestId = 0
|
|
|
|
|
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
const open = async (type: string, id?: number, defaultData?: Record<string, any>) => {
|
|
|
|
|
const currentOpenId = ++openRequestId
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
resetForm()
|
|
|
|
|
if (!id) {
|
|
|
|
|
if (defaultData) {
|
|
|
|
|
formData.value = {
|
|
|
|
|
...formData.value,
|
|
|
|
|
...defaultData
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const typeOptions = getIntDictOptions(DICT_TYPE.MATERIAL_CLASSIFICATION_TYPE)
|
|
|
|
|
if (typeOptions.length > 0) {
|
|
|
|
|
if (formData.value.categoryType === undefined && typeOptions.length > 0) {
|
|
|
|
|
formData.value.categoryType = typeOptions[0].value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1125,6 +1165,11 @@ const resetForm = () => {
|
|
|
|
|
categoryId: undefined,
|
|
|
|
|
unitId: undefined,
|
|
|
|
|
status: CommonStatusEnum.ENABLE,
|
|
|
|
|
isSample: false,
|
|
|
|
|
sampleCategory: undefined,
|
|
|
|
|
bizUnit: undefined,
|
|
|
|
|
customerId: undefined,
|
|
|
|
|
customerName: undefined,
|
|
|
|
|
standard: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
expiryDay: undefined,
|
|
|
|
|
|