salary
qsh 5 months ago
parent 35598b4d6d
commit 1c37dbc5f8
  1. 54
      src/views/Clue/Order/index.vue
  2. 28
      src/views/Clue/Pool/Comp/DialogSuccess.vue
  3. 7
      src/views/Clue/Pool/index.vue

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="allSchemas.searchSchema" labelWidth="0"> <Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore> <template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button> <el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button> <el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
@ -9,6 +9,7 @@
</Search> </Search>
<!-- 列表 --> <!-- 列表 -->
<SSTable <SSTable
v-if="!loading"
class="mt-20px" class="mt-20px"
v-model:tableObject="tableObject" v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns" :tableColumns="allSchemas.tableColumns"
@ -77,10 +78,17 @@
</template> </template>
<script setup name="ClueOrder"> <script setup name="ClueOrder">
import { allSchemas } from './order.data' import { getSimpleFieldList } from '@/api/clue/orderField'
import * as SignApi from '@/api/clue/sign'
import { removeNullField } from '@/utils'
const allSchemas = ref({})
const searchRef = ref()
const tableObject = ref({ const tableObject = ref({
tableList: [{ name: '测试', contact: '18888888888' }], tableList: [],
loading: false, loading: false,
total: 1, total: 1,
pageSize: 20, pageSize: 20,
@ -88,17 +96,51 @@ const tableObject = ref({
}) })
function resetQuery() { function resetQuery() {
// searchRef.value.reset()
tableObject.value.currentPage = 1
getTableList()
} }
// //
function getTableList() { async function getTableList() {
// //
tableObject.value.loading = true
try {
const queryParams = await searchRef.value.getFormModel()
const params = {
...queryParams,
pageNo: tableObject.value.currentPage,
pageSize: tableObject.value.pageSize
}
const data = await SignApi.getSignPage(removeNullField(params))
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.diyParams }))
tableObject.value.total = data.total
} finally {
tableObject.value.loading = false
}
}
const loading = ref(true)
async function getCurdSchemas() {
loading.value = true
try {
const data = await getSimpleFieldList()
allSchemas.value = useCrudSchemas(data).allSchemas
} finally {
loading.value = false
nextTick(() => {
getTableList()
})
}
} }
// //
function sellAfter() { function sellAfter() {
// //
} }
onMounted(() => {
getCurdSchemas()
})
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

@ -128,11 +128,13 @@
class="mb-5px" class="mb-5px"
type="primary" type="primary"
size="small" size="small"
@click="form.signProduct.push({ productId: undefined, specsId: undefined, signNum: 0 })" @click="
form.signProducts.push({ productId: undefined, specsId: undefined, signNum: 0 })
"
> >
添加成交产品 添加成交产品
</el-button> </el-button>
<el-table :data="form.signProduct" border size="small"> <el-table :data="form.signProducts" border size="small">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column prop="productId" label="产品"> <el-table-column prop="productId" label="产品">
<template #default="{ row }"> <template #default="{ row }">
@ -189,7 +191,7 @@
<Icon <Icon
icon="ep:remove-filled" icon="ep:remove-filled"
class="text-red-500" class="text-red-500"
@click="handleRemove('signProduct', $index)" @click="handleRemove('signProducts', $index)"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -255,7 +257,7 @@
<template #footer> <template #footer>
<span> <span>
<el-button @click="show = false"> </el-button> <el-button @click="show = false"> </el-button>
<el-button type="primary" @click="handleSave"> </el-button> <el-button :disabled="formLoading" type="primary" @click="handleSave"> </el-button>
</span> </span>
</template> </template>
</Dialog> </Dialog>
@ -339,7 +341,7 @@ function resetForm(id) {
payAmount: 0, payAmount: 0,
remark: undefined, remark: undefined,
extraPay: [], extraPay: [],
signProduct: [] signProducts: []
} }
} }
@ -355,7 +357,7 @@ async function handleSave() {
return return
} }
if (form.value.signProduct.some((it) => !it.schoolId || !item.specsId || !it.signNum)) { if (form.value.signProducts.some((it) => !it.productId || !item.specsId || !it.signNum)) {
message.info('请将成交产品信息填写完整!') message.info('请将成交产品信息填写完整!')
return return
} }
@ -363,9 +365,19 @@ async function handleSave() {
// //
formLoading.value = true formLoading.value = true
try { try {
await createSign(form.value) const params = { ...form.value }
params.diyParams = {}
diyFieldList.value.map((it) => {
params.diyParams[it.field] = undefined
})
for (const key in params.diyParams) {
if (Object.hasOwnProperty.call(params, key)) {
params.diyParams[key] = params[key]
}
}
await createSign(params)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
dialogVisible.value = false show.value = false
// //
emit('success') emit('success')
} finally { } finally {

@ -187,6 +187,11 @@ async function getCurdSchemas() {
loading.value = true loading.value = true
try { try {
const data = await getSimpleFieldList() const data = await getSimpleFieldList()
data.forEach((elem) => {
if (elem.field == 'followUser') {
elem.search.options = userOptions.value
}
})
allSchemas.value = useCrudSchemas(data).allSchemas allSchemas.value = useCrudSchemas(data).allSchemas
} finally { } finally {
loading.value = false loading.value = false
@ -314,8 +319,8 @@ const userOptions = ref([])
onMounted(() => { onMounted(() => {
getUserOption().then((data) => { getUserOption().then((data) => {
userOptions.value = data userOptions.value = data
getCurdSchemas()
}) })
getCurdSchemas()
}) })
</script> </script>

Loading…
Cancel
Save