|
|
|
|
@ -358,7 +358,7 @@ const queryParams = reactive({
|
|
|
|
|
no: undefined,
|
|
|
|
|
productId: undefined,
|
|
|
|
|
outTime: [],
|
|
|
|
|
statusList: [0, 1, 10],
|
|
|
|
|
statusList: [],
|
|
|
|
|
remark: undefined,
|
|
|
|
|
outType: undefined,
|
|
|
|
|
creator: undefined
|
|
|
|
|
@ -378,6 +378,8 @@ const activeName = ref('')
|
|
|
|
|
const queryFormRef = ref() // 鎼滅储鐨勮〃鍗?
|
|
|
|
|
const exportLoading = ref(false) // 瀵煎嚭鐨勫姞杞戒腑
|
|
|
|
|
const showAllFilters = ref(false)
|
|
|
|
|
const DEFAULT_STATUS_LIST = [0, 1, 10]
|
|
|
|
|
const useInitialStatusFilter = ref(true)
|
|
|
|
|
const filterCount = 7
|
|
|
|
|
const toggleFilters = () => {
|
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
@ -425,7 +427,7 @@ const getList = async () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
await loadAuditConfig()
|
|
|
|
|
const data = await StockOutApi.getStockOutPage(queryParams)
|
|
|
|
|
const data = await StockOutApi.getStockOutPage(buildQueryParams())
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
|
@ -433,14 +435,24 @@ const getList = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const buildQueryParams = () => ({
|
|
|
|
|
...queryParams,
|
|
|
|
|
statusList: queryParams.statusList?.length
|
|
|
|
|
? queryParams.statusList
|
|
|
|
|
: useInitialStatusFilter.value
|
|
|
|
|
? DEFAULT_STATUS_LIST
|
|
|
|
|
: []
|
|
|
|
|
})
|
|
|
|
|
/** 鎼滅储鎸夐挳鎿嶄綔 */
|
|
|
|
|
const handleQuery = () => {
|
|
|
|
|
useInitialStatusFilter.value = false
|
|
|
|
|
queryParams.pageNo = 1
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 閲嶇疆鎸夐挳鎿嶄綔 */
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
useInitialStatusFilter.value = false
|
|
|
|
|
queryFormRef.value.resetFields()
|
|
|
|
|
queryParams.statusList = []
|
|
|
|
|
queryParams.outType = activeName.value || stockOutTypeOptions.value[0]?.value
|
|
|
|
|
@ -532,7 +544,7 @@ const handleExport = async () => {
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const ids = selectionList.value.map((item) => item.id).filter((v) => v != null)
|
|
|
|
|
const params = {
|
|
|
|
|
...queryParams,
|
|
|
|
|
...buildQueryParams(),
|
|
|
|
|
ids: ids.length ? ids.join(',') : undefined
|
|
|
|
|
}
|
|
|
|
|
const data = await StockOutApi.exportStockOut(params)
|
|
|
|
|
@ -564,7 +576,8 @@ const syncDefaultOutType = () => {
|
|
|
|
|
watch(stockOutTypeOptions, (options) => {
|
|
|
|
|
if (!queryParams.outType && options.length) {
|
|
|
|
|
syncDefaultOutType()
|
|
|
|
|
handleQuery()
|
|
|
|
|
queryParams.pageNo = 1
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|