fix 修改商品sku上架后不可修改,添加公告管理
This commit is contained in:
parent
ef3c28b8b7
commit
847a79ac58
38
src/api/business/Advertisement/Notices/notice.js
Normal file
38
src/api/business/Advertisement/Notices/notice.js
Normal file
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @Descripttion: 公告Api接口
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
*/
|
||||
|
||||
// 公告分页查询列表
|
||||
export function noticeList(query) {
|
||||
return request({
|
||||
url: '/business/Notice/getNoticeList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 公告新增或修改
|
||||
export function addOrUpdateNotice(data) {
|
||||
return request({
|
||||
url: '/business/Notice/addOrUpdateNotice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 公告删除
|
||||
export function delNotice(ids) {
|
||||
return request({
|
||||
url: '/business/Notice/'+ ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
38
src/api/business/Custom/HistorySearchs/historysearch.js
Normal file
38
src/api/business/Custom/HistorySearchs/historysearch.js
Normal file
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @Descripttion: 历史搜索Api接口
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
*/
|
||||
|
||||
// 历史搜索分页查询列表
|
||||
export function historySearchList(query) {
|
||||
return request({
|
||||
url: '/business/HistorySearch/getHistorySearchList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 历史搜索新增或修改
|
||||
export function addOrUpdateHistorySearch(data) {
|
||||
return request({
|
||||
url: '/business/HistorySearch/addOrUpdateHistorySearch',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 历史搜索删除
|
||||
export function delHistorySearch(ids) {
|
||||
return request({
|
||||
url: '/business/HistorySearch/'+ ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-upload multiple :action="uploadImgUrl" list-type="picture-card" :on-success="handleUploadSuccess"
|
||||
:before-upload="handleBeforeUpload" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
|
||||
name="file" :data="data" :drag="drag" :on-remove="handleRemove" :show-file-list="true" :headers="headers"
|
||||
:file-list="fileList" :on-preview="handlePictureCardPreview" :class="{ hide: fileList.length >= limit }">
|
||||
:file-list="fileList" :on-preview="handlePictureCardPreview" :class="{ hide: fileList.length >= limit }" :disabled="disabled">
|
||||
<el-icon class="avatar-uploader-icon">
|
||||
<plus />
|
||||
</el-icon>
|
||||
@ -65,6 +65,11 @@ const props = defineProps({
|
||||
drag: {
|
||||
type: Boolean,
|
||||
},
|
||||
// 是否禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
@ -0,0 +1,118 @@
|
||||
<!--
|
||||
* @Descripttion: (公告/tb_notice 添加弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="添加公告信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="标题" prop="noticeTitle">
|
||||
<el-input v-model="formData.noticeTitle" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="内容" prop="noticeContent">
|
||||
<el-input v-model="formData.noticeContent" type="textarea" :rows="5" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="noticeSort">
|
||||
<el-input-number v-model.number="formData.noticeSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div key="dialog-footer">
|
||||
<el-button type="primary" @click="handleAddClick(formRef)" :loading="loadingStatus">添加</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { addOrUpdateNotice } from '@/api/business/Advertisement/Notices/notice.js';
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// -业务参数
|
||||
|
||||
|
||||
// -业务方法
|
||||
|
||||
|
||||
|
||||
// -基础参数
|
||||
const loadingStatus = ref(false)
|
||||
const labelWidth = 100;
|
||||
const formRef = ref();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const formData = reactive({
|
||||
noticeSort: 1
|
||||
});
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
done: Function,
|
||||
});
|
||||
const imgData = ref({
|
||||
fileDir: "Notice"
|
||||
})
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
noticeGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||
noticeTitle: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
||||
noticeContent: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
||||
noticeSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
|
||||
// 提交
|
||||
const handleAddClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
loadingStatus.value = true
|
||||
|
||||
|
||||
const { code } = await addOrUpdateNotice(formData);
|
||||
if (code == 200) {
|
||||
modal.msgSuccess('添加成功')
|
||||
closeDialog();
|
||||
loadingStatus.value = false
|
||||
}
|
||||
});
|
||||
};
|
||||
const closeDialog = () => {
|
||||
handleResetClick(formRef.value);
|
||||
props.done();
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
};
|
||||
</script>
|
@ -0,0 +1,87 @@
|
||||
<!--
|
||||
* @Descripttion: (公告/tb_notice 详情弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="公告信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="标题">
|
||||
<el-input v-model="formData.noticeTitle" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="内容">
|
||||
<el-input v-model="formData.noticeContent" type="textarea" :rows="5" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序">
|
||||
<el-input-number v-model.number="formData.noticeSort" controls-position="right" :precision="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
}
|
||||
|
||||
const formData = ref({
|
||||
...props.data,
|
||||
});
|
||||
watch(props, async (v) => {
|
||||
formData.value = v.data;
|
||||
});
|
||||
|
||||
// -业务参数
|
||||
|
||||
// -业务方法
|
||||
|
||||
|
||||
|
||||
// 基础参数
|
||||
const formRef = ref();
|
||||
const labelWidth = 100;
|
||||
const { proxy } = getCurrentInstance()
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
done: Function,
|
||||
});
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
|
||||
|
||||
// -基础方法
|
||||
const closeDialog = () => {
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
</script>
|
@ -0,0 +1,132 @@
|
||||
<!--
|
||||
* @Descripttion: (公告/tb_notice 编辑弹窗)
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="修改公告信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="标题" prop="noticeTitle">
|
||||
<el-input v-model="formData.noticeTitle" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item :label-width="labelWidth" label="内容" prop="noticeContent">
|
||||
<el-input v-model="formData.noticeContent" type="textarea" :rows="5" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="排序" prop="noticeSort">
|
||||
<el-input-number v-model.number="formData.noticeSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleEditClick(formRef)" :loading="loadingStatus">编辑</el-button>
|
||||
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { addOrUpdateNotice } from "@/api/business/Advertisement/Notices/notice.js";
|
||||
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
}
|
||||
|
||||
const formData = ref({
|
||||
...props.data,
|
||||
});
|
||||
watch(props, async (v) => {
|
||||
formData.value = v.data;
|
||||
|
||||
});
|
||||
|
||||
// 业务参数
|
||||
|
||||
// -业务方法
|
||||
|
||||
|
||||
|
||||
// -基础参数
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
data: Object,
|
||||
done: Function,
|
||||
});
|
||||
|
||||
const loadingStatus = ref(false)
|
||||
const labelWidth = 100;
|
||||
const formRef = ref();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const imgData = ref({
|
||||
fileDir: "Notice"
|
||||
})
|
||||
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
noticeGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||
noticeTitle: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
||||
noticeContent: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
||||
noticeSort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||
});
|
||||
|
||||
// -基础方法
|
||||
// 提交
|
||||
const handleEditClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
loadingStatus.value = true
|
||||
|
||||
|
||||
const { code } = await addOrUpdateNotice(formData.value);
|
||||
if (code == 200) {
|
||||
modal.msgSuccess('修改成功')
|
||||
closeDialog();
|
||||
loadingStatus.value = false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const handleResetClick = async (formEl) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
}
|
||||
const closeDialog = () => {
|
||||
props.done();
|
||||
emits("update:modelValue", false);
|
||||
};
|
||||
|
||||
</script>
|
189
src/views/business/Advertisement/Notices/index.vue
Normal file
189
src/views/business/Advertisement/Notices/index.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<!--
|
||||
* @Descripttion: (公告/tb_notice)
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-10-09)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-10-09)
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="24">
|
||||
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
||||
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
|
||||
@submit.prevent>
|
||||
<el-form-item label="标题" prop="noticeTitle">
|
||||
<el-input v-model="queryParams.noticeTitle" placeholder="请输入标题" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:notice:addOrUpdate']" plain icon="plus"
|
||||
@click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:notice:delete']" plain icon="delete"
|
||||
@click="handleDelete">
|
||||
{{ $t('btn.delete') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格渲染 prop="对应的字段"-->
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column prop="noticeTitle" label="标题" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="noticeContent" label="内容" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="noticeSort" label="排序" align="center" sortable />
|
||||
|
||||
<el-table-column label="操作" width="350" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:notice:addOrUpdate']">编辑</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:notice:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
|
||||
<!-- 添加 -->
|
||||
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||
<!-- 编辑 -->
|
||||
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||
<!-- 详情 -->
|
||||
<DetailDialog v-model="DetailDialogVisible" :data="DetailDialogRow" :done="() => resetQuery()"></DetailDialog>
|
||||
</template>
|
||||
<script setup name="notice">
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import modal from '@/plugins/modal.js'
|
||||
import { noticeList, delNotice } from '@/api/business/Advertisement/Notices/notice.js'
|
||||
import AddDialog from "./components/AddDialog.vue";
|
||||
import EditDialog from "./components/EditDialog.vue";
|
||||
import DetailDialog from "./components/DetailDialog.vue";
|
||||
|
||||
const AddDialogVisible = ref(false);
|
||||
const EditDialogVisible = ref(false);
|
||||
const EditDialogRow = ref({});
|
||||
const DetailDialogVisible = ref(false);
|
||||
const DetailDialogRow = ref({});
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
// 选中categoryId数组数组
|
||||
const ids = ref([])
|
||||
// 非单选禁用
|
||||
const single = ref(true)
|
||||
// 非多个禁用
|
||||
const multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
const showSearch = ref(true)
|
||||
// 数据列表
|
||||
const dataList = ref([])
|
||||
// 总记录数
|
||||
const total = ref(0)
|
||||
// 是否加载
|
||||
const loading = ref(true)
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
})
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
// 业务参数
|
||||
|
||||
|
||||
// 业务方法
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//基础方法
|
||||
|
||||
// 查询数据
|
||||
function getList() {
|
||||
loading.value = true
|
||||
|
||||
|
||||
noticeList(queryParams.value).then((res) => {
|
||||
if (res.code == 200) {
|
||||
loading.value = false;
|
||||
dataList.value = res.data.result;
|
||||
total.value = res.data.totalNum;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.noticeId)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 重置查询操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryForm')
|
||||
handleQuery()
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
getList()
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const Ids = row.noticeId || ids.value
|
||||
|
||||
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return delNotice(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
handleQuery()
|
||||
modal.msgSuccess("删除成功")
|
||||
})
|
||||
.catch(() => { })
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 修改
|
||||
function handleUpdate(row) {
|
||||
EditDialogVisible.value = true
|
||||
EditDialogRow.value = row
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
DetailDialogVisible.value = true
|
||||
DetailDialogRow.value = row
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
</script>
|
@ -158,7 +158,7 @@
|
||||
<el-row v-if="formData.goodsSpecType == 2">
|
||||
<el-col :lg="24">
|
||||
|
||||
<MultiSpec v-model="formData"></MultiSpec>
|
||||
<MultiSpec v-model="formData" :isAdd="true"></MultiSpec>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -91,7 +91,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="规格类型" prop="goodsSpecType">
|
||||
<el-radio-group v-model="formData.goodsSpecType">
|
||||
<el-radio-group v-model="formData.goodsSpecType" :disabled="formData.goodsShelfStatus == 1">
|
||||
<el-radio v-for="item in spec_type " :key="item.dictValue" :label="parseInt(item.dictValue)"
|
||||
@change="handleChangeSpecType">{{
|
||||
item.dictLabel }}</el-radio>
|
||||
@ -153,9 +153,7 @@
|
||||
|
||||
<el-row v-if="formData.goodsSpecType == 2">
|
||||
<el-col :lg="24">
|
||||
|
||||
<MultiSpec v-model="formData"></MultiSpec>
|
||||
|
||||
<MultiSpec v-model="formData" :isAdd="formData.goodsShelfStatus == 2"></MultiSpec>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -202,7 +200,7 @@
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="主图视频" prop="goodsMainImageVideo">
|
||||
<div style="display: block;">
|
||||
<UploadFile v-model="formData.goodsMainImageVideo" :limit="10" :fileSize="100" :data=imgData
|
||||
<UploadFile v-model="formData.goodsMainImageVideo" :drag="true" :limit="10" :fileSize="100" :data=imgData
|
||||
:isShowTip="false" />
|
||||
<div class="input-intro">建议视频宽高比19:9,建议时长8-45秒</div>
|
||||
</div>
|
||||
|
@ -3,30 +3,31 @@
|
||||
<div style="display: block;width: 100%;">
|
||||
<!-- <el-input-number v-model.number="formData.goodsSpec" controls-position="right" :min="0.01"
|
||||
:precision="2" /> -->
|
||||
<el-alert v-if="isAdd" title="注意:上架商品后无法修改规格!请谨慎填写" type="warning " show-icon :closable="false" />
|
||||
<div class="input-intro">最多添加3个商品规格组,生成的SKU数量不能超出50个</div>
|
||||
|
||||
<!-- 规格样式 -->
|
||||
<div class="sepc-big-box" v-for="(item, index) in goodsSpecList">
|
||||
<div class="sepc-title-box">
|
||||
<el-input v-model="item.specName" @change="handleChangeSepc(item, index)" class="spec-input" placeholder="规格组名称"
|
||||
clearable />
|
||||
<el-link type="primary" @click="handleDelSpec(item)">删除规格组</el-link>
|
||||
:clearable="isAdd" :disabled="!isAdd" />
|
||||
<el-link type="primary" @click="handleDelSpec(item)" v-if="isAdd">删除规格组</el-link>
|
||||
</div>
|
||||
<div class="spec-value-box">
|
||||
<div class="spec-value-input-big-box">
|
||||
<div class="spec-value-input-box" v-for="specValue in item.props">
|
||||
<div class="spec-value-input-del" @click="handleDelSpecValue(item, specValue)"><el-icon>
|
||||
<div v-if="isAdd" class="spec-value-input-del" @click="handleDelSpecValue(item, specValue)"><el-icon>
|
||||
<Close />
|
||||
</el-icon></div>
|
||||
<el-input v-model="specValue.specValueName" @change="handleChangeSepcValue()" class="spec-value-input"
|
||||
placeholder="规格值名称" clearable />
|
||||
placeholder="规格值名称" :disabled="!isAdd" :clearable="isAdd" />
|
||||
</div>
|
||||
</div>
|
||||
<el-link type="primary" v-if="isAddSpecValueMax" @click="handleAddSpecValue(item)">添加规格值</el-link>
|
||||
<el-link type="primary" v-if="isAddSpecValueMax && isAdd" @click="handleAddSpecValue(item)">添加规格值</el-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-button v-if="isAddSpecMax" class="mt-5" @click="handleAddSpec">
|
||||
<el-button v-if="isAddSpecMax && isAdd" class="mt-5" @click="handleAddSpec">
|
||||
<el-icon class="avatar-uploader-icon">
|
||||
<plus />
|
||||
</el-icon>
|
||||
@ -49,39 +50,39 @@
|
||||
|
||||
<el-table-column prop="goodsSkuImg" label="预览图" width="125" align="center">
|
||||
<template #default="scope">
|
||||
<UploadImage ref="uploadRef" v-model="scope.row.goodsSkuImg" :data=imgData :limit="1" :fileSize="5" :drag="true"
|
||||
<UploadImage ref="uploadRef" :disabled="!isAdd" v-model="scope.row.goodsSkuImg" :data=imgData :limit="1" :fileSize="5" :drag="true"
|
||||
:isShowTip="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="goodsSkuPrice" label="商品价格" width="145">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model.number="scope.row.goodsSkuPrice" controls-position="right" :min="0" :precision="2" />
|
||||
<el-input-number v-model.number="scope.row.goodsSkuPrice" controls-position="right" :min="0" :precision="2" :disabled="!isAdd" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="goodsSkuLinePrice" label="划线价格" width="145">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model.number="scope.row.goodsSkuLinePrice" controls-position="right" :min="0"
|
||||
:precision="2" />
|
||||
:precision="2" :disabled="!isAdd" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="goodsSkuStockNum" label="库存数量" width="145">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model.number="scope.row.goodsSkuStockNum" controls-position="right" :min="0" />
|
||||
<el-input-number v-model.number="scope.row.goodsSkuStockNum" controls-position="right" :min="0" :disabled="!isAdd"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="goodsSkuWeight" label="商品重量 (KG)" width="145">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model.number="scope.row.goodsSkuWeight" controls-position="right" :min="0" :precision="2" />
|
||||
<el-input-number v-model.number="scope.row.goodsSkuWeight" controls-position="right" :min="0" :precision="2" :disabled="!isAdd"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="goodsSkuSkuCode" label="SKU编码" width="145">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.goodsSkuSkuCode" placeholder="" />
|
||||
<el-input v-model="scope.row.goodsSkuSkuCode" placeholder="" :disabled="!isAdd"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -95,6 +96,7 @@ import descartes from "./dikaerji";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Object,
|
||||
isAdd: Boolean,
|
||||
});
|
||||
|
||||
watch(props, async (v) => {
|
||||
@ -122,6 +124,7 @@ watch(props, async (v) => {
|
||||
skuColumns.value.push(column); // 将表头对象添加到skuColumns数组
|
||||
});
|
||||
}
|
||||
console.log(v.modelValue.skuList, '原数据');
|
||||
skuList.value = v.modelValue.skuList;
|
||||
if (v.modelValue.skuList && v.modelValue.skuList.length !== 0) {
|
||||
getSpanArr(skuList.value);
|
||||
@ -192,7 +195,9 @@ const spanArr = ref([])
|
||||
const spanArr1 = ref([])
|
||||
const pos = ref("")
|
||||
const pos1 = ref("")
|
||||
|
||||
const imgData = ref({
|
||||
fileDir: "Goods"
|
||||
})
|
||||
|
||||
|
||||
/** sku列表方法 */
|
||||
@ -221,6 +226,7 @@ const getList = () => {
|
||||
specSecondValue: Array.isArray(item) ? item[1] : null,
|
||||
specThirdValue: Array.isArray(item) ? item[2] : null,
|
||||
goodsGuid: 0,
|
||||
goodsSkuId: 0,
|
||||
goodsSkuImg: "",
|
||||
goodsSkuPrice: 0.01,
|
||||
goodsSkuLinePrice: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user