first commit

This commit is contained in:
2026-09-21 19:21:35 +08:00
commit 6c944c4ffd
2733 changed files with 296956 additions and 0 deletions
+289
View File
@@ -0,0 +1,289 @@
<template>
<div class="home">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="手机号" prop="phoneNumber">
<el-input
v-model="queryParams.phoneNumber"
placeholder="请输入用户手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="网站订单号 " prop="outTradeNo ">
<el-input
v-model="queryParams.outTradeNo"
placeholder="请输入网站订单号 "
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column align="center" prop="id" label="ID" width="50"></el-table-column>
<el-table-column align="center" prop="nickName" label="申请用户"></el-table-column>
<el-table-column align="center" prop="userType" label="用户类型" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.userType === '01'" type="warning" size="mini">主播</el-tag>
<el-tag v-else-if="scope.row.userType === '02'" type="success" size="mini">普通</el-tag>
<el-tag v-else-if="scope.row.userType === '03'" type="info" size="mini">机器人</el-tag>
<el-tag v-else-if="scope.row.userType === '04'" type="danger" size="mini">招商</el-tag>
<el-tag v-else-if="scope.row.userType === '05'" size="mini">卡商</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column align="center" prop="ornamentName" label="饰品名称"></el-table-column>
<el-table-column align="center" prop="address" label="饰品图片">
<template slot align="center" scope="scope">
<image-preview :src="scope.row.imageUrl" :width="50" :height="50" />
</template>
</el-table-column>
<el-table-column align="center" prop="outTradeNo" label="订单号"></el-table-column>
<el-table-column align="center" prop="batchId" label="批次号" width="140"></el-table-column>
<el-table-column align="center" prop="remainingCount" label="当日剩余次数" width="110">
<template slot-scope="scope">
<el-tag :type="scope.row.remainingCount > 0 ? 'success' : 'danger'" size="mini">
{{ scope.row.remainingCount !== undefined && scope.row.remainingCount !== null ? scope.row.remainingCount : '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="ornamentsPrice" label="价格" width="120">
<template slot-scope="scope">
<span :style="{ color: getPriceColor(scope.row), fontWeight: 'bold' }">
{{ scope.row.ornamentsPrice }}
</span>
<div v-if="scope.row.cs340Price" style="font-size: 12px; color: #999;">
三方: {{ scope.row.cs340Price }}
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="createTime" label="下单时间"></el-table-column>
<el-table-column align="center" prop="address" label="操作">
<template slot-scope="scope">
<!-- <el-button type="text" @click="tradeBuy(scope.row)">查询</el-button> -->
<el-button type="text" @click="tradeBuyCs2pifa(scope.row)">查询cs2pifa</el-button>
<el-button type="text" @click="handleReturn(scope.row)">退回申请</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<el-dialog title="退回申请" :visible.sync="dialogFormVisible">
<el-form :model="form" :rules="rule" ref="ruleForm">
<el-form-item label="原因" prop="message">
<el-input type="textarea" v-model="form.message" autocomplete="off" placeholder="填写退回原因"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit('ruleForm')">确 定</el-button>
</div>
</el-dialog>
<el-dialog title="在售详情" :visible.sync="dialogSaleInfo">
<p>饰品名称:{{saleInfo.itemName}}</p>
<p>库存数量:{{saleInfo.onSaleStock}}</p>
<p>最低在售价格:{{saleInfo.minSellPrice}}</p>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogSaleInfo = false">取 消</el-button>
<el-button type="primary" @click="createOrderByCs2pifa()">确认发货</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
deliverGoodslist,
tradeBuy,
deliveryFail,
queryOnSaleInfo,
batchQueryPrices
} from "@/api/skins/ttdelivery/api";
export default {
name: 'Delivery',
data() {
return {
rule: {
message: [
{ required: true, message: "请输入退回申请的原因", trigger: "blur" },
{ min: 1, max: 5, message: "至少一个字的原因", trigger: "blur" }
]
},
form: {},
dialogFormVisible: false,
dialogSaleInfo: false,
total: 1,
showSearch: true,
loading: false,
tableData: [],
saleInfo: {},
createOrderByV5ItemData: {},
queryParams: {
outTradeNo: null,
pageNum: 1,
pageSize: 10,
phoneNumber: null,
userName: null
}
};
},
mounted() {
this.getList();
},
methods: {
getPriceColor(row) {
if (!row.cs340Price) return '#606266'; // 无三方价格时默认色
return row.ornamentsPrice > row.cs340Price ? '#F56C6C' : '#67C23A'; // 溢价红色,未溢价绿色
},
handleSubmit(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
deliveryFail(this.form).then(res => {
this.dialogFormVisible = false;
this.getList();
this.$modal.msgSuccess("修改成功");
this.form = {};
});
} else {
return false;
}
});
},
handleReturn(res) {
this.form.deliveryRecordId = res.id;
this.dialogFormVisible = true;
},
tradeBuy(res) {
// let aa = {
// deliveryRecordId: res.id,
// id: res.ornamentsId
// };
// tradeBuy(aa).then(res => {
// });
this.$router.push({
path: "/delivery/zbtrecord",
query: {
id: res.ornamentId,
t_id: res.id
}
});
},
tradeBuyCs2pifa(data) {
if (!data.hashName) {
this.$modal.msgError("该饰品未配置hashName,无法查询cs2pifa在售信息");
return;
}
this.createOrderByV5ItemData = data;
queryOnSaleInfo({ marketHashName: data.hashName }).then(res => {
if (!res || !res.data || !res.data.saleCommodityResponse) {
this.$modal.msgError("未查询到该饰品的cs2pifa在售信息");
return;
}
this.saleInfo.itemName = res.data.saleTemplateResponse
? res.data.saleTemplateResponse.templateHashName
: data.hashName;
this.saleInfo.onSaleStock = res.data.saleCommodityResponse.sellNum;
this.saleInfo.minSellPrice = res.data.saleCommodityResponse.minSellPrice;
// 回写实时三方价格到表格行
const realTimePrice = parseFloat(this.saleInfo.minSellPrice);
if (!isNaN(realTimePrice)) {
this.tableData = this.tableData.map(row => {
if (row.id === data.id) {
return { ...row, cs340Price: realTimePrice };
}
return row;
});
}
this.dialogSaleInfo = true;
});
},
createOrderByCs2pifa() {
let aa = {
productId: this.createOrderByV5ItemData.ornamentId,
deliveryRecordId: this.createOrderByV5ItemData.id,
price: this.createOrderByV5ItemData.ornamentsPrice,
partyType: 8
};
tradeBuy(aa).then(res => {
this.getList();
this.$message({
type: "success",
message: "购买发货成功!"
});
});
},
resetQuery() {
this.queryParams = {
outTradeNo: null,
pageNum: 1,
pageSize: 10,
phoneNumber: null,
userName: null
};
this.getList();
},
handleQuery() {
this.getList();
},
getList() {
this.loading = true;
deliverGoodslist(this.queryParams).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
// 加载完成后批量实时查询三方价格
this.fetchRealTimePrices();
});
},
fetchRealTimePrices() {
// 收集所有有 hashName 的饰品
const hashNames = this.tableData
.filter(row => row.hashName)
.map(row => row.hashName);
if (hashNames.length === 0) return;
batchQueryPrices(hashNames).then(res => {
if (res && res.code === 200 && res.data) {
const priceMap = res.data;
this.tableData = this.tableData.map(row => {
if (row.hashName && priceMap[row.hashName] !== undefined) {
return { ...row, cs340Price: parseFloat(priceMap[row.hashName]) };
}
return row;
});
}
}).catch(() => {
// 接口异常时保留数据库缓存价格
});
}
}
};
</script>
<style scoped lang="scss">
.home {
padding: 20px;
}
</style>
@@ -0,0 +1,218 @@
<template>
<div class="home">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户账号" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="饰品名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入饰品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
v-model="queryParams.startTime"
format="yyyy 年 MM 月 dd 日"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
@click="syncAllStatusMethod"
>一键发货</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column align="center" prop="id" label="Id" width="50"></el-table-column>
<el-table-column align="center" prop="nickName" label="申请用户"></el-table-column>
<el-table-column align="center" prop="itemName" label="饰品名称"></el-table-column>
<el-table-column align="center" prop="address" label="饰品图片">
<template slot align="center" scope="scope">
<image-preview :src="scope.row.imageUrl" :width="50" :height="50" />
</template>
</el-table-column>
<el-table-column align="center" prop="outTradeNo" label="网站订单号"></el-table-column>
<el-table-column align="center" prop="orderId" label="第三方平台订单号" width="180"></el-table-column>
<el-table-column align="center" prop="buyPrice" label="实际购买价格 "></el-table-column>
<el-table-column align="center" prop="thirdpartyDelivery" label="发货方式">
<template slot-scope="scope">
<div
v-if="scope.row.thirdpartyDelivery == '1'"
style="display:flex; align-items:center;justify-content:center;line-height: 1;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #F39c12; display:inline-block;"
></span>
人工发货
</div>
<div
v-if="scope.row.thirdpartyDelivery == '2'"
style="display:flex; align-items:center;justify-content:center;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #00a65a; display:inline-block;"
></span>
自动发货
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="status" label="状态">
<template slot-scope="scope">
<div
v-if="scope.row.status == '1'"
style="display:flex; align-items:center;justify-content:center;line-height: 1;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: green; display:inline-block;"
></span>
待发货
</div>
<div
v-if="scope.row.status == '3'"
style="display:flex; align-items:center;justify-content:center;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #696969; display:inline-block;"
></span>
待收货
</div>
<div
v-if="scope.row.status == '10'"
style="display:flex; align-items:center;justify-content:center;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #696969; display:inline-block;"
></span>
订单完成
</div>
<div
v-if="scope.row.status == '11'"
style="display:flex; align-items:center;justify-content:center;"
>
订单取消
<span
style="width: 8px; height:8px; margin-left:5px; border-radius: 50%; background-color: #DD4b39; display:inline-block;"
></span>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="message" label="消息"></el-table-column>
<el-table-column align="center" prop="updateTime" label="下单时间"></el-table-column>
<el-table-column align="center" prop="address" label="操作" width="100">
<template slot-scope="scope">
<el-button type="text" @click="handleSync(scope.row)">同步</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import {
getDeliveryRecordList,
synchronousStatus,
syncAllStatus
} from "@/api/skins/ttdelivery/api";
export default {
name: 'SendGoods',
data() {
return {
ornamentsId: null,
loading: false,
total: 1,
showSearch: true,
tableData: [],
queryParams: {
outTradeNo: null,
pageNum: 1,
pageSize: 10,
phoneNumber: null,
userName: null,
userId: null
}
};
},
mounted() {
this.getList();
},
methods: {
handleSync(res) {
let aa = {
outTradeNo: res.outTradeNo
};
synchronousStatus(aa).then(res => {
this.getList();
});
},
resetQuery() {
this.queryParams = {
outTradeNo: null,
pageNum: 1,
pageSize: 10,
phoneNumber: null,
userName: null,
userId: null
};
this.getList();
},
handleQuery() {
this.getList();
},
getList() {
this.loading = true;
getDeliveryRecordList(this.queryParams).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
});
},
syncAllStatusMethod() {
syncAllStatus().then(res => {
this.getList();
})
}
}
};
</script>
<style scoped lang="scss">
.home {
padding: 20px;
}
</style>
@@ -0,0 +1,355 @@
<template>
<div class="home">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="批次号" prop="batchId">
<el-input
v-model="queryParams.batchId"
placeholder="请输入批次号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转赠人ID" prop="fromUserId">
<el-input
v-model="queryParams.fromUserId"
placeholder="请输入转赠人ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转赠人昵称" prop="fromNickName">
<el-input
v-model="queryParams.fromNickName"
placeholder="请输入转赠人昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="受赠人ID" prop="toUserId">
<el-input
v-model="queryParams.toUserId"
placeholder="请输入受赠人ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="受赠人昵称" prop="toNickName">
<el-input
v-model="queryParams.toNickName"
placeholder="请输入受赠人昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="饰品名称" prop="ornamentName">
<el-input
v-model="queryParams.ornamentName"
placeholder="请输入饰品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
v-model="dateRange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
ref="table"
:data="tableData"
style="width: 100%"
v-loading="loading"
border
>
<el-table-column type="expand" width="50">
<template slot-scope="props">
<el-table :data="props.row.ornaments" border size="mini" style="margin: 0 20px; width: auto;">
<el-table-column align="center" prop="ornamentName" label="饰品名称" width="300" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="ornamentPrice" label="饰品价格" width="120"></el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column align="center" prop="batchId" label="批次号" width="160" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="fromUserId" label="转赠人ID" width="90"></el-table-column>
<el-table-column align="center" prop="fromNickName" label="转赠人昵称" width="120"></el-table-column>
<el-table-column align="center" label="今日转赠次数" width="130">
<template slot-scope="scope">
<span v-if="scope.row.dailyTotalCount == null">未记录</span>
<span v-else>
剩 {{ scope.row.dailyAvailableCount }} / {{ scope.row.dailyTotalCount }}
<el-tooltip placement="top">
<div slot="content">
上限:{{ scope.row.dailyTotalCount }}<br/>
已用:{{ scope.row.dailyUsedCount }}<br/>
审核中:{{ scope.row.dailyPendingCount }}
</div>
<i class="el-icon-question" style="color: #909399; margin-left: 4px;"></i>
</el-tooltip>
</span>
</template>
</el-table-column>
<el-table-column align="center" prop="toUserId" label="受赠人ID" width="90"></el-table-column>
<el-table-column align="center" prop="toNickName" label="受赠人昵称" width="120"></el-table-column>
<el-table-column align="center" label="饰品数量" width="90">
<template slot-scope="scope">
<el-button type="text" @click="toggleExpand(scope.row)">{{ scope.row.ornaments ? scope.row.ornaments.length : 0 }} 个</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="status" label="状态" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" type="warning" size="mini">待审核</el-tag>
<el-tag v-else-if="scope.row.status === 1" type="success" size="mini">审核通过</el-tag>
<el-tag v-else-if="scope.row.status === 2" type="danger" size="mini">审核驳回</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="createTime" label="申请时间" width="160"></el-table-column>
<el-table-column align="center" class-name="operation-column" label="操作" width="120">
<template slot-scope="scope">
<div v-if="scope.row.status === 0" style="display: flex; justify-content: center; align-items: center;">
<el-button type="text" style="color: #67C23A; margin: 0 5px;" @click="handleApprove(scope.row)">同意</el-button>
<el-button type="text" style="color: #F56C6C; margin: 0 5px;" @click="handleReject(scope.row)">驳回</el-button>
</div>
<div v-else style="text-align: center; color: #999;">已处理</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 驳回原因对话框 -->
<el-dialog title="驳回转赠申请" :visible.sync="dialogVisible" width="600px">
<el-form :model="rejectForm" :rules="rules" ref="rejectFormRef" label-width="100px">
<el-form-item label="批次号">
<span>{{ rejectForm.batchId }}</span>
</el-form-item>
<el-form-item label="转赠人">
<span>{{ rejectForm.fromNickName }} (ID: {{ rejectForm.fromUserId }})</span>
</el-form-item>
<el-form-item label="受赠人">
<span>{{ rejectForm.toNickName }} (ID: {{ rejectForm.toUserId }})</span>
</el-form-item>
<el-form-item label="饰品明细">
<el-table :data="rejectForm.ornaments" border size="mini" style="width: 100%;">
<el-table-column align="center" prop="ornamentName" label="饰品名称" min-width="300" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="ornamentPrice" label="饰品价格" width="120"></el-table-column>
</el-table>
</el-form-item>
<el-form-item label="驳回原因" prop="rejectReason">
<el-input
type="textarea"
:rows="4"
v-model="rejectForm.rejectReason"
placeholder="请输入驳回原因"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitReject">确 定</el-button>
</div>
</el-dialog>
<!-- 同意确认对话框 -->
<el-dialog title="审核确认" :visible.sync="approveDialogVisible" width="600px">
<el-form label-width="100px">
<el-form-item label="批次号">
<span>{{ approveForm.batchId }}</span>
</el-form-item>
<el-form-item label="转赠人">
<span>{{ approveForm.fromNickName }} (ID: {{ approveForm.fromUserId }})</span>
</el-form-item>
<el-form-item label="受赠人">
<span>{{ approveForm.toNickName }} (ID: {{ approveForm.toUserId }})</span>
</el-form-item>
<el-form-item label="饰品明细">
<el-table :data="approveForm.ornaments" border size="mini" style="width: 100%;">
<el-table-column align="center" prop="ornamentName" label="饰品名称" min-width="300" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="ornamentPrice" label="饰品价格" width="120"></el-table-column>
</el-table>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="approveDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitApprove">确定同意</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { transferApplyBatchList, approveTransferBatch, rejectTransferBatch } from "@/api/skins/transfer/api";
export default {
name: 'TransferApply',
data() {
return {
loading: false,
showSearch: true,
tableData: [],
total: 0,
dateRange: [],
dialogVisible: false,
approveDialogVisible: false,
approveForm: {
ornaments: []
},
rejectForm: {
ornaments: []
},
rules: {
rejectReason: [
{ required: true, message: "请输入驳回原因", trigger: "blur" },
{ min: 2, max: 200, message: "驳回原因长度在 2 到 200 个字符", trigger: "blur" }
]
},
queryParams: {
pageNum: 1,
pageSize: 10,
batchId: null,
fromUserId: null,
fromNickName: null,
toUserId: null,
toNickName: null,
ornamentName: null,
status: 0,
phoneNumber: null,
startTime: null,
endTime: null
}
};
},
mounted() {
this.getList();
},
methods: {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.dateRange = [];
this.queryParams = {
pageNum: 1,
pageSize: 10,
batchId: null,
fromUserId: null,
fromNickName: null,
toUserId: null,
toNickName: null,
ornamentName: null,
status: 0,
phoneNumber: null,
startTime: null,
endTime: null
};
this.getList();
},
getList() {
this.loading = true;
if (this.dateRange && this.dateRange.length === 2) {
this.queryParams.startTime = this.dateRange[0];
this.queryParams.endTime = this.dateRange[1];
} else {
this.queryParams.startTime = null;
this.queryParams.endTime = null;
}
transferApplyBatchList(this.queryParams).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
toggleExpand(row) {
this.$refs.table && this.$refs.table.toggleRowExpansion(row);
},
/**
* 同意整批转赠
*/
handleApprove(row) {
this.approveForm = {
batchId: row.batchId,
fromUserId: row.fromUserId,
fromNickName: row.fromNickName,
toUserId: row.toUserId,
toNickName: row.toNickName,
ornaments: row.ornaments || []
};
this.approveDialogVisible = true;
},
submitApprove() {
approveTransferBatch(this.approveForm.batchId).then(res => {
this.$modal.msgSuccess("批次审核通过成功");
this.approveDialogVisible = false;
this.getList();
});
},
/**
* 驳回整批转赠
*/
handleReject(row) {
this.rejectForm = {
batchId: row.batchId,
fromUserId: row.fromUserId,
fromNickName: row.fromNickName,
toUserId: row.toUserId,
toNickName: row.toNickName,
ornaments: row.ornaments || [],
rejectReason: ''
};
this.dialogVisible = true;
this.$nextTick(() => {
if (this.$refs.rejectFormRef) {
this.$refs.rejectFormRef.clearValidate();
}
});
},
submitReject() {
this.$refs.rejectFormRef.validate(valid => {
if (valid) {
rejectTransferBatch(this.rejectForm.batchId, this.rejectForm.rejectReason).then(res => {
this.$modal.msgSuccess("批次已驳回");
this.dialogVisible = false;
this.getList();
});
}
});
}
}
};
</script>
<style scoped lang="scss">
.home {
padding: 20px;
}
::v-deep .operation-column .cell {
text-align: center !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
</style>
@@ -0,0 +1,230 @@
<template>
<div class="home">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="批次号" prop="batchId">
<el-input
v-model="queryParams.batchId"
placeholder="请输入批次号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转赠人ID" prop="fromUserId">
<el-input
v-model="queryParams.fromUserId"
placeholder="请输入转赠人ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转赠人昵称" prop="fromNickName">
<el-input
v-model="queryParams.fromNickName"
placeholder="请输入转赠人昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="受赠人ID" prop="toUserId">
<el-input
v-model="queryParams.toUserId"
placeholder="请输入受赠人ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="受赠人昵称" prop="toNickName">
<el-input
v-model="queryParams.toNickName"
placeholder="请输入受赠人昵称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="饰品名称" prop="ornamentName">
<el-input
v-model="queryParams.ornamentName"
placeholder="请输入饰品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option label="审核通过" :value="1"></el-option>
<el-option label="审核驳回" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
v-model="dateRange"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
ref="table"
:data="tableData"
style="width: 100%"
v-loading="loading"
border
>
<el-table-column type="expand" width="50">
<template slot-scope="props">
<el-table :data="props.row.ornaments" border size="mini" style="margin: 0 20px; width: auto;">
<el-table-column align="center" prop="ornamentName" label="饰品名称" width="300" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="ornamentPrice" label="饰品价格" width="120"></el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column align="center" prop="batchId" label="批次号" width="160" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="fromUserId" label="转赠人ID" width="90"></el-table-column>
<el-table-column align="center" prop="fromNickName" label="转赠人昵称" width="120"></el-table-column>
<el-table-column align="center" label="今日转赠次数" width="130">
<template slot-scope="scope">
<span v-if="scope.row.dailyTotalCount == null">未记录</span>
<span v-else>
剩 {{ scope.row.dailyAvailableCount }} / {{ scope.row.dailyTotalCount }}
<el-tooltip placement="top">
<div slot="content">
上限:{{ scope.row.dailyTotalCount }}<br/>
已用:{{ scope.row.dailyUsedCount }}<br/>
审核中:{{ scope.row.dailyPendingCount }}
</div>
<i class="el-icon-question" style="color: #909399; margin-left: 4px;"></i>
</el-tooltip>
</span>
</template>
</el-table-column>
<el-table-column align="center" prop="toUserId" label="受赠人ID" width="90"></el-table-column>
<el-table-column align="center" prop="toNickName" label="受赠人昵称" width="120"></el-table-column>
<el-table-column align="center" label="饰品数量" width="90">
<template slot-scope="scope">
<el-button type="text" @click="toggleExpand(scope.row)">{{ scope.row.ornaments ? scope.row.ornaments.length : 0 }} 个</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="status" label="状态" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 1" type="success" size="mini">审核通过</el-tag>
<el-tag v-else-if="scope.row.status === 2" type="danger" size="mini">审核驳回</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="rejectReason" label="驳回原因" min-width="120" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="createTime" label="申请时间" width="160"></el-table-column>
<el-table-column align="center" prop="updateTime" label="处理时间" width="160"></el-table-column>
</el-table>
<pagination
v-show="total > 0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import { transferApplyBatchList } from "@/api/skins/transfer/api";
export default {
name: 'TransferApplyProcessed',
data() {
return {
loading: false,
showSearch: true,
tableData: [],
total: 0,
dateRange: [],
queryParams: {
pageNum: 1,
pageSize: 10,
batchId: null,
fromUserId: null,
fromNickName: null,
toUserId: null,
toNickName: null,
ornamentName: null,
status: null,
statusList: [1, 2],
phoneNumber: null,
startTime: null,
endTime: null
}
};
},
mounted() {
this.getList();
},
methods: {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.dateRange = [];
this.queryParams = {
pageNum: 1,
pageSize: 10,
batchId: null,
fromUserId: null,
fromNickName: null,
toUserId: null,
toNickName: null,
ornamentName: null,
status: null,
statusList: [1, 2],
phoneNumber: null,
startTime: null,
endTime: null
};
this.getList();
},
getList() {
this.loading = true;
if (this.dateRange && this.dateRange.length === 2) {
this.queryParams.startTime = this.dateRange[0];
this.queryParams.endTime = this.dateRange[1];
} else {
this.queryParams.startTime = null;
this.queryParams.endTime = null;
}
// 如果单独选择了状态,则优先使用 status;否则使用 statusList=[1,2]
const query = { ...this.queryParams };
if (query.status != null) {
query.statusList = null;
}
transferApplyBatchList(query).then(res => {
this.tableData = res.rows;
this.total = res.total;
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
toggleExpand(row) {
this.$refs.table && this.$refs.table.toggleRowExpansion(row);
}
}
};
</script>
<style scoped lang="scss">
.home {
padding: 20px;
}
</style>
@@ -0,0 +1,276 @@
<template>
<div class="home">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form-item label="发货" prop="phoneNumber">
<el-select v-model="queryParams.delivery" placeholder="请选择发货模式" clearable>
<el-option
v-for="dict in dict.type.delivery_way"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@keyup.enter.native="handleQuery"
/>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="userName ">
<el-select v-model="queryParams.orderBy" placeholder="请选择排序方式" clearable>
<el-option
v-for="dict in dict.type.sale_sorting"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@keyup.enter.native="handleQuery"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%" v-loading="loading">
<el-table-column align="center" prop="itemName" label="装备名称"></el-table-column>
<el-table-column align="center" prop="itemName" label="装备名称">
<template slot-scope="scope">
<image-preview :src="scope.row.imageUrl" :width="40" :height="40" />
</template>
</el-table-column>
<el-table-column align="center" prop="cnyPrice" label="价格(人民币)"></el-table-column>
<el-table-column align="center" prop="delivery" label="发货方式">
<template slot-scope="scope">
<div
v-if="scope.row.delivery == 1"
style="display:flex; align-items:center;justify-content:center;line-height: 1;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #F39c12; display:inline-block;"
></span>
人工发货
</div>
<div
v-if="scope.row.delivery == 2"
style="display:flex; align-items:center;justify-content:center;"
>
<span
style="width: 8px; height:8px; margin-right:5px; border-radius: 50%; background-color: #00a65a; display:inline-block;"
></span>
自动发货
</div>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-edit" @click="handleAppoint(scope.row)">购买发货</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="指定获奖者" :visible.sync="dialogFormVisible">
<el-form :model="formAdd" label-width="120px">
<el-form-item label="用户">
<el-popover placement="bottom-start" width="460" trigger="hover" ref="morePop">
<el-input slot="reference" v-model="form.nickName" placeholder="用户 " readonly></el-input>
<el-form>
<el-row>
<el-col :span="18">
<el-input
v-model="queryParams.nickName"
placeholder="请输入用户名称"
@input="serchornaments"
></el-input>
</el-col>
<el-col :span="6">
<el-button @click="serchornaments" style="margin-left: 35px;">搜索</el-button>
</el-col>
</el-row>
<el-row>
<el-form v-loading="loadings" v-if="userList !== null">
<div class="magicbox" @scroll="scrollEventFn" v-if="userList.length > 0">
<div
class="magic"
v-for="(item,index) in userList"
:key="index"
@click="addOr(item)"
>
<div>{{ item.nickName }}</div>
<div>{{item.phoneNumber}}</div>
</div>
</div>
<div v-else>
<div style="margin:0 auto; text-align:center; margin-top:10px;">无此用户</div>
</div>
</el-form>
<el-form v-else>
<div style="margin:0 auto; text-align:center; margin-top:10px;">请输入用户昵称</div>
</el-form>
</el-row>
</el-form>
</el-popover>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleSubmit">确 定</el-button>
</div>
</el-dialog>
<pagination
v-show="total>0"
:limit.sync="queryParams.limit"
:page.sync="queryParams.page"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import { listUser } from "@/api/skins/ttuser/api";
import { tradeBuy, getAvailableMarketList } from "@/api/skins/ttdelivery/api";
export default {
name: 'ZbtRecord',
dicts: ["delivery_way", "sale_sorting"],
data() {
return {
total: 1,
loading: false,
formAdd: {},
orOnselects: {},
orform: {},
userList: {},
id: Number(this.$route.query.id),
t_id: Number(this.$route.query.t_id),
tableData: [],
dialogFormVisible: false,
loadings: false,
queryParams: {
page: 1,
limit: 10,
delivery: null,
orderBy: null
},
form: {},
forms: {
nickName: null
}
};
},
mounted() {
this.getList();
this.serchornaments();
},
methods: {
addOr(res) {
this.form.nickName = res.nickName;
this.form.userId = res.userId;
this.$refs.morePop.doClose();
},
handleSubmit() {
namedWinner(this.form).then(res => {
this.dialogFormVisible = false;
this.getList();
this.$message({
message: "编辑成功",
type: "success"
});
});
},
serchornaments() {
this.loadings = true;
listUser(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loadings = false;
});
},
handleAppoint(res) {
let aa = {
productId: res.id,
deliveryRecordId: this.t_id,
partyType: 1
};
this.$confirm("确定购买发货?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
tradeBuy(aa).then(res => {
this.getList();
this.$message({
type: "success",
message: "购买发货成功!"
});
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消购买发货"
});
});
},
scrollEventFn(e) {
if (
e.srcElement.scrollTop + e.srcElement.clientHeight >=
e.srcElement.scrollHeight
) {
this.queryParams.pageNum += 1;
listUser(this.queryParams).then(res => {
this.userList.push.apply(this.userList, res.rows);
});
}
},
resetQuery() {
this.queryParams = {
page: 1,
limit: 10,
delivery: null,
orderBy: null
};
this.getList();
},
handleQuery() {
this.getList();
},
getList() {
this.loading = true;
let data = {
partyType: 1,
ornamentsId: []
}
data.ornamentsId.push(this.id);
getAvailableMarketList(data).then(res => {
this.total = res.data.length;
this.tableData = res.data;
this.loading = false;
});
}
}
};
</script>
<style lang="scss" scoped>
.magicbox {
margin: 0 auto;
margin-top: 5px;
height: 300px;
overflow-y: scroll;
.magic {
height: 32px;
padding: 2px 5px;
line-height: 32px;
display: flex;
align-items: center;
justify-content: space-between;
&:hover {
background-color: #409eff;
transition: all ease 0.3s;
}
}
}
.home {
padding: 20px;
}
</style>