上传
This commit is contained in:
@@ -2,32 +2,32 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
// 创建
|
// 创建
|
||||||
export const createField = (data) => {
|
export const createField = (data) => {
|
||||||
return request.post({ url: '/admin-api/crm/clue-param/create', data })
|
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 1 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
export const updateField = (data) => {
|
export const updateField = (data) => {
|
||||||
return request.put({ url: '/admin-api/crm/clue-param/update', data })
|
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export const deleteField = (id) => {
|
export const deleteField = (id) => {
|
||||||
return request.delete({ url: `/admin-api/crm/clue-param/delete?id=${id}` })
|
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得
|
// 获得
|
||||||
export const getField = (id) => {
|
export const getField = (id) => {
|
||||||
return request.get({ url: `/admin-api/crm/clue-param/get?id=${id}` })
|
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得精简信息列表
|
// 获得精简信息列表
|
||||||
export const getSimpleFieldList = () => {
|
export const getSimpleFieldList = () => {
|
||||||
return request.get({ url: '/admin-api/crm/clue-param/simple-list' })
|
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 1 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取自定义字段
|
// 获取自定义字段
|
||||||
export const getDiyFieldList = () => {
|
export const getDiyFieldList = () => {
|
||||||
return request.get({ url: '/admin-api/crm/clue-param/get-diy-param' })
|
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 1 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 状态修改
|
// 状态修改
|
||||||
@@ -36,5 +36,5 @@ export const updateFieldStatus = (signParamId, status) => {
|
|||||||
signParamId,
|
signParamId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/clue-param/status/update', data: data })
|
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,3 +44,8 @@ export const getClueCount = async () => {
|
|||||||
export const getOpearateRecord = async (params) => {
|
export const getOpearateRecord = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/clue-operate-record/list', params })
|
return await request.get({ url: '/admin-api/crm/clue-operate-record/list', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取公海线索
|
||||||
|
export const getPublicClue = async (data) => {
|
||||||
|
return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,32 +2,32 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
// 创建
|
// 创建
|
||||||
export const createField = (data) => {
|
export const createField = (data) => {
|
||||||
return request.post({ url: '/admin-api/crm/sign-param/create', data })
|
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 2 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
export const updateField = (data) => {
|
export const updateField = (data) => {
|
||||||
return request.put({ url: '/admin-api/crm/sign-param/update', data })
|
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export const deleteField = (id) => {
|
export const deleteField = (id) => {
|
||||||
return request.delete({ url: `/admin-api/crm/sign-param/delete?id=${id}` })
|
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得
|
// 获得
|
||||||
export const getField = (id) => {
|
export const getField = (id) => {
|
||||||
return request.get({ url: `/admin-api/crm/sign-param/get?id=${id}` })
|
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得精简信息列表
|
// 获得精简信息列表
|
||||||
export const getSimpleFieldList = () => {
|
export const getSimpleFieldList = () => {
|
||||||
return request.get({ url: '/admin-api/crm/sign-param/simple-list' })
|
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 2 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取自定义字段
|
// 获取自定义字段
|
||||||
export const getDiyFieldList = () => {
|
export const getDiyFieldList = () => {
|
||||||
return request.get({ url: '/admin-api/crm/sign-param/get-diy-param' })
|
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 2 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 状态修改
|
// 状态修改
|
||||||
@@ -36,5 +36,5 @@ export const updateFieldStatus = (signParamId, status) => {
|
|||||||
signParamId,
|
signParamId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sign-param/status/update', data: data })
|
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
40
src/api/mall/product/productField.js
Normal file
40
src/api/mall/product/productField.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export const createField = (data) => {
|
||||||
|
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export const updateField = (data) => {
|
||||||
|
return request.put({ url: '/admin-api/crm/param/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export const deleteField = (id) => {
|
||||||
|
return request.delete({ url: `/admin-api/crm/param/delete?id=${id}` })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得
|
||||||
|
export const getField = (id) => {
|
||||||
|
return request.get({ url: `/admin-api/crm/param/get?id=${id}` })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得精简信息列表
|
||||||
|
export const getSimpleFieldList = () => {
|
||||||
|
return request.get({ url: '/admin-api/crm/param/simple-list', params: { module: 3 } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取自定义字段
|
||||||
|
export const getDiyFieldList = () => {
|
||||||
|
return request.get({ url: '/admin-api/crm/param/get-diy-param', params: { module: 3 } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态修改
|
||||||
|
export const updateFieldStatus = (signParamId, status) => {
|
||||||
|
const data = {
|
||||||
|
signParamId,
|
||||||
|
status
|
||||||
|
}
|
||||||
|
return request.put({ url: '/admin-api/crm/param/status/update', data: data })
|
||||||
|
}
|
||||||
@@ -20,6 +20,6 @@ export const deletePurchase = async (id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
// 审核
|
||||||
export const auditPurchase = async (params) => {
|
export const auditPurchase = async (data) => {
|
||||||
return await request.get({ url: '/admin-api/crm/erp-purchase/audit', params })
|
return await request.post({ url: '/admin-api/crm/erp-purchase/audit', data })
|
||||||
}
|
}
|
||||||
|
|||||||
11
src/api/system/set/index.js
Normal file
11
src/api/system/set/index.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 通过key,查询内容
|
||||||
|
export const getConfigByConfigKey = (params) => {
|
||||||
|
return request.get({ url: '/admin-api/crm/config/getConfigByConfigKey', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存配置项
|
||||||
|
export const updateConfig = (data) => {
|
||||||
|
return request.put({ url: '/admin-api/crm/config/update', data })
|
||||||
|
}
|
||||||
@@ -131,7 +131,7 @@ const toggleClick = () => {
|
|||||||
<DictTag :type="item.dictType" :value="data[item.field] + ''" />
|
<DictTag :type="item.dictType" :value="data[item.field] + ''" />
|
||||||
</slot>
|
</slot>
|
||||||
<slot v-else-if="item.isEditor">
|
<slot v-else-if="item.isEditor">
|
||||||
<div v-dompurify-html="data[item.field]"></div>
|
<div v-if="data[item.field]" v-dompurify-html="data[item.field]"></div>
|
||||||
</slot>
|
</slot>
|
||||||
<slot v-else :name="item.field" :row="data">{{ data[item.field] }}</slot>
|
<slot v-else :name="item.field" :row="data">{{ data[item.field] }}</slot>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
>
|
>
|
||||||
<el-button type="primary"><Icon icon="ep:upload-filled" />选取文件</el-button>
|
<el-button type="primary"><Icon icon="ep:upload-filled" />选取文件</el-button>
|
||||||
<template v-if="isShowTip" #tip>
|
<template v-if="isShowTip" #tip>
|
||||||
<div style="font-size: 8px">
|
<div style="font-size: 12px">
|
||||||
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 8px">
|
<div style="font-size: 12px">
|
||||||
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
|
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b> 的文件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog title="成交登记" v-model="show" width="800px">
|
<Dialog title="成交登记" v-model="show" width="800px">
|
||||||
<Descriptions :data="info" :schema="schema" :columns="2" />
|
<Descriptions :data="info" :schema="showSchema" :columns="2" />
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
@@ -42,48 +42,60 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup name="DialogSuccess">
|
||||||
|
import * as ClueApi from '@/api/clue'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
const rules = ref({})
|
const rules = ref({})
|
||||||
const info = ref({})
|
const info = ref({})
|
||||||
|
|
||||||
const schema = ref([
|
const props = defineProps({
|
||||||
{
|
schema: {
|
||||||
field: 'name',
|
type: Array
|
||||||
label: '线索名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'specsName',
|
|
||||||
label: '联系方式'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'supplier',
|
|
||||||
label: '意向状态'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'supplier',
|
|
||||||
label: '创建时间'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'purchaseCount',
|
|
||||||
label: '诉求',
|
|
||||||
span: 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
isEditor: true,
|
|
||||||
span: 2
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
|
|
||||||
function open(val) {
|
const showSchema = computed(() => {
|
||||||
show.value = true
|
const arr = [
|
||||||
info.value = { ...val }
|
{
|
||||||
|
field: 'requirement',
|
||||||
|
label: '诉求',
|
||||||
|
span: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
isEditor: true,
|
||||||
|
span: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
return [...props.schema, ...arr]
|
||||||
|
})
|
||||||
|
|
||||||
|
async function open(id) {
|
||||||
|
try {
|
||||||
|
resetForm(id)
|
||||||
|
const data = await ClueApi.getClue(id)
|
||||||
|
info.value = { ...data, ...data.diyParams }
|
||||||
|
show.value = true
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
function resetForm(id) {
|
||||||
|
form.value = {
|
||||||
|
clueId: id,
|
||||||
|
dealDate: formatDate(new Date()),
|
||||||
|
state: true,
|
||||||
|
payPrice: 0,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleSave() {
|
function handleSave() {
|
||||||
console.log('保存成功')
|
console.log('保存成功')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,12 @@
|
|||||||
<el-tag type="success">{{ info.intentionState }}</el-tag>
|
<el-tag type="success">{{ info.intentionState }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" plain @click="handleUpdate">修改</el-button>
|
<el-button type="primary" v-hasPermi="['clue:pool:update']" plain @click="handleUpdate">
|
||||||
<el-button type="danger" plain @click="handleRemove">删除</el-button>
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button type="danger" v-hasPermi="['clue:pool:delete']" plain @click="handleRemove">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
@@ -37,7 +41,13 @@
|
|||||||
<!-- 详细信息 -->
|
<!-- 详细信息 -->
|
||||||
<el-tabs v-model="infoIndex" type="border-card">
|
<el-tabs v-model="infoIndex" type="border-card">
|
||||||
<el-tab-pane label="跟进记录" name="followRecord">
|
<el-tab-pane label="跟进记录" name="followRecord">
|
||||||
<el-button class="mb-10px" type="primary" @click="addFollow">添加跟进记录</el-button>
|
<el-button
|
||||||
|
v-hasPermi="['clue:pool:update']"
|
||||||
|
class="mb-10px"
|
||||||
|
type="primary"
|
||||||
|
@click="addFollow"
|
||||||
|
>添加跟进记录</el-button
|
||||||
|
>
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
<el-timeline-item
|
<el-timeline-item
|
||||||
v-for="item in followRecordList"
|
v-for="item in followRecordList"
|
||||||
@@ -148,7 +158,8 @@ const showSchema = computed(() => {
|
|||||||
{
|
{
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
span: 2
|
span: 2,
|
||||||
|
isEditor: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
return [...props.schema, ...arr]
|
return [...props.schema, ...arr]
|
||||||
|
|||||||
@@ -94,30 +94,42 @@
|
|||||||
>
|
>
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<template v-if="queryType != 4">
|
||||||
type="primary"
|
<el-button
|
||||||
link
|
type="primary"
|
||||||
@click="handleEdit(scope.row)"
|
link
|
||||||
v-hasPermi="['clue:pool:update']"
|
@click="handleEdit(scope.row)"
|
||||||
>
|
v-hasPermi="['clue:pool:update']"
|
||||||
修改
|
>
|
||||||
</el-button>
|
修改
|
||||||
<el-button
|
</el-button>
|
||||||
type="primary"
|
<el-button
|
||||||
link
|
type="primary"
|
||||||
@click="handleSuccess(scope.row)"
|
link
|
||||||
v-hasPermi="['clue:pool:enroll']"
|
@click="handleSuccess(scope.row)"
|
||||||
>
|
v-hasPermi="['clue:pool:enroll']"
|
||||||
登记
|
>
|
||||||
</el-button>
|
登记
|
||||||
<el-button
|
</el-button>
|
||||||
type="primary"
|
<el-button
|
||||||
link
|
type="primary"
|
||||||
v-hasPermi="['clue:pool:release']"
|
link
|
||||||
@click="handleRelease(scope.row.clueId)"
|
v-hasPermi="['clue:pool:release']"
|
||||||
>
|
@click="handleRelease(scope.row.clueId)"
|
||||||
释放
|
>
|
||||||
</el-button>
|
释放
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
v-hasPermi="['clue:pool:gain']"
|
||||||
|
@click="handleGain(scope.row.clueId)"
|
||||||
|
>
|
||||||
|
获取
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</SSTable>
|
</SSTable>
|
||||||
@@ -136,7 +148,7 @@
|
|||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
@update="handleEdit"
|
@update="handleEdit"
|
||||||
/>
|
/>
|
||||||
<DialogSuccess ref="successRef" />
|
<DialogSuccess ref="successRef" :schema="allSchemas.formSchema" />
|
||||||
<DialogFollow ref="followRef" @success="getTableList" />
|
<DialogFollow ref="followRef" @success="getTableList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -256,7 +268,7 @@ async function makeCall(phone) {
|
|||||||
|
|
||||||
// 登记
|
// 登记
|
||||||
function handleSuccess(row) {
|
function handleSuccess(row) {
|
||||||
successRef.value.open(row)
|
successRef.value.open(row.clueId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 释放
|
// 释放
|
||||||
@@ -280,6 +292,21 @@ function handleRelease(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleGain(id) {
|
||||||
|
message.confirm('是否确认获取公海线索?').then(() => {
|
||||||
|
try {
|
||||||
|
ClueApi.getPublicClue({
|
||||||
|
clueId: id,
|
||||||
|
publicClue: false
|
||||||
|
}).then(() => {
|
||||||
|
message.success('获取成功')
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
getTableList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
const userOptions = ref([])
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUserOption().then((data) => {
|
getUserOption().then((data) => {
|
||||||
|
|||||||
@@ -2,45 +2,55 @@
|
|||||||
<el-row :gutter="80">
|
<el-row :gutter="80">
|
||||||
<el-col :span="10" :offset="0">
|
<el-col :span="10" :offset="0">
|
||||||
<el-button class="mb-10px" type="primary" @click="handleInsert">新增属性</el-button>
|
<el-button class="mb-10px" type="primary" @click="handleInsert">新增属性</el-button>
|
||||||
<el-table :data="tableList">
|
<el-table :data="tableList" :row-class-name="setRowClass" @row-click="handleRowClick">
|
||||||
<el-table-column prop="name" label="名称" />
|
<el-table-column prop="label" label="名称" />
|
||||||
<el-table-column label="启用状态">
|
<el-table-column prop="field" label="属性编码" />
|
||||||
|
<el-table-column prop="component" label="类型" width="200px">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ typeOptions.find((it) => it.value == row.component).label }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="启用状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="row.status"
|
v-model="row.status"
|
||||||
:active-value="1"
|
:active-value="0"
|
||||||
:inactive-value="0"
|
:inactive-value="1"
|
||||||
:disabled="!row.canUpdate"
|
|
||||||
@change="changeStatus(row)"
|
@change="changeStatus(row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="80px">
|
<el-table-column label="操作" width="80px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
:disabled="!row.canUpdate"
|
|
||||||
style="padding: 0"
|
|
||||||
@click="remove(row)"
|
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" :offset="0">
|
<el-col :span="14" :offset="0" v-if="tableList.length || formType == 'create'">
|
||||||
<el-form :model="form" ref="fieldForm" :rules="rules" label-width="80px" :inline="false">
|
<el-form :model="form" ref="fieldForm" :rules="rules" label-width="100px" :inline="false">
|
||||||
<el-form-item label="属性名称" prop="name">
|
<el-form-item label="属性名称" prop="label">
|
||||||
<el-input v-model="form.name" placeholder="请输入属性名称" />
|
<el-input v-model="form.label" placeholder="请输入属性名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="属性类型" prop="type">
|
<el-form-item prop="field">
|
||||||
|
<template #label>
|
||||||
|
<div class="flex justify-center" style="align-items: center">
|
||||||
|
<span>属性编码</span>
|
||||||
|
<Tooltip message="请输入字母或数字,必须以字母开头" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-input v-model="form.field" placeholder="请输入属性编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="属性类型" prop="component">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.type"
|
v-model="form.component"
|
||||||
placeholder="请选择属性类型"
|
placeholder="请选择属性类型"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@change="form.options = []"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in typeOptions"
|
v-for="item in typeOptions"
|
||||||
@@ -51,72 +61,174 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="['Checkbox', 'Radio', 'Select'].includes(form.type)"
|
v-if="['Checkbox', 'Radio', 'Select'].includes(form.component)"
|
||||||
label="选项"
|
label="选项"
|
||||||
prop="option"
|
prop="options"
|
||||||
key="option"
|
key="options"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="optionList.push([])"> 新增选项 </el-button>
|
<el-button type="primary" @click="handleAddOption"> 新增选项 </el-button>
|
||||||
<div
|
<div
|
||||||
class="flex justify-between mt-10px"
|
class="flex justify-between mt-10px"
|
||||||
v-for="(item, index) in optionList"
|
v-for="(item, index) in form.options"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<el-input v-model="item.label" placeholder="请输入选项内容" clearable />
|
<el-input
|
||||||
<el-button type="primary" text @click="optionList.splice(index, 1)">删除</el-button>
|
v-model="item.name"
|
||||||
|
placeholder="请输入选项内容"
|
||||||
|
clearable
|
||||||
|
style="width: 300px !important"
|
||||||
|
@blur="item.id = item.name"
|
||||||
|
/>
|
||||||
|
<el-button type="primary" text @click="form.options.splice(index, 1)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
<el-button type="primary" :disabled="formLoading" @click="onSubmit">保存</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup name="FieldProduct">
|
||||||
const tableList = ref([{ name: '单位', status: 0, canUpdate: true }])
|
import * as FieldApi from '@/api/mall/product/productField'
|
||||||
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const tableList = ref([])
|
||||||
|
const currentRowId = ref('')
|
||||||
|
|
||||||
|
function setRowClass({ row }) {
|
||||||
|
return row.field == currentRowId.value ? 'current-row' : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleRowClick(row) {
|
||||||
|
formType.value = 'update'
|
||||||
|
currentRowId.value = row.field
|
||||||
|
form.value = { ...row }
|
||||||
|
}
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
name: undefined,
|
label: undefined,
|
||||||
type: undefined,
|
field: '',
|
||||||
option: undefined
|
component: undefined,
|
||||||
|
options: [],
|
||||||
|
status: 0,
|
||||||
|
isCustom: true,
|
||||||
|
isForm: true,
|
||||||
|
isSearch: true,
|
||||||
|
isTable: true
|
||||||
})
|
})
|
||||||
|
|
||||||
const typeOptions = ref([
|
const loading = ref(false)
|
||||||
{ label: '输入框', value: 'Input' },
|
|
||||||
{ label: '多选', value: 'Checkbox' },
|
|
||||||
{ label: '单选', value: 'Radio' },
|
|
||||||
{ label: '下拉选', value: 'Select' },
|
|
||||||
{ label: '开关', value: 'Switch' },
|
|
||||||
{ label: '日期选择', value: 'DatePicker' },
|
|
||||||
{ label: '时间选择', value: 'TimePicker' },
|
|
||||||
{ label: '富文本', value: 'Editor' },
|
|
||||||
{ label: '图片', value: 'UploadImg' },
|
|
||||||
{ label: '文件', value: 'UploadFile' }
|
|
||||||
])
|
|
||||||
|
|
||||||
const rules = {}
|
const typeOptions = ref([])
|
||||||
|
|
||||||
const optionList = ref([])
|
const rules = {
|
||||||
|
label: { required: true, message: '名称不可为空', trigger: 'blur' },
|
||||||
|
field: { required: true, message: '编码不可为空', trigger: 'blur' },
|
||||||
|
component: { required: true, message: '类型不可为空', trigger: 'change' }
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getList() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await FieldApi.getDiyFieldList()
|
||||||
|
tableList.value = data
|
||||||
|
if (data.length) {
|
||||||
|
handleRowClick(data[0])
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formType = ref('')
|
||||||
|
|
||||||
function handleInsert() {
|
function handleInsert() {
|
||||||
console.log('新增')
|
formType.value = 'create'
|
||||||
|
form.value = {
|
||||||
|
label: undefined,
|
||||||
|
field: '',
|
||||||
|
component: undefined,
|
||||||
|
options: [],
|
||||||
|
status: 0,
|
||||||
|
isCustom: true,
|
||||||
|
isForm: true,
|
||||||
|
isSearch: true,
|
||||||
|
isTable: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeStatus(row) {
|
async function remove(id) {
|
||||||
console.log(row.status)
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await FieldApi.deleteField(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(row) {
|
async function changeStatus(row) {
|
||||||
console.log(row.status)
|
try {
|
||||||
|
// 二次确认
|
||||||
|
await message.confirm('是否确认修改状态')
|
||||||
|
await FieldApi.updateFieldStatus(row.clueParamId, row.status)
|
||||||
|
message.success('修改成功')
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {
|
||||||
|
// 取消后,进行恢复按钮
|
||||||
|
row.status = row.status == 0 ? 1 : 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
const fieldForm = ref()
|
||||||
console.log('保存')
|
const formLoading = ref(false)
|
||||||
|
|
||||||
|
function handleAddOption() {
|
||||||
|
if (form.value.options) {
|
||||||
|
form.value.options.push({})
|
||||||
|
} else {
|
||||||
|
form.value.options = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onSubmit() {
|
||||||
|
// 校验表单
|
||||||
|
if (!fieldForm.value) return
|
||||||
|
const valid = await fieldForm.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await FieldApi.createField(form.value)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await FieldApi.updateField(form.value)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 发送操作成功的事件
|
||||||
|
getList()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
typeOptions.value = getDictOptions('attribute_type')
|
||||||
|
getList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -1,34 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form :model="form" ref="formRef" label-width="auto">
|
<el-form :model="form" ref="formRef" label-width="auto">
|
||||||
<el-form-item label="采购申请自动通过">
|
<el-form-item label="采购申请自动通过">
|
||||||
<el-radio-group v-model="form.autoAuditPurchase">
|
<el-radio-group v-model="form.purchaseAuditAutoCompleteConfig">
|
||||||
<el-radio :label="true"> 是 </el-radio>
|
<el-radio label="true"> 是 </el-radio>
|
||||||
<el-radio :label="false"> 否 </el-radio>
|
<el-radio label="false"> 否 </el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||||
<el-button @click="getData">刷新</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="BasicSettingMall">
|
<script setup name="BasicSettingMall">
|
||||||
|
import * as ConfigApi from '@/api/system/set'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
autoAuditPurchase: 0
|
purchaseAuditAutoCompleteConfig: 'true'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const info = ref({})
|
||||||
|
|
||||||
function getData() {
|
function getData() {
|
||||||
form.value = {
|
ConfigApi.getConfigByConfigKey({ configKey: 'purchaseAuditAutoCompleteConfig' }).then((data) => {
|
||||||
autoAuditPurchase: 1
|
info.value = data
|
||||||
}
|
form.value = {
|
||||||
|
purchaseAuditAutoCompleteConfig: data.configValue
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
message.success('保存成功')
|
const data = {
|
||||||
|
...info,
|
||||||
|
purchaseAuditAutoCompleteConfig: form.value.purchaseAuditAutoCompleteConfig
|
||||||
|
}
|
||||||
|
ConfigApi.updateConfig(data).then(() => {
|
||||||
|
message.success('保存成功')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getData()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -33,6 +33,38 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="8"
|
||||||
|
:offset="0"
|
||||||
|
v-for="fieldItem in diyFieldList"
|
||||||
|
:key="fieldItem.clueParamId"
|
||||||
|
>
|
||||||
|
<el-form-item :label="fieldItem.label" :prop="fieldItem.field">
|
||||||
|
<component :is="componentMap[fieldItem.component]" v-model="form[fieldItem.field]">
|
||||||
|
<template v-if="fieldItem.component == 'Select'">
|
||||||
|
<el-option
|
||||||
|
v-for="item in fieldItem.options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="fieldItem.component == 'Radio'">
|
||||||
|
<el-radio v-for="item in fieldItem.options" :key="item.id" :label="item.id">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-radio>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="fieldItem.component == 'Checkbox'">
|
||||||
|
<el-checkbox
|
||||||
|
v-for="item in fieldItem.options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</component>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
@@ -51,7 +83,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20" v-if="!formLoading">
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
<el-form-item label="轮播图" prop="carouselImages">
|
<el-form-item label="轮播图" prop="carouselImages">
|
||||||
<UploadImgs v-model="form.carouselImages" height="100px" width="100px" />
|
<UploadImgs v-model="form.carouselImages" height="100px" width="100px" />
|
||||||
@@ -143,21 +175,25 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="mt-20px flex justify-center">
|
<div class="mt-20px flex justify-center">
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||||
<el-button plain>重置</el-button>
|
<el-button plain @click="router.replace('/MiniMall/product')">返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
<ProductAttributesAddForm ref="attributesAddFormRef" :propertyList="form.productSpecList" />
|
<ProductAttributesAddForm ref="attributesAddFormRef" :propertyList="form.productSpecList" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { cloneDeep } from 'lodash-es'
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
import { getDiyFieldList } from '@/api/mall/product/productField'
|
||||||
import * as PropertyApi from '@/api/mall/product/property'
|
import * as PropertyApi from '@/api/mall/product/property'
|
||||||
import * as ProductApi from '@/api/mall/product/index'
|
import * as ProductApi from '@/api/mall/product/index'
|
||||||
import ProductAttributesAddForm from './Comp/ProductAttributesAddForm.vue'
|
import ProductAttributesAddForm from './Comp/ProductAttributesAddForm.vue'
|
||||||
import * as BrandApi from '@/api/mall/product/brand'
|
import * as BrandApi from '@/api/mall/product/brand'
|
||||||
import * as CategoryApi from '@/api/mall/product/category'
|
import * as CategoryApi from '@/api/mall/product/category'
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
|
import { isObject } from '@/utils/is.ts'
|
||||||
|
import { componentMap } from '@/components/Form/src/componentMap'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
@@ -184,7 +220,11 @@ const opts = ref({
|
|||||||
category: []
|
category: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const diyFieldList = ref([])
|
||||||
async function getOptions() {
|
async function getOptions() {
|
||||||
|
getDiyFieldList().then((data) => {
|
||||||
|
diyFieldList.value = data
|
||||||
|
})
|
||||||
BrandApi.getSimpleBrandList().then((data) => {
|
BrandApi.getSimpleBrandList().then((data) => {
|
||||||
opts.value.brand = data || []
|
opts.value.brand = data || []
|
||||||
})
|
})
|
||||||
@@ -329,24 +369,35 @@ const spuForm = ref()
|
|||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
spuForm.value.validate(async (valid) => {
|
spuForm.value.validate(async (valid) => {
|
||||||
if (valid && validateSku()) {
|
try {
|
||||||
// 深拷贝一份, 这样最终 server 端不满足,不需要影响原始数据
|
if (valid && validateSku()) {
|
||||||
const deepCopyFormData = cloneDeep(unref(form.value))
|
// 深拷贝一份, 这样最终 server 端不满足,不需要影响原始数据
|
||||||
deepCopyFormData.productSpecList = deepCopyFormData.skuList
|
const deepCopyFormData = cloneDeep(unref(form.value))
|
||||||
if (deepCopyFormData.productCategory && deepCopyFormData.productCategory.length) {
|
deepCopyFormData.productSpecList = deepCopyFormData.skuList
|
||||||
deepCopyFormData.productCategory = deepCopyFormData.productCategory.at(-1)
|
if (deepCopyFormData.productCategory && deepCopyFormData.productCategory.length) {
|
||||||
}
|
deepCopyFormData.productCategory = deepCopyFormData.productCategory.at(-1)
|
||||||
delete deepCopyFormData.skuList
|
}
|
||||||
// 校验都通过后提交表单
|
delete deepCopyFormData.skuList
|
||||||
const data = deepCopyFormData
|
// 校验都通过后提交表单
|
||||||
const id = route.query.id
|
let data = {
|
||||||
if (!id) {
|
...deepCopyFormData,
|
||||||
await ProductApi.createProduct(data)
|
diyParams: {}
|
||||||
message.success(t('common.createSuccess'))
|
}
|
||||||
} else {
|
for (let i = 0; i < diyFieldList.value.length; i++) {
|
||||||
await ProductApi.updateProduct(data)
|
const element = diyFieldList.value[i]
|
||||||
message.success(t('common.updateSuccess'))
|
data.diyParams[element.field] = data[element.field]
|
||||||
|
}
|
||||||
|
const id = route.query.id
|
||||||
|
if (!id) {
|
||||||
|
await ProductApi.createProduct(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ProductApi.updateProduct(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -414,10 +465,15 @@ const getDetail = async () => {
|
|||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await ProductApi.getProduct(route.query.id)
|
const res = await ProductApi.getProduct(route.query.id)
|
||||||
const propList = getPropertyList(res.productSpecList)
|
let diyField = {}
|
||||||
|
if (res.diyParams) {
|
||||||
|
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
||||||
|
}
|
||||||
|
const propList = getPropertyList(res?.productSpecList || [])
|
||||||
form.value = {
|
form.value = {
|
||||||
...res,
|
...res,
|
||||||
skuList: res.productSpecList,
|
...diyField,
|
||||||
|
skuList: res?.productSpecList || [],
|
||||||
productSpecList: propList
|
productSpecList: propList
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -81,7 +81,15 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="简介" min-width="70" prop="productIntro" />
|
<el-table-column label="简介" min-width="70" prop="productIntro" />
|
||||||
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="180" />
|
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="180" />
|
||||||
<el-table-column fixed="right" label="操作" min-width="80">
|
<el-table-column v-for="item in diyFieldList" :key="item.clueParamId" :label="item.label">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-if="item.component == 'DatePicker'">
|
||||||
|
{{ formatDate(row[item.field]) }}
|
||||||
|
</div>
|
||||||
|
<div v-else>{{ row[item.field] }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column fixed="right" label="操作" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<!-- TODO:【详情】,可以后面点做哈 -->
|
<!-- TODO:【详情】,可以后面点做哈 -->
|
||||||
<el-button
|
<el-button
|
||||||
@@ -113,12 +121,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Product">
|
<script setup name="Product">
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { getDiyFieldList } from '@/api/mall/product/productField'
|
||||||
|
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||||
import { createImageViewer } from '@/components/ImageViewer'
|
import { createImageViewer } from '@/components/ImageViewer'
|
||||||
import * as ProductApi from '@/api/mall/product'
|
import * as ProductApi from '@/api/mall/product'
|
||||||
import * as BrandApi from '@/api/mall/product/brand'
|
import * as BrandApi from '@/api/mall/product/brand'
|
||||||
import * as CategoryApi from '@/api/mall/product/category'
|
import * as CategoryApi from '@/api/mall/product/category'
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
|
import { isObject } from '@/utils/is.ts'
|
||||||
|
|
||||||
const { currentRoute, push } = useRouter()
|
const { currentRoute, push } = useRouter()
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@@ -162,13 +172,20 @@ async function getList() {
|
|||||||
params.productCategory = params.productCategory.at(-1)
|
params.productCategory = params.productCategory.at(-1)
|
||||||
}
|
}
|
||||||
const data = await ProductApi.getProductPage(params)
|
const data = await ProductApi.getProductPage(params)
|
||||||
tableList.value = data.list.map((prod) => ({
|
tableList.value = data.list.map((prod) => {
|
||||||
...prod,
|
let diyField = {}
|
||||||
properties: prod.productSpecList[0].properties.map((item) => ({
|
if (prod.diyParams) {
|
||||||
propertyId: item.propertyId,
|
diyField = isObject(prod.diyParams) ? prod.diyParams : JSON.parse(prod.diyParams)
|
||||||
label: item.propertyName
|
}
|
||||||
}))
|
return {
|
||||||
}))
|
...prod,
|
||||||
|
...diyField,
|
||||||
|
properties: prod.productSpecList[0].properties.map((item) => ({
|
||||||
|
propertyId: item.propertyId,
|
||||||
|
label: item.propertyName
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
})
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -187,7 +204,12 @@ function handleQuery() {
|
|||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const diyFieldList = ref([])
|
||||||
|
|
||||||
async function getOptions() {
|
async function getOptions() {
|
||||||
|
getDiyFieldList().then((data) => {
|
||||||
|
diyFieldList.value = data
|
||||||
|
})
|
||||||
BrandApi.getSimpleBrandList().then((data) => {
|
BrandApi.getSimpleBrandList().then((data) => {
|
||||||
opts.value.brand = data || []
|
opts.value.brand = data || []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ import * as WarehouseApi from '@/api/mall/warehouse'
|
|||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
opts: {
|
opts: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
<el-form-item label="审核" prop="isPass">
|
<el-form-item label="审核" prop="isPass">
|
||||||
<el-radio-group v-model="form.isPass">
|
<el-radio-group v-model="form.isPass">
|
||||||
<el-radio :label="2">通过</el-radio>
|
<el-radio :label="true">通过</el-radio>
|
||||||
<el-radio :label="3">驳回</el-radio>
|
<el-radio :label="false">驳回</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -23,13 +23,15 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<span>
|
<span>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = 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>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogAuditPurchase">
|
<script setup name="DialogAuditPurchase">
|
||||||
|
import { auditPurchase } from '@/api/mall/purchase'
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
@@ -65,7 +67,7 @@ const open = (val, flag) => {
|
|||||||
]
|
]
|
||||||
schema.value = [...schema.value, ...arr]
|
schema.value = [...schema.value, ...arr]
|
||||||
} else {
|
} else {
|
||||||
form.value.isPass = 2
|
form.value.isPass = true
|
||||||
form.value.auditRemark = ''
|
form.value.auditRemark = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,8 +121,19 @@ const resetSchema = () => {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSave() {
|
const formLoading = ref(false)
|
||||||
console.log('保存')
|
const emit = defineEmits(['getList'])
|
||||||
|
async function handleSave() {
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
await auditPurchase(form.value)
|
||||||
|
message.success('审核完成')
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('getList')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<DialogAdd :opts="opts" ref="creatPurchase" />
|
<DialogAdd :opts="opts" ref="creatPurchase" />
|
||||||
<DialogAudit ref="auditPurchase" />
|
<DialogAudit ref="auditPurchase" @get-list="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user