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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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