页面修改

This commit is contained in:
zmj 2023-11-08 18:04:28 +08:00
parent d774ecd43e
commit a32750bfd8
4 changed files with 177 additions and 375 deletions

View File

@ -2,7 +2,7 @@ const config = {
terminal: 1, //终端 terminal: 1, //终端
title: "后台管理系统", //网站默认标题 title: "后台管理系统", //网站默认标题
version: "1.6.0", //版本号 version: "1.6.0", //版本号
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || "https://preview-logistics.lihaink.cn"}/`, //请求接口域名 baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ""}/`, //请求接口域名
urlPrefix: "adminapi", //请求默认前缀 urlPrefix: "adminapi", //请求默认前缀
timeout: 10 * 1000, //请求超时时 timeout: 10 * 1000, //请求超时时
}; };

View File

@ -1,100 +1,44 @@
<template> <template>
<div> <div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never"> <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-form class="mb-[-16px]" inline> <el-form class="mb-[-16px]" inline>
<el-form-item label="公司名称" prop="company_name"> <el-form-item label="公司名称" prop="company_name">
<el-input <el-input class="w-[280px]" v-model="queryParams.company_name" clearable placeholder="请输入公司名称" />
class="w-[280px]" </el-form-item>
v-model="queryParams.company_name" <el-form-item label="联系人" prop="contract_no">
clearable <el-input class="w-[280px]" v-model="queryParams.company_b_user" clearable placeholder="请输入联系人" />
placeholder="请输入公司名称" </el-form-item><el-form-item label="" prop="status">
/> <el-input class="w-[280px]" v-model="queryParams.company_b_phone" clearable placeholder="请输入联系方式" />
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="contract_no"> <el-form-item>
<el-input <el-button type="primary" @click="resetPage">查询</el-button>
class="w-[280px]" <el-button @click="resetParams">重置</el-button>
v-model="queryParams.company_b_user" </el-form-item>
clearable </el-form>
placeholder="请输入联系人" <div class="mt-4">
/> </el-form-item <el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }">
><el-form-item label="联系方式" prop="status"> <el-table-column label="公司名称" :width="250" prop="company_b_name" show-overflow-tooltip />
<el-input <el-table-column label="社会代码" prop="company_b_code" show-overflow-tooltip />
class="w-[280px]" <el-table-column label="主要联系人" prop="company_b_user" show-overflow-tooltip />
v-model="queryParams.company_b_phone" <el-table-column label="联系方式" prop="company_b_phone" align="center" show-overflow-tooltip />
clearable <el-table-column label="租车数量" prop="num" align="center" show-overflow-tooltip />
placeholder="请输入联系方式" <el-table-column label="合同状态" prop="num" align="center" show-overflow-tooltip>
/> <template #default="{ row }">
</el-form-item> {{ row.status >= 3 ? "已签约" : "未签约" }}
<el-form-item> </template>
<el-button type="primary" @click="resetPage">查询</el-button> </el-table-column>
<el-button @click="resetParams">重置</el-button> <el-table-column label="操作" align="center" width="auto" fixed="right">
</el-form-item> <template #default="{ row }">
</el-form> <el-button type="primary" link>
<div class="mt-4"> <router-link :to="{
<el-table path: '/contract/detail',
:data="pager.lists" query: {
:default-sort="{ prop: 'create_time', order: 'descending' }" id: row.id,
> },
<el-table-column }">查看</router-link>
label="公司名称" </el-button>
:width="250"
prop="company_b_name" <!-- <el-button
show-overflow-tooltip
/>
<el-table-column
label="社会代码"
prop="company_b_code"
show-overflow-tooltip
/>
<el-table-column
label="主要联系人"
prop="company_b_user"
show-overflow-tooltip
/>
<el-table-column
label="联系方式"
prop="company_b_phone"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="租车数量"
prop="num"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="合同状态"
prop="num"
align="center"
show-overflow-tooltip
>
<template #default="{ row }">
{{ row.status >= 3 ? "已签约" : "未签约" }}
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="auto"
fixed="right"
>
<template #default="{ row }">
<el-button type="primary" link>
<router-link
:to="{
path: '/contract/detail',
query: {
id: row.id,
},
}"
>查看</router-link
>
</el-button>
<!-- <el-button type="primary" link @click="test(row.id)">
查看
</el-button> -->
<el-button
v-if="row.status == 1" v-if="row.status == 1"
type="primary" type="primary"
link link
@ -108,22 +52,17 @@
link link
type="primary" type="primary"
>重新发送{{ row.nums ? row.nums + "s" : "" }}</el-button >重新发送{{ row.nums ? row.nums + "s" : "" }}</el-button
> > -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="flex mt-4 justify-end"> <div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" /> <pagination v-model="pager" @change="getLists" />
</div> </div>
</el-card> </el-card>
<edit-popup <edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
v-if="showEdit" </div>
ref="editRef"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template> </template>
<script lang="ts" setup name="flowTypeLists"> <script lang="ts" setup name="flowTypeLists">
@ -133,62 +72,62 @@ import { contractList, sendContract, sendMsg } from "@/api/contract";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
const sendAgain = (id: number) => { const sendAgain = (id: number) => {
feedback.msgSuccess("发送成功"); feedback.msgSuccess("发送成功");
sendMsg({ id }).then((res) => { sendMsg({ id }).then((res) => {
var inde = pager.lists.findIndex(function (element) { var inde = pager.lists.findIndex(function (element) {
return element.id === id; return element.id === id;
});
index.value = inde;
pager.lists[index.value].nums = 10;
timeFn(index.value);
}); });
index.value = inde;
pager.lists[index.value].nums = 10;
timeFn(index.value);
});
}; };
const timeFn = (i: number) => { const timeFn = (i: number) => {
const timers = setInterval(() => { const timers = setInterval(() => {
pager.lists[i].nums--; pager.lists[i].nums--;
if (pager.lists[i].nums <= 0) { if (pager.lists[i].nums <= 0) {
clearInterval(timers); clearInterval(timers);
} }
}, 1000); }, 1000);
}; };
const index = ref(0); const index = ref(0);
const sendContractFn = (id: number) => { const sendContractFn = (id: number) => {
sendContract({ id }).then((res) => { sendContract({ id }).then((res) => {
feedback.msgSuccess("发送成功"); feedback.msgSuccess("发送成功");
var inde = pager.lists.findIndex(function (element) { var inde = pager.lists.findIndex(function (element) {
return element.id === id; return element.id === id;
});
index.value = inde;
pager.lists[index.value].status = 2;
pager.lists[index.value].nums = 10;
timeFn(index.value);
}); });
index.value = inde;
pager.lists[index.value].status = 2;
pager.lists[index.value].nums = 10;
timeFn(index.value);
});
}; };
const test = () => { const test = () => {
// console.log(5454); // console.log(5454);
}; };
// //
const queryParams = reactive({ const queryParams = reactive({
company_name: "", company_name: "",
company_b_user: "", company_b_user: "",
company_b_phone: "", company_b_phone: "",
}); });
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: contractList, fetchFun: contractList,
params: queryParams, params: queryParams,
}); });
// console.log(pager.lists); // console.log(pager.lists);
const handleView = async (data: any) => { const handleView = async (data: any) => {
showEdit.value = true; showEdit.value = true;
await nextTick(); await nextTick();
editRef.value?.open(data.id); editRef.value?.open(data.id);
}; };
getLists().then((res) => { getLists().then((res) => {
pager.lists.forEach((item, index) => { pager.lists.forEach((item, index) => {
item.nums = 0; item.nums = 0;
}); });
}); });
</script> </script>

