This commit is contained in:
weipengfei 2024-07-04 17:59:46 +08:00
parent 74d981c5bd
commit 8f95b9733e
12 changed files with 341 additions and 311 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -50,6 +50,8 @@ const form = ref({
price: 0, price: 0,
uid: '', uid: '',
user_ship: '', user_ship: '',
village: null,
brigade: null,
}); });
const cart_id = ref([]); const cart_id = ref([]);
const isRePay = ref(false); const isRePay = ref(false);
@ -109,6 +111,8 @@ const handleEnter = () => {
userRechangeAmountApi({ userRechangeAmountApi({
uid: form.value.uid, uid: form.value.uid,
user_ship: form.value.user_ship, user_ship: form.value.user_ship,
village: form.value.village,
brigade: form.value.brigade,
price: form.value.price, price: form.value.price,
pay_type: pay_type, pay_type: pay_type,
auth_code: input.value, auth_code: input.value,
@ -326,6 +330,8 @@ const cashBnt = () => {
userRechangeAmountApi({ userRechangeAmountApi({
uid: form.value.uid, uid: form.value.uid,
user_ship: form.value.user_ship, user_ship: form.value.user_ship,
village: form.value.village,
brigade: form.value.brigade,
price: form.value.price, price: form.value.price,
pay_type: 17, pay_type: 17,
}) })

View File

@ -67,6 +67,7 @@ const printReceipt = (content = "") => {
// - // -
const letPrintReceipt = (content = "") => { const letPrintReceipt = (content = "") => {
console.log("预打印"); console.log("预打印");
let str = printTicket(content, true) let str = printTicket(content, true)
console.log(str); console.log(str);
@ -142,7 +143,7 @@ onUnmounted(() => {
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
"> ">
<el-icon color="#fff" size="18" @click="onRefresh"> <el-icon color="#fff" size="25" @click="onRefresh">
<Refresh /> <Refresh />
</el-icon> </el-icon>
</div> </div>

View File

@ -41,7 +41,7 @@ onMounted(() => {
<div class="my-code" v-show="type == 1"> <div class="my-code" v-show="type == 1">
<h2>订单核销</h2> <h2>订单核销</h2>
<div class="box"> <div class="box">
<input ref="inputRef" v-model="code" placeholder="" class="input" @keyup.enter="handleEnterKey" /> <input ref="inputRef" v-model="code" placeholder="请输入核销码" class="input" @keyup.enter="handleEnterKey" />
<div class="btn" @click="handleEnterKey">查询</div> <div class="btn" @click="handleEnterKey">查询</div>
</div> </div>
<div class="to-list" @click="handleListed"> <div class="to-list" @click="handleListed">

View File

@ -129,7 +129,12 @@ onUnmounted(() => {
</div> </div>
<div class="header-input"> <div class="header-input">
<el-input v-model="where.order_id" placeholder="请输入订单编号" @keydown.enter="getOrderList(true)" <el-input v-model="where.order_id" placeholder="请输入订单编号" @keydown.enter="getOrderList(true)"
@clear="getOrderList(true)" clearable> @clear="getOrderList(true)" >
<template #suffix>
<el-icon v-if="where.order_id != ''" size="18" @click="where.order_id = '';getOrderList(true)" style="cursor: pointer;margin-right: 0.5rem;">
<CircleClose />
</el-icon>
</template>
<template #append> <template #append>
<el-button type="primary" style=" <el-button type="primary" style="
background-color: #1890ff; background-color: #1890ff;

View File

@ -238,13 +238,12 @@ onUnmounted(() => {
> >
</div> --> </div> -->
</div> </div>
<!-- <div class="update-price"> <div class="update-price">
<el-switch v-model="is_storage" size="large" inline-prompt active-text="存货" inactive-text="不存" /> <el-switch v-model="is_storage" size="large" inline-prompt active-text="存货" inactive-text="不存" />
</div> --> </div>
</div> </div>
<div class="order-btn"> <div class="order-btn">
<el-button class="btn" type="primary" @click="goPay" :disabled="list.length == 0">{{ "立即结账 (F9)" <el-button class="btn" type="primary" @click="goPay" :disabled="list.length == 0">{{ "立即结账 (F9)" }}</el-button>
}}</el-button>
</div> </div>
</div> </div>
<price ref="priceRef" @changeAllPrice="changeAllPrice"></price> <price ref="priceRef" @changeAllPrice="changeAllPrice"></price>

View File

@ -27,7 +27,7 @@ const name = ref("");
const loadMore = () => { const loadMore = () => {
emit("loadMore", { emit("loadMore", {
store_name_code: name.value, store_name: name.value,
}); });
}; };
@ -86,8 +86,14 @@ onUnmounted(() => {
<div class="header-nav" :class="{ 'input-focus': isfocus }"> <div class="header-nav" :class="{ 'input-focus': isfocus }">
<div class="nav-item-label">搜索 (Shift)</div> <div class="nav-item-label">搜索 (Shift)</div>
<div class="nav-item-input"> <div class="nav-item-input">
<el-input v-model="name" placeholder=" 搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索" clearable ref="codeRef" <el-input v-model="name" placeholder="搜索商品名称/条形码或点击聚焦扫码, 按回车(Enter)搜索" ref="codeRef" @focus="focus"
@focus="focus" @blur="blur" @keyup.enter="handleEnter" @clear="handleEnter" /> @blur="blur" @keyup.enter="handleEnter" @clear="handleEnter" style="font-size: 1rem;">
<template #suffix>
<el-icon v-if="name!=''" size="28" @click="name = ''" style="cursor: pointer;margin-right: 1rem;">
<CircleClose />
</el-icon>
</template>
</el-input>
</div> </div>
<div class="nav-item-btn" @click="handleEnter"> <div class="nav-item-btn" @click="handleEnter">
<el-button class="btn" type="primary"><el-icon> <el-button class="btn" type="primary"><el-icon>
@ -288,7 +294,8 @@ onUnmounted(() => {
justify-content: center; justify-content: center;
} }
} }
.no-stock-re{
.no-stock-re {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;

View File

@ -43,11 +43,15 @@ const getStoreList = (data = {}, reload = false) => {
...where.value, ...where.value,
...data, ...data,
}; };
console.log("===", data, where.value);
if (reload) { if (reload) {
storeList.value = []; storeList.value = [];
where.value.page_no = 1; where.value.page_no = 1;
loadEnd.value = false; loadEnd.value = false;
} }
if(data.top_cate_id==='') {
where.value.store_name = null;
}
loading.value = true; loading.value = true;
saleStoreListApi({ saleStoreListApi({
...where.value, ...where.value,
@ -60,11 +64,11 @@ const getStoreList = (data = {}, reload = false) => {
if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true; if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true;
storeList.value = storeList.value.concat(res.data.lists); storeList.value = storeList.value.concat(res.data.lists);
if ( if (
data.store_name_code && data.store_name &&
storeList.value.length == 1 && storeList.value.length == 1 &&
isAllDigits(data.store_name_code) isAllDigits(data.store_name)
) { ) {
shopRef.value.code = ""; shopRef.value.name = "";
shopRef.value.inputBlur(); shopRef.value.inputBlur();
changeItem(storeList.value[0]); changeItem(storeList.value[0]);
} }

View File

@ -1,11 +1,11 @@
<script setup> <script setup>
import { ref, onMounted, onUnmounted } from "vue"; import { ref, onMounted, onUnmounted } from "vue";
import { import {
orderListApi, orderListApi,
orderStatusApi, orderStatusApi,
orderLadingApi, orderLadingApi,
cartListApi, cartListApi,
saleOrderListApi, saleOrderListApi,
} from "@/api/store.js"; } from "@/api/store.js";
import { useUserStore } from "@/store/user.js"; import { useUserStore } from "@/store/user.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
@ -15,48 +15,48 @@ import moment from "moment";
const userStore = useUserStore(); const userStore = useUserStore();
const props = defineProps({ const props = defineProps({
isSystem: { isSystem: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
source: { source: {
type: Number, type: Number,
default: 1, default: 1,
}, },
}); });
const lists = ref([]); const lists = ref([]);
const tabPosition = ref(1); // 1-, 2- const tabPosition = ref(1); // 1-, 2-
const changeTabPosition = (e) => { const changeTabPosition = (e) => {
where.value.page_no = 1; where.value.page_no = 1;
loadEnd.value = false; loadEnd.value = false;
loading.value = false; loading.value = false;
orderList.value = []; orderList.value = [];
getOrderList(true); getOrderList(true);
}; };
const payRef = ref(null); const payRef = ref(null);
const date = ref(""); const date = ref("");
const changeDate = () => { const changeDate = () => {
where.value.start_time = moment(date.value[0]).format('YYYY-MM-DD 00:00:00'); where.value.start_time = moment(date.value[0]).format('YYYY-MM-DD 00:00:00');
where.value.end_time = moment(date.value[1]).format('YYYY-MM-DD 23:59:59'); where.value.end_time = moment(date.value[1]).format('YYYY-MM-DD 23:59:59');
getOrderList(true); getOrderList(true);
}; };
const disabledDate = (time)=>{ const disabledDate = (time) => {
return time.getTime() > Date.now(); return time.getTime() > Date.now();
} }
const where = ref({ const where = ref({
page_no: 1, page_no: 1,
page_size: 20, page_size: 20,
order_id: "", order_id: "",
start_time: "", start_time: "",
end_time: "", end_time: "",
is_sashier: 1, // 1-, 2- is_sashier: 1, // 1-, 2-
}); });
const loading = ref(false); const loading = ref(false);
@ -66,32 +66,32 @@ const activeStore = ref(0);
const loadEnd = ref(false); const loadEnd = ref(false);
const orderList = ref([]); const orderList = ref([]);
const getOrderList = (reload = false) => { const getOrderList = (reload = false) => {
if (reload) where.value.page_no = 1; if (reload) where.value.page_no = 1;
else if (loadEnd.value || loading.value) return; else if (loadEnd.value || loading.value) return;
loading.value = true; loading.value = true;
if (tabPosition.value == 1) where.value.paid = null; if (tabPosition.value == 1) where.value.paid = null;
if (tabPosition.value == 2) where.value.paid = 0; if (tabPosition.value == 2) where.value.paid = 0;
saleOrderListApi(where.value) saleOrderListApi(where.value)
.then((res) => { .then((res) => {
if (reload) orderList.value = res.data.lists; if (reload) orderList.value = res.data.lists;
else orderList.value = [...orderList.value, ...res.data.lists]; else orderList.value = [...orderList.value, ...res.data.lists];
if (where.value.page_no == 1 && orderList.value.length > 0) mitt.emit("set-sale-order-detail", orderList.value[0]); if (where.value.page_no == 1 && orderList.value.length > 0) mitt.emit("set-sale-order-detail", orderList.value[0]);
if (res.data.lists.length < where.value.page_size) loadEnd.value = true; if (res.data.lists.length < where.value.page_size) loadEnd.value = true;
else where.value.page_no++; else where.value.page_no++;
activeStore.value = 0; activeStore.value = 0;
console.log(where.value.page_no); console.log(where.value.page_no);
total.value = res.data.count; total.value = res.data.count;
loading.value = false; loading.value = false;
}) })
.catch((err) => { .catch((err) => {
loadEnd.value = true; loadEnd.value = true;
loading.value = false; loading.value = false;
}); });
}; };
const setForm = (item, index) => { const setForm = (item, index) => {
activeStore.value = index; activeStore.value = index;
mitt.emit("set-sale-order-detail", item); mitt.emit("set-sale-order-detail", item);
}; };
defineExpose({ defineExpose({
@ -99,266 +99,254 @@ defineExpose({
}) })
onMounted(() => { onMounted(() => {
mitt.on("update-sale-order-detail", (item) => { mitt.on("update-sale-order-detail", (item) => {
console.log("==="); console.log("===");
orderList.value[activeStore.value].paid = 1; orderList.value[activeStore.value].paid = 1;
}); });
}); });
onUnmounted(()=>{ onUnmounted(() => {
mitt.off("update-sale-order-detail"); mitt.off("update-sale-order-detail");
}) })
</script> </script>
<template> <template>
<div class="my-order"> <div class="my-order">
<div class="header-nav"> <div class="header-nav">
<div class="nav-item"> <div class="nav-item">
{{ "收银订单" }} {{ "收银订单" }}
</div> </div>
<div class="nav-item-btn"> <div class="nav-item-btn">
<el-radio-group <el-radio-group v-model="tabPosition" @change="changeTabPosition" size="small">
v-model="tabPosition" <el-radio-button :value="1">全部</el-radio-button>
@change="changeTabPosition" <el-radio-button :value="2">未支付</el-radio-button>
size="small" </el-radio-group>
> <el-date-picker v-model="date" type="daterange" start-placeholder="开始时间" end-placeholder="结束时间"
<el-radio-button :value="1">全部</el-radio-button> size="small" value-format="YYYY/MM/DD" :disabled-date="disabledDate" @change="changeDate"
<el-radio-button :value="2">未支付</el-radio-button> :clearable="false" style="width: 14rem; margin-left: 1rem" />
</el-radio-group> </div>
<el-date-picker </div>
v-model="date" <div class="header-input">
type="daterange" <el-input v-model="where.order_id" placeholder="请输入订单编号" @keydown.enter="getOrderList(true)"
start-placeholder="开始时间" @clear="getOrderList(true)">
end-placeholder="结束时间" <template #suffix>
size="small" <el-icon v-if="where.order_id != ''" size="18" @click="where.order_id = '';getOrderList(true)" style="cursor: pointer;margin-right: 0.5rem;">
value-format="YYYY/MM/DD" <CircleClose />
:disabled-date="disabledDate" </el-icon>
@change="changeDate" </template>
:clearable="false" <template #append>
style="width: 14rem; margin-left: 1rem" <el-button type="primary" style="
/>
</div>
</div>
<div class="header-input">
<el-input
v-model="where.order_id"
placeholder="请输入订单编号"
@keydown.enter="getOrderList(true)"
@clear="getOrderList(true)"
clearable
>
<template #append>
<el-button
type="primary"
style="
background-color: #1890ff; background-color: #1890ff;
color: #fff; color: #fff;
border-radius: 0 0.315rem 0.315rem 0; border-radius: 0 0.315rem 0.315rem 0;
" " @click="getOrderList(true)">搜索</el-button>
@click="getOrderList(true)" </template>
>搜索</el-button </el-input>
>
</template>
</el-input>
</div>
<div
class="order-lists"
v-loading="loading"
v-infinite-scroll="getOrderList"
:infinite-scroll-distance="300"
:infinite-scroll-delay="500"
style="overflow: auto"
>
<div
class="item"
:class="{ 'item-active': activeStore == index }"
v-for="(item, index) in orderList"
:key="index"
@click="setForm(item, index)"
>
<div class="top">
<div class="sn" :class="'cahier'">单号: {{ item.order_id }}</div>
<div class="create-time">{{ item.pay_time }}</div>
</div> </div>
<div class="shop"> <div class="order-lists" v-loading="loading" v-infinite-scroll="getOrderList" :infinite-scroll-distance="300"
<div class="left" v-if="item.product_info"> :infinite-scroll-delay="500" style="overflow: auto">
<el-image <div class="item" :class="{ 'item-active': activeStore == index }" v-for="(item, index) in orderList"
v-for="(shop, imgkey) in item.product_info.slice(0, 5)" :key="index" @click="setForm(item, index)">
:key="imgkey" <div class="top">
:src="shop.image" <div class="sn" :class="'cahier'">单号: {{ item.order_id }}</div>
class="shop-img" <div class="create-time">{{ item.pay_time }}</div>
></el-image> </div>
<div v-if="item.product_info.length == 1" class="shop-name"> <div class="shop">
{{ item.product_info[0].store_name }} <div class="left" v-if="item.product_info">
</div> <el-image v-for="(shop, imgkey) in item.product_info.slice(0, 5)" :key="imgkey"
</div> :src="shop.image" class="shop-img"></el-image>
<div class="right"> <div v-if="item.product_info.length == 1" class="shop-name">
<div class="money">¥{{ item.pay_price }}</div> {{ item.product_info[0].store_name }}
<div class="count">{{ item.total_num }}款商品</div> </div>
</div> </div>
</div> <div class="right">
<div class="bottom"> <div class="money">¥{{ item.pay_price }}</div>
<div class="pay"> <div class="count">{{ item.total_num }}款商品</div>
<div v-if="item.paid"> </div>
{{ item.paid_name }} </div>
<spna v-if="item.pay_type_name">({{ item.pay_type_name }})</spna> <div class="bottom">
<span v-else-if="item.pay_type == 9">(微信收款)</span> <div class="pay">
<span v-else-if="item.pay_type == 17">(现金支付)</span> <div v-if="item.paid">
<span v-else-if="item.pay_type == 13">(支付宝收款)</span> {{ item.paid_name }}
<span v-else-if="item.pay_type == 3">(余额支付)</span> <spna v-if="item.pay_type_name">({{ item.pay_type_name }})</spna>
<span v-else-if="item.pay_type == 1">(微信支付)</span> <span v-else-if="item.pay_type == 9">(微信收款)</span>
</div> <span v-else-if="item.pay_type == 17">(现金支付)</span>
<div v-else style="color: #ff4a00">{{ item.paid_name }}</div> <span v-else-if="item.pay_type == 13">(支付宝收款)</span>
</div> <span v-else-if="item.pay_type == 3">(余额支付)</span>
<!-- <div class="cashier" v-if="item.service_info"> <span v-else-if="item.pay_type == 1">(微信支付)</span>
</div>
<div v-else style="color: #ff4a00">{{ item.paid_name }}</div>
</div>
<!-- <div class="cashier" v-if="item.service_info">
收银员: {{ item.service_info.nickname }} 收银员: {{ item.service_info.nickname }}
</div> </div>
<div class="cashier" v-else>平台订单</div> --> <div class="cashier" v-else>平台订单</div> -->
</div>
</div>
<div v-if="loadEnd" class="load-end">没有更多了</div>
<div v-if="loading" class="load-end">加载中...</div>
</div> </div>
</div>
<div v-if="loadEnd" class="load-end">没有更多了</div>
<div v-if="loading" class="load-end">加载中...</div>
</div> </div>
</div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.my-order { .my-order {
border-radius: 1.2rem; border-radius: 1.2rem;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
width: 30rem; width: 30rem;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
.header-nav { .header-nav {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
padding: 1rem; padding: 1rem;
height: 3.5rem; height: 3.5rem;
span { span {
color: #ff4a00;
}
.nav-item {
font-weight: bold;
}
.nav-item-btn {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.header-input {
padding: 1rem;
padding-top: 0;
height: 2.5rem;
border-bottom: 1px solid #eee;
}
.order-lists {
height: calc(100vh - 100px - 10.2rem);
overflow-y: auto;
.item {
padding: 1rem;
border-bottom: 1px solid #eee;
.top {
display: flex;
justify-content: space-between;
align-items: flex-end;
.sn {
font-weight: bold;
font-size: 0.9rem;
}
.cahier {
&::before {
content: "收银";
font-weight: 400;
font-size: 0.7rem;
padding: 0.1rem 0.1rem;
margin-right: 0.2rem;
border: 1px solid #2ec479;
color: #2ec479;
border-radius: 0.187rem;
}
}
.cahier2 {
&::before {
content: "平台";
font-weight: 400;
font-size: 0.7rem;
padding: 0.1rem 0.1rem;
margin-right: 0.2rem;
border: 1px solid #ff4a00;
color: #ff4a00; color: #ff4a00;
border-radius: 0.187rem;
}
} }
.create-time {
font-size: 0.8rem; .nav-item {
}
}
.shop {
display: flex;
justify-content: space-between;
.right {
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: center;
.money {
font-size: 1rem;
color: #ff4a00;
font-weight: bold; font-weight: bold;
}
.count {
font-size: 0.7rem;
color: #999;
}
} }
.left {
height: 4.5rem; .nav-item-btn {
display: flex; display: flex;
align-items: center; justify-content: space-between;
.shop-img { align-items: center;
width: 3.5rem;
height: 3.5rem;
border-radius: 0.3rem;
margin-right: 0.4rem;
}
.shop-name {
font-size: 0.9rem;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
/* 将文本限制为三行 */
-webkit-line-clamp: 3;
}
} }
}
.bottom {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
color: #777;
.manage-btn {
color: #fff;
background-color: #e6a23c;
border-radius: 0.2rem;
padding: 0 0.2rem;
margin-left: 0.5rem;
}
}
} }
.item-active {
background-color: #efefef; .header-input {
padding: 1rem;
padding-top: 0;
height: 2.5rem;
border-bottom: 1px solid #eee;
}
.order-lists {
height: calc(100vh - 100px - 10.2rem);
overflow-y: auto;
.item {
padding: 1rem;
border-bottom: 1px solid #eee;
.top {
display: flex;
justify-content: space-between;
align-items: flex-end;
.sn {
font-weight: bold;
font-size: 0.9rem;
}
.cahier {
&::before {
content: "收银";
font-weight: 400;
font-size: 0.7rem;
padding: 0.1rem 0.1rem;
margin-right: 0.2rem;
border: 1px solid #2ec479;
color: #2ec479;
border-radius: 0.187rem;
}
}
.cahier2 {
&::before {
content: "平台";
font-weight: 400;
font-size: 0.7rem;
padding: 0.1rem 0.1rem;
margin-right: 0.2rem;
border: 1px solid #ff4a00;
color: #ff4a00;
border-radius: 0.187rem;
}
}
.create-time {
font-size: 0.8rem;
}
}
.shop {
display: flex;
justify-content: space-between;
.right {
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: center;
.money {
font-size: 1rem;
color: #ff4a00;
font-weight: bold;
}
.count {
font-size: 0.7rem;
color: #999;
}
}
.left {
height: 4.5rem;
display: flex;
align-items: center;
.shop-img {
width: 3.5rem;
height: 3.5rem;
border-radius: 0.3rem;
margin-right: 0.4rem;
}
.shop-name {
font-size: 0.9rem;
color: #333;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
/* 将文本限制为三行 */
-webkit-line-clamp: 3;
}
}
}
.bottom {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
color: #777;
.manage-btn {
color: #fff;
background-color: #e6a23c;
border-radius: 0.2rem;
padding: 0 0.2rem;
margin-left: 0.5rem;
}
}
}
.item-active {
background-color: #efefef;
}
}
.load-end {
text-align: center;
padding: 1rem;
color: #333;
font-size: 0.8rem;
} }
}
.load-end {
text-align: center;
padding: 1rem;
color: #333;
font-size: 0.8rem;
}
} }
</style> </style>

View File

@ -232,21 +232,31 @@ const updateAddress = async () => {
...addressInfo.value, ...addressInfo.value,
uid: formData.value.id uid: formData.value.id
}).then(res => { }).then(res => {
ElMessage.success('编辑成功') selectedEd.value = JSON.parse(JSON.stringify(selectedValues.value))
ElMessage.success('编辑成功');
isDisabled.value = true; isDisabled.value = true;
}) }).catch(err => {
cancelUpdate();
} )
} }
const cancelUpdate = () => { const cancelUpdate = () => {
selectedValues.value = JSON.parse(JSON.stringify(selectedEd.value)) selectedValues.value = JSON.parse(JSON.stringify(selectedEd.value))
if(selectedEd.value.length>0){
addressInfo.value.city = selectedEd.value[0]
addressInfo.value.area = selectedEd.value[1]
addressInfo.value.street = selectedEd.value[2]
addressInfo.value.village = selectedEd.value[3]
addressInfo.value.brigade = selectedEd.value[4]
}
isDisabled.value = true; isDisabled.value = true;
} }
const isDisabled = ref(true); const isDisabled = ref(true);
const activeStore = ref(0); const activeStore = ref(0);
const activeStoreList = ref(["基本信息"]); // const activeStoreList = ref([""]);
// const activeStoreList = ref(["", ""]); const activeStoreList = ref(["基本信息", "用户资产"]);
const isOut = ref(false); // const isOut = ref(false); //
const productList = ref([]); // const productList = ref([]); //
@ -363,7 +373,9 @@ const shipRecharge = () => {
data: { data: {
uid: formData.value.id, uid: formData.value.id,
price: shipForm.value.money, price: shipForm.value.money,
user_ship: shipForm.value.user_ship user_ship: shipForm.value.user_ship,
village: addressInfo.value.village,
brigade: addressInfo.value.brigade
} }
}); });
payRef.value.drawer = true; payRef.value.drawer = true;
@ -372,11 +384,12 @@ const shipRecharge = () => {
}) })
} }
const rechargeMoney = (type) => { const rechargeMoney = (type) => {
if(selectedEd.value.length == 0) return ElMessage.error("请先选择用户地址");
shipForm.value.type = type; shipForm.value.type = type;
if (type == 'add') { if (type == 'add') {
shipForm.value.user_ship = formData.value.user_ship; shipForm.value.user_ship = formData.value.user_ship;
shipForm.value.user_ship_name = formData.value.user_ship_name; shipForm.value.user_ship_name = formData.value.user_ship_name;
changeShip(shipForm.value.user_ship) changeShip(shipForm.value.user_ship);
} }
dialogFormShip.value = true; dialogFormShip.value = true;
} }
@ -391,8 +404,10 @@ onMounted(() => {
data.phone = data.mobile + ''; data.phone = data.mobile + '';
delete data.mobile; delete data.mobile;
formData.value = Object.assign(res, data); formData.value = Object.assign(res, data);
console.log(formData.value); // console.log(formData.value);
}) })
selectedValues.value = [];
selectedEd.value = [];
getAddress(); getAddress();
initProduct(true); initProduct(true);
shipForm.value = { shipForm.value = {
@ -528,7 +543,7 @@ onUnmounted(() => {
<div class="info-item-title">用户地址:</div> <div class="info-item-title">用户地址:</div>
<el-cascader :key="formData.id" style="flex: 1;" v-model="selectedValues" :options="options" <el-cascader :key="formData.id" style="flex: 1;" v-model="selectedValues" :options="options"
:props="props" :load="loadOptions" class="w-full" :disabled="isDisabled" /> :props="props" :load="loadOptions" class="w-full" :disabled="isDisabled" />
<el-button v-if="isDisabled" type="primary" style="margin-left: 1rem;" <el-button v-if="isDisabled && !selectedEd.length" type="primary" style="margin-left: 1rem;"
@click="isDisabled = false">修改</el-button> @click="isDisabled = false">修改</el-button>
<el-button v-if="!isDisabled" type="primary" style="margin-left: 1rem;" <el-button v-if="!isDisabled" type="primary" style="margin-left: 1rem;"
@click="updateAddress">确认</el-button> @click="updateAddress">确认</el-button>

View File

@ -225,7 +225,12 @@ onUnmounted(() => {
</div> </div>
<div class="header-input"> <div class="header-input">
<el-input v-model="where.mobile" placeholder="搜索手机号" @keydown.enter="getOrderList(true)" <el-input v-model="where.mobile" placeholder="搜索手机号" @keydown.enter="getOrderList(true)"
@clear="getOrderList(true)" clearable> @clear="getOrderList(true)" >
<template #suffix>
<el-icon v-if="where.mobile != ''" size="18" @click="where.mobile = '';getOrderList(true)" style="cursor: pointer;margin-right: 0.5rem;">
<CircleClose />
</el-icon>
</template>
<template #append> <template #append>
<el-button type="primary" style=" <el-button type="primary" style="
background-color: #1890ff; background-color: #1890ff;