|
|
|
@ -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() |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|