This commit is contained in:
weipengfei 2024-05-09 14:43:48 +08:00
parent 7712e2432d
commit 6f5f723409
11 changed files with 64 additions and 64 deletions

View File

@ -17,7 +17,7 @@ const list = ref([]);
const tabPosition = ref(1); // 1-, 2-
const changeTabPosition = (e) => {
where.value.page = 1;
where.value.page_no = 1;
loadEnd.value = false;
loading.value = false;
orderList.value = [];
@ -28,8 +28,8 @@ const changeTabPosition = (e) => {
const payRef = ref(null);
const where = ref({
page: 1,
limit: 20,
page_no: 1,
page_size: 20,
search_info: ''
});
@ -42,7 +42,7 @@ const loadEnd = ref(false);
const orderList = ref([]);
const getOrderList = (reload=false) => {
if(!where.value.search_info) return ElMessage.error("请输入订单编号");
if(reload) where.value.page = 1;
if(reload) where.value.page_no = 1;
else if(loadEnd.value || loading.value) return;
loading.value = true;
if (tabPosition.value == 1) where.value.paid = null;
@ -54,8 +54,8 @@ const getOrderList = (reload=false) => {
mitt.emit("set-order-detail", orderList.value[0]);
// if(reload) orderList.value = res.data.list;
// else orderList.value = [...orderList.value, ...res.data.list];
// if(res.data.list.length < where.value.limit) loadEnd.value = true;
// else where.value.page++;
// if(res.data.list.length < where.value.page_size) loadEnd.value = true;
// else where.value.page_no++;
// activeStore.value = 0;
// mitt.emit("set-order-detail", orderList.value[0]);
// total.value = res.data.count;

View File

@ -22,8 +22,8 @@ const userStore = useUserStore();
const route = useRoute();
const where = ref({
page: 0,
limit: 30,
page_no: 0,
page_size: 30,
});
const getStoreList = (data={}, reload=false) => {
where.value = {
@ -33,11 +33,11 @@ const getStoreList = (data={}, reload=false) => {
};
if (reload) {
storeList.value = [];
where.value.page = 1;
where.value.page_no = 1;
loadEnd.value = false;
}
storeListApi(userStore.userInfo.service.mer_id, where.value).then((res) => {
if (res.data?.list?.length < where.value.limit) loadEnd.value = true;
if (res.data?.list?.length < where.value.page_size) loadEnd.value = true;
let list = res.data.list.map((item) => {
item.attr = Object.keys(item.sku);
return item;
@ -58,7 +58,7 @@ const getStoreList = (data={}, reload=false) => {
const loadEnd = ref(false);
const loadMore = (data) => {
if (loadEnd.value) return;
where.value.page++;
where.value.page_no++;
getStoreList(data);
};
@ -143,7 +143,7 @@ const aF9 = () => {
};
onMounted(() => {
getStoreList();
where.value.page++;
where.value.page_no++;
mitt.on("F9", aF9);
});

View File

@ -26,7 +26,7 @@ const list = ref([]);
const tabPosition = ref(1); // 1-, 2-
const payType = ref(0); //
const changeTabPosition = (e) => {
where.value.page = 1;
where.value.page_no = 1;
loadEnd.value = false;
loading.value = false;
orderList.value = [];
@ -42,8 +42,8 @@ const changeDate = () => {
};
const where = ref({
page: 1,
limit: 20,
page_no: 1,
page_size: 20,
search_info: "",
date: "",
staff_id: 0,
@ -66,7 +66,7 @@ const activeStore = ref(0);
const loadEnd = ref(false);
const orderList = ref([]);
const getOrderList = (reload = false) => {
if (reload) where.value.page = 1;
if (reload) where.value.page_no = 1;
else if (loadEnd.value || loading.value) return;
if (!props.isSystem) {
where.value.staff_id = userStore.userInfo.service.service_id;
@ -81,8 +81,8 @@ const getOrderList = (reload = false) => {
.then((res) => {
if (reload) orderList.value = res.data.list;
else orderList.value = [...orderList.value, ...res.data.list];
if (res.data.list.length < where.value.limit) loadEnd.value = true;
else where.value.page++;
if (res.data.list.length < where.value.page_size) loadEnd.value = true;
else where.value.page_no++;
activeStore.value = 0;
if (orderList.value.length > 0)
mitt.emit("set-order-detail", orderList.value[0]);

View File

@ -22,8 +22,8 @@ const tabPosition = ref(1); // 1-全部, 2-未收银
const payRef = ref(null);
const where = ref({
page: 1,
limit: 15,
page_no: 1,
page_size: 15,
staff_id: userStore.userInfo.service.service_id,
});
@ -52,17 +52,17 @@ const getStatistics = () => {
getStatistics();
const prevClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const nextClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const currentChange = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};

View File

@ -19,8 +19,8 @@ const tabPosition = ref(1); // 1-全部, 2-未支付
const payRef = ref(null);
const where = ref({
page: 1,
limit: 20,
page_no: 1,
page_size: 20,
});
const loading = ref(false);
@ -51,22 +51,22 @@ const getCartList = () => {
getCartList();
const changeTabPosition = (e) => {
where.value.page = 1;
where.value.page_no = 1;
getOrderList();
};
const prevClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const nextClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const currentChange = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
@ -177,7 +177,7 @@ const goHome = ()=>{
</el-table-column>
</el-table>
<el-pagination
:page-size="where.limit"
:page_no-size="where.page_size"
layout="prev, pager, next"
:total="total"
@prev-click="prevClick"

View File

@ -23,8 +23,8 @@ const userStore = useUserStore();
const route = useRoute();
const where = ref({
page: 1,
limit: 30,
page_no: 1,
page_size: 30,
});
const getStoreList = (data = {}, reload = false) => {
where.value = {
@ -33,11 +33,11 @@ const getStoreList = (data = {}, reload = false) => {
};
if (reload) {
storeList.value = [];
where.value.page = 1;
where.value.page_no = 1;
loadEnd.value = false;
}
saleStoreListApi(where.value).then((res) => {
if (res.data?.lists?.length < where.value.limit) loadEnd.value = true;
if (res.data?.lists?.length < where.value.page_size) loadEnd.value = true;
storeList.value = storeList.value.concat(res.data.lists);
if (
data.bar_code &&
@ -47,7 +47,7 @@ const getStoreList = (data = {}, reload = false) => {
shopRef.value.bar_code = "";
changeItem(storeList.value[0], storeList.value[0].attr[0]);
}
where.value.page++;
where.value.page_no++;
});
};
@ -136,7 +136,7 @@ const aF9 = () => {
};
onMounted(() => {
getStoreList();
where.value.page++;
where.value.page_no++;
mitt.on("F9", aF9);
});

View File

@ -24,7 +24,7 @@ const list = ref([]);
const tabPosition = ref(1); // 1-, 2-
const changeTabPosition = (e) => {
where.value.page = 1;
where.value.page_no = 1;
loadEnd.value = false;
loading.value = false;
orderList.value = [];
@ -40,8 +40,8 @@ const changeDate = ()=>{
}
const where = ref({
page: 1,
limit: 20,
page_no: 1,
page_size: 20,
store_name: "",
date: "",
staff_id: 0,
@ -55,7 +55,7 @@ const activeStore = ref(0);
const loadEnd = ref(false);
const orderList = ref([]);
const getOrderList = (reload = false) => {
if (reload) where.value.page = 1;
if (reload) where.value.page_no = 1;
else if (loadEnd.value || loading.value) return;
if(!props.isSystem) where.value.staff_id = userStore.userInfo.service.service_id;
loading.value = true;
@ -65,8 +65,8 @@ const getOrderList = (reload = false) => {
.then((res) => {
if (reload) orderList.value = res.data.list;
else orderList.value = [...orderList.value, ...res.data.list];
if (res.data.list.length < where.value.limit) loadEnd.value = true;
else where.value.page++;
if (res.data.list.length < where.value.page_size) loadEnd.value = true;
else where.value.page_no++;
activeStore.value = 0;
mitt.emit("set-order-detail", orderList.value[0]);
total.value = res.data.count;

View File

@ -21,8 +21,8 @@ const tabPosition = ref(1); // 1-全部, 2-未收银
const payRef = ref(null);
const where = ref({
page: 1,
limit: 15,
page_no: 1,
page_size: 15,
staff_id: userStore.userInfo.service.service_id,
});
@ -51,17 +51,17 @@ const getStatistics = () => {
getStatistics();
const prevClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const nextClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const currentChange = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
</script>

View File

@ -19,8 +19,8 @@ const tabPosition = ref(1); // 1-全部, 2-未支付
const payRef = ref(null);
const where = ref({
page: 1,
limit: 20,
page_no: 1,
page_size: 20,
});
const loading = ref(false);
@ -51,22 +51,22 @@ const getCartList = () => {
getCartList();
const changeTabPosition = (e) => {
where.value.page = 1;
where.value.page_no = 1;
getOrderList();
};
const prevClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const nextClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
const currentChange = (e) => {
where.value.page = e;
where.value.page_no = e;
getOrderList();
};
@ -177,7 +177,7 @@ const goHome = ()=>{
</el-table-column>
</el-table>
<el-pagination
:page-size="where.limit"
:page_no-size="where.page_size"
layout="prev, pager, next"
:total="total"
@prev-click="prevClick"

View File

@ -208,7 +208,7 @@ defineExpose({
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="1"
:page_size="1"
>
<el-icon><Plus /></el-icon>
</el-upload>
@ -220,7 +220,7 @@ defineExpose({
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="9"
:page_size="9"
>
<el-icon><Plus /></el-icon>
</el-upload>
@ -232,7 +232,7 @@ defineExpose({
name="field"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:limit="9"
:page_size="9"
>
<el-icon><Plus /></el-icon>
</el-upload>

View File

@ -9,8 +9,8 @@ const orderList = ref([]);
const userStore = useUserStore();
const where = ref({
page: 1,
limit: 15,
page_no: 1,
page_size: 15,
type: 1,
keyword: "",
staff_id: userStore.userInfo.service.service_id,
@ -42,17 +42,17 @@ const getShopList = (loadmore = false) => {
getShopList();
const prevClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getShopList();
};
const nextClick = (e) => {
where.value.page = e;
where.value.page_no = e;
getShopList();
};
const currentChange = (e) => {
where.value.page = e;
where.value.page_no = e;
getShopList();
};
@ -92,7 +92,7 @@ const activeIndex = ref('1');
const handleSelect = (key) => {
where.value.type = key;
where.value.page = 1;
where.value.page_no = 1;
getShopList();
};
@ -194,7 +194,7 @@ const showAdd = (type='add', data)=>{
</el-table>
<el-pagination
:page-size="where.limit"
:page_no-size="where.page_size"
layout="prev, pager, next"
:total="total"
@prev-click="prevClick"