|
@@ -3,7 +3,7 @@
|
|
|
<div class="page-action">
|
|
|
<t-space size="small">
|
|
|
<upload-button
|
|
|
- upload-url="/api/admin/user/archives/import"
|
|
|
+ upload-url="/api/admin/device/delivery/import"
|
|
|
:format="['xls', 'xlsx']"
|
|
|
>
|
|
|
<t-button variant="outline">
|
|
@@ -18,7 +18,7 @@
|
|
|
<t-button
|
|
|
variant="outline"
|
|
|
:disabled="!selectedRowKeys.length"
|
|
|
- @click="handleDestroy"
|
|
|
+ @click="handleOperate('DELIVER')"
|
|
|
>
|
|
|
<template #icon><svg-icon name="delete" color="#262626" /></template
|
|
|
>批量发货
|
|
@@ -26,7 +26,7 @@
|
|
|
<t-button
|
|
|
variant="outline"
|
|
|
:disabled="!selectedRowKeys.length"
|
|
|
- @click="handleDestroy"
|
|
|
+ @click="handleOperate('RECEIVE')"
|
|
|
>
|
|
|
<template #icon><svg-icon name="delete" color="#262626" /></template
|
|
|
>批量签收
|
|
@@ -34,7 +34,7 @@
|
|
|
<t-button
|
|
|
variant="outline"
|
|
|
:disabled="!selectedRowKeys.length"
|
|
|
- @click="handleDestroy"
|
|
|
+ @click="handleOperate('CANCEL')"
|
|
|
>
|
|
|
<template #icon><svg-icon name="delete" color="#262626" /></template
|
|
|
>批量作废
|
|
@@ -65,7 +65,7 @@
|
|
|
<div class="flex-1 page-wrap">
|
|
|
<t-table
|
|
|
size="small"
|
|
|
- row-key="userArchivesId"
|
|
|
+ row-key="id"
|
|
|
:columns="columns"
|
|
|
:data="tableData"
|
|
|
bordered
|
|
@@ -81,16 +81,46 @@
|
|
|
:selected-row-keys="selectedRowKeys"
|
|
|
@select-change="selectChange"
|
|
|
>
|
|
|
+ <template #serviceName="{ row }">
|
|
|
+ {{ row.serviceName || '-' }}
|
|
|
+ </template>
|
|
|
+ <template #crmNo="{ row }">
|
|
|
+ {{ row.crmNo || '-' }}
|
|
|
+ </template>
|
|
|
<template #operate="{ row }">
|
|
|
- <div class="table-operations" @click.stop>
|
|
|
+ <div class="table-operations" @click.stop v-if="row.effect">
|
|
|
<t-link
|
|
|
- v-if="perm.LINK_Update"
|
|
|
theme="primary"
|
|
|
hover="color"
|
|
|
@click="handleEdit(row)"
|
|
|
+ v-if="row.status == 'UN_DELIVER'"
|
|
|
>
|
|
|
修改
|
|
|
</t-link>
|
|
|
+ <t-link
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ v-if="row.status == 'UN_DELIVER'"
|
|
|
+ @click="handleOperate('CANCEL', [row.id])"
|
|
|
+ >
|
|
|
+ 作废
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ v-if="row.status == 'UN_DELIVER'"
|
|
|
+ @click="handleOperate('DELIVER', [row.id])"
|
|
|
+ >
|
|
|
+ 发货
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ v-if="row.status == 'DELIVER'"
|
|
|
+ @click="handleOperate('RECEIVE', [row.id])"
|
|
|
+ >
|
|
|
+ 签收
|
|
|
+ </t-link>
|
|
|
</div>
|
|
|
</template>
|
|
|
</t-table>
|
|
@@ -98,6 +128,7 @@
|
|
|
<EditDeviceInfoDialog
|
|
|
v-model:visible="showEditDeviceDialog"
|
|
|
:curRow="curRow"
|
|
|
+ @success="fetchData"
|
|
|
></EditDeviceInfoDialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -110,12 +141,11 @@ import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
|
|
|
import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
|
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
import {
|
|
|
- personFilesListApi,
|
|
|
- personFilesStatisticsApi,
|
|
|
- personFilesDestroyApi,
|
|
|
- personFilesExportApi,
|
|
|
+ deviceSendStatusUpdateApi,
|
|
|
+ deviceSendListApi,
|
|
|
+ deviceSendExportApi,
|
|
|
} from '@/api/resource-guard';
|
|
|
-import { DEVICE_SEND_STATUS } from '@/config/constants';
|
|
|
+import { DEVICE_SEND_STATUS, DEVICE_USAGE_TYPE } from '@/config/constants';
|
|
|
import usePermission from '@/hooks/usePermission';
|
|
|
import EditDeviceInfoDialog from './edit-device-info-dialog.vue';
|
|
|
import { dictToOptionList } from '@/utils/tool';
|
|
@@ -123,13 +153,10 @@ const { perm } = usePermission();
|
|
|
|
|
|
const curRow = ref(null);
|
|
|
const showEditDeviceDialog = ref(false);
|
|
|
-setTimeout(() => {
|
|
|
- showEditDeviceDialog.value = true;
|
|
|
-});
|
|
|
|
|
|
const fields = ref([
|
|
|
{
|
|
|
- prop: 'a',
|
|
|
+ prop: 'serviceId',
|
|
|
label: '服务单元',
|
|
|
type: 'select',
|
|
|
labelWidth: 80,
|
|
@@ -137,18 +164,18 @@ const fields = ref([
|
|
|
cell: 'service',
|
|
|
},
|
|
|
{
|
|
|
- prop: 'b',
|
|
|
+ prop: 'usageType',
|
|
|
label: '用途类型',
|
|
|
type: 'select',
|
|
|
labelWidth: 80,
|
|
|
colSpan: 6,
|
|
|
- options: [],
|
|
|
+ options: dictToOptionList(DEVICE_USAGE_TYPE),
|
|
|
attrs: {
|
|
|
clearable: true,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- prop: 'c',
|
|
|
+ prop: 'crmNo',
|
|
|
label: '项目单号',
|
|
|
labelWidth: 80,
|
|
|
colSpan: 6,
|
|
@@ -157,7 +184,7 @@ const fields = ref([
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- prop: 'd',
|
|
|
+ prop: 'status',
|
|
|
label: '发货状态',
|
|
|
type: 'select',
|
|
|
labelWidth: 80,
|
|
@@ -168,7 +195,7 @@ const fields = ref([
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- prop: 'e',
|
|
|
+ prop: 'deliverUserId',
|
|
|
label: '发货人',
|
|
|
type: 'select',
|
|
|
labelWidth: 80,
|
|
@@ -176,7 +203,7 @@ const fields = ref([
|
|
|
cell: 'user',
|
|
|
},
|
|
|
{
|
|
|
- prop: 'f',
|
|
|
+ prop: 'deliverTime',
|
|
|
label: '发货时间',
|
|
|
labelWidth: 80,
|
|
|
type: 'daterange',
|
|
@@ -187,7 +214,7 @@ const fields = ref([
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- prop: 'h',
|
|
|
+ prop: 'deviceNo',
|
|
|
label: '设备编号',
|
|
|
labelWidth: 80,
|
|
|
colSpan: 6,
|
|
@@ -204,7 +231,7 @@ const fields = ref([
|
|
|
cell: 'supplier',
|
|
|
},
|
|
|
{
|
|
|
- prop: 'g',
|
|
|
+ prop: 'receiveTime',
|
|
|
label: '验收时间',
|
|
|
labelWidth: 80,
|
|
|
type: 'daterange',
|
|
@@ -214,7 +241,15 @@ const fields = ref([
|
|
|
valueType: 'time-stamp',
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
+ {
|
|
|
+ prop: 'serialNo',
|
|
|
+ label: '设备序列号',
|
|
|
+ labelWidth: 80,
|
|
|
+ colSpan: 6,
|
|
|
+ attrs: {
|
|
|
+ clearable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
type: 'buttons',
|
|
|
colSpan: 2,
|
|
@@ -232,20 +267,24 @@ const fields = ref([
|
|
|
]);
|
|
|
|
|
|
const params = reactive({
|
|
|
- a: '',
|
|
|
- b: '',
|
|
|
- c: '',
|
|
|
- d: '',
|
|
|
- e: '',
|
|
|
- f: [],
|
|
|
- g: [],
|
|
|
- h: '',
|
|
|
+ serviceId: '',
|
|
|
+ usageType: '',
|
|
|
+ crmNo: '',
|
|
|
+ status: '',
|
|
|
+ deliverUserId: '',
|
|
|
+ deliverTime: [],
|
|
|
+ deviceNo: '',
|
|
|
+ receiveTime: [],
|
|
|
supplierId: '',
|
|
|
+ serialNo: '',
|
|
|
});
|
|
|
const computedParams = computed(() => {
|
|
|
- let data = omit(params, ['f', 'g']);
|
|
|
- // data.archivesTimeStart = params.archivesTime[0];
|
|
|
- // data.archivesTimeEnd = params.archivesTime[1];
|
|
|
+ let data = omit(params, ['deliverTime', 'receiveStartTime']);
|
|
|
+ data.deliverStartTime = params.deliverTime[0];
|
|
|
+ data.deliverEndTime = params.deliverTime[1];
|
|
|
+
|
|
|
+ data.receiveStartTime = params.receiveTime[0];
|
|
|
+ data.receiveEndTime = params.receiveTime[1];
|
|
|
return data;
|
|
|
});
|
|
|
|
|
@@ -256,15 +295,72 @@ const columns = [
|
|
|
width: 50,
|
|
|
fixed: 'left',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '服务单元',
|
|
|
+ colKey: 'serviceName',
|
|
|
+ width: 100,
|
|
|
+ cell: 'serviceName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '项目单号',
|
|
|
+ colKey: 'crmNo',
|
|
|
+ width: 140,
|
|
|
+ cell: 'crmNo',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '用途',
|
|
|
+ colKey: 'usageTypeStr',
|
|
|
+ width: 70,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '出库/入库',
|
|
|
+ colKey: 'deliveryTypeStr',
|
|
|
+ width: 110,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '供应商',
|
|
|
+ colKey: 'supplierName',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备编号',
|
|
|
+ colKey: 'deviceNo',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '序列号',
|
|
|
+ colKey: 'serialNo',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '品牌',
|
|
|
+ colKey: 'brand',
|
|
|
+ width: 70,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '型号',
|
|
|
+ colKey: 'model',
|
|
|
+ width: 70,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '邮寄地址',
|
|
|
+ colKey: 'mailingAddress',
|
|
|
+ minWidth: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '收件人',
|
|
|
+ colKey: 'consignee',
|
|
|
+ width: 90,
|
|
|
+ },
|
|
|
{
|
|
|
title: '管理',
|
|
|
colKey: 'operate',
|
|
|
fixed: 'right',
|
|
|
- width: 80,
|
|
|
+ width: 160,
|
|
|
},
|
|
|
];
|
|
|
const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
|
|
|
- personFilesListApi,
|
|
|
+ deviceSendListApi,
|
|
|
{
|
|
|
fetchDataHandle: () => {
|
|
|
selectedRowKeys.value = [];
|
|
@@ -280,24 +376,36 @@ const selectChange = (value) => {
|
|
|
|
|
|
const handleEdit = (row) => {
|
|
|
curRow.value = row;
|
|
|
- showAddPersonFileDialog.value = true;
|
|
|
+ showEditDeviceDialog.value = true;
|
|
|
};
|
|
|
-const handleDestroy = () => {
|
|
|
- if (!selectedRowKeys.value.length) {
|
|
|
+const handleOperate = (status, ids) => {
|
|
|
+ let str =
|
|
|
+ status === 'DELIVER'
|
|
|
+ ? '发货'
|
|
|
+ : status === 'RECEIVE'
|
|
|
+ ? '签收'
|
|
|
+ : status === 'CANCEL'
|
|
|
+ ? '作废'
|
|
|
+ : '';
|
|
|
+ let confirmBody = !ids
|
|
|
+ ? `确定要${str}当前选择的所有记录吗?`
|
|
|
+ : `确定要${str}当前记录吗?`;
|
|
|
+ if (!selectedRowKeys.value.length && !ids) {
|
|
|
MessagePlugin.error('请选择要作废的记录');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const confirmDia = DialogPlugin({
|
|
|
header: '操作提示',
|
|
|
- body: `确定要作废当前选择的所有记录吗`,
|
|
|
+ body: confirmBody,
|
|
|
confirmBtn: '确定',
|
|
|
cancelBtn: '取消',
|
|
|
onConfirm: async () => {
|
|
|
confirmDia.hide();
|
|
|
- const res = await personFilesDestroyApi(selectedRowKeys.value).catch(
|
|
|
- () => {}
|
|
|
- );
|
|
|
+ const res = await deviceSendStatusUpdateApi({
|
|
|
+ idList: ids || selectedRowKeys.value,
|
|
|
+ status,
|
|
|
+ }).catch(() => {});
|
|
|
if (!res) return;
|
|
|
MessagePlugin.success('操作成功');
|
|
|
fetchData();
|
|
@@ -312,11 +420,9 @@ const multExport = () => {
|
|
|
cancelBtn: '取消',
|
|
|
onConfirm: async () => {
|
|
|
confirmDia.hide();
|
|
|
- const res = await personFilesExportApi(computedParams.value).catch(
|
|
|
- () => {}
|
|
|
- );
|
|
|
- if (!res) return;
|
|
|
- MessagePlugin.success('导出任务提交成功,请前往任务管理中下载');
|
|
|
+ deviceSendExportApi(computedParams.value).catch(() => {
|
|
|
+ MessagePlugin.error('导出失败');
|
|
|
+ });
|
|
|
},
|
|
|
});
|
|
|
};
|