fix: 用户查询

fix-0609-xwk
向文可 2 years ago
parent a8d32b1a0e
commit 462f25020b

@ -90,33 +90,6 @@
endTime: null,
},
});
watch(
() => route.query.id,
(value) => {
state.condition.userId = value;
},
{ immediate: true, deep: true }
);
watch(
() => state.condition,
(value) => {
store.commit('order/setCondition', _.cloneDeep(value));
},
{ immediate: true, deep: true }
);
watch(
() => state.condition.orderStatus,
() => {
handleSearch();
},
{ deep: true }
);
watch(
() => state.condition.userId,
() => {
handleSearch();
}
);
const handleReset = () => {
state.condition = {
userId: null,
@ -154,6 +127,33 @@
await store.dispatch('order/search');
loading.value = false;
};
watch(
() => route.query.id,
(value) => {
state.condition.userId = value;
},
{ immediate: true, deep: true }
);
watch(
() => state.condition,
(value) => {
store.commit('order/setCondition', _.cloneDeep(value));
},
{ immediate: true, deep: true }
);
watch(
() => state.condition.orderStatus,
() => {
handleSearch();
},
{ deep: true }
);
watch(
() => state.condition.userId,
() => {
handleSearch();
}
);
onActivated(() => {
if (route.query.status) {
state.condition.orderStatus = route.query.status.split(',').map((item) => +item);

@ -52,13 +52,6 @@
dateRange: [],
},
});
watch(
() => state.condition,
(value) => {
store.commit('customer/setCondition', _.cloneDeep(value));
},
{ immediate: true, deep: true }
);
const handleReset = () => {
state.condition = {
phone: null,
@ -67,14 +60,26 @@
};
};
const handleSearch = async () => {
if (route.query.phone && !state.condition.phone) {
state.condition.phone = route.query.phone;
store.commit('customer/setCondition', _.cloneDeep(state.condition));
}
loading.value = true;
await store.dispatch('customer/search');
loading.value = false;
};
watch(
() => route.query.phone,
(value) => {
state.condition.phone = value;
store.commit('customer/setCondition', _.cloneDeep(state.condition));
handleSearch();
},
{ immediate: true }
);
watch(
() => state.condition,
(value) => {
store.commit('customer/setCondition', _.cloneDeep(value));
},
{ immediate: true, deep: true }
);
onActivated(handleSearch);
const handleEnable = async (row) => {
loading.value = true;

Loading…
Cancel
Save