This commit is contained in:
qiaopengfei 2024-08-09 14:24:00 +08:00
parent 271c9beb73
commit 3e55f0ecb6
19 changed files with 2211 additions and 942 deletions

View File

@ -1,2 +1,49 @@
import request from '@axioshooks'
// 获取售后管理列表
export function select_by_conditions(data) {
return request({
url: 'xy_openapi/afterSale/select_by_conditions',
method: 'post',
data
})
}
// 同意退款
export function agree_refund(data) {
return request({
url: `xy_openapi/afterSale/agree_refund/${data}`,
method: 'get',
data
})
}
// 拒绝退款
export function refuse_refund(data) {
return request({
url: `xy_openapi/afterSale/refuse_refund/${data}`,
method: 'get',
data
})
}
// 确认收货
export function confirm_receipt(data) {
return request({
url: `xy_openapi/afterSale/confirm_receipt/${data}`,
method: 'get',
data
})
}
// 拒绝收货
export function refuse_receipt(data) {
return request({
url: `xy_openapi/afterSale/refuse_receipt/${data}`,
method: 'get',
data
})
}
// 日志
export function after_log(data) {
return request({
url: `xy_openapi/afterSale/after_log/${data}`,
method: 'get',
data
})
}

View File

@ -18,7 +18,7 @@ export function edit_product(data) {
// 复制商品
export function get_commodity(data) {
return request({
url: `xy_openapi/commodity_info/get_commodity`,
url: `xy_openapi/commodity_info/get_commodity/${data}`,
method: 'get',
data
})
@ -47,3 +47,11 @@ export function delete_one(data) {
data
})
}
// 日志
export function commodity_log(data) {
return request({
url: `xy_openapi/commodity_info/commodity_log/${data}`,
method: 'get',
data
})
}

View File

@ -7,3 +7,61 @@ export function order_info(data) {
data
})
}
// 获取物流信息
export function logistics_inquiry(data) {
return request({
url: `xy_openapi/api/order_info/logistics_inquiry/${data}`,
method: 'get',
data
})
}
// 订单发货信息查询
export function get_order_shopped_info(data) {
return request({
url: `xy_openapi/api/order_info/get_order_shopped_info/${data}`,
method: 'get',
data
})
}
// 订单下单
export function sf_place_order(data) {
return request({
url: `xy_openapi/api/logistics/sf_place_order`,
method: 'post',
data
})
}
//发货
export function order_shopped(data) {
return request({
url: `xy_openapi/api/order_info/order_shopped`,
method: 'post',
data
})
}
//打印面单
export function express_printing(data) {
return request({
url: `xy_openapi/api/logistics/express_printing`,
method: 'post',
data
})
}
//取消订单
export function cancel_order(data) {
return request({
url: `xy_openapi/api/order_info/cancel_order/${data}`,
method: 'get',
data
})
}
//机器日志
export function order_log(data) {
return request({
url: `xy_openapi/api/order_info/order_log/${data}`,
method: 'get',
data
})
}

42
src/api/translateSet.js Normal file
View File

@ -0,0 +1,42 @@
import request from '@axioshooks'
// 获取地址列表
export function userAddress(data) {
return request({
url: 'xy_openapi/address/userAddress',
method: 'post',
data
})
}
// 添加物流信息
export function add(data) {
return request({
url: 'xy_openapi/address/add',
method: 'post',
data
})
}
// 获取寄件人集合
export function senderList(data) {
return request({
url: 'xy_openapi/sender/list',
method: 'get',
data
})
}
// 添加寄件人
export function senderAdd(data) {
return request({
url: 'xy_openapi/sender/add',
method: 'post',
data
})
}
// 删除寄件人
export function senderDelete(data) {
return request({
url: `xy_openapi/sender/delete/${data}`,
method: 'delete',
data
})
}

View File

@ -0,0 +1,70 @@
<template>
<!-- 机器日志 -->
<el-dialog
width="35%"
title="机器日志"
v-model="props.logsvisible"
:before-close="close"
:close-on-click-modal="false"
>
<el-table
:data="props.logsList"
border
height="260px"
style="width: 100%"
v-loading="props.logsloading"
>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column
prop="nickname"
label="操作人"
min-width="110"
align="center"
>
</el-table-column>
<el-table-column
prop="operationName"
label="内容"
min-width="210"
align="center"
>
</el-table-column>
<el-table-column
prop="createTime"
label="操作时间"
min-width="180"
align="center"
/>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="close"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const props = defineProps({
logsvisible: {
type: Boolean,
default: false,
},
logsloading: {
type: Boolean,
default: false,
},
logsList: {
type: Array,
default: [],
},
});
const emit = defineEmits(["logsclose"]);
const close = () => {
emit("logsclose");
};
</script>
<style scoped lang='scss'>
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-for="(item, index) in props.ButtonList" :key="index">
<div v-for="(item, index) in props.ButtonList" :key="index" style="text-align: center;">
<el-link
v-if="item.show && item.AssemblyName === 'el-link'"
:type="item.type"

View File

