123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <el-card class="box-card">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- :searchConfig="searchConfig"
- highlight-current-row
- :defaultExpandAll="true"
- :table-events="{
- select: selectRow,
- 'select-all': selectRow,
- }"
- :action-list="[
- {
- text: '拆分包裹',
- action: () => clickUnpack(),
- },
- {
- text: '合并订单',
- action: () => clickMerge(),
- },
- {
- text: '取消合并',
- action: () => clickUnMerge(),
- },
- {
- text: '修改收件信息',
- action: () => clickModifyInformation(),
- },
- {
- text: '修改快递',
- action: () => clickModifiedExpress(),
- },
- {
- text: '打印快递单',
- action: () => clickPrint(),
- type: 'warning',
- },
- {
- text: '填写线下快递单号',
- action: () => clickFillInExpressCode(),
- },
- ]"
- @get-list="getList"
- @clickReset="clickReset">
- <template #typeExpand="{ item }">
- <div v-html="item.remark"></div>
- </template>
- <template #code="{ item }">
- <div>
- <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
- </div>
- </template>
- <template #groupOrderCodeList="{ item }">
- <div>
- <div v-if="item.groupOrderCodeList && item.groupOrderCodeList.length > 0">{{ item.groupOrderCodeList.join(",") }}</div>
- </div>
- </template>
- </byTable>
- </el-card>
- </template>
- <script setup>
- import byTable from "/src/components/byTable/index";
- const { proxy } = getCurrentInstance();
- const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- code: "",
- departmentId: "",
- expressDeliveryCode: "",
- printStatus: "",
- beginTime: "",
- endTime: "",
- },
- });
- const loading = ref(false);
- const searchConfig = computed(() => {
- return [
- {
- type: "input",
- prop: "code",
- label: "订单号",
- },
- {
- type: "select",
- prop: "departmentId",
- data: departmentList.value,
- label: "事业部",
- },
- {
- type: "input",
- prop: "expressDeliveryCode",
- label: "快递单号",
- },
- {
- type: "select",
- prop: "printStatus",
- data: [
- {
- dictKey: "1",
- dictValue: "是",
- },
- {
- dictKey: "0",
- dictValue: "否",
- },
- ],
- label: "打印状态",
- },
- {
- type: "date",
- propList: ["beginTime", "endTime"],
- label: "交期",
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- type: "expand",
- attrs: {
- label: " ",
- slot: "typeExpand",
- width: 50,
- },
- },
- {
- type: "selection",
- attrs: {
- checkAtt: "isCheck",
- },
- },
- // {
- // attrs: {
- // label: "日期",
- // slot: "backupDateStr",
- // width: 220,
- // align: "center",
- // },
- // },
- {
- attrs: {
- label: "主订单号",
- slot: "code",
- width: 160,
- },
- },
- {
- attrs: {
- label: "合并订单号",
- slot: "groupOrderCodeList",
- width: 160,
- },
- },
- {
- attrs: {
- label: "合并订单号",
- slot: "groupOrderCodeList",
- width: 160,
- },
- },
- {
- attrs: {
- label: "快照时间",
- prop: "backupDate",
- },
- },
- ];
- });
- const getDemandData = () => {
- proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- departmentList.value = departmentList.value.concat(
- res.rows.map((item) => {
- return {
- dictKey: item.id,
- dictValue: item.name,
- };
- })
- );
- }
- });
- };
- getDemandData();
- const getList = async (req, status) => {
- if (status) {
- sourceList.value.pagination = {
- pageNum: sourceList.value.pagination.pageNum,
- pageSize: sourceList.value.pagination.pageSize,
- };
- } else {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- }
- loading.value = true;
- proxy.post("/issueBill/page", sourceList.value.pagination).then((res) => {
- if (res.rows && res.rows.length > 0) {
- sourceList.value.data = res.rows.map((item) => {
- return {
- ...item,
- isCheck: true,
- };
- });
- } else {
- sourceList.value.data = [];
- }
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList();
- const clickReset = () => {
- getList("", true);
- };
- const selectData = ref([]);
- const selectRow = (data) => {
- selectData.value = data;
- };
- const clickCode = (row) => {
- proxy.$router.replace({
- path: "/order-detail",
- query: {
- detailId: row.id,
- text: "订单详情",
- random: proxy.random(),
- },
- });
- };
- </script>
- <style lang="scss" scoped></style>
|