diff --git a/src/views/erp/mold/MoldBrandForm.vue b/src/views/erp/mold/MoldBrandForm.vue
index 8ce42add..db8e800b 100644
--- a/src/views/erp/mold/MoldBrandForm.vue
+++ b/src/views/erp/mold/MoldBrandForm.vue
@@ -28,11 +28,6 @@
-
-
-
-
-
@@ -104,7 +99,6 @@ const formData = ref({
productName: '',
productIds: [],
images: '',
- version: '',
status: 0,
useTime: 0,
maintainType: undefined,
@@ -134,21 +128,6 @@ const handleCodeAutoChange = (value: boolean) => {
formRef.value?.clearValidate('code')
}
-const handleVersionInput = (value: string) => {
- formData.value.version = value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1')
-}
-
-const stripVersionPrefix = (val: any): string => {
- if (!val) return ''
- return String(val).replace(/^V/i, '')
-}
-
-const addVersionPrefix = (val: any): string => {
- if (!val) return ''
- const raw = String(val).replace(/^V/i, '')
- return raw ? `V${raw}` : ''
-}
-
const formRules = reactive({
code: [{ validator: validateCode, trigger: 'blur' }],
name: [{ required: true, message: t('MoldManagement.MoldBrandFormPage.validatorNameRequired'), trigger: 'blur' }],
@@ -168,7 +147,6 @@ const resetForm = () => {
productName: '',
productIds: [],
images: '',
- version: '',
status: 1,
useTime: 0,
maintainType: undefined,
@@ -203,7 +181,6 @@ const open = async (type: string, id?: number) => {
...formData.value,
...data,
isCode: (data as any)?.isCode ?? false,
- version: stripVersionPrefix(data?.version),
productIds: Array.isArray(data?.productIds)
? data.productIds
: data?.productId
@@ -225,7 +202,6 @@ const submitForm = async () => {
handleProductChange(formData.value.productIds)
const payload: MoldBrandVO = {
...formData.value,
- version: addVersionPrefix(formData.value.version),
productIds: Array.isArray(formData.value.productIds) ? formData.value.productIds : [],
isEnable: Boolean(formData.value.isEnable)
}
diff --git a/src/views/erp/mold/index.vue b/src/views/erp/mold/index.vue
index a5baf626..eab90e0c3 100644
--- a/src/views/erp/mold/index.vue
+++ b/src/views/erp/mold/index.vue
@@ -65,7 +65,6 @@
-
@@ -86,10 +85,10 @@
{{ t('MoldManagement.MoldBrandPage.detail')
}}
- {{
- t('MoldManagement.MoldBrandPage.moldUp') }}
- {{
+ {{
t('MoldManagement.MoldBrandPage.moldDown') }}
+ {{
+ t('MoldManagement.MoldBrandPage.moldUp') }}
{{
t('MoldManagement.MoldBrandPage.maintain') }}
- {{ t('ErpStock.In.submitAudit') }}
+ {{ submitActionText }}
-
-
+
-
+
([]) // 鐢ㄦ埛鍒楄〃
const formVisible = ref(false) // 琛ㄥ崟鏄惁鍙
const actionLoading = ref(false)
+const isAuditDisabled = ref(false)
+const submitActionText = computed(() => isAuditDisabled.value ? '出库' : t('ErpStock.Out.submitAudit'))
const submitDialogVisible = ref(false)
const submitFormRef = ref()
const submitFormData = reactive({
@@ -391,7 +394,7 @@ const submitFormData = reactive({
auditUserId: '',
remark: ''
})
-const submitFormRules = reactive({
+const submitFormRules = computed(() => isAuditDisabled.value ? {} : {
auditUserId: [{ required: true, message: t('ErpStock.Out.validatorAuditUserRequired'), trigger: 'change' }]
})
const auditDialogVisible = ref(false)
@@ -404,10 +407,21 @@ const auditFormData = reactive({
const auditDialogTitle = computed(() => auditFormData.status === '20' ? t('ErpStock.Out.auditApprove') : t('ErpStock.Out.auditReject'))
const auditRemarkPlaceholder = computed(() => auditFormData.status === '20' ? t('ErpStock.Out.placeholderAuditApproveRemark') : t('ErpStock.Out.placeholderAuditRejectRemark'))
+const loadAuditConfig = async () => {
+ try {
+ const data = await ConfigApi.getConfigPage({ pageNo: 1, pageSize: 10, key: 'isAudit' } as PageParam & { key: string })
+ const auditConfig = data?.list?.find((item) => item?.key === 'isAudit')
+ isAuditDisabled.value = auditConfig?.value === '0'
+ } catch {
+ isAuditDisabled.value = false
+ }
+}
+
/** 鏌ヨ鍒楄〃 */
const getList = async () => {
loading.value = true
try {
+ await loadAuditConfig()
const data = await StockOutApi.getStockOutPage(queryParams)
list.value = data.list
total.value = data.total
@@ -461,14 +475,19 @@ const openSubmitDialog = (row: StockOutVO) => {
}
const handleSubmitStockOut = async () => {
- await submitFormRef.value.validate()
+ if (!isAuditDisabled.value) {
+ await submitFormRef.value.validate()
+ }
actionLoading.value = true
try {
- await StockOutApi.submitStockOut({
+ const data: { id: string; auditUserId?: string; remark?: string } = {
id: submitFormData.id,
- auditUserId: submitFormData.auditUserId,
remark: submitFormData.remark
- })
+ }
+ if (!isAuditDisabled.value) {
+ data.auditUserId = submitFormData.auditUserId
+ }
+ await StockOutApi.submitStockOut(data as { id: string; auditUserId: string; remark?: string })
message.success(t('ErpStock.Out.submitSuccess'))
submitDialogVisible.value = false
await getList()