feat 添加商品评价
This commit is contained in:
parent
dca9e7ca48
commit
cf0c86afc2
46
src/api/business/GoodsManager/GoodsComments/goodscomment.js
Normal file
46
src/api/business/GoodsManager/GoodsComments/goodscomment.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Descripttion: 商品评价Api接口
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-15)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-15)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 商品评价分页查询列表
|
||||||
|
export function goodsCommentList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/GoodsComment/getGoodsCommentList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品评价新增或修改
|
||||||
|
export function addOrUpdateGoodsComment(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/GoodsComment/addOrUpdateGoodsComment',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商品评价删除
|
||||||
|
export function delGoodsComment(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/business/GoodsComment/'+ ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 商品评价回复
|
||||||
|
export function goodsCommentRecover(data) {
|
||||||
|
return request({
|
||||||
|
url: 'business/GoodsComment/recover',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -76,7 +76,7 @@ import { ElMessage } from 'element-plus'
|
|||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import { addOrUpdateCustomerAddress } from '@/api/business/Custom/CustomerAddresses/customerAddress.js';
|
import { addOrUpdateCustomerAddress } from '@/api/business/Custom/CustomerAddresses/customerAddress.js';
|
||||||
import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
||||||
import ChooseCustomerDialog from './ChooseCustomerDialog.vue';
|
import ChooseCustomerDialog from '@/views/business/components/ChooseCustomerDialog.vue';
|
||||||
|
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
|
@ -67,7 +67,7 @@ const getCustomerListFun = async () => {
|
|||||||
await customerList(queryParams).then((res) => {
|
await customerList(queryParams).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
customersList.value = res.data.result
|
customersList.value = res.data.result
|
||||||
total.value = res.totalNum
|
total.value = res.data.totalNum
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -0,0 +1,248 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (商品评价/tb_goods_comment 添加弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-15)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-15)
|
||||||
|
-->
|
||||||
|
<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 v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
|
||||||
|
<el-input v-model='formData.shopName' disabled type="text" placeholder='点击选择店铺'>
|
||||||
|
<template #append>
|
||||||
|
<div @click="handleChooseShop">选择</div>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户" prop="customerGuid">
|
||||||
|
<el-input v-model='formData.customerNickname' disabled type="text" placeholder='点击选择客户'>
|
||||||
|
<template #append>
|
||||||
|
<div @click="handleChooseCustomer">选择</div>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品" prop="goodsGuid">
|
||||||
|
<el-input v-model='formData.goodsName' disabled type="text" placeholder='点击选择商品'>
|
||||||
|
<template #append>
|
||||||
|
<div @click="handleChooseGoods">选择</div>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评分分数" prop="goodsCommentRating">
|
||||||
|
<el-rate v-model="formData.goodsCommentRating" allow-half />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价内容" prop="goodsCommentContent">
|
||||||
|
<el-input v-model="formData.goodsCommentContent" type="textarea" :rows="5" placeholder="请输入评价内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价图片" prop="goodsCommentImages">
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.goodsCommentImages" :data=imgData :limit="1" :fileSize="5"
|
||||||
|
:drag="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="goodsCommentStatus">
|
||||||
|
<el-radio-group v-model="formData.goodsCommentStatus">
|
||||||
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
|
item.dictLabel }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="goodsCommentSort">
|
||||||
|
<el-input-number v-model.number="formData.goodsCommentSort" 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>
|
||||||
|
|
||||||
|
<!-- 选择店铺 -->
|
||||||
|
<ChooseShopDialog v-model="ChooseShopDialogVisible" :data="ChooseShopDialogRow" :done="handelAddShop">
|
||||||
|
</ChooseShopDialog>
|
||||||
|
<!-- 选择客户 -->
|
||||||
|
<ChooseCustomerDialog v-model="ChooseCustomerDialogVisible" :data="ChooseCustomerDialogRow">
|
||||||
|
</ChooseCustomerDialog>
|
||||||
|
<!-- 选择商品 -->
|
||||||
|
<ChooseGoodsDialog v-model="ChooseGoodsDialogVisible" :data="ChooseGoodsDialogRow">
|
||||||
|
</ChooseGoodsDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import { addOrUpdateGoodsComment } from '@/api/business/GoodsManager/GoodsComments/goodsComment.js';
|
||||||
|
import ChooseShopDialog from '@/views/business/components/ChooseShopDialog.vue';
|
||||||
|
import ChooseCustomerDialog from '@/views/business/components/ChooseCustomerDialog.vue';
|
||||||
|
import ChooseGoodsDialog from '@/views/business/components/ChooseGoodsDialog.vue';
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
await getrating_type()
|
||||||
|
await getrecover_status()
|
||||||
|
await getdisplay_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 当前用户id
|
||||||
|
const userid = useUserStore().userId
|
||||||
|
// 评分类型字典选项列表
|
||||||
|
const rating_type = ref([]);
|
||||||
|
// 回复状态字典选项列表
|
||||||
|
const recover_status = ref([]);
|
||||||
|
// 显示状态字典选项列表
|
||||||
|
const display_status = ref([]);
|
||||||
|
// 选择店铺弹窗参数
|
||||||
|
const ChooseShopDialogVisible = ref(false);
|
||||||
|
const ChooseShopDialogRow = ref({});
|
||||||
|
// 选择客户弹窗参数
|
||||||
|
const ChooseCustomerDialogVisible = ref(false);
|
||||||
|
const ChooseCustomerDialogRow = ref({});
|
||||||
|
// 选择商品弹窗参数
|
||||||
|
const ChooseGoodsDialogVisible = ref(false);
|
||||||
|
const ChooseGoodsDialogRow = ref({});
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getrating_type() {
|
||||||
|
await proxy.getDicts('rating_type').then((res) => {
|
||||||
|
rating_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getrecover_status() {
|
||||||
|
await proxy.getDicts('recover_status').then((res) => {
|
||||||
|
recover_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdisplay_status() {
|
||||||
|
await proxy.getDicts('display_status').then((res) => {
|
||||||
|
display_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 打开选择店铺弹窗
|
||||||
|
const handleChooseShop = () => {
|
||||||
|
ChooseShopDialogVisible.value = true
|
||||||
|
ChooseShopDialogRow.value = formData
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理添加店铺后的回调
|
||||||
|
async function handelAddShop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开选择客户弹窗
|
||||||
|
const handleChooseCustomer = () => {
|
||||||
|
ChooseCustomerDialogVisible.value = true
|
||||||
|
ChooseCustomerDialogRow.value = formData
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开选择商品弹窗
|
||||||
|
const handleChooseGoods = () => {
|
||||||
|
if(!formData.shopGuid && userid == 1){
|
||||||
|
modal.msgError("请先选择店铺")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ChooseGoodsDialogVisible.value = true
|
||||||
|
ChooseGoodsDialogRow.value = formData
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = reactive({
|
||||||
|
goodsCommentStatus: 1,
|
||||||
|
goodsCommentSort: 100
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "GoodsComment"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
shopGuid: [{ required: true, message: "店铺不能为空", trigger: "blur" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户不能为空", trigger: "blur" }],
|
||||||
|
goodsGuid: [{ required: true, message: "商品不能为空", trigger: "blur" }],
|
||||||
|
goodsCommentRating: [{ required: true, message: "评分分数不能为空", trigger: "blur",type: "number" }],
|
||||||
|
goodsCommentRatingType: [{ required: true, message: "评分类型不能为空", trigger: "change", type: "number" }],
|
||||||
|
goodsCommentContent: [{ required: true, message: "评价内容不能为空", trigger: "blur" }],
|
||||||
|
goodsCommentRecoverStatus: [{ required: true, message: "回复状态不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsCommentStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsCommentSort: [{ 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 addOrUpdateGoodsComment(formData);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('添加成功')
|
||||||
|
closeDialog();
|
||||||
|
loadingStatus.value = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeDialog = () => {
|
||||||
|
formData.shopName = ""
|
||||||
|
formData.shopGuid = 0
|
||||||
|
formData.customerNickname = ""
|
||||||
|
formData.customerGuid = 0
|
||||||
|
formData.goodsName = ""
|
||||||
|
formData.goodsGuid = 0
|
||||||
|
formData.goodsCommentRating = 0
|
||||||
|
handleResetClick(formRef.value);
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,137 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (商品评价/tb_goods_comment 详情弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-15)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-15)
|
||||||
|
-->
|
||||||
|
<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 v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
|
||||||
|
<el-input v-model='formData.shopName' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户" prop="customerGuid">
|
||||||
|
<el-input v-model='formData.customerNickname' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品" prop="goodsGuid">
|
||||||
|
<el-input v-model='formData.goodsName' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评分分数" prop="goodsCommentRating">
|
||||||
|
<el-rate v-model="formData.goodsCommentRating" allow-half />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价内容" prop="goodsCommentContent">
|
||||||
|
<el-input v-model="formData.goodsCommentContent" type="textarea" :rows="5" placeholder="请输入评价内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价图片" prop="goodsCommentImages">
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.goodsCommentImages" :data=imgData :limit="1" :fileSize="5"
|
||||||
|
:drag="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="goodsCommentStatus">
|
||||||
|
<el-radio-group v-model="formData.goodsCommentStatus">
|
||||||
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
|
item.dictLabel }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="goodsCommentSort">
|
||||||
|
<el-input-number v-model.number="formData.goodsCommentSort" controls-position="right" :min="0" />
|
||||||
|
</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";
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getrating_type()
|
||||||
|
await getrecover_status()
|
||||||
|
await getdisplay_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 当前用户id
|
||||||
|
const userid = useUserStore().userId
|
||||||
|
// 评分类型字典选项列表
|
||||||
|
const rating_type = ref([]);
|
||||||
|
// 回复状态字典选项列表
|
||||||
|
const recover_status = ref([]);
|
||||||
|
// 显示状态字典选项列表
|
||||||
|
const display_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getrating_type() {
|
||||||
|
await proxy.getDicts('rating_type').then((res) => {
|
||||||
|
rating_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getrecover_status() {
|
||||||
|
await proxy.getDicts('recover_status').then((res) => {
|
||||||
|
recover_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdisplay_status() {
|
||||||
|
await proxy.getDicts('display_status').then((res) => {
|
||||||
|
display_status.value = res.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,188 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (商品评价/tb_goods_comment 编辑弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-15)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-15)
|
||||||
|
-->
|
||||||
|
<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 v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="店铺" prop="shopGuid">
|
||||||
|
<el-input v-model='formData.shopName' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-if="userid == 1" :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户" prop="customerGuid">
|
||||||
|
<el-input v-model='formData.customerNickname' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品" prop="goodsGuid">
|
||||||
|
<el-input v-model='formData.goodsName' disabled type="text">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评分分数" prop="goodsCommentRating">
|
||||||
|
<el-rate v-model="formData.goodsCommentRating" allow-half />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价内容" prop="goodsCommentContent">
|
||||||
|
<el-input v-model="formData.goodsCommentContent" type="textarea" :rows="5" placeholder="请输入评价内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="评价图片" prop="goodsCommentImages">
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.goodsCommentImages" :data=imgData :limit="1" :fileSize="5"
|
||||||
|
:drag="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="显示状态" prop="goodsCommentStatus">
|
||||||
|
<el-radio-group v-model="formData.goodsCommentStatus">
|
||||||
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="parseInt(item.dictValue)">{{
|
||||||
|
item.dictLabel }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="goodsCommentSort">
|
||||||
|
<el-input-number v-model.number="formData.goodsCommentSort" 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 useUserStore from '@/store/modules/user'
|
||||||
|
import { addOrUpdateGoodsComment } from "@/api/business/GoodsManager/GoodsComments/goodsComment.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getrating_type()
|
||||||
|
await getrecover_status()
|
||||||
|
await getdisplay_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
// 当前用户id
|
||||||
|
const userid = useUserStore().userId
|
||||||
|
// 评分类型字典选项列表
|
||||||
|
const rating_type = ref([]);
|
||||||
|
// 回复状态字典选项列表
|
||||||
|
const recover_status = ref([]);
|
||||||
|
// 显示状态字典选项列表
|
||||||
|
const display_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
//字典获取
|
||||||
|
async function getrating_type() {
|
||||||
|
await proxy.getDicts('rating_type').then((res) => {
|
||||||
|
rating_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getrecover_status() {
|
||||||
|
await proxy.getDicts('recover_status').then((res) => {
|
||||||
|
recover_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getdisplay_status() {
|
||||||
|
await proxy.getDicts('display_status').then((res) => {
|
||||||
|
display_status.value = res.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: "GoodsComment"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
shopGuid: [{ required: true, message: "店铺不能为空", trigger: "blur" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户不能为空", trigger: "blur" }],
|
||||||
|
goodsGuid: [{ required: true, message: "商品不能为空", trigger: "blur" }],
|
||||||
|
goodsCommentRating: [{ required: true, message: "评分分数不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsCommentRatingType: [{ required: true, message: "评分类型不能为空", trigger: "change", type: "number" }],
|
||||||
|
goodsCommentContent: [{ required: true, message: "评价内容不能为空", trigger: "blur" }],
|
||||||
|
goodsCommentRecoverStatus: [{ required: true, message: "回复状态不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsCommentStatus: [{ required: true, message: "显示状态不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsCommentSort: [{ 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 addOrUpdateGoodsComment(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>
|
@ -0,0 +1,100 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (商品评价/tb_goods_comment 回复弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-17)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-17)
|
||||||
|
-->
|
||||||
|
<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="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="回复内容" prop="goodsCommentRecoverContent">
|
||||||
|
<el-input v-model.number="formData.goodsCommentRecoverContent" type="textarea" :rows="10" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div key="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleRecoverClick(formRef)" :loading="loadingStatus">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { goodsCommentRecover } from '@/api/business/GoodsManager/GoodsComments/goodsComment.js';
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
goodsCommentRecoverContent: [{ required: true, message: "回复内容不能为空", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleRecoverClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
formData.value.goodsCommentId = props.data.goodsCommentId
|
||||||
|
|
||||||
|
const { code, data } = await goodsCommentRecover(formData.value);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess(data)
|
||||||
|
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>
|
308
src/views/business/GoodsManager/GoodsComments/index.vue
Normal file
308
src/views/business/GoodsManager/GoodsComments/index.vue
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (商品评价/tb_goods_comment)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-07-15)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-07-15)
|
||||||
|
-->
|
||||||
|
<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="shopName">
|
||||||
|
<el-input v-model.number="queryParams.shopName" placeholder="请输入店铺" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品" prop="goodsName">
|
||||||
|
<el-input v-model.number="queryParams.goodsName" placeholder="请输入商品" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="评分类型" prop="goodsCommentRatingType">
|
||||||
|
<el-select v-model="queryParams.goodsCommentRatingType" placeholder="请选择评分类型" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in rating_type " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="回复状态" prop="GoodsCommentRecoverStatus">
|
||||||
|
<el-select v-model="queryParams.GoodsCommentRecoverStatus" placeholder="请选择回复状态" clearable
|
||||||
|
@change="handleQuery">
|
||||||
|
<el-option v-for="item in recover_status " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="显示状态" prop="goodsCommentStatus">
|
||||||
|
<el-radio-group v-model="queryParams.goodsCommentStatus">
|
||||||
|
<el-radio v-for="item in display_status " :key="item.dictValue" :label="item.dictValue">{{ item.dictLabel
|
||||||
|
}}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</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:goodscomment: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:goodscomment: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" highlight-current-row
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
|
||||||
|
<el-table-column prop="shopName" label="店铺名称" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="goodsInfo" width="350" label="商品信息" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="goods-info-box">
|
||||||
|
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain"
|
||||||
|
:src="scope.row.goodsPicture?.split(',')[0]" :preview-src-list="scope.row.goodsPicture?.split(',')">
|
||||||
|
<div><el-icon :size="15">
|
||||||
|
<document />
|
||||||
|
</el-icon></div>
|
||||||
|
</el-image>
|
||||||
|
<div class="goods-info-text">
|
||||||
|
{{ scope.row.goodsName }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentRating" label="评分分数" align="center" sortable>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-rate v-model="scope.row.goodsCommentRating" allow-half disabled />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentContent" width="350" label="评价内容" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="goodsCommentImages" label="评价图片" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain"
|
||||||
|
:src="scope.row.goodsCommentImages?.split(',')[0]"
|
||||||
|
:preview-src-list="scope.row.goodsCommentImages?.split(',')">
|
||||||
|
<div><el-icon :size="15">
|
||||||
|
<document />
|
||||||
|
</el-icon></div>
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentRatingType" label="评分类型" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="rating_type" :value="scope.row.goodsCommentRatingType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentRecoverStatus" label="回复状态" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="recover_status" :value="scope.row.goodsCommentRecoverStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentStatus" label="显示状态" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="display_status" :value="scope.row.goodsCommentStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsCommentSort" label="排序" align="center" sortable />
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="350" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="warning" v-if="scope.row.goodsCommentRecoverStatus == 1" size="small" icon="check"
|
||||||
|
@click="handleRecover(scope.row)" v-hasPermi="['business:goodscomment:recover']">回复</el-button>
|
||||||
|
<el-button type="warning" v-if="scope.row.goodsCommentRecoverStatus == 2" size="small" icon="check"
|
||||||
|
@click="handleRecover(scope.row)" v-hasPermi="['business:goodscomment:recover']">编辑回复</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:goodscomment:addOrUpdate']">编辑</el-button>
|
||||||
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:goodscomment: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>
|
||||||
|
<!-- 回复 -->
|
||||||
|
<RecoverDialog v-model="RecoverDialogVisible" :data="RecoverDialogRow" :done="() => resetQuery()"></RecoverDialog>
|
||||||
|
</template>
|
||||||
|
<script setup name="goodscomment">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { goodsCommentList, delGoodsComment } from '@/api/business/GoodsManager/GoodsComments/goodsComment.js'
|
||||||
|
import AddDialog from "./components/AddDialog.vue";
|
||||||
|
import EditDialog from "./components/EditDialog.vue";
|
||||||
|
import DetailDialog from "./components/DetailDialog.vue";
|
||||||
|
import RecoverDialog from "./components/RecoverDialog.vue";
|
||||||
|
|
||||||
|
const AddDialogVisible = ref(false);
|
||||||
|
const EditDialogVisible = ref(false);
|
||||||
|
const EditDialogRow = ref({});
|
||||||
|
const DetailDialogVisible = ref(false);
|
||||||
|
const DetailDialogRow = ref({});
|
||||||
|
const RecoverDialogVisible = ref(false);
|
||||||
|
const RecoverDialogRow = 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)
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
|
||||||
|
|
||||||
|
// 业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const rating_type = ref([]);
|
||||||
|
async function getrating_type() {
|
||||||
|
await proxy.getDicts('rating_type').then((res) => {
|
||||||
|
rating_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getrating_type()
|
||||||
|
// 字典获取
|
||||||
|
const recover_status = ref([]);
|
||||||
|
async function getrecover_status() {
|
||||||
|
await proxy.getDicts('recover_status').then((res) => {
|
||||||
|
recover_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getrecover_status()
|
||||||
|
// 字典获取
|
||||||
|
const display_status = ref([]);
|
||||||
|
async function getdisplay_status() {
|
||||||
|
await proxy.getDicts('display_status').then((res) => {
|
||||||
|
display_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getdisplay_status()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//基础方法
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
function getList() {
|
||||||
|
loading.value = true
|
||||||
|
|
||||||
|
|
||||||
|
goodsCommentList(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.goodsCommentId)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置查询操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm('queryForm')
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.goodsCommentId || ids.value
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return delGoodsComment(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
handleQuery()
|
||||||
|
modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditDialogVisible.value = true
|
||||||
|
EditDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailDialogVisible.value = true
|
||||||
|
DetailDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 回复
|
||||||
|
function handleRecover(row) {
|
||||||
|
RecoverDialogVisible.value = true
|
||||||
|
RecoverDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
handleQuery()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.goods-info-box {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-info-text {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -78,7 +78,7 @@ import { ElMessage } from 'element-plus'
|
|||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import { addOrUpdateGoodsServices } from '@/api/business/GoodsManager/GoodsServicess/goodsServices.js';
|
import { addOrUpdateGoodsServices } from '@/api/business/GoodsManager/GoodsServicess/goodsServices.js';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import ChooseShopDialog from './ChooseShopDialog.vue';
|
import ChooseShopDialog from '@/views/business/components/ChooseShopDialog.vue';
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
const openDialog = async () => {
|
const openDialog = async () => {
|
||||||
|
@ -1,117 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-model="props.modelValue" title="选择店铺" width="900px" @closed="closeDialog" @open="openDialog">
|
|
||||||
|
|
||||||
<el-form inline :model="queryParams">
|
|
||||||
<el-form-item label="店铺名称">
|
|
||||||
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
|
||||||
搜索
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- 表格渲染 prop="对应的字段"-->
|
|
||||||
<el-table v-loading="loading" :data="shopsList" ref="tableRef" border highlight-current-row
|
|
||||||
@row-click="handleRowClick">
|
|
||||||
<el-table-column prop="shopName" label="店铺名称" align="left" :show-overflow-tooltip="true" />
|
|
||||||
</el-table>
|
|
||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getShopListFun" />
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="handleEditClick()">添加</el-button>
|
|
||||||
<el-button @click="handleResetClick()">重置</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { reactive, ref, watch, nextTick } from 'vue';
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { shopList } from '@/api/business/ShopManager/Shops/shop.js'
|
|
||||||
|
|
||||||
// 业务参数
|
|
||||||
const total = ref(0)
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
// 基础参数
|
|
||||||
const tableRef = ref(null);
|
|
||||||
// 查询参数
|
|
||||||
const queryParams = reactive({
|
|
||||||
shopName: "",
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10
|
|
||||||
});
|
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
|
||||||
const props = defineProps({
|
|
||||||
modelValue: Boolean,
|
|
||||||
data: Object,
|
|
||||||
});
|
|
||||||
const formData = ref({
|
|
||||||
...props.data
|
|
||||||
});
|
|
||||||
|
|
||||||
let shopsList = ref([]);
|
|
||||||
// 打开窗口时运行
|
|
||||||
const openDialog = async () => {
|
|
||||||
await getShopListFun()
|
|
||||||
}
|
|
||||||
|
|
||||||
const getShopListFun = async () => {
|
|
||||||
loading.value = true
|
|
||||||
await shopList(queryParams).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
shopsList.value = res.data.result
|
|
||||||
total.value = res.totalNum
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(props, (v) => {
|
|
||||||
formData.value = v.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
// -业务方法
|
|
||||||
let shopName = ref("");
|
|
||||||
let shopGuid = ref("");
|
|
||||||
|
|
||||||
|
|
||||||
// -基础方法
|
|
||||||
|
|
||||||
// 点击行
|
|
||||||
const handleRowClick = (row) => {
|
|
||||||
shopName.value = row.shopName
|
|
||||||
shopGuid.value = row.shopGuid
|
|
||||||
}
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
shopName.value = ""
|
|
||||||
emits('update:modelValue', false);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const handleEditClick = async () => {
|
|
||||||
if (shopName.value !== "") {
|
|
||||||
|
|
||||||
formData.value.shopName = shopName.value
|
|
||||||
formData.value.shopGuid = shopGuid.value
|
|
||||||
if (formData.value.shopName != null) {
|
|
||||||
closeDialog();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ElMessage.error("请选择店铺")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResetClick = async formEl => {
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
@ -339,7 +339,7 @@ import { shopGoodsCategoryTreeList } from '@/api/business/GoodsManager/ShopGoods
|
|||||||
import { deliveryList } from '@/api/business/LogisticsManage/Deliverys/delivery.js'
|
import { deliveryList } from '@/api/business/LogisticsManage/Deliverys/delivery.js'
|
||||||
import { goodsServicesList } from '@/api/business/GoodsManager/GoodsServicess/goodsServices.js'
|
import { goodsServicesList } from '@/api/business/GoodsManager/GoodsServicess/goodsServices.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import ChooseShopDialog from './ChooseShopDialog.vue';
|
import ChooseShopDialog from '@/views/business/components/ChooseShopDialog.vue';
|
||||||
import MultiSpec from './MultiSpec/MultiSpec.vue';
|
import MultiSpec from './MultiSpec/MultiSpec.vue';
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ import { ElMessage } from 'element-plus'
|
|||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js';
|
import { shopGoodsCategoryTreeList, addOrUpdateShopGoodsCategory } from '@/api/business/GoodsManager/ShopGoodsCategorys/shopGoodsCategory.js';
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import ChooseShopDialog from './ChooseShopDialog.vue';
|
import ChooseShopDialog from '@/views/business/components/ChooseShopDialog.vue';
|
||||||
|
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
|
@ -1,117 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-model="props.modelValue" title="选择店铺" width="900px" @closed="closeDialog" @open="openDialog">
|
|
||||||
|
|
||||||
<el-form inline :model="queryParams">
|
|
||||||
<el-form-item label="店铺名称">
|
|
||||||
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
|
||||||
搜索
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- 表格渲染 prop="对应的字段"-->
|
|
||||||
<el-table v-loading="loading" :data="shopsList" ref="tableRef" border highlight-current-row
|
|
||||||
@row-click="handleRowClick">
|
|
||||||
<el-table-column prop="shopName" label="店铺名称" align="left" :show-overflow-tooltip="true" />
|
|
||||||
</el-table>
|
|
||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getShopListFun" />
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="handleEditClick()">添加</el-button>
|
|
||||||
<el-button @click="handleResetClick()">重置</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { reactive, ref, watch, nextTick } from 'vue';
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { shopList } from '@/api/business/ShopManager/Shops/shop.js'
|
|
||||||
|
|
||||||
// 业务参数
|
|
||||||
const total = ref(0)
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
// 基础参数
|
|
||||||
const tableRef = ref(null);
|
|
||||||
// 查询参数
|
|
||||||
const queryParams = reactive({
|
|
||||||
shopName: "",
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10
|
|
||||||
});
|
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
|
||||||
const props = defineProps({
|
|
||||||
modelValue: Boolean,
|
|
||||||
data: Object,
|
|
||||||
});
|
|
||||||
const formData = ref({
|
|
||||||
...props.data
|
|
||||||
});
|
|
||||||
|
|
||||||
let shopsList = ref([]);
|
|
||||||
// 打开窗口时运行
|
|
||||||
const openDialog = async () => {
|
|
||||||
await getShopListFun()
|
|
||||||
}
|
|
||||||
|
|
||||||
const getShopListFun = async () => {
|
|
||||||
loading.value = true
|
|
||||||
await shopList(queryParams).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
shopsList.value = res.data.result
|
|
||||||
total.value = res.totalNum
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(props, (v) => {
|
|
||||||
formData.value = v.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
// -业务方法
|
|
||||||
let shopName = ref("");
|
|
||||||
let shopGuid = ref("");
|
|
||||||
|
|
||||||
|
|
||||||
// -基础方法
|
|
||||||
|
|
||||||
// 点击行
|
|
||||||
const handleRowClick = (row) => {
|
|
||||||
shopName.value = row.shopName
|
|
||||||
shopGuid.value = row.shopGuid
|
|
||||||
}
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
shopName.value = ""
|
|
||||||
emits('update:modelValue', false);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const handleEditClick = async () => {
|
|
||||||
if (shopName.value !== "") {
|
|
||||||
|
|
||||||
formData.value.shopName = shopName.value
|
|
||||||
formData.value.shopGuid = shopGuid.value
|
|
||||||
if (formData.value.shopName != null) {
|
|
||||||
closeDialog();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ElMessage.error("请选择店铺")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResetClick = async formEl => {
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
@ -115,7 +115,7 @@ import { ElMessageBox } from 'element-plus'
|
|||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { addOrUpdateDelivery } from '@/api/business/LogisticsManage/Deliverys/delivery.js';
|
import { addOrUpdateDelivery } from '@/api/business/LogisticsManage/Deliverys/delivery.js';
|
||||||
import ChooseShopDialog from './ChooseShopDialog.vue';
|
import ChooseShopDialog from '@/views/business/components/ChooseShopDialog.vue';
|
||||||
import RegionTranser from './RegionTranser.vue';
|
import RegionTranser from './RegionTranser.vue';
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
|
@ -1,117 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-model="props.modelValue" title="选择店铺" width="900px" @closed="closeDialog" @open="openDialog">
|
|
||||||
|
|
||||||
<el-form inline :model="queryParams">
|
|
||||||
<el-form-item label="店铺名称">
|
|
||||||
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
|
||||||
搜索
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- 表格渲染 prop="对应的字段"-->
|
|
||||||
<el-table v-loading="loading" :data="shopsList" ref="tableRef" border highlight-current-row
|
|
||||||
@row-click="handleRowClick">
|
|
||||||
<el-table-column prop="shopName" label="店铺名称" align="left" :show-overflow-tooltip="true" />
|
|
||||||
</el-table>
|
|
||||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getShopListFun" />
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="handleEditClick()">添加</el-button>
|
|
||||||
<el-button @click="handleResetClick()">重置</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { reactive, ref, watch, nextTick } from 'vue';
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { shopList } from '@/api/business/ShopManager/Shops/shop.js'
|
|
||||||
|
|
||||||
// 业务参数
|
|
||||||
const total = ref(0)
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
// 基础参数
|
|
||||||
const tableRef = ref(null);
|
|
||||||
// 查询参数
|
|
||||||
const queryParams = reactive({
|
|
||||||
shopName: "",
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10
|
|
||||||
});
|
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue']);
|
|
||||||
const props = defineProps({
|
|
||||||
modelValue: Boolean,
|
|
||||||
data: Object,
|
|
||||||
});
|
|
||||||
const formData = ref({
|
|
||||||
...props.data
|
|
||||||
});
|
|
||||||
|
|
||||||
let shopsList = ref([]);
|
|
||||||
// 打开窗口时运行
|
|
||||||
const openDialog = async () => {
|
|
||||||
await getShopListFun()
|
|
||||||
}
|
|
||||||
|
|
||||||
const getShopListFun = async () => {
|
|
||||||
loading.value = true
|
|
||||||
await shopList(queryParams).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
shopsList.value = res.data.result
|
|
||||||
total.value = res.totalNum
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(props, (v) => {
|
|
||||||
formData.value = v.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
// -业务方法
|
|
||||||
let shopName = ref("");
|
|
||||||
let shopGuid = ref("");
|
|
||||||
|
|
||||||
|
|
||||||
// -基础方法
|
|
||||||
|
|
||||||
// 点击行
|
|
||||||
const handleRowClick = (row) => {
|
|
||||||
shopName.value = row.shopName
|
|
||||||
shopGuid.value = row.shopGuid
|
|
||||||
}
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
shopName.value = ""
|
|
||||||
emits('update:modelValue', false);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const handleEditClick = async () => {
|
|
||||||
if (shopName.value !== "") {
|
|
||||||
|
|
||||||
formData.value.shopName = shopName.value
|
|
||||||
formData.value.shopGuid = shopGuid.value
|
|
||||||
if (formData.value.shopName != null) {
|
|
||||||
closeDialog();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ElMessage.error("请选择店铺")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResetClick = async formEl => {
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
@ -105,8 +105,8 @@ import { ElMessage } from 'element-plus'
|
|||||||
import modal from '@/plugins/modal.js'
|
import modal from '@/plugins/modal.js'
|
||||||
import { addOrUpdateShop, getFirstGoodsCategoryList } from '@/api/business/ShopManager/Shops/shop.js';
|
import { addOrUpdateShop, getFirstGoodsCategoryList } from '@/api/business/ShopManager/Shops/shop.js';
|
||||||
import { goodsCategoryTreeList } from '@/api/business/GoodsManager/GoodsCategorys/goodsCategory.js';
|
import { goodsCategoryTreeList } from '@/api/business/GoodsManager/GoodsCategorys/goodsCategory.js';
|
||||||
import ChooseCustomerDialog from './ChooseCustomerDialog.vue';
|
import ChooseCustomerDialog from '@/views/business/components/ChooseCustomerDialog.vue';
|
||||||
import ChooseUserDialog from './ChooseUserDialog.vue';
|
import ChooseUserDialog from '@/views/business/components/ChooseUserDialog.vue';
|
||||||
|
|
||||||
|
|
||||||
// 打开弹窗时回调
|
// 打开弹窗时回调
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<el-input v-model='queryParams.customerNickname' placeholder='请输入客户名称'></el-input>
|
<el-input v-model='queryParams.customerNickname' placeholder='请输入客户名称'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
<el-button type="primary" @click="handleQuery">
|
||||||
搜索
|
搜索
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch, nextTick } from 'vue';
|
import { reactive, ref, watch, nextTick } from 'vue';
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { getCustomerWithOutBindList } from '@/api/business/ShopManager/Shops/shop.js';
|
import { customerList } from '@/api/business/Custom/Customers/customer.js'
|
||||||
|
|
||||||
// 业务参数
|
// 业务参数
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
@ -62,12 +62,17 @@ const openDialog = async () => {
|
|||||||
await getCustomerListFun()
|
await getCustomerListFun()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getCustomerListFun()
|
||||||
|
}
|
||||||
|
|
||||||
const getCustomerListFun = async () => {
|
const getCustomerListFun = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
await getCustomerWithOutBindList(queryParams).then((res) => {
|
await customerList(queryParams).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
customersList.value = res.data.result
|
customersList.value = res.data.result
|
||||||
total.value = res.totalNum
|
total.value = res.data.totalNum
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -91,6 +96,7 @@ const handleRowClick = (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
|
queryParams.customerNickname = ""
|
||||||
customerNickname.value = ""
|
customerNickname.value = ""
|
||||||
emits('update:modelValue', false);
|
emits('update:modelValue', false);
|
||||||
};
|
};
|
||||||
@ -100,7 +106,8 @@ const handleEditClick = async () => {
|
|||||||
if (customerNickname.value !== "") {
|
if (customerNickname.value !== "") {
|
||||||
|
|
||||||
formData.value.customerNickname = customerNickname.value
|
formData.value.customerNickname = customerNickname.value
|
||||||
formData.value.shopCustomerGuid = customerGuid.value
|
formData.value.customerAddressCustomerGuid = customerGuid.value
|
||||||
|
formData.value.customerGuid = customerGuid.value
|
||||||
if (formData.value.customerNickname != null) {
|
if (formData.value.customerNickname != null) {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
142
src/views/business/components/ChooseGoodsDialog.vue
Normal file
142
src/views/business/components/ChooseGoodsDialog.vue
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="选择商品" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
|
||||||
|
<el-form inline :model="queryParams">
|
||||||
|
<el-form-item label="商品名称">
|
||||||
|
<el-input v-model='queryParams.goodsName' placeholder='请输入商品名称'></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="handleQuery">
|
||||||
|
搜索
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<!-- 表格渲染 prop="对应的字段"-->
|
||||||
|
<el-table v-loading="loading" :data="goodssList" ref="tableRef" border highlight-current-row
|
||||||
|
@row-click="handleRowClick">
|
||||||
|
<el-table-column prop="goodsPicture" width="150" label="图片" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain"
|
||||||
|
:src="scope.row.goodsPicture?.split(',')[0]" :preview-src-list="scope.row.goodsPicture?.split(',')">
|
||||||
|
<div><el-icon :size="15">
|
||||||
|
<document />
|
||||||
|
</el-icon></div>
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsName" label="商品名称" align="left" :show-overflow-tooltip="true" />
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getgoodsListFun" />
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEditClick()">添加</el-button>
|
||||||
|
<el-button @click="handleResetClick()">重置</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch, nextTick } from 'vue';
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { goodsList } from '@/api/business/GoodsManager/Goodss/goods.js'
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
const total = ref(0)
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
// 基础参数
|
||||||
|
const tableRef = ref(null);
|
||||||
|
// 查询参数
|
||||||
|
const queryParams = reactive({
|
||||||
|
goodsName: "",
|
||||||
|
shopGuid: 0,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits(['update:modelValue']);
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
// done: Function,
|
||||||
|
});
|
||||||
|
const formData = ref({
|
||||||
|
...props.data
|
||||||
|
});
|
||||||
|
|
||||||
|
const goodssList = ref([]);
|
||||||
|
// 打开窗口时运行
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
|
||||||
|
await getgoodsListFun()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getgoodsListFun()
|
||||||
|
}
|
||||||
|
|
||||||
|
const getgoodsListFun = async () => {
|
||||||
|
loading.value = true
|
||||||
|
await goodsList(queryParams).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
goodssList.value = res.data.result
|
||||||
|
total.value = res.data.totalNum
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(props, (v) => {
|
||||||
|
if(v.data.shopGuid){
|
||||||
|
queryParams.shopGuid = v.data.shopGuid
|
||||||
|
}
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
let goodsName = ref("");
|
||||||
|
let goodsGuid = ref("");
|
||||||
|
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
|
||||||
|
// 点击行
|
||||||
|
const handleRowClick = (row) => {
|
||||||
|
goodsName.value = row.goodsName
|
||||||
|
goodsGuid.value = row.goodsGuid
|
||||||
|
}
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
queryParams.goodsName = ""
|
||||||
|
goodsName.value = ""
|
||||||
|
emits('update:modelValue', false);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleEditClick = async () => {
|
||||||
|
if (goodsName.value !== "") {
|
||||||
|
|
||||||
|
formData.value.goodsName = goodsName.value
|
||||||
|
formData.value.goodsGuid = goodsGuid.value
|
||||||
|
if (formData.value.goodsName != null) {
|
||||||
|
// props.done();
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.error("请选择商品")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetClick = async formEl => {
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -6,7 +6,7 @@
|
|||||||
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
|
<el-input v-model='queryParams.shopName' placeholder='请输入店铺名称'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
<el-button type="primary" @click="handleQuery">
|
||||||
搜索
|
搜索
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -63,12 +63,17 @@ const openDialog = async () => {
|
|||||||
await getShopListFun()
|
await getShopListFun()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getShopListFun()
|
||||||
|
}
|
||||||
|
|
||||||
const getShopListFun = async () => {
|
const getShopListFun = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
await shopList(queryParams).then((res) => {
|
await shopList(queryParams).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
shopsList.value = res.data.result
|
shopsList.value = res.data.result
|
||||||
total.value = res.totalNum
|
total.value = res.data.totalNum
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -92,6 +97,7 @@ const handleRowClick = (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
|
queryParams.shopName = ""
|
||||||
shopName.value = ""
|
shopName.value = ""
|
||||||
emits('update:modelValue', false);
|
emits('update:modelValue', false);
|
||||||
};
|
};
|
@ -6,7 +6,7 @@
|
|||||||
<el-input v-model='queryParams.userName' placeholder='请输入用户名称'></el-input>
|
<el-input v-model='queryParams.userName' placeholder='请输入用户名称'></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="tableRef.reload()" icon="ElIconSearch">
|
<el-button type="primary" @click="handleQuery">
|
||||||
搜索
|
搜索
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -67,7 +67,7 @@ const getUserListFun = async () => {
|
|||||||
await getUserWithOutBindList(queryParams).then((res) => {
|
await getUserWithOutBindList(queryParams).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
usersList.value = res.data.result
|
usersList.value = res.data.result
|
||||||
total.value = res.totalNum
|
total.value = res.data.totalNum
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -91,6 +91,7 @@ const handleRowClick = (row) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
|
queryParams.userName = ""
|
||||||
userName.value = ""
|
userName.value = ""
|
||||||
emits('update:modelValue', false);
|
emits('update:modelValue', false);
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user