Browse Source

新增在途订单

dev-xx
qb 6 months ago
parent
commit
daabaec567
  1. 14
      src/api/warehouse/OrderInTransit.js
  2. 10
      src/option/waybill/TemporaryStorageList.js
  3. 389
      src/views/distribution/inventory/delivery/OrderInTransit.vue
  4. 7
      src/views/waybill/orderPackageList.vue

14
src/api/warehouse/OrderInTransit.js

@ -0,0 +1,14 @@
import request from '@/axios';
/**
* 获取在途订单列表
* @param {*} params
* @returns
*/
export const getListTransfer = params => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/listTransfer',
method: 'get',
params,
});
};

10
src/option/waybill/TemporaryStorageList.js

@ -45,6 +45,16 @@ export const columnList = [
fixed: false,
sortable: true,
},
{
prop: 'senderFactory',
label: '发货工厂',
type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
},
{
prop: 'storeName',
label: '门店名称',

389
src/views/distribution/inventory/delivery/OrderInTransit.vue

@ -0,0 +1,389 @@
<template>
<basic-container v-loading="details.loadingObj.pageLoading">
<div class="avue-crud">
<!-- 搜索模块 -->
<div v-h5uShow="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="header_search">
<template v-for="item in details.columnList" :key="item.prop">
<el-form-item v-if="item.isTitleSearch" :label="item.label">
<!-- 普通输入框 -->
<template v-if="item.type === 2">
<el-input
class="w100"
:placeholder="`请输入${item.label}`"
v-model="details.query[item.prop]"
clearable
></el-input>
</template>
<!-- 下拉框 -->
<template v-else-if="item.type === 3">
<el-select
v-model="details.query[item.prop.replace('Name', '')]"
:placeholder="`请选择${item.label}`"
class="w100"
clearable
filterable
:multiple="item.multiple || false"
@change="
val => {
!val && delete details.query[item.prop.replace('Name', '')];
}
"
>
<el-option
v-for="val in item.checkarr"
:key="val.value"
:label="val.label"
:value="val.value"
/>
</el-select>
</template>
</el-form-item>
</template>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset"> </el-button>
</el-form-item>
</el-form>
</div>
<!-- 控件模块 -->
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left"></div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="Search" @click="searchHide" circle></el-button>
</div>
</div>
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '操作'">
<el-text @click="handleView(slotProps.scope)"> 查看 </el-text>
</template>
</template>
</tablecmt>
<!-- 分页模块 -->
<div class="flex-c-sb mt20">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.current"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.size"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</div>
</basic-container>
<!-- 列表配置显示 -->
<edittablehead
@closce="showdrawer"
:drawerShow="drawerShow"
v-model="details.columnList"
></edittablehead>
</template>
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick, getCurrentInstance } from 'vue';
import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import {
downloadXls,
setNodeHeight,
getHtmls,
deepClone,
handleClearTableQuery,
debounce,
handleSelectQuery,
handleInputQuery,
handleTranslationDataSeclect,
getObjType,
} from '@/utils/util';
import { columnList } from '@/option/distribution/distributionStockArticleSelf';
import { getListTransfer } from '@/api/warehouse/OrderInTransit';
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
//
const $router = useRouter();
const $store = useStore();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 列表 */
columnList: deepClone(columnList),
/** 列表数据 */
data: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
/** 页面loading */
pageLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
current: 1,
size: 30,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 新增 | 编辑 物料 */
addMaterial: false,
/** 上传 */
UploadPackageDelivery: false,
},
});
const { search, query, shortcuts, data, loadingObj, selectionList, drawerShow, page } =
toRefs(details);
/** 请求页面数据 */
const onLoad = debounce(async (isTranslation = true) => {
try {
details.loadingObj.list = true;
const submitData = {
...details.query,
...details.page,
};
delete submitData.total;
const res = await getListTransfer(submitData);
const { code, data } = res.data;
if (code !== 200 || getObjType(data) !== 'object') return;
details.data = data.records || [];
details.page.total = data.total;
isTranslation && handleTranslationDataSeclect(details.data, details.columnList);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
}, 10);
const handleData = (key, res) => {
const { code, data } = res.data;
if (code !== 200) return;
for (let i = 0; i < details.columnList.length; i++) {
const value = details.columnList[i];
if (value.label === key)
return (value.checkarr =
getObjType(data) === 'array'
? data.map(val => {
val.label = val.dictValue;
val.value = val.dictKey;
return val;
})
: []);
}
};
//
const initData = async () => {
try {
details.loadingObj.pageLoading = true;
await Promise.all([
//
getDictionaryBiz('distribution_type').then(res => handleData('服务类型', res)),
getDictionaryBiz('order_status').then(res => handleData('订单状态', res)),
getDictionaryBiz('basic_grounding').then(res => handleData('上架状态', res)),
getDictionaryBiz('freeze_status').then(res => handleData('冻结状态', res)),
getDictionaryBiz('order_stockup_status').then(res => handleData('备货状态', res)),
getDictionaryBiz('order_reservation_status').then(res => handleData('预约状态', res)),
getDictionaryBiz('order_receive_status').then(res => handleData('入库状态', res)),
onLoad(false),
]);
await nextTick();
handleTranslationDataSeclect(details.data, details.columnList);
console.log('details.columnList :>> ', details.columnList);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
initData();
/** 搜索 */
const searchChange = () => {
onLoad();
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.page.current = 1;
handleClearTableQuery(details.columnList);
onLoad();
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean) => {
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
details.search = !details.search;
setNodeHeight(details.listNode, '', true);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
handleInputQuery(index, row, details.query);
onLoad();
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad();
};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
handleSelectQuery(index, row, details.query);
onLoad();
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (size: number) => {
details.page.size = size;
onLoad();
};
/** 页码改变执行的回调 */
const currentChange = current => {
details.page.current = current;
onLoad();
};
/** 查看 */
const handleView = ({ row }) => {
$router.push({
path: '/distribution/inventory/distributionStockArticleDetails',
query: {
id: row.id,
name: '详情 - ' + row.orderCode,
isZero: row.isZero,
},
});
};
</script>
<style scoped lang="scss">
//
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-range-editor.el-input__wrapper) {
height: 100% !important;
}
.avue-crud {
position: relative;
}
//
:deep(.el-overlay) {
position: absolute;
}
:deep(.el-input-number .el-input__inner) {
text-align: left !important;
}
:deep(.el-overlay-dialog) {
position: absolute;
}
</style>

7
src/views/waybill/orderPackageList.vue

@ -308,7 +308,12 @@
</el-dialog>
<!-- 打印二维码 -->
<MyPrint v-model="details.popUpShow.QRCodeVisible" width="780px" :html="details.html" />
<MyPrint
type="titlePrint"
v-model="details.popUpShow.QRCodeVisible"
width="780px"
:html="details.html"
/>
<!-- 列表配置显示 -->
<edittablehead

Loading…
Cancel
Save