View File

@ -1,184 +1,77 @@
<template> <template>
<div> <div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never"> <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-form class="mb-[-16px]" inline> <el-form class="mb-[-16px]" inline>
<el-form-item label="订单编号" prop="company_id"> <el-form-item label="订单编号" prop="company_id">
<el-input <el-input class="w-[280px]" v-model="queryParams.order_sn" clearable placeholder="请输入订单编号" />
class="w-[280px]" </el-form-item>
v-model="queryParams.order_sn" <el-form-item label="商家名称" prop="company_id">
clearable <el-input class="w-[280px]" v-model="queryParams.shop_name" clearable placeholder="请输入商家名称" />
placeholder="请输入订单编号" </el-form-item>
/> <el-form-item label="商家电话" prop="company_id">
</el-form-item> <el-input class="w-[280px]" v-model="queryParams.shop_phone" clearable placeholder="请输入商家电话" />
<el-form-item label="商家名称" prop="company_id"> </el-form-item>
<el-input <el-form-item label="商家地址" prop="company_id">
class="w-[280px]" <el-input class="w-[280px]" v-model="queryParams.shop_address" clearable placeholder="请输入商家地址" />
v-model="queryParams.shop_name" </el-form-item>
clearable <el-form-item label="收件人" prop="company_id">
placeholder="请输入商家名称" <el-input class="w-[280px]" v-model="queryParams.receiver_name" clearable placeholder="请输入收件人" />
/> </el-form-item>
</el-form-item>
<el-form-item label="商家电话" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.shop_phone"
clearable
placeholder="请输入商家电话"
/>
</el-form-item>
<el-form-item label="商家地址" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.shop_address"
clearable
placeholder="请输入商家地址"
/>
</el-form-item>
<el-form-item label="收件人" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.receiver_name"
clearable
placeholder="请输入收件人"
/>
</el-form-item>
<el-form-item label="收件人电话" prop="company_id"> <el-form-item label="收件人电话" prop="company_id">
<el-input <el-input class="w-[280px]" v-model="queryParams.receiver_phone" clearable placeholder="请输入收件人电话" />
class="w-[280px]" </el-form-item>
v-model="queryParams.receiver_phone" <el-form-item label="配送人员" prop="company_id">
clearable <el-input class="w-[280px]" v-model="queryParams.courier_name" clearable placeholder="请输入配送人员姓名" />
placeholder="请输入收件人电话" </el-form-item>
/> <el-form-item label="所属公司" prop="company_id">
</el-form-item> <el-input class="w-[280px]" v-model="queryParams.courier_company" clearable placeholder="请输入所属公司地址" />
<el-form-item label="配送人员" prop="company_id"> </el-form-item>
<el-input <el-form-item label="村/镇/小队" prop="company_id">
class="w-[280px]" <el-input class="w-[280px]" v-model="queryParams.receiver_address" clearable placeholder="请输入村/镇/小队" />
v-model="queryParams.courier_name" </el-form-item>
clearable <el-form-item>
placeholder="请输入配送人员姓名" <el-button type="primary" @click="resetPage">查询</el-button>
/> <el-button @click="resetParams">重置</el-button>
</el-form-item> </el-form-item>
<el-form-item label="所属公司" prop="company_id"> </el-form>
<el-input <div class="mt-4">
class="w-[280px]" <el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }"
v-model="queryParams.courier_company" @selection-change="handleSelectionChange">
clearable
placeholder="请输入所属公司地址"
/>
</el-form-item>
<el-form-item label="村/镇/小队" prop="company_id">
<el-input
class="w-[280px]"
v-model="queryParams.receiver_address"
clearable
placeholder="请输入村/镇/小队"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
<div class="mt-4">
<el-table
:data="pager.lists"
:default-sort="{ prop: 'create_time', order: 'descending' }"
@selection-change="handleSelectionChange"
>
<el-table-column
label="订单编号"
:width="250"
prop="order_sn"
show-overflow-tooltip
/>
<el-table-column
label="商户名称"
prop="shop_name"
show-overflow-tooltip
/>
<el-table-column
label="收货人"
prop="receiver_name"
show-overflow-tooltip
/>
<el-table-column
label="收货人号码"
prop="receiver_phone"
show-overflow-tooltip
/>
<el-table-column
label="收货地址"
prop="receiver_address"
show-overflow-tooltip
/>
<el-table-column
label="商品数量"
prop="product_count"
align="center"
show-overflow-tooltip
/>
<el-table-column <el-table-column label="订单编号" :width="250" prop="order_sn" show-overflow-tooltip />
label="下单时间" <el-table-column label="商户名称" prop="shop_name" show-overflow-tooltip />
sortable <el-table-column label="收货人" prop="receiver_name" show-overflow-tooltip />
prop="create_time" <el-table-column label="收货人号码" prop="receiver_phone" show-overflow-tooltip />
show-overflow-tooltip <el-table-column label="收货地址" prop="receiver_address" show-overflow-tooltip />
/> <el-table-column label="商品数量" prop="product_count" align="center" show-overflow-tooltip />
<el-table-column <el-table-column label="下单时间" sortable prop="create_time" show-overflow-tooltip />
label="订单状态"
:filters="[
{ text: '待取货', value: '0' },
{ text: '配送中', value: '1' },
{ text: '已配送', value: '2' },
{ text: '已取消', value: '3' },
]"
:filter-method="filterHandler"
prop="status_name"
show-overflow-tooltip
>
</el-table-column>
<el-table-column <el-table-column label="订单状态" :filters="[
label="配送人员" { text: '待取货', value: '0' },
prop="courier_name" { text: '配送中', value: '1' },
show-overflow-tooltip { text: '已配送', value: '2' },
/> { text: '已取消', value: '3' },
<el-table-column ]" :filter-method="filterHandler" prop="status_name" show-overflow-tooltip>
label="配送人员所属公司" </el-table-column>
prop="courier_company"
show-overflow-tooltip <el-table-column label="配送人员" prop="courier_name" show-overflow-tooltip />
/> <el-table-column label="配送人员所属公司" prop="courier_company" show-overflow-tooltip />
<el-table-column <el-table-column label="操作" align="center" width="auto" fixed="right">
label="操作" <template #default="{ row }">
align="center" <el-button type="primary" v-perms="['logistics.logistics/detail']" link
width="auto" @click="handleView(row)">查看</el-button>
fixed="right" </template>
> </el-table-column>
<template #default="{ row }"> </el-table>
<el-button </div>
type="primary" <div class="flex mt-4 justify-end">
v-perms="['logistics.logistics/detail']" <pagination v-model="pager" @change="getLists" />
link </div>
@click="handleView(row)" </el-card>
>查看</el-button <edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
> </div>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template> </template>
<script lang="ts" setup name="flowTypeLists"> <script lang="ts" setup name="flowTypeLists">
@ -186,41 +79,11 @@ import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions"; import { useDictData } from "@/hooks/useDictOptions";
import { orderList } from "@/api/logistics"; import { orderList } from "@/api/logistics";
import EditPopup from "./edit.vue"; import EditPopup from "./edit.vue";
// let obj = [
// {
// cunid: 1,
// zhgn: [
// {
// zhengid: 1,
// dui: [1, 2, 3],
// },
// {
// zhengid: 2,
// dui: [1, 2, 3],
// },
// ],
// },
// {
// cunid: 3,
// zhgn: [
// {
// zhengid: 1,
// dui: [1, 2, 3],
// },
// {
// zhengid: 2,
// dui: [1, 2, 3],
// },
// ],
// },
// ];
interface User { interface User {
date: string; date: string;
name: string; name: string;
address: string; address: string;
tag: string; tag: string;
} }
const editRef = shallowRef<InstanceType<typeof EditPopup>>(); const editRef = shallowRef<InstanceType<typeof EditPopup>>();
// //
@ -228,15 +91,15 @@ const showEdit = ref(false);
// //
// 'order_sn' =>,'shop_name'=> ,'shop_phone' => ,'shop_address' => ,'user_name' => ,'user_address' => ,'user_phone' => // 'order_sn' =>,'shop_name'=> ,'shop_phone' => ,'shop_address' => ,'user_name' => ,'user_address' => ,'user_phone' =>
const queryParams = reactive({ const queryParams = reactive({
order_sn: "", order_sn: "",
shop_name: "", shop_name: "",
shop_phone: "", shop_phone: "",
shop_address: "", shop_address: "",
receiver_name: "", receiver_name: "",
receiver_address: "", receiver_address: "",
receiver_phone: "", receiver_phone: "",
courier_name: "", courier_name: "",
courier_company: "", courier_company: "",
}); });
// //
@ -244,22 +107,22 @@ const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id); selectData.value = val.map(({ id }) => id);
}; };
const filterHandler = (value: string, row: any, column: any) => { const filterHandler = (value: string, row: any, column: any) => {
return row.status == value; return row.status == value;
}; };
// //
const { dictData } = useDictData(""); const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: orderList, fetchFun: orderList,
params: queryParams, params: queryParams,
}); });
const handleView = async (data: any) => { const handleView = async (data: any) => {
showEdit.value = true; showEdit.value = true;
await nextTick(); await nextTick();
editRef.value?.open(data.id); editRef.value?.open(data.id);
}; };
getLists(); getLists();
</script> </script>

View File

@ -43,7 +43,7 @@
<el-table-column label="当前使用人" prop="rent_info.use_user_name" show-overflow-tooltip /> <el-table-column label="当前使用人" prop="rent_info.use_user_name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="rent_info.use_user_phone" show-overflow-tooltip /> <el-table-column label="联系方式" prop="rent_info.use_user_phone" show-overflow-tooltip />
<el-table-column label="车辆使用情况" prop="status_name" show-overflow-tooltip /> <el-table-column label="车辆使用情况" align="center" prop="status_name" show-overflow-tooltip />
<el-table-column label="当前运载货物" prop="create_time" show-overflow-tooltip /> <el-table-column label="当前运载货物" prop="create_time" show-overflow-tooltip />
<el-table-column label="车辆类型" prop="type_name" show-overflow-tooltip /> <el-table-column label="车辆类型" prop="type_name" show-overflow-tooltip />