|
@@ -4,8 +4,12 @@
|
|
<BasicTable @register="registerTable">
|
|
<BasicTable @register="registerTable">
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
<a-button type="primary" @click="put" v-if="getCheckPerm('device-in')"> 入库</a-button>
|
|
<a-button type="primary" @click="put" v-if="getCheckPerm('device-in')"> 入库</a-button>
|
|
- <a-button type="primary" @click="batchPut" v-if="getCheckPerm('device-all-in')"> 批量入库</a-button>
|
|
|
|
- <a-button type="primary" @click="batchOutflow" v-if="getCheckPerm('device-all-out')">批量出库</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="batchPut" v-if="getCheckPerm('device-all-in')">
|
|
|
|
+ 批量入库</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-button type="primary" @click="batchOutflow" v-if="getCheckPerm('device-all-out')"
|
|
|
|
+ >批量出库</a-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
<TableAction
|
|
<TableAction
|
|
@@ -67,7 +71,7 @@
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import priorityMoadl from '../productOperation/modal/priorityMoadl.vue';
|
|
import priorityMoadl from '../productOperation/modal/priorityMoadl.vue';
|
|
import { cameraList } from '/@/api/customer';
|
|
import { cameraList } from '/@/api/customer';
|
|
- import { cameraDelete } from '/@/api/device'
|
|
|
|
|
|
+ import { cameraDelete } from '/@/api/device';
|
|
import batchOutflowModal from './OutflowModal.vue';
|
|
import batchOutflowModal from './OutflowModal.vue';
|
|
import detailModal from './detailsMoadl.vue';
|
|
import detailModal from './detailsMoadl.vue';
|
|
import batchPutModal from './batchPutModal.vue';
|
|
import batchPutModal from './batchPutModal.vue';
|
|
@@ -77,7 +81,7 @@
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
import { UnbindCameraApi, cameraAllType } from '/@/api/account';
|
|
import { UnbindCameraApi, cameraAllType } from '/@/api/account';
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
-import { lte } from 'lodash';
|
|
|
|
|
|
+ import { lte } from 'lodash';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
components: {
|
|
components: {
|
|
BasicTable,
|
|
BasicTable,
|
|
@@ -107,10 +111,8 @@ import { lte } from 'lodash';
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
let companyId: Number = 0;
|
|
let companyId: Number = 0;
|
|
try {
|
|
try {
|
|
- companyId = Number(router.currentRoute.value.params.id) - 0;
|
|
|
|
- } catch (error) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ companyId = Number(router.currentRoute.value.params.id) - 0;
|
|
|
|
+ } catch (error) {}
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// console.log(router.currentRoute.value.params.id);
|
|
// console.log(router.currentRoute.value.params.id);
|
|
});
|
|
});
|
|
@@ -143,7 +145,16 @@ import { lte } from 'lodash';
|
|
// return typeObj[record.type]
|
|
// return typeObj[record.type]
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ {
|
|
|
|
+ title: '设备颜色',
|
|
|
|
+ dataIndex: 'colour',
|
|
|
|
+ width: 120,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '设备版本',
|
|
|
|
+ dataIndex: 'version',
|
|
|
|
+ width: 120,
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '激活时间',
|
|
title: '激活时间',
|
|
dataIndex: 'activatedTime',
|
|
dataIndex: 'activatedTime',
|
|
@@ -154,15 +165,15 @@ import { lte } from 'lodash';
|
|
dataIndex: 'outType',
|
|
dataIndex: 'outType',
|
|
width: 80,
|
|
width: 80,
|
|
customRender: ({ record }) => {
|
|
customRender: ({ record }) => {
|
|
- let typeObj ={
|
|
|
|
- '0':t('routes.product.outType.0'),
|
|
|
|
- '4':t('routes.product.outType.4'),
|
|
|
|
- '1':t('routes.product.outType.1'),
|
|
|
|
- '2':t('routes.product.outType.2'),
|
|
|
|
- '3':t('routes.product.outType.3'),
|
|
|
|
- }
|
|
|
|
- return typeObj[record.outType] || '未出库'
|
|
|
|
- }
|
|
|
|
|
|
+ let typeObj = {
|
|
|
|
+ '0': t('routes.product.outType.0'),
|
|
|
|
+ '4': t('routes.product.outType.4'),
|
|
|
|
+ '1': t('routes.product.outType.1'),
|
|
|
|
+ '2': t('routes.product.outType.2'),
|
|
|
|
+ '3': t('routes.product.outType.3'),
|
|
|
|
+ };
|
|
|
|
+ return typeObj[record.outType] || '未出库';
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '经销商名称',
|
|
title: '经销商名称',
|
|
@@ -190,7 +201,7 @@ import { lte } from 'lodash';
|
|
dataIndex: 'userName',
|
|
dataIndex: 'userName',
|
|
width: 180,
|
|
width: 180,
|
|
customRender({ record }) {
|
|
customRender({ record }) {
|
|
- return record.userName?record.userName:'未绑定'
|
|
|
|
|
|
+ return record.userName ? record.userName : '未绑定';
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
|
|
@@ -207,7 +218,7 @@ import { lte } from 'lodash';
|
|
const searchForm: Partial<FormProps> = {
|
|
const searchForm: Partial<FormProps> = {
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
// showAdvancedButton: true,
|
|
// showAdvancedButton: true,
|
|
- autoAdvancedLine:1,
|
|
|
|
|
|
+ autoAdvancedLine: 1,
|
|
actionColOptions: {
|
|
actionColOptions: {
|
|
span: 24,
|
|
span: 24,
|
|
},
|
|
},
|
|
@@ -221,7 +232,8 @@ import { lte } from 'lodash';
|
|
xl: 6,
|
|
xl: 6,
|
|
xxl: 6,
|
|
xxl: 6,
|
|
},
|
|
},
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
field: 'type',
|
|
field: 'type',
|
|
component: 'ApiSelect',
|
|
component: 'ApiSelect',
|
|
label: '设备类型',
|
|
label: '设备类型',
|
|
@@ -235,29 +247,6 @@ import { lte } from 'lodash';
|
|
labelField: 'name',
|
|
labelField: 'name',
|
|
valueField: 'cameraType',
|
|
valueField: 'cameraType',
|
|
immediate: true,
|
|
immediate: true,
|
|
- // options: [
|
|
|
|
- // {
|
|
|
|
- // label: t('routes.product.type.0'),
|
|
|
|
- // value: 0,
|
|
|
|
- // key: '0',
|
|
|
|
- // },{
|
|
|
|
- // label: t('routes.product.type.1'),
|
|
|
|
- // value: 1,
|
|
|
|
- // key: '1',
|
|
|
|
- // },{
|
|
|
|
- // label: t('routes.product.type.2'),
|
|
|
|
- // value: 9,
|
|
|
|
- // key: '9',
|
|
|
|
- // },{
|
|
|
|
- // label: t('routes.product.type.3'),
|
|
|
|
- // value: 10,
|
|
|
|
- // key: '10',
|
|
|
|
- // },{
|
|
|
|
- // label: t('routes.product.type.11'),
|
|
|
|
- // value: 11,
|
|
|
|
- // key: '11',
|
|
|
|
- // },
|
|
|
|
- // ],
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -266,7 +255,7 @@ import { lte } from 'lodash';
|
|
component: 'RangePicker',
|
|
component: 'RangePicker',
|
|
componentProps: {
|
|
componentProps: {
|
|
format: 'YYYY-MM-DD',
|
|
format: 'YYYY-MM-DD',
|
|
- valueFormat:'YYYY-MM-DD',
|
|
|
|
|
|
+ valueFormat: 'YYYY-MM-DD',
|
|
},
|
|
},
|
|
colProps: {
|
|
colProps: {
|
|
xl: 7,
|
|
xl: 7,
|
|
@@ -287,15 +276,18 @@ import { lte } from 'lodash';
|
|
label: t('routes.product.outType.0'),
|
|
label: t('routes.product.outType.0'),
|
|
value: 0,
|
|
value: 0,
|
|
key: '0',
|
|
key: '0',
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: t('routes.product.outType.1'),
|
|
label: t('routes.product.outType.1'),
|
|
value: 1,
|
|
value: 1,
|
|
key: '1',
|
|
key: '1',
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: t('routes.product.outType.2'),
|
|
label: t('routes.product.outType.2'),
|
|
value: 2,
|
|
value: 2,
|
|
key: '2',
|
|
key: '2',
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: t('routes.product.outType.3'),
|
|
label: t('routes.product.outType.3'),
|
|
value: 3,
|
|
value: 3,
|
|
key: '3',
|
|
key: '3',
|
|
@@ -345,11 +337,12 @@ import { lte } from 'lodash';
|
|
label: '未绑定',
|
|
label: '未绑定',
|
|
value: 0,
|
|
value: 0,
|
|
key: '0',
|
|
key: '0',
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: '已绑定',
|
|
label: '已绑定',
|
|
value: 1,
|
|
value: 1,
|
|
key: '1',
|
|
key: '1',
|
|
- }
|
|
|
|
|
|
+ },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -362,6 +355,63 @@ import { lte } from 'lodash';
|
|
xxl: 6,
|
|
xxl: 6,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ field: 'colour',
|
|
|
|
+ component: 'Select',
|
|
|
|
+ label: '设备颜色',
|
|
|
|
+ required: true,
|
|
|
|
+ defaultValue: '黑色',
|
|
|
|
+ colProps: {
|
|
|
|
+ span: 7,
|
|
|
|
+ },
|
|
|
|
+ componentProps: {
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: '黑色',
|
|
|
|
+ value: '黑色',
|
|
|
|
+ key: '1',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '红色',
|
|
|
|
+ value: '红色',
|
|
|
|
+ key: '2',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '蓝色',
|
|
|
|
+ value: '蓝色',
|
|
|
|
+ key: '3',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '金色',
|
|
|
|
+ value: '金色',
|
|
|
|
+ key: '4',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ field: 'version',
|
|
|
|
+ component: 'Select',
|
|
|
|
+ required: true,
|
|
|
|
+ label: '设备版本',
|
|
|
|
+ colProps: {
|
|
|
|
+ span: 6,
|
|
|
|
+ },
|
|
|
|
+ componentProps: {
|
|
|
|
+ options: [
|
|
|
|
+ {
|
|
|
|
+ label: '标准版',
|
|
|
|
+ value: '标准版',
|
|
|
|
+ key: '1',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: 'RTK版',
|
|
|
|
+ value: 'RTK版',
|
|
|
|
+ key: '2',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ },
|
|
],
|
|
],
|
|
};
|
|
};
|
|
const [registerTable, { reload }] = useTable({
|
|
const [registerTable, { reload }] = useTable({
|
|
@@ -374,14 +424,14 @@ import { lte } from 'lodash';
|
|
useSearchForm: true,
|
|
useSearchForm: true,
|
|
formConfig: searchForm,
|
|
formConfig: searchForm,
|
|
showTableSetting: true,
|
|
showTableSetting: true,
|
|
- showIndexColumn:false,
|
|
|
|
|
|
+ showIndexColumn: false,
|
|
rowKey: 'id',
|
|
rowKey: 'id',
|
|
- beforeFetch:(T)=>{
|
|
|
|
- if(T.ctivated){
|
|
|
|
- T.activatedStartTime = T.ctivated[0]
|
|
|
|
- T.activatedEndTime = T.ctivated[1]
|
|
|
|
|
|
+ beforeFetch: (T) => {
|
|
|
|
+ if (T.ctivated) {
|
|
|
|
+ T.activatedStartTime = T.ctivated[0];
|
|
|
|
+ T.activatedEndTime = T.ctivated[1];
|
|
}
|
|
}
|
|
- return T
|
|
|
|
|
|
+ return T;
|
|
},
|
|
},
|
|
fetchSetting: {
|
|
fetchSetting: {
|
|
pageField: 'pageNum',
|
|
pageField: 'pageNum',
|
|
@@ -397,26 +447,26 @@ import { lte } from 'lodash';
|
|
title: () => h('span', '温馨提示'),
|
|
title: () => h('span', '温馨提示'),
|
|
content: '解绑后用户将看不到该相机拍摄的场景。<br/>确定解绑吗?',
|
|
content: '解绑后用户将看不到该相机拍摄的场景。<br/>确定解绑吗?',
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await UnbindCameraApi({cameraId:record.id})
|
|
|
|
|
|
+ await UnbindCameraApi({ cameraId: record.id });
|
|
createMessage.success(t('common.optSuccess'));
|
|
createMessage.success(t('common.optSuccess'));
|
|
- reload()
|
|
|
|
|
|
+ reload();
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- async function handleDelete(record: Recordable){
|
|
|
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
createConfirm({
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
iconType: 'warning',
|
|
title: () => h('span', '温馨提示'),
|
|
title: () => h('span', '温馨提示'),
|
|
content: '删除设备后需要重新入库<br/>确定删除吗?',
|
|
content: '删除设备后需要重新入库<br/>确定删除吗?',
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await cameraDelete({id:record.id})
|
|
|
|
|
|
+ await cameraDelete({ id: record.id });
|
|
createMessage.success(t('common.optSuccess'));
|
|
createMessage.success(t('common.optSuccess'));
|
|
- reload()
|
|
|
|
|
|
+ reload();
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
function handlePriority(record) {
|
|
function handlePriority(record) {
|
|
- openPriorityModal(true, {cameraId:record.id});
|
|
|
|
|
|
+ openPriorityModal(true, { cameraId: record.id });
|
|
}
|
|
}
|
|
function deviceLink() {
|
|
function deviceLink() {
|
|
openLinkModal(true);
|
|
openLinkModal(true);
|
|
@@ -434,15 +484,15 @@ import { lte } from 'lodash';
|
|
});
|
|
});
|
|
}
|
|
}
|
|
function put() {
|
|
function put() {
|
|
- openModalEnter(true)
|
|
|
|
|
|
+ openModalEnter(true);
|
|
}
|
|
}
|
|
function batchPut() {
|
|
function batchPut() {
|
|
console.log('批量入库');
|
|
console.log('批量入库');
|
|
- openModalPut(true, {})
|
|
|
|
|
|
+ openModalPut(true, {});
|
|
}
|
|
}
|
|
function batchOutflow() {
|
|
function batchOutflow() {
|
|
console.log('批量出库');
|
|
console.log('批量出库');
|
|
- openLinkModal(true, {})
|
|
|
|
|
|
+ openLinkModal(true, {});
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
registerTable,
|
|
registerTable,
|