diff --git a/src/hooks/web/useCrudSchemas.ts b/src/hooks/web/useCrudSchemas.ts
index 39e42d7..2050aaf 100644
--- a/src/hooks/web/useCrudSchemas.ts
+++ b/src/hooks/web/useCrudSchemas.ts
@@ -229,6 +229,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
value: defaultValue,
...schemaItem.form,
field: schemaItem.field,
+ isRequired: schemaItem.isRequired,
label: schemaItem.form?.label || schemaItem.label
}
diff --git a/src/views/Clue/Order/Comp/AfterSales.vue b/src/views/Clue/Order/Comp/AfterSales.vue
index 007c852..259e4d8 100644
--- a/src/views/Clue/Order/Comp/AfterSales.vue
+++ b/src/views/Clue/Order/Comp/AfterSales.vue
@@ -76,6 +76,8 @@
+
+
diff --git a/src/views/Clue/Order/Comp/DialogAfterSale.vue b/src/views/Clue/Order/Comp/DialogAfterSale.vue
index d943a54..5d0a98d 100644
--- a/src/views/Clue/Order/Comp/DialogAfterSale.vue
+++ b/src/views/Clue/Order/Comp/DialogAfterSale.vue
@@ -4,6 +4,7 @@
+
@@ -13,35 +14,61 @@
新增售后
-
-
-
-
-
-
-
-
-
- 退货
- 不退货
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 退货
+ 不退货
+
+
+
+
+
+
+
+
+
+
+
+
+
+
保存
取消
@@ -72,7 +99,8 @@ function open(signId) {
const showAdd = ref(true)
const form = ref({})
const rules = {
- refundAmount: { required: true, message: '回款金额不可为空', trigger: 'blur' },
+ percentageDeductAmount: { required: true, message: '提成扣款金额不可为空', trigger: 'blur' },
+ refundAmount: { required: true, message: '退款金额不可为空', trigger: 'blur' },
reason: { required: true, message: '售后原因不可为空', trigger: 'blur' },
solution: { required: true, message: '解决方案不可为空', trigger: 'blur' }
}
@@ -91,6 +119,7 @@ function handleAdd() {
solution: undefined,
refundAmount: undefined,
isReturns: false,
+ percentageDeductAmount: undefined,
remark: undefined
}
}
diff --git a/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue b/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue
index 1dfe612..15272c7 100644
--- a/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue
+++ b/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue
@@ -63,6 +63,16 @@ const schema = [
label: '退款金额',
span: 1
},
+ {
+ field: 'percentageDeductAmount',
+ label: '提成扣款',
+ span: 1
+ },
+ {
+ field: 'isCompanyReceipts',
+ label: '是否公司收款',
+ span: 1
+ },
{
field: 'isReturns',
label: '是否退货',
diff --git a/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue b/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue
index c92d506..12a8667 100644
--- a/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue
+++ b/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue
@@ -54,6 +54,16 @@ const applySchema = [
label: '退款金额',
span: 1
},
+ {
+ field: 'percentageDeductAmount',
+ label: '提成扣款',
+ span: 1
+ },
+ {
+ field: 'isCompanyReceipts',
+ label: '是否公司收款',
+ span: 1
+ },
{
field: 'isReturns',
label: '是否退货',
diff --git a/src/views/Clue/Order/Comp/MallSettle.vue b/src/views/Clue/Order/Comp/MallSettle.vue
index 3ec56c1..cf25af8 100644
--- a/src/views/Clue/Order/Comp/MallSettle.vue
+++ b/src/views/Clue/Order/Comp/MallSettle.vue
@@ -136,6 +136,7 @@
/>
+
diff --git a/src/views/Clue/Order/Comp/SchoolSettle.vue b/src/views/Clue/Order/Comp/SchoolSettle.vue
index ea2fde4..e3af63d 100644
--- a/src/views/Clue/Order/Comp/SchoolSettle.vue
+++ b/src/views/Clue/Order/Comp/SchoolSettle.vue
@@ -142,6 +142,7 @@
/>
+
diff --git a/src/views/Clue/Pool/Comp/DialogClue.vue b/src/views/Clue/Pool/Comp/DialogClue.vue
index 92d8cd2..61cb2a6 100644
--- a/src/views/Clue/Pool/Comp/DialogClue.vue
+++ b/src/views/Clue/Pool/Comp/DialogClue.vue
@@ -200,6 +200,20 @@ const formSchema = computed(() => {
]
})
+const rules = computed(() => {
+ let ruleObj = {}
+ props.schema.map((it) => {
+ if (it.isRequired) {
+ Reflect.set(ruleObj, it.field, {
+ required: true,
+ message: `${it.label}不可为空`,
+ trigger: 'blur, change'
+ })
+ }
+ })
+ return ruleObj
+})
+
const dateAfterToday = (t) => {
return t.getTime() > Date.now()
}
@@ -210,14 +224,6 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // 表单 Ref
-const rules = {
- name: { required: true, message: '线索名称不可为空', trigger: 'blur' },
- phone: { required: true, message: '联系方式不可为空', trigger: 'blur' },
- source: { required: true, message: '线索来源不可为空', trigger: 'change' },
- intentionState: { required: true, message: '意向状态不可为空', trigger: 'change' },
- consultTime: { required: true, message: '咨询日期不可为空', trigger: 'change' }
-}
-
const tabName = ref('info')
const followList = ref([])
diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue
index ec6c301..b525aba 100644
--- a/src/views/Clue/Pool/Comp/DialogSuccess.vue
+++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue
@@ -329,6 +329,7 @@ import { getPlaceList } from '@/api/school/place'
import { getClassTypeList } from '@/api/school/class'
import { getSimpleProductList } from '@/api/mall/product'
import { getConfigByConfigKey } from '@/api/system/set'
+import { getSimpleFieldList } from '@/api/clue/orderField'
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
import { formatDate } from '@/utils/formatTime'
@@ -338,11 +339,6 @@ import { useAppStore } from '@/store/modules/app'
const show = ref(false)
const form = ref({})
-const rules = ref({
- dealDate: { required: true, message: '成交日期不可为空', trigger: 'change' },
- payAmount: { required: true, message: '支付金额不可为空', trigger: 'change,blur' },
- signPrice: { required: true, message: '支付金额不可为空', trigger: 'change,blur' }
-})
const schoolRules = {
signSchool: { required: true, message: '成交驾校不可为空', trigger: 'change' },
@@ -402,11 +398,29 @@ const showSchema = computed(() => {
return [...list, ...arr]
})
+// const rules = computed(() => {
+// let ruleObj = {}
+// props.schema.map((it) => {
+// if (it.isRequired) {
+// Reflect.set(ruleObj, it.field, {
+// required: true,
+// message: `${it.label}不可为空`,
+// trigger: 'blur, change'
+// })
+// }
+// })
+// if (appStore.getAppInfo?.instanceType == 1) {
+// ruleObj = { ...ruleObj, ...schoolRules }
+// }
+// return ruleObj
+// })
+
const extraPayOptions = getDictOptions('other_pay_type')
async function open(id) {
try {
resetForm(id)
+ getDiyFields()
const data = await ClueApi.getClue(id)
info.value = { ...data, ...data.diyParams }
show.value = true
@@ -416,6 +430,26 @@ async function open(id) {
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+const rules = ref([])
+function getDiyFields() {
+ getSimpleFieldList().then((data) => {
+ let ruleObj = {}
+ data.map((it) => {
+ if (it.isRequired) {
+ Reflect.set(ruleObj, it.field, {
+ required: true,
+ message: `${it.label}不可为空`,
+ trigger: 'blur, change'
+ })
+ }
+ })
+ if (appStore.getAppInfo?.instanceType == 1) {
+ ruleObj = { ...ruleObj, ...schoolRules }
+ }
+ rules.value = ruleObj
+ })
+}
+
async function resetForm(id) {
const data = await getConfigByConfigKey({ configKey: 'companyCollectionConfig' })
form.value = {
@@ -553,9 +587,6 @@ function handleRemove(type, index) {
}
onMounted(() => {
- if (appStore.getAppInfo?.instanceType == 1) {
- rules.value = { ...rules.value, ...schoolRules }
- }
getOptions()
})
diff --git a/src/views/Clue/Set/Comp/FieldClue.vue b/src/views/Clue/Set/Comp/FieldClue.vue
index 0349bf2..0f3a058 100644
--- a/src/views/Clue/Set/Comp/FieldClue.vue
+++ b/src/views/Clue/Set/Comp/FieldClue.vue
@@ -5,11 +5,16 @@
-
+
{{ typeOptions.find((it) => it.value == row.component).label }}
+
+
+ {{ row.isRequired ? '必填' : '非必填' }}
+
+
+
+
+ 必填
+ 非必填
+
+
-
+
{{ typeOptions.find((it) => it.value == row.component).label }}
+
+
+ {{ row.isRequired ? '必填' : '非必填' }}
+
+
+
+
+ 必填
+ 非必填
+
+