fix: 修改交班部分文件名称,修改部分深度作用样式
This commit is contained in:
parent
8026fcb98c
commit
34068cf8dd
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<!-- 交班模块 -->
|
||||
<div style="padding: 15px;">
|
||||
<div style="padding: 15px">
|
||||
<!-- 搜索 -->
|
||||
<Search></Search>
|
||||
<my-search></my-search>
|
||||
<!-- 表格 -->
|
||||
<Content></Content>
|
||||
<my-content></my-content>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Search from './workconfig/Search.vue'
|
||||
import Content from './workconfig/Content.vue'
|
||||
import mySearch from "./workconfig/my-search.vue";
|
||||
import myContent from "./workconfig/my-content.vue";
|
||||
</script>
|
||||
|
|
@ -1,21 +1,38 @@
|
|||
<template>
|
||||
<div class="Table">
|
||||
<!-- 表格 -->
|
||||
<Table :list="datas.tableData" @handleDelete="handleDelete" @handleEdit="handleEdit"></Table>
|
||||
<my-table
|
||||
:list="datas.tableData"
|
||||
@handleDelete="handleDelete"
|
||||
@handleEdit="handleEdit"
|
||||
></my-table>
|
||||
<!-- 分页 -->
|
||||
<Paging :pagingConfig="datas.pagingConfig" @sizeChange="sizeChange" @currentChange="currentChange"></Paging>
|
||||
<my-paging
|
||||
:pagingConfig="datas.pagingConfig"
|
||||
@sizeChange="sizeChange"
|
||||
@currentChange="currentChange"
|
||||
></my-paging>
|
||||
<!-- 其他模板 -->
|
||||
<!-- 新增/编辑 -->
|
||||
<myDialog ref="myDialogRef" :title="datas.title" @confirm="confirm" width="30%">
|
||||
<my-dialog ref="myDialogRef" :title="datas.title" @confirm="confirm" width="30%">
|
||||
<el-form ref="ruleFormRef" :rules="datas.rules" :model="datas.DialogForm" label-width="80px">
|
||||
<el-form-item label="商品图片" required prop="images">
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<div v-for="(item, index) in datas.DialogForm.images" :key="index" style="position: relative"
|
||||
class="showStyle">
|
||||
<div
|
||||
v-for="(item, index) in datas.DialogForm.images"
|
||||
:key="index"
|
||||
style="position: relative"
|
||||
class="showStyle"
|
||||
>
|
||||
<el-icon class="buttonstyle" @click="deleteEvent(item)">
|
||||
<DeleteFilled />
|
||||
</el-icon>
|
||||
<img style="width: 148px; height: 148px; margin-right: 6px" class="imgStyle" :src="item" alt="" />
|
||||
<img
|
||||
style="width: 148px; height: 148px; margin-right: 6px"
|
||||
class="imgStyle"
|
||||
:src="item"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="upImgStyle" @click="addimgEvent">+</div>
|
||||
</div>
|
||||
|
|
@ -30,7 +47,11 @@
|
|||
<el-input v-model="datas.DialogForm.telephone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开启下单积分抵扣">
|
||||
<el-switch v-model="datas.DialogForm.enableDeduction" :active-value="1" :inactive-value="0" />
|
||||
<el-switch
|
||||
v-model="datas.DialogForm.enableDeduction"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额外价格">
|
||||
<el-col :span="3">
|
||||
|
|
@ -43,128 +64,131 @@
|
|||
<el-input v-model="datas.DialogForm.remark" placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</myDialog>
|
||||
</my-dialog>
|
||||
<!-- 选择图片 -->
|
||||
<AddImg ref="addImg" @successEvent="successEvent"></AddImg>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import Table from './component/Table.vue'
|
||||
import Paging from './component/Paging.vue'
|
||||
import myDialog from '@/components/mycomponents/myDialog.vue'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import API from './api'
|
||||
import myTable from "./component/my-table.vue";
|
||||
import myPaging from "./component/my-paging.vue";
|
||||
import myDialog from "@/components/mycomponents/myDialog.vue";
|
||||
import eventBus from "@/utils/eventBus";
|
||||
import API from "./api";
|
||||
|
||||
const datas = reactive({
|
||||
tableData: [], // 表格数据
|
||||
title: '新增数据',
|
||||
title: "新增数据",
|
||||
pagingConfig: {
|
||||
total: 0, // 总数
|
||||
pageSize: 10, // 每页数据数量
|
||||
pageNumber: 1, // 当前页码
|
||||
},
|
||||
DialogForm: { // 弹窗表单数据
|
||||
DialogForm: {
|
||||
// 弹窗表单数据
|
||||
name: "",
|
||||
telephone: "",
|
||||
address: "",
|
||||
remark: "",
|
||||
images: []
|
||||
images: [],
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入供应商名称', trigger: 'blur' },
|
||||
{ min: 3, max: 5, message: 'Length should be 3 to 5', trigger: 'blur' },
|
||||
{ required: true, message: "请输入供应商名称", trigger: "blur" },
|
||||
{ min: 3, max: 5, message: "Length should be 3 to 5", trigger: "blur" },
|
||||
],
|
||||
}
|
||||
})
|
||||
const myDialogRef = ref(null)
|
||||
const ruleFormRef = ref(null)
|
||||
},
|
||||
});
|
||||
const myDialogRef = ref(null);
|
||||
const ruleFormRef = ref(null);
|
||||
onMounted(() => {
|
||||
getList()
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
})
|
||||
getList();
|
||||
eventBus.on("search", (res) => {
|
||||
getList(res);
|
||||
});
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('search')
|
||||
})
|
||||
eventBus.off("search");
|
||||
});
|
||||
|
||||
async function getList(data = {}) {
|
||||
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||
datas.tableData = res.records
|
||||
datas.pagingConfig.total = res.totalRow
|
||||
datas.pagingConfig.pageSize = res.pageSize
|
||||
datas.pagingConfig.pageNumber = res.pageNumber
|
||||
const res = await API.getPage({
|
||||
page: datas.pagingConfig.pageNumber,
|
||||
size: datas.pagingConfig.pageSize,
|
||||
...data,
|
||||
});
|
||||
datas.tableData = res.records;
|
||||
datas.pagingConfig.total = res.totalRow;
|
||||
datas.pagingConfig.pageSize = res.pageSize;
|
||||
datas.pagingConfig.pageNumber = res.pageNumber;
|
||||
}
|
||||
function add() {
|
||||
if (datas.DialogForm.id) {
|
||||
rest()
|
||||
rest();
|
||||
}
|
||||
datas.title = '新增数据'
|
||||
myDialogRef.value.open()
|
||||
datas.title = "新增数据";
|
||||
myDialogRef.value.open();
|
||||
}
|
||||
async function handleEdit(row) {
|
||||
datas.title = '编辑数据'
|
||||
const res = await API.getinfo(row.id)
|
||||
datas.DialogForm = res
|
||||
datas.title = "编辑数据";
|
||||
const res = await API.getinfo(row.id);
|
||||
datas.DialogForm = res;
|
||||
// 有图片
|
||||
// datas.DialogForm.goodsImageUrl = res.goodsImageUrl.split(',')
|
||||
myDialogRef.value.open()
|
||||
myDialogRef.value.open();
|
||||
}
|
||||
async function confirm() {
|
||||
ruleFormRef.value.validate(async valid => {
|
||||
ruleFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
let res = null
|
||||
if (datas.title == '新增数据') {
|
||||
let res = null;
|
||||
if (datas.title == "新增数据") {
|
||||
// 图片处理
|
||||
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.add(datas.DialogForm)
|
||||
res = await API.add(datas.DialogForm);
|
||||
} else {
|
||||
// datas.DialogForm.goodsImageUrl = datas.DialogForm.goodsImageUrl.join(',')
|
||||
res = await API.update(datas.DialogForm)
|
||||
res = await API.update(datas.DialogForm);
|
||||
}
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '成功',
|
||||
type: 'success',
|
||||
})
|
||||
rest()
|
||||
getList()
|
||||
myDialogRef.value.close()
|
||||
message: "成功",
|
||||
type: "success",
|
||||
});
|
||||
rest();
|
||||
getList();
|
||||
myDialogRef.value.close();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
// 重置
|
||||
function rest() {
|
||||
datas.DialogForm = { sort: 1, images: [] }
|
||||
datas.DialogForm = { sort: 1, images: [] };
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
ElMessageBox.confirm("是否删除数据项?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(
|
||||
async () => {
|
||||
let res = await API.deleteByIds(id)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
})
|
||||
getList()
|
||||
}
|
||||
}).then(async () => {
|
||||
let res = await API.deleteByIds(id);
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
getList();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 图片
|
||||
const addImg = ref(null)
|
||||
const addImg = ref(null);
|
||||
function addimgEvent() {
|
||||
(addImg.value)?.show()
|
||||
addImg.value?.show();
|
||||
}
|
||||
function successEvent(d) {
|
||||
datas.DialogForm['images'].push(d[0].url);
|
||||
datas.DialogForm["images"].push(d[0].url);
|
||||
}
|
||||
function deleteEvent(d) {
|
||||
let index = datas.DialogForm.images.findIndex((ele) => ele == d);
|
||||
|
|
@ -172,14 +196,13 @@ function deleteEvent(d) {
|
|||
}
|
||||
// 分页
|
||||
function sizeChange(val) {
|
||||
datas.pagingConfig.pageSize = val
|
||||
getList()
|
||||
datas.pagingConfig.pageSize = val;
|
||||
getList();
|
||||
}
|
||||
function currentChange(val) {
|
||||
datas.pagingConfig.pageNumber = val
|
||||
getList()
|
||||
datas.pagingConfig.pageNumber = val;
|
||||
getList();
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.Table {
|
||||
|
|
@ -223,10 +223,8 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lose {
|
||||
&::v-deep .el-input__inner {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
:deep(.lose .el-input__inner) {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
|
|
|
|||
|
|
@ -26,19 +26,35 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
<template #goods="scope">
|
||||
<div class="goods_info">
|
||||
<div class="row" v-for="item in scope.row.productList" :key="item.id">
|
||||
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
||||
<div class="info">
|
||||
<div class="name">
|
||||
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
||||
{{ item.productName }}
|
||||
</span>
|
||||
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
|
||||
</div>
|
||||
<div class="sku">{{ item.productSkuName }}</div>
|
||||
</div>
|
||||
<div class="goodslang">
|
||||
<div class="goods-list">
|
||||
<el-button
|
||||
v-for="item in scope.row.productList"
|
||||
@click="toGoods(item.id)"
|
||||
:key="item.productId"
|
||||
type="text"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-button>
|
||||
<span v-if="scope.row.productList.length > 1">,</span>
|
||||
</div>
|
||||
<el-dropdown trigger="click" v-if="scope.row.productList.length > 1" @command="toGoods">
|
||||
<span class="el-dropdown-link" style="color: blue">
|
||||
<el-icon><CaretBottom /></el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
class="clearfix"
|
||||
v-for="item in scope.row.productList"
|
||||
:key="item.id"
|
||||
:command="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -123,7 +139,6 @@ async function handleEditClick(row: IObject) {
|
|||
console.log({ ...row });
|
||||
editModalRef.value?.setFormData({ ...row, url: [row.url] });
|
||||
}
|
||||
1;
|
||||
// 其他工具栏
|
||||
function handleToolbarClick(name: string) {
|
||||
console.log(name);
|
||||
|
|
@ -180,7 +195,35 @@ const refDetail = ref();
|
|||
function showdetail(row: OrderInfoVo) {
|
||||
refDetail.value.show(row);
|
||||
}
|
||||
function toGoods(id: number) {
|
||||
router.push({
|
||||
path: "/product/index",
|
||||
query: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goodslang {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.goods-list {
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
|
||||
:deep(.goods-list .el-button--text span) {
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
:deep(.goods-list .el-button--text) {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ const state = reactive({
|
|||
codeUrl: "",
|
||||
cookiePass: "",
|
||||
loginForm: {
|
||||
username: "ymf",
|
||||
password: "123456",
|
||||
username: "",
|
||||
password: "",
|
||||
// rememberMe: false,
|
||||
code: "",
|
||||
uuid: "",
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
::v-deep .el-input--small .el-input__inner {
|
||||
:deep(.el-input--small .el-input__inner) {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
:deep(.image-slot) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -150,12 +150,12 @@ export default {
|
|||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner {
|
||||
:deep(.el-input--small .el-input__inner) {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
:deep(.image-slot) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
|
|
|||
Loading…
Reference in New Issue