上传
This commit is contained in:
@@ -19,9 +19,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in resourceOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.sourceId"
|
||||
:label="item.sourceName"
|
||||
:value="item.sourceId"
|
||||
/>
|
||||
</el-select>
|
||||
<span>{{ row.channel }}</span>
|
||||
@@ -36,21 +36,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="mt-20px flex justify-center">
|
||||
<el-button type="primary" @click="handleInsert">新增规则</el-button>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueSet">
|
||||
import { getClueGainRuleList, deleteClueGainRule } from '@/api/clue/clueGetSet'
|
||||
import { getClueGainRuleList, deleteClueGainRule, saveClueGainRule } from '@/api/clue/clueGetSet'
|
||||
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
|
||||
import { listToTree } from '@/utils/tree.ts'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
@@ -59,6 +61,12 @@ const list = ref([])
|
||||
const loading = ref(false)
|
||||
const resourceOptions = ref([])
|
||||
|
||||
function getOptions() {
|
||||
getResourceOptions().then((data) => {
|
||||
resourceOptions.value = listToTree(data, { id: 'sourceId', pId: 'parentId' })
|
||||
})
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -73,8 +81,20 @@ function handleInsert() {
|
||||
list.value.push({ source: '', url: '', edit: true, status: 0 })
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
console.log('保存成功')
|
||||
const formLoading = ref(false)
|
||||
async function onSubmit() {
|
||||
if (list.value.some((it) => !it.source || !it.resource || !it.channel)) {
|
||||
message.info('请将表格数据填写完整!')
|
||||
return
|
||||
}
|
||||
formLoading.value = true
|
||||
try {
|
||||
await saveClueGainRule(list.value.map((it) => ({ ...it, channel: it.source })))
|
||||
message.success('保存成功')
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleRemove(idx) {
|
||||
@@ -101,6 +121,7 @@ function handleChange(row) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<!-- 得根据自动获得的线索做配置 -->
|
||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in resourceOptions"
|
||||
@@ -63,7 +64,7 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="权重配置">
|
||||
<el-input v-model="form.value" type="number" placeholder="请输入权重">
|
||||
<el-input v-model="form.weight" type="number" placeholder="请输入权重">
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -78,6 +79,7 @@
|
||||
|
||||
<script setup name="ClueSend">
|
||||
import { getUserPage } from '@/api/system/user'
|
||||
import { getClueDistributeRuleByUser } from '@/api/clue/clueGetSet'
|
||||
|
||||
// const message = useMessage() // 消息弹窗
|
||||
// const { t } = useI18n() // 国际化
|
||||
@@ -102,7 +104,7 @@ const form = ref({
|
||||
isAuto: 1,
|
||||
users: [1, 2],
|
||||
resource: [3],
|
||||
sendTime: '00:00'
|
||||
weight: undefined
|
||||
})
|
||||
const rules = ref({})
|
||||
|
||||
@@ -145,7 +147,9 @@ function resourceCheckedChange(val) {
|
||||
|
||||
function handleRowClick(row) {
|
||||
currentRowId.value = row.id
|
||||
form.value = { ...row }
|
||||
getClueDistributeRuleByUser({ employeeId: row.id }).then((data) => {
|
||||
form.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
/>
|
||||
<span>发货自动发起采购</span>
|
||||
<span>允许负库存</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
||||
<el-radio
|
||||
|
||||
Reference in New Issue
Block a user