qb 8 months ago
parent
commit
62961ebe8a
  1. 10
      src/api/warehouse/warehouseRetentionRecord.js
  2. 8
      src/option/warehouse/warehouseRetentionRecord.js
  3. 125
      src/views/warehouse/warehouseRetentionRecord/warehouseRetentionRecord.vue

10
src/api/warehouse/warehouseRetentionRecord.js

@ -102,3 +102,13 @@ export const $_warehouseRetentionRecordPage = params => {
params,
});
};
// 导出
export const $_warehouseRetentionScan = params => {
return request({
url: '/api/logpm-warehouse/warehouseRetentionScan/export-warehouseRetentionScan',
method: 'get',
params,
responseType: 'blob',
});
};

8
src/option/warehouse/warehouseRetentionRecord.js

@ -160,8 +160,8 @@ export const columnList = [
sortable: true,
},
{
prop: 'scanTypeNameS',
label: '滞留操作类型',
prop: 'conditionsNameS',
label: '滞留货物类型',
type: 3,
values: '',
width: '180',
@ -171,11 +171,11 @@ export const columnList = [
value: 1,
},
{
label: '订单',
label: '定制品',
value: 2,
},
{
label: '托盘',
label: '零担',
value: 3,
},
],

125
src/views/warehouse/warehouseRetentionRecord/warehouseRetentionRecord.vue

@ -5,7 +5,19 @@
<!-- 搜索模块 -->
<el-row v-if="search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="el-fr-d">
<el-form :inline="true" :model="TopQuery" class="el-fr-d">
<el-form-item label="滞留扫描日期">
<el-date-picker
v-model="TopQuery.time"
type="datetimerange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
:default-time="defaultTime2"
/>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
@ -19,7 +31,7 @@
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" @click="AddInfo"
<el-button type="primary" @click="exportExcel"
><el-icon><Download /></el-icon></el-button
>
</div>
@ -88,7 +100,7 @@
<script setup>
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue';
import { $_warehouseRetentionRecordPage } from '@/api/warehouse/warehouseRetentionRecord.js';
import { $_warehouseRetentionRecordPage ,$_warehouseRetentionScan} from '@/api/warehouse/warehouseRetentionRecord.js';
import { columnList } from '@/option/warehouse/warehouseRetentionRecord';
import { getDictionaryBiz } from '@/api/system/dict'; //
import { processRowProperty, setNodeHeight } from '@/utils/util';
@ -100,10 +112,12 @@ import dayjs from 'dayjs';
const $router = useRouter(); //
const $useStore = useStore(); //
const $route = useRoute(); //
const TopQuery = ref({});
const details = reactive({
/** 是否开启搜索 */
search: false,
/** 表格搜索条件 */
defaultTime2: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], // '12:00:00', '08:00:00'
query: {},
/** 时间快捷选择设置 */
shortcuts: [
@ -192,6 +206,7 @@ const {
zeroAdditionalRecordingInfo,
popUpShow,
recorddata,
defaultTime2,
} = toRefs(details);
/** 展开列表控件 */
@ -208,6 +223,9 @@ const inputsc = (index, row) => {
const test = val => {};
/** 表格表头时间选择 */
const timesc = (index, row) => {
if (row.prop == 'retentionScanTime') {
row.prop = 'scanDate';
}
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
@ -216,6 +234,7 @@ const timesc = (index, row) => {
if (!index) {
delete details.query[row.prop];
}
onLoad();
};
/** 表格表头输入框搜索 */
@ -234,7 +253,14 @@ const selectionChange = list => {
};
//
const searchChange = () => {
details.search = false; //
if (TopQuery.value.time?.length) {
TopQuery.value.scanDateStart = dayjs(TopQuery.value.time[0]).format('YYYY-MM-DD HH:mm:ss');
TopQuery.value.scanDateEnd = dayjs(TopQuery.value.time[1]).format('YYYY-MM-DD HH:mm:ss');
} else {
delete TopQuery.value.scanDateStart;
delete TopQuery.value.scanDateStart;
}
onLoad();
};
//
const sizeChange = val => {
@ -276,36 +302,38 @@ const onLoad = () => {
current: details.page.currentPage,
size: details.page.pageSize,
...details.query,
...TopQuery.value,
};
details.loadingObj.list = true;
$_warehouseRetentionRecordPage(data).then(res => {
console.log(res, '返回值');
if (res.data.code == 200) {
details.data = res.data.data.records || [];
if (details.data?.length) {
details.data.forEach(item => {
if (item.retentionWay == 1) {
item.retentionWayNameS = '扫描';
} else if (item.retentionWay == 2) {
item.retentionWayNameS = '文员';
}
if (item.scanType == 1) {
item.scanType = '包件';
} else if (item.scanTypeS == 2) {
item.scanTypeName = '订单';
} else if (item.scanType == 3) {
item.scanTypeNameS = '托盘';
}
});
$_warehouseRetentionRecordPage(data)
.then(res => {
console.log(res, '返回值');
if (res.data.code == 200) {
details.data = res.data.data.records || [];
if (details.data?.length) {
details.data.forEach(item => {
if (item.retentionWay == 1) {
item.retentionWayNameS = '扫描';
} else if (item.retentionWay == 2) {
item.retentionWayNameS = '文员';
}
if (item.conditions == 1) {
item.conditionsNameS = '包件';
} else if (item.conditions == 2) {
item.conditionsNameS = '定制品';
} else if (item.conditions == 3) {
item.conditionsNameS = '零担';
}
});
}
details.page.total = res.data.data.total || 0;
}
details.page.total = res.data.data.total||0;
}
}).catch(()=>{
}).finally(()=>{
details.loadingObj.list = false;
})
})
.catch(() => {})
.finally(() => {
details.loadingObj.list = false;
});
};
onLoad();
const view = row => {
@ -320,6 +348,41 @@ const view = row => {
});
};
//
//
const exportExcel = () => {
ElMessageBox.confirm('是否导出数据?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
details.loadingObj.list = true;
let data = {
...details.query,
...TopQuery.value,
};
$_warehouseRetentionScan(data).then(res => {
details.loadingObj.list = false;
downloadXls(res.data, `滞留包条明细.xlsx`);
ElMessage({
message: '导出成功',
type: 'success',
});
});
})
.catch(() => {});
};
//
const searchReset=()=>{
details.columnList.forEach(item=>{
item.values=''
})
details.query={},
TopQuery.value={},
onLoad()
}
</script>
<style scoped lang="scss">

Loading…
Cancel
Save