|
@@ -15,7 +15,7 @@
|
|
|
>
|
|
|
<el-form
|
|
|
ref="indentForm"
|
|
|
- :rules="rules"
|
|
|
+ :rules="computedRules"
|
|
|
:model="form"
|
|
|
label-width="130px"
|
|
|
>
|
|
@@ -291,7 +291,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { defineComponent, ref, watch, nextTick, inject } from 'vue'
|
|
|
+import { defineComponent, ref, watch, nextTick, inject, computed } from 'vue'
|
|
|
import {
|
|
|
ElButton,
|
|
|
ElForm,
|
|
@@ -497,6 +497,20 @@ const rules = {
|
|
|
},
|
|
|
],
|
|
|
}
|
|
|
+let computedRules = computed(() => {
|
|
|
+ // product_sku 包含gi_的商品, 需要填写产品别名(必填), 否则返回rules的复制体
|
|
|
+ let temp: any = cloneDeep(rules)
|
|
|
+ if (/gi_/i.test(form.value.product_sku)) {
|
|
|
+ temp.product_alias_name = [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请填写产品别名',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+})
|
|
|
// 客户下拉框候选列表
|
|
|
const customList = ref([] as any[])
|
|
|
const loading = ref(false)
|