@ -0,0 +1,27 @@
<template>
<div class="button-group">
<el-button
v-bind="$attrs"
v-for="(item, index) in $attrs.buttonList"
:key="index"
@click="item.handler(item)"
>{{ item.name }}</el-button
>
<slot name="other"></slot>
</div>
</template>
<script setup>
</script>
<style scoped lang='scss'>
.button-group {
padding:10px 20px;
box-sizing: border-box;
}
::v-deep .el-button {
margin-left: 0px !important;
margin-right: 10px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -160,7 +160,7 @@ const onFormChange=(value)=>{
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.box-cneter {
transition: height 0.5s ease;
overflow: hidden;

View File

@ -66,7 +66,7 @@
<div class="info-left">
<el-popover
width="250"
v-if="row.commodityImg"
v-if="row.commodityImg && row.commodityImg !== null"
ref="popoverRef"
trigger="click"
>
@ -93,7 +93,44 @@
</div>
</div>
</div>
<div v-else-if="item.label === '订单状态'">
<div class="row_box">
{{
row.orderStatus == 1
? "订单已创建"
: row.orderStatus == 2
? "代发货"
: row.orderStatus == 3
? "已发货"
: row.orderStatus == 4
? "交易成功"
: row.orderStatus == 5
? "已退款"
: row.orderStatus == 6
? "交易关闭"
: row.orderStatus == 0
? "待处理"
: ""
}}
</div>
</div>
<div v-else-if="item.label === '买家信息'">
<div class="row_content">
<div style="font-weight: bold">
<span style="display: block; margin-right: 10px">{{
row.receiverName
}}</span
>{{ row.receiverPhone }}
</div>
<div>
{{ row.receiverProvince }} {{ row.receiverCity }}
{{ row.receiverDistrict }}
</div>
<div>
{{ row.receiverAddress }}
</div>
</div>
</div>
<div v-else-if="item.label === '操作'" class="row_box operate">
<slot name="OperateButton" :row="row"></slot>
</div>
@ -188,7 +225,6 @@ const visibleMethodEvent = ({ row }) => {
return row.render == true;
};
//
const selectAllEvent = (val) => {
$emit("selectAllEvent", val.records);
@ -249,7 +285,8 @@ p {
}
}
}
.row_box {
.row_box,
.row_content {
padding: 10px;
box-sizing: border-box;
display: flex;
@ -257,6 +294,11 @@ p {
justify-content: center;
min-height: 100px;
}
.row_content {
display: inline-block;
align-items: start;
justify-content: start;
}
.row_text {
font-weight: bold;
}

View File

@ -7,6 +7,7 @@ import OrderManagement from './views/OrderManagement/index.vue';
import AfterSalesManagement from './views/AfterSalesManagement/index.vue';
import NewlyBuiltGoods from './views/NewlyBuiltGoods/index.vue';
import XyShop from "./views/XyShop/index.vue";
import translateSet from "./views/translateSet/index.vue";
import {
@ -81,6 +82,14 @@ export const routes = [
path: '/XyShop',
component: XyShop,
},
{
meta: {
label: "物流配置",
icon: markRaw(Location)
},
path: '/translateSet',
component: translateSet,
},
]

View File

@ -35,6 +35,13 @@
></PaginaTion>
</div>
</div>
<LogsDialog
v-if="logsvisible"
:logsvisible="logsvisible"
:logsloading="logsloading"
:logsList="logsList"
@logsclose="logsvisible = false"
></LogsDialog>
</template>
<script setup>
@ -46,24 +53,24 @@ import SearchForm from "@components/searchForm/index.vue";
import Table from "@components/table.vue";
import OperateButton from "@/components/OperateButton.vue";
import PaginaTion from "@components/Pagination.vue";
import LogsDialog from "@/components/LogsDialog.vue";
import {
select_by_conditions,
edit_product,
publish,
pull_off,
delete_one,
} from "@/api/CommodityManagement";
agree_refund,
refuse_refund,
confirm_receipt,
refuse_receipt,
after_log
} from "@/api/AfterSalesManagement";
import { getshopInfo } from "@/api/newlybuiltgoods";
const activeName = ref("");
const tabs = ref([
{ label: "全部", value: "", total: 0 },
{ label: "草稿箱", value: "1", total: 0 },
{ label: "待发布", value: "2", total: 0 },
{ label: "发布成功", value: "-3", total: 0 },
{ label: "发布失败", value: "-4", total: 0 },
{ label: "手动下架", value: "-2", total: 0 },
{ label: "已售出", value: "3", total: 0 },
{ label: "其他", value: "99", total: 0 },
{ label: "仅退款", value: "1", total: 0 },
{ label: "退货退款", value: "2", total: 0 },
{ label: "退款关闭", value: "-3", total: 0 },
{ label: "退款成功", value: "-4", total: 0 },
]);
const Inputs = ref([
{
@ -74,6 +81,7 @@ const Inputs = ref([
value: "",
popover: true,
},
{
type: "el-select",
placeholder: "请选择闲鱼店铺",
@ -83,26 +91,12 @@ const Inputs = ref([
options: [],
},
{
type: "el-select",
placeholder: "请输入商品类型",
title: "商品类型",
name: "auctionType",
type: "el-input",
placeholder: "查询售后编号",
title: "售后编号",
name: "refundId",
value: "",
options: [
{ label: "一口价", value: "a" },
{ label: "拍卖", value: "b" },
],
},
{
type: "el-select",
placeholder: "请选择分类",
title: "商品分类",
name: "itemBizType",
value: "",
options: [
{ label: "普通商品", value: "2" },
{ label: "特卖商品", value: "24" },
],
popover: true,
},
{
type: "el-input",
@ -111,19 +105,51 @@ const Inputs = ref([
value: "",
title: "商品名称",
},
{
type: "el-select",
placeholder: "请选择订单类型",
title: "订单类型",
name: "orderType",
value: "",
options: [
{
label: "拍卖",
value: "a",
},
{
label: "一口价",
value: "b",
},
],
},
{
type: "el-input",
placeholder: "请输入买家姓名",
name: "buyerName",
value: "",
title: "买家姓名",
},
{
type: "el-input",
placeholder: "请输入买家电话",
name: "buyerPhone",
value: "",
title: "买家电话",
},
{
type: "el-date-picker",
title: "创建时间",
title: "售后时间",
placeholder: "",
name: "createTime",
name: "afterSaleTime",
value: [],
width: "215px",
},
{
type: "el-date-picker",
title: "上架时间",
placeholder: "",
name: "shelfTime",
title: "处理时间",
placeholder: "handleTime",
name: "",
value: [],
width: "215px",
},
@ -132,25 +158,35 @@ const Inputs = ref([
const TableRef = ref(null);
const TableKey = ref(new Date().getTime());
const TabLoading = ref(false);
const logsloading = ref(false);
const logsvisible = ref(false);
const logsList = ref([]);
const TableData = ref([]);
const TableLabel = ref([
{
label: "闲鱼商品ID",
param: "commodityId",
label: "订单编号",
param: "orderOn",
align: "center",
show: true,
display: "top_left",
},
{
label: "创建时间",
param: "createTime",
label: "售后编号",
param: "refundId",
align: "center",
show: true,
display: "top_left",
},
{
label: "上架时间",
param: "createTime",
label: "申请售后时间",
param: "",
align: "center",
show: true,
display: "top_left",
},
{
label: "处理时间",
param: "",
align: "center",
show: true,
display: "top_left",
@ -163,50 +199,43 @@ const TableLabel = ref([
minwidth: "210",
},
{
label: "商品状态",
param: "publishStatusName",
label: "订单状态",
param: "",
align: "center",
show: true,
minwidth: "150",
},
{
label: "商品类型",
param: "itemBizType",
label: "售后状态",
param: "refundStateName",
align: "center",
show: true,
minwidth: "150",
},
{
label: "分类",
param: "auctionType",
label: "商品总价(元)",
param: "commodityMoney",
align: "center",
show: true,
minwidth: "150",
},
{
label: "售价(元)",
param: "retailPrice",
label: "订单类型",
param: "orderType",
align: "center",
show: true,
minwidth: "150",
},
{
label: "库存(个)",
param: "stock",
align: "center",
show: true,
minwidth: "150",
},
{
label: "销量",
param: "salesVolume",
label: "买家信息",
param: "",
align: "center",
show: true,
minwidth: "150",
},
{
label: "闲鱼店铺",
param: "xyName",
param: "xyShopName",
align: "center",
show: true,
minwidth: "150",
@ -223,78 +252,74 @@ const New_TableLabel = ref([]);
const ButtonListGroup = ref([
{
AssemblyName: "el-link",
name: "编辑",
name: "同意退款",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
edit_product(row.id).then((res) => {
agree_refund(row.saleId).then((res) => {
if (res.code === "200") {
router.push({
path: "/NewlyBuiltGoods",
query: {
params: JSON.stringify(res.data),
},
});
ElMessage.success(res.msg);
getDatas();
} else {
ElMessage.warning(res.msg);
}
});
},
},
{
AssemblyName: "el-link",
name: "复制",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {},
},
{
AssemblyName: "el-link",
name: "上架",
name: "确认收货",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
publish(row.id).then((res) => {
confirm_receipt(row.saleId).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
} else {
ElMessage.warning(res.msg);
}
});
},
},
{
AssemblyName: "el-popconfirm",
name: "下架",
title: "是否下架?",
name: "拒绝退款",
title: "是否拒绝退款?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
pull_off(row.id).then((res) => {
refuse_refund(row.saleId).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
} else {
ElMessage.warning(res.msg);
}
});
},
},
{
AssemblyName: "el-popconfirm",
name: "删除",
title: "是否删除?",
name: "拒绝收货",
title: "是否拒绝收货?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
delete_one(row.id).then((res) => {
refuse_receipt(row.saleId).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
} else {
ElMessage.warning(res.msg);
}
});
},
@ -305,7 +330,18 @@ const ButtonListGroup = ref([
show: false,
type: "warning",
mode: "detail",
confirm: (row) => {},
confirm: (row) => {
logsvisible.value = true;
logsloading.value = true;
setTimeout(() => {
after_log(row.saleId).then((res) => {
logsloading.value = false;
if (res.code === "200") {
logsList.value = res.data;
}
});
}, 300);
},
},
]);
let commodityInfoDto = reactive({
@ -324,13 +360,11 @@ const getDatas = () => {
newData.map((item) => {
item.ButtonGroup = ButtonListGroup.value.map((el) => {
if (
(el.name === "编辑" &&
[1, -4, -2].includes(item.publishStatus)) ||
(el.name === "下架" && [-3].includes(item.publishStatus)) ||
(el.name === "复制" &&
[1, -2, -3, -4, 3].includes(item.publishStatus)) ||
(el.name === "上架" && [-2, -4].includes(item.publishStatus)) ||
(el.name === "删除" && [1, -4, -2].includes(item.publishStatus))
(el.name === "同意退款" && [0].includes(item.refundState)) ||
(el.name === "拒绝退款" && [0].includes(item.refundState)) ||
(el.name === "确认收货" && [2].includes(item.refundState)) ||
(el.name === "拒绝收货" && [2].includes(item.refundState)) ||
el.name === "日志"
) {
return { ...el, show: true };
}
@ -348,12 +382,13 @@ const getDatas = () => {
};
//
const onSearch = (value) => {
if (value.createTime) {
value.startCreateTime = new Date(value.createTime[0]).getTime();
value.endCreateTime = new Date(value.createTime[1]).getTime() + 86399999;
} else if (value.shelfTime) {
value.startShelfTime = new Date(value.shelfTime[0]).getTime();
value.endShelfTime = new Date(value.shelfTime[1]).getTime() + 86399999;
if (value.afterSaleTime) {
value.afterSaleStartTime = new Date(value.afterSaleTime[0]).getTime();
value.afterSaleEndTime =
new Date(value.afterSaleTime[1]).getTime() + 86399999;
} else if (value.handleTime) {
value.handleStartTime = new Date(value.handleTime[0]).getTime();
value.handleEndTime = new Date(value.handleTime[1]).getTime() + 86399999;
}
commodityInfoDto = {
...commodityInfoDto,

View File

@ -35,6 +35,13 @@
></PaginaTion>
</div>
</div>
<LogsDialog
v-if="logsvisible"
:logsvisible="logsvisible"
:logsloading="logsloading"
:logsList="logsList"
@logsclose="logsvisible = false"
></LogsDialog>
</template>
<script setup>
@ -46,13 +53,16 @@ import SearchForm from "@components/searchForm/index.vue";
import Table from "@components/table.vue";
import OperateButton from "@/components/OperateButton.vue";
import PaginaTion from "@components/Pagination.vue";
import LogsDialog from "@/components/LogsDialog.vue";
import {
select_by_conditions,
edit_product,
publish,
pull_off,
delete_one,
get_commodity
get_commodity,
commodity_log,
} from "@/api/CommodityManagement";
import { getshopInfo } from "@/api/newlybuiltgoods";
const activeName = ref("");
@ -133,6 +143,9 @@ const Inputs = ref([
const TableRef = ref(null);
const TableKey = ref(new Date().getTime());
const TabLoading = ref(false);
const logsloading = ref(false);
const logsvisible = ref(false);
const logsList = ref([]);
const TableData = ref([]);
const TableLabel = ref([
{
@ -151,7 +164,7 @@ const TableLabel = ref([
},
{
label: "上架时间",
param: "createTime",
param: "shelfTime",
align: "center",
show: true,
display: "top_left",
@ -207,7 +220,7 @@ const TableLabel = ref([
},
{
label: "闲鱼店铺",
param: "xyName",
param: "xyShopName",
align: "center",
show: true,
minwidth: "150",
@ -317,7 +330,18 @@ const ButtonListGroup = ref([
show: false,
type: "warning",
mode: "detail",
confirm: (row) => {},
confirm: (row) => {
logsvisible.value = true;
logsloading.value = true;
setTimeout(() => {
commodity_log(row.id).then((res) => {
logsloading.value = false;
if (res.code === "200") {
logsList.value = res.data;
}
});
}, 300);
},
},
]);
let commodityInfoDto = reactive({
@ -342,7 +366,9 @@ const getDatas = () => {
(el.name === "复制" &&
[1, -2, -3, -4, 3].includes(item.publishStatus)) ||
(el.name === "上架" && [-2, -4].includes(item.publishStatus)) ||
(el.name === "删除" && [1, -4, -2].includes(item.publishStatus))
(el.name === "删除" &&
[1, -4, -2].includes(item.publishStatus)) ||
el.name === "日志"
) {
return { ...el, show: true };
}
@ -360,7 +386,7 @@ const getDatas = () => {
};
//
const onSearch = (value) => {
commodityInfoDto.pageNo=1;
commodityInfoDto.pageNo = 1;
if (value.createTime) {
value.startCreateTime = new Date(value.createTime[0]).getTime();
value.endCreateTime = new Date(value.createTime[1]).getTime() + 86399999;

View File

@ -497,7 +497,7 @@ import {
address_default,
publish_shelve,
} from "@/api/newlybuiltgoods";
let routerParams = reactive({});
let routerParams = ref("");
let ruleForm = ref({
bidDate: [],
auctionType: "b", //
@ -538,7 +538,7 @@ let ruleForm = ref({
whiteBgImage: "", //()
whiteAliImage: "",
flag: "1", //稿-0 -1
republishId: 0, //id
republishId: "", //id
logistics: 1, // 1 2 bidStep
transportFee: "", //2
templateId: "", //3
@ -793,12 +793,12 @@ const information = reactive({
information.goods_class.loading = false;
if (res.code === "200") {
let new_data = Object.assign([], res.data);
routerParams
? (ruleForm.value.pvListDtoList = routerParams.pvListDtoList)
routerParams.value
? (ruleForm.value.pvListDtoList = routerParams.value.pvListDtoList)
: (ruleForm.value.pvListDtoList = []);
information.goods_attribute.group = [];
new_data.map((item) => {
if (!routerParams) {
if (!routerParams.value) {
ruleForm.value.pvListDtoList.push({
propertyId: "",
propertyName: "",
@ -889,7 +889,7 @@ const goodsInfo = reactive({
})
.then((res) => {
if (res.code === "200") {
if (!routerParams) {
if (!routerParams.value) {
ruleForm.value.xyImages = res.data.xy; //
ruleForm.value.aliImages = res.data.ali; //
} else {
@ -1193,7 +1193,7 @@ const specificationSubmit = (row) => {
keydown: (e, data, el) => {
if (e.key !== "Enter") return;
if (data.tableData.every((item) => !item.inventory)) {
data.tableData.forEach((item) => {
data.new_tableData.forEach((item) => {
item.inventory = el.search;
});
}
@ -1391,7 +1391,6 @@ const publish = (formRef) => {
ruleForm.value.skuList = ruleFormSkuList;
}
ruleForm.value.flag = "1";
ruleform.value.republishId='';
publish_shelve(ruleForm.value).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
@ -1472,37 +1471,42 @@ onMounted(() => {
changeSellType();
if (route.query.params) {
try {
routerParams = JSON.parse(route.query.params);
routerParams.value = JSON.parse(route.query.params);
} catch (err) {
console.log(err);
}
console.log(routerParams, "params");
if (routerParams.classValue && routerParams.classValue.length) {
routerParams.classValue[0] = Number(routerParams.classValue[0]);
routerParams.classValue[1] = Number(routerParams.classValue[1]);
if (routerParams.value.classValue && routerParams.value.classValue.length) {
routerParams.value.classValue[0] = Number(routerParams.value.classValue[0]);
routerParams.value.classValue[1] = Number(routerParams.value.classValue[1]);
}
routerParams.logistics = Number(routerParams.logistics);
routerParams.value.logistics = Number(routerParams.value.logistics);
routerParams.aliImages.map((e) => {
routerParams.value.aliImages.map((e) => {
goodsInfo.more_src.fileImgList.push({ url: e });
});
if (routerParams.whiteAliImage) {
goodsInfo.White_src.fileImgList.push({ url: routerParams.whiteAliImage });
if (routerParams.value.whiteAliImage) {
goodsInfo.White_src.fileImgList.push({ url: routerParams.value.whiteAliImage });
}
if (routerParams.skuList && routerParams.skuList.length) {
let row = transformSkuList(routerParams.skuList);
if (routerParams.value.skuList && routerParams.value.skuList.length) {
let row = transformSkuList(routerParams.value.skuList);
specificationSubmit(row);
console.log(priceList.fixPrice.find((e) => e.label == "销售规格").tableData);
priceList.fixPrice.find((e) => e.label == "销售规格").tableData.forEach((item,index)=>{
item.price=routerParams.skuList[index].price
item.inventory=routerParams.skuList[index].quantity
})
priceList.fixPrice.find((e) => e.label == "销售规格").new_tableData.forEach((item,index)=>{
item.price=routerParams.skuList[index].price
item.inventory=routerParams.skuList[index].quantity
})
console.log(
priceList.fixPrice.find((e) => e.label == "销售规格").tableData
);
priceList.fixPrice
.find((e) => e.label == "销售规格")
.tableData.forEach((item, index) => {
item.price = routerParams.value.skuList[index].price;
item.inventory = routerParams.value.skuList[index].quantity;
});
priceList.fixPrice
.find((e) => e.label == "销售规格")
.new_tableData.forEach((item, index) => {
item.price = routerParams.value.skuList[index].price;
item.inventory = routerParams.value.skuList[index].quantity;
});
}
ruleForm.value = routerParams;
ruleForm.value = routerParams.value;
information.goods_class.visibleChange(false);
}
});

View File

@ -0,0 +1,48 @@
<template>
<el-dialog v-on="$attrs" width="500">
<template #header>
<div class="title">物流信息</div>
</template>
<div style="min-height: 100px" v-loading="$attrs.logisticLoading">
<div style="margin-bottom: 10px">
订单编号{{ props.logisticsList.mailNo || "无" }}
</div>
<el-timeline style="max-width: 600px">
<el-timeline-item
v-for="(activity, index) in props.logisticsList.routes"
:key="index"
:timestamp="activity.acceptTime"
>
{{ activity.remark }}
</el-timeline-item>
</el-timeline>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="confirm"> 确定 </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const props = defineProps({
logisticsList: {
type: Object,
default: {},
},
});
const $emit = defineEmits(["logisticsDialogConfirm"]);
const confirm = () => {
$emit("logisticsDialogConfirm");
};
</script>
<style scoped lang='scss'>
.title {
font-size: 16px;
font-weight: bold;
margin: 0 !important;
}
</style>

View File

@ -35,6 +35,39 @@
></PaginaTion>
</div>
</div>
<LogisticsInfo
v-if="logisticVisible"
v-model="logisticVisible"
:title="'物流信息'"
:logisticsList="logisticsList"
:logisticLoading="logisticLoading"
@logisticsDialogConfirm="logisticVisible = false"
>
</LogisticsInfo>
<DriverForm
v-if="DeliveryVisible"
:DeliveryVisible="DeliveryVisible"
:DeliveryInfoList="DeliveryInfoList"
@Print="Print"
@deliveryCancel="deliveryCancel"
@deliveryConfirm="deliveryConfirm"
/>
<LogsDialog
v-if="logsvisible"
:logsvisible="logsvisible"
:logsloading="logsloading"
:logsList="logsList"
@logsclose="logsvisible = false"
></LogsDialog>
<el-dialog
:close-on-click-modal="false"
title="打印面单"
v-model="printshow"
width="70%"
class="printmodel"
>
<iframe class="prism-player" :src="printimg" width="100%" height="800px" />
</el-dialog>
</template>
<script setup>
@ -46,15 +79,21 @@ import SearchForm from "@components/searchForm/index.vue";
import Table from "@components/table.vue";
import OperateButton from "@/components/OperateButton.vue";
import PaginaTion from "@components/Pagination.vue";
import LogisticsInfo from "./components/logisticsInfo.vue";
import DriverForm from "@components/driverForm/index.vue";
import LogsDialog from "@/components/LogsDialog.vue";
import {
order_info,
// get_commodity_id,
// publish,
// pull_off,
// delete_one,
logistics_inquiry,
get_order_shopped_info,
express_printing,
cancel_order,
order_log,
} from "@/api/OrderManagement";
import { getshopInfo } from "@/api/newlybuiltgoods";
const activeName = ref("");
let printimg = ref(null);
const printshow = ref(false);
const tabs = ref([
{ label: "全部", value: "", total: 0 },
{ label: "订单已创建", value: "1", total: 0 },
@ -70,10 +109,11 @@ const Inputs = ref([
type: "el-input",
placeholder: "查询订单编号",
title: "订单编号",
name: "commodityId",
name: "orderOn",
value: "",
popover: true,
},
{
type: "el-select",
placeholder: "请选择闲鱼店铺",
@ -82,30 +122,42 @@ const Inputs = ref([
value: "",
options: [],
},
{
type: "el-select",
placeholder: "请选择订单状态",
title: "订单状态",
name: "",
value: "",
options: [
],
},
{
type: "el-select",
placeholder: "请选择订单类型",
title: "订单类型",
name: "",
name: "orderType",
value: "",
options: [
{
label: "拍卖",
value: "a",
},
{
label: "一口价",
value: "b",
},
],
},
{
type: "el-input",
placeholder: "请输入商品名称",
name: "title",
value: "",
title: "商品名称",
},
{
type: "el-input",
placeholder: "请输入买家姓名",
name: "buyerName",
value: "",
title: "买家姓名",
},
{
type: "el-input",
placeholder: "请输入买家电话",
name: "",
name: "buyerPhone",
value: "",
title: "买家电话",
},
@ -120,7 +172,7 @@ const Inputs = ref([
{
type: "el-date-picker",
title: "付款时间",
placeholder: "",
placeholder: "payTime",
name: "",
value: [],
width: "215px",
@ -128,7 +180,7 @@ const Inputs = ref([
{
type: "el-date-picker",
title: "发货时间",
placeholder: "",
placeholder: "deliveryTime",
name: "",
value: [],
width: "215px",
@ -136,7 +188,7 @@ const Inputs = ref([
{
type: "el-date-picker",
title: "交易成功时间",
placeholder: "",
placeholder: "successTime",
name: "",
value: [],
width: "215px",
@ -150,7 +202,7 @@ const TableData = ref([]);
const TableLabel = ref([
{
label: "订单编号",
param: "",
param: "orderOn",
align: "center",
show: true,
display: "top_left",
@ -164,14 +216,14 @@ const TableLabel = ref([
},
{
label: "付款时间",
param: "",
param: "paymentTime",
align: "center",
show: true,
display: "top_left",
},
{
label: "发货时间",
param: "",
param: "deliveryTime",
align: "center",
show: true,
display: "top_left",
@ -192,21 +244,21 @@ const TableLabel = ref([
},
{
label: "规格",
param: "",
param: "sku",
align: "center",
show: true,
minwidth: "150",
},
{
label: "商品总价(元)",
param: "",
param: "retailPrice",
align: "center",
show: true,
minwidth: "150",
},
{
label: "订单类型",
param: "",
param: "orderType",
align: "center",
show: true,
minwidth: "150",
@ -220,7 +272,7 @@ const TableLabel = ref([
},
{
label: "闲鱼店铺",
param: "xyName",
param: "xyShopName",
align: "center",
show: true,
minwidth: "150",
@ -234,81 +286,86 @@ const TableLabel = ref([
},
]);
const New_TableLabel = ref([]);
const logisticVisible = ref(false);
const logisticLoading = ref(false);
const logsloading = ref(false);
const logsvisible = ref(false);
const logsList = ref([]);
const logisticsList = ref("");
const DeliveryInfoList = ref({});
const DeliveryVisible = ref(false);
const DeliveryLoading = ref(false);
const ButtonListGroup = ref([
{
AssemblyName: "el-link",
name: "编辑",
name: "发货",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
// get_commodity_id(row.id).then((res) => {
// if (res.code === "200") {
// router.push({
// path: "/NewlyBuiltGoods",
// query: {
// params: JSON.stringify(res.data),
// },
// });
// }
// });
},
},
{
AssemblyName: "el-link",
name: "复制",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {},
},
{
AssemblyName: "el-link",
name: "上架",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
// publish(row.id).then((res) => {
// if (res.code === "200") {
// ElMessage.success(res.msg);
// getDatas();
// }
// });
},
},
{
AssemblyName: "el-popconfirm",
name: "下架",
title: "是否下架?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
// pull_off(row.id).then((res) => {
// if (res.code === "200") {
// ElMessage.success(res.msg);
// getDatas();
// }
// });
},
},
{
AssemblyName: "el-popconfirm",
name: "删除",
title: "是否删除?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
delete_one(row.id).then((res) => {
DeliveryVisible.value = true;
// DeliveryLoading.value = true;
get_order_shopped_info(row.orderId).then((res) => {
if (res.code === "200") {
DeliveryInfoList.value = Object.assign({}, res.data);
DeliveryLoading.value = false;
} else {
ElMessage.warning(res.msg);
DeliveryLoading.value = false;
}
});
},
},
{
AssemblyName: "el-link",
name: "查看物流",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
logisticsList.value = {};
logisticVisible.value = true;
logisticLoading.value = true;
logistics_inquiry(row.orderId).then((res) => {
logisticLoading.value = false;
if (res.code == "200") {
if (res.data) {
logisticsList.value = res.data;
} else {
ElMessage.warning("暂无物流信息");
}
}
});
},
},
{
AssemblyName: "el-link",
name: "补打快递单",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
console.log(row, "row");
Print({ masterWaybillNo: "SF7444487421834", type: 1 });
},
},
{
AssemblyName: "el-popconfirm",
name: "取消订单",
title: "是否取消订单?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
cancel_order(row.orderId).then((res) => {
if (res.code == "200") {
ElMessage.success(res.msg);
getDatas();
} else {
ElMessage.warning(res.msg);
}
});
},
@ -319,15 +376,28 @@ const ButtonListGroup = ref([
show: false,
type: "warning",
mode: "detail",
confirm: (row) => {},
confirm: (row) => {
logsvisible.value = true;
logsloading.value = true;
setTimeout(() => {
order_log(row.orderId).then((res) => {
logsloading.value = false;
if (res.code === "200") {
logsList.value = res.data;
}
});
}, 300);
},
},
]);
let orderInfoDto = reactive({
pageNo: 1,
pageSize: 20,
publishStatus: "",
});
const totalNumbel = ref(0);
const getDatas = () => {
TabLoading.value = true;
order_info(orderInfoDto)
@ -338,13 +408,12 @@ const getDatas = () => {
newData.map((item) => {
item.ButtonGroup = ButtonListGroup.value.map((el) => {
if (
(el.name === "编辑" &&
[1, -4, -2].includes(item.publishStatus)) ||
(el.name === "下架" && [-3].includes(item.publishStatus)) ||
(el.name === "复制" &&
[1, -2, -3, -4, 3].includes(item.publishStatus)) ||
(el.name === "上架" && [-2, -4].includes(item.publishStatus)) ||
(el.name === "删除" && [1, -4, -2].includes(item.publishStatus))
(el.name === "发货" && [2].includes(item.orderStatus)) ||
(el.name === "查看物流" &&
[3, 4, 5].includes(item.orderStatus)) ||
(el.name === "补打快递单" && [3].includes(item.orderStatus)) ||
(el.name === "取消订单" && [1, 2].includes(item.orderStatus)) ||
el.name === "日志"
) {
return { ...el, show: true };
}
@ -365,10 +434,18 @@ const onSearch = (value) => {
if (value.createTime) {
value.startCreateTime = new Date(value.createTime[0]).getTime();
value.endCreateTime = new Date(value.createTime[1]).getTime() + 86399999;
} else if (value.shelfTime) {
value.startShelfTime = new Date(value.shelfTime[0]).getTime();
value.endShelfTime = new Date(value.shelfTime[1]).getTime() + 86399999;
} else if (value.payTime) {
value.payStartTime = new Date(value.payTime[0]).getTime();
value.payEndTime = new Date(value.payTime[1]).getTime() + 86399999;
} else if (value.deliveryTime) {
value.deliveryStartTime = new Date(value.deliveryTime[0]).getTime();
value.deliveryEndTime =
new Date(value.deliveryTime[1]).getTime() + 86399999;
} else if (value.successTime) {
value.successStartTime = new Date(value.successTime[0]).getTime();
value.successEndTime = new Date(value.successTime[1]).getTime() + 86399999;
}
orderInfoDto = {
...orderInfoDto,
...value,
@ -395,6 +472,72 @@ const get_shopInfo = () => {
}
});
};
const base64FileHeaderMapper = (fileBase64) => {
const fileHeader = new Map();
// 3
fileHeader.set("/9j", "jpeg");
fileHeader.set("iVB", "png");
// fileHeader.set("Qk0", "BMP")
// fileHeader.set("SUk", "TIFF")
fileHeader.set("JVB", "pdf");
// fileHeader.set("UEs", "OFD")
let res = "";
// map
fileHeader.forEach((v, k) => {
// IE IE
if (k == fileBase64.substr(0, 3)) {
res = v;
}
});
// mapunknown file
if (res == "") {
res = "unknown file";
}
// mapvalue
return res;
};
const base64ToBlob = (code, type) => {
code = code.replace(/[\n\r]/g, "");
const raw = window.atob(code);
const rawLength = raw.length;
const uint8Array = new Uint8Array(rawLength);
for (let i = 0; i < rawLength; i++) {
uint8Array[i] = raw.charCodeAt(i);
}
if (type === "pdf") {
return new Blob([uint8Array], {
type: "application/pdf",
});
} else {
return new Blob([uint8Array], {
type: "image/jpeg",
});
}
};
const Print = (params) => {
express_printing(params).then((res) => {
if (res.code === "200") {
const da = res.data;
const s = base64FileHeaderMapper(da);
const blob = base64ToBlob(da, s);
printimg.value = URL.createObjectURL(blob);
if (da) {
printshow.value = true;
} else {
ElMessage("邮寄码获取超时,请再次点击");
}
}
});
};
const deliveryCancel = () => {
DeliveryVisible.value = false;
};
const deliveryConfirm = () => {
DeliveryVisible.value = false;
getDatas();
};
onMounted(() => {
TabChange();
get_shopInfo();

View File

@ -15,7 +15,7 @@
</div>
</div>
<div class="main">
<el-row :gutter="20">
<el-row :gutter="20" v-if="store_list.length">
<el-col
:xs="12"
:sm="10"
@ -71,7 +71,7 @@
</el-col>
</el-row>
<!-- 空状态 -->
<!-- <el-empty description="暂无数据" class="empty"></el-empty> -->
<el-empty v-else description="暂无数据" class="empty"></el-empty>
</div>
<!-- 弹窗 -->

View File

@ -0,0 +1,145 @@
<template>
<div>
<el-dialog
:title="props.AddTitle"
v-model="props.AddDialogVisible"
width="30%"
:close-on-click-modal="false"
:before-close="AddClose"
>
<el-form
ref="ruleFormRef"
:model="props.ruleForm"
status-icon
:rules="props.rules"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item
v-for="(item, index) in props.ruleFormList"
:key="index"
:label="item.label"
:prop="item.prop"
v-show="item.show == '1'"
>
<el-input
v-if="item.type === 'input'"
v-model="props.ruleForm[item.params]"
:clearable="item.clearable"
:disabled="item.disabled"
:placeholder="item.placeholder"
></el-input>
<el-select
v-if="item.type === 'select'"
v-model="props.ruleForm[item.params]"
:autocomplete="item.autocomplete"
:clearable="item.clearable"
:placeholder="item.placeholder"
><el-option
v-for="item in item.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option
></el-select>
<el-checkbox-group
v-if="item.type === 'checkbo'"
v-model="props.ruleForm[item.params]"
>
<el-checkbox
v-for="item in item.options"
:key="item.value"
:value="item.value"
:name="item.label"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<el-radio-group
v-if="item.type === 'radio'"
v-model="props.ruleForm[item.params]"
@change="item.radioChange"
>
<el-radio
v-for="el in item.options"
:key="el.value"
:value="el.value"
>{{ el.label }}</el-radio
>
</el-radio-group>
<el-input
v-if="item.type === 'textarea'"
type="textarea"
v-model="props.ruleForm[item.params]"
:placeholder="item.placeholder"
:autosize="item.autosize"
></el-input>
<div class="picture" v-else-if="item.type === 'UploadImage'">
<UploadImage
:limit="item.limit"
:imgList="item.fileImgList"
:multiple="item.multiple"
@onSuccessFiles="item.onSuccessFiles"
/>
</div>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="AddClose">取消</el-button>
<el-button type="primary" @click="submitForm(ruleFormRef)">{{
editText
}}</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import UploadImage from "@components/Upload/newfileupload.vue";
import { ref, defineEmits, defineProps } from "vue";
const ruleFormRef = ref(null);
const $emit = defineEmits(["submitForm", "AddClose"]);
const props = defineProps({
AddDialogVisible: {
type: Boolean,
default: false,
},
AddTitle: {
type: String,
default: "",
},
editText: {
type: String,
default: "前往授权",
},
ruleForm: {
type: Object,
default: () => ({}),
},
ruleFormList: {
type: Array,
default: () => [],
},
rules: {
type: Object,
default: () => ({}),
},
});
const submitForm = (form) => {
form.validate((valid) => {
if (!valid) return;
$emit("submitForm");
});
};
const AddClose = () => {
$emit("AddClose");
ruleFormRef.value.resetFields();
};
</script>
<style scoped lang='scss'>
</style>

View File

@ -0,0 +1,585 @@
<template>
<div class="xy_shop">
<div class="head">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item
:label="item.label"
v-for="(item, index) in formSelect"
:key="index"
>
<el-input
style="width: 190px"
v-if="item.type == 'input'"
v-model="xyUserAddressDto[item.params]"
:placeholder="`请输入${item.label}`"
clearable
/>
<el-button
v-if="item.type == 'button'"
:type="item.status"
@click="item.handler(item)"
>{{ item.name }}</el-button
>
</el-form-item>
</el-form>
</div>
<buttonGroup :buttonList="buttonList"></buttonGroup>
<div class="main">
<div class="table">
<vxe-table
border
ref="xTable"
height="auto"
:data="tableData"
align="center"
>
<vxe-column
v-for="config in tableColumn"
:key="config.key"
:type="config.type"
:field="config.field"
:title="config.title"
:fixed="config.fixed"
:width="config.width"
:filters="config.filters"
>
</vxe-column>
<vxe-colgroup title="默认寄件人">
<vxe-column field="name" title="姓名"></vxe-column>
<vxe-column field="phone" title="联系方式"></vxe-column>
<vxe-column field="address" title="地址"></vxe-column>
</vxe-colgroup>
<vxe-column field="ship_by_default" title="是否打单发货默认物流">
<template #default="{ row }">
<span>{{ row.default_flag ? "是" : "否" }}</span>
</template>
</vxe-column>
<vxe-column field="remark" title="备注"></vxe-column>
<vxe-column title="操作">
<!-- <template #default="{ row }">
<el-button type="text" @click="edit(row)" style="margin-right: 10px"
>编辑</el-button
>
<el-button
slot="reference"
type="text"
style="color: #f56c6c"
@click="delConfirm(row)"
>删除</el-button
>
</template> -->
</vxe-column>
</vxe-table>
</div>
</div>
</div>
<AddDialog
:AddDialogVisible="AddDialogVisible"
:AddTitle="AddTitle"
:editText="editText"
:ruleForm="ruleForm"
:ruleFormList="ruleFormList"
:rules="rules"
@AddClose="AddClose"
@submitForm="submitForm"
></AddDialog>
<el-dialog title="寄件人管理" v-model="jjrdialogVisible" width="800px">
<div>
<div>
<el-form>
<el-form-item>
<el-button type="success" @click="addjjrinfo">新增</el-button>
<el-button type="primary" @click="changejjr">修改</el-button>
<span style="margin: 0px 10px">
<el-popconfirm title="您确定删除吗?" @confirm="delthechoose">
<template #reference>
<el-button type="danger">删除</el-button>
</template>
</el-popconfirm>
</span>
</el-form-item>
</el-form>
</div>
<div>
<vxe-table
border
ref="xTable2"
height="300"
:data="jjrdialogtableData"
:radio-config="{ highlight: true }"
align="center"
>
<vxe-column type="radio" width="60"> </vxe-column>
<vxe-column field="name" title="姓名"></vxe-column>
<vxe-column field="phone" title="电话"></vxe-column>
<vxe-column title="地址">
<template #default="{ row }">
<div>{{ row.province + row.city + row.detailed }}</div>
</template>
</vxe-column>
</vxe-table>
</div>
</div>
</el-dialog>
<el-dialog
:title="title1"
v-model="xzjjrdialogVisible"
width="500px"
top="18vh"
>
<div>
<el-form v-model="jjrformLableAlign" label-width="90px">
<el-form-item label="寄件人">
<el-input
v-model="jjrformLableAlign.name"
placeholder="请输入寄件人"
></el-input>
</el-form-item>
<el-form-item label="电话">
<el-input
v-model="jjrformLableAlign.phone"
placeholder="请输入寄件人电话"
></el-input>
</el-form-item>
<el-form-item label="省市区">
<el-cascader
ref="areaRef"
style="width: 100%"
v-model="jjrformLableAlign.area"
:options="area"
:filterable="true"
placeholder="请选择省市区"
@change="areaChange($event)"
/>
</el-form-item>
<el-form-item label="详细地址">
<el-input
v-model="jjrformLableAlign.detailed"
placeholder="请输入详细地址"
></el-input>
</el-form-item>
<el-form-item label="邮政编码">
<el-input
v-model="jjrformLableAlign.postal_code"
placeholder="请输入邮政编码"
clearable
></el-input>
</el-form-item>
<!-- <el-form-item label="是否设为默认">
<el-radio-group v-model="jjrformLableAlign.default">
<el-radio :label='1'></el-radio>
<el-radio :label='0'></el-radio>
</el-radio-group>
</el-form-item> -->
</el-form>
</div>
<template #footer>
<el-button @click="xzjjrdialogVisible = false"> </el-button>
<el-button type="primary" @click="surejjrset" v-if="jjbtnshow"
> </el-button
>
<el-button type="primary" @click="changeset" v-if="!jjbtnshow"
> </el-button
>
</template>
</el-dialog>
</template>
<script setup>
import { router } from "@/router.js";
import { useRoute } from "vue-router";
import { ref, reactive, onMounted, computed } from "vue";
import { Delete, Edit, Search, Share, Upload } from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";
import buttonGroup from "@/components/buttongroup.vue";
import AddDialog from "./components/addDialog.vue";
import {
userAddress,
add,
senderList,
senderAdd,
senderDelete,
} from "@/api/translateSet";
import { region } from "@/api/newlybuiltgoods";
const route = useRoute();
const AddDialogVisible = ref(false);
const jjrdialogVisible = ref(false);
const xzjjrdialogVisible = ref(false);
const jjbtnshow = ref(false);
const jjrformLableAlign = ref({
area: [],
name: "",
phone: "",
province_id: "",
province: "",
city_id: "",
city: "",
district_id: "",
district: "",
detailed: "",
postal_code: "",
});
const title1 = ref("");
const area = ref([]);
const areaRef = ref(null);
const AddTitle = ref("添加快递公司");
const editText = ref("确定");
const ruleForm = ref({
expressCompany: "",
id: "",
businesses_code: "",
user_id: "",
logistics_id: "",
month_flag: "",
sender_id: "",
month_code: "",
default_flag: "",
remark: "",
logistics_name: "",
jd_access_token: "",
logistics_code: "",
});
const ruleFormList = ref([
{
type: "input",
label: "物流名称",
params: "logistics_name",
prop: "logistics_name",
clearable: true,
show: true,
placeholder: "请输入物流名称",
},
{
type: "select",
label: "快递公司",
params: "expressCompany",
prop: "expressCompany",
clearable: true,
show: true,
placeholder: "请选择快递公司",
inputChange: () => {},
options: [],
},
{
type: "input",
label: "物流编码",
params: "logistics_code",
prop: "logistics_code",
clearable: true,
disabled: true,
show: true,
placeholder: "选择快递公司后自动显示",
},
{
type: "radio",
label: "是否使用月结",
params: "month_flag",
prop: "month_flag",
show: true,
clearable: true,
radioChange: (e) => {
ruleFormList.value.find((e) => e.label === "月结号").show = e;
},
options: [
{
label: "是",
value: "1",
},
{
label: "否",
value: "0",
},
],
},
{
type: "select",
label: "快递产品",
params: "",
prop: "",
clearable: true,
show: false,
placeholder: "请选择快递产品",
inputChange: () => {},
options: [],
},
{
type: "input",
label: "月结号",
params: "",
prop: "",
clearable: true,
show: false,
placeholder: "请输入月结号",
},
{
type: "input",
label: "access_token",
params: "",
prop: "",
clearable: true,
show: false,
placeholder: "请输入access_token",
},
{
type: "input",
label: "refresh_token",
params: "",
prop: "",
clearable: true,
show: false,
placeholder: "请输入refresh_token",
},
{
type: "select",
label: "默认寄件人",
params: "sender_id",
prop: "sender_id",
show: true,
clearable: true,
options: [],
},
{
type: "radio",
label: "是否默认物流",
params: "",
prop: "",
show: true,
clearable: true,
options: [
{
label: "是",
value: "1",
},
{
label: "否",
value: "0",
},
],
},
{
type: "textarea",
label: "备注",
params: "remark",
prop: "remark",
autosize: { minRows: 5, maxRows: 5 },
clearable: true,
show: true,
placeholder: "请输入备注",
},
]);
const rules = ref({});
let xyUserAddressDto = reactive({
logisticsCode: "",
logisticsName: "",
});
const buttonList = ref([
{
name: "新增物流",
handler: (item) => {
AddDialogVisible.value = true;
},
},
{
name: "寄件人管理",
handler: (item) => {
jjrdialogVisible.value = true;
},
},
]);
const formSelect = ref([
{
type: "input",
label: "物流编号",
params: "logisticsCode",
},
{
type: "input",
label: "物流名称",
params: "logisticsName",
},
{
type: "button",
status: "primary",
name: "查询",
handler: (item) => {
get_userAddress();
},
},
{
type: "button",
status: "",
name: "重置",
handler: (item) => {
xyUserAddressDto = { logisticsCode: "", logisticsName: "" };
get_userAddress();
},
},
]);
const tableData = ref({});
const jjrdialogtableData = ref({});
const tableColumn = ref([
{ key: 3, field: "logisticsCode", title: "物流编号", width: 120 },
{ key: 5, field: "logisticsName", title: "物流名称", width: 120 },
{ key: 4, field: "expressCompany", title: "快递公司", width: 120 },
]);
const submitForm = () => {
add(ruleForm.value).then((res) => {
if (res.code === "200") {
}
});
};
const AddClose = () => {
AddDialogVisible.value = false;
};
const get_userAddress = () => {
userAddress(xyUserAddressDto).then((res) => {
if (res.code === "200") {
tableData.value = res.data;
}
});
};
const get_senderList = () => {
senderList().then((res) => {
if (res.code === "200") {
jjrdialogtableData.value = res.data;
ruleFormList.value.find((e) => e.label == "默认寄件人").options =
res.data.map((e) => ({
label: e.name,
value: e.id,
}));
}
});
};
const addjjrinfo = () => {
jjrformLableAlign.value = {};
jjbtnshow.value = true;
title1.value = "新增寄件人";
xzjjrdialogVisible.value = true;
};
const xTable2 = ref(null);
const changejjr = () => {
if (xTable2.value.getRadioRecord() === null) {
ElMessage.error({
message: "请选中一条后修改",
});
} else {
const params = xTable2.value.getRadioRecord();
xzjjrdialogVisible.value = true;
jjbtnshow.value = false;
title1.value = "修改寄件人";
console.log(params, "fasdflsdjfkds");
jjrformLableAlign.value.name = params.name;
jjrformLableAlign.value.detailed = params.detailed;
jjrformLableAlign.value.phone = params.phone;
jjrformLableAlign.value.postal_code = params.postal_code;
jjrformLableAlign.value.area = [
params.province_id,
params.city_id,
params.district_id,
];
}
};
//
const get_region = () => {
region().then((res) => {
if (res.code === "200") {
const transformData = (data) => {
return data.map((item) => {
let result = {
label: item.name,
value: item.id,
};
if (item.child && Array.isArray(item.child)) {
result.children = transformData(item.child);
}
return result;
});
};
area.value = transformData(res.data);
}
});
};
const areaChange = (value) => {
// const selectedData = areaRef.value.cascaderPanelRef.options;
// if (selectedData.length > 0) {
// const province = selectedData[0];
// const city = selectedData.length > 1 ? selectedData[0].children[0] : null;
// const district = selectedData.length > 2 ?selectedData[0].children[0]: null;
// console.log(
// `Province: ${province.label}, City: ${
// city ? city.label : "None"
// }, District: ${district ? district.label : "None"}`
// );
// }
};
const surejjrset = () => {
const area = jjrformLableAlign.value.area;
let params = {
...jjrformLableAlign.value,
province_id: area[0],
province: "",
city_id: area[1],
city: "",
district_id: area[2],
district: "",
};
return;
senderAdd(params).then((res) => {});
};
const delthechoose = () => {
if (!xTable2.value.getRadioRecord()) {
ElMessage.error({
message: "请选中一条后修改",
});
} else {
const params = xTable2.value.getRadioRecord();
senderDelete(params.id).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
get_senderList();
}
});
}
};
onMounted(() => {
get_userAddress();
get_senderList();
get_region();
});
</script>
<style scoped lang='scss'>
.xy_shop {
background: #f1f2f5;
.head {
height: 80px;
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
}
:deep(.el-form-item) {
margin-bottom: 0;
margin-right: 10px;
}
.main {
height: calc(100vh - 173px);
padding: 0 20px 20px;
box-sizing: border-box;
.table {
height: 100%;
background-color: #fff;
padding: 20px;
box-sizing: border-box;
}
}
}
</style>