分享
This commit is contained in:
@ -13,12 +13,16 @@ NProgress.configure({ showSpinner: false });
|
|||||||
const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*'];
|
const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*'];
|
||||||
|
|
||||||
const isWhiteList = (path: string) => {
|
const isWhiteList = (path: string) => {
|
||||||
return whiteList.some(pattern => isPathMatch(pattern, path))
|
return whiteList.some((pattern) => isPathMatch(pattern, path));
|
||||||
}
|
};
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
if (getToken()) {
|
console.log(to);
|
||||||
|
console.log(getToken());
|
||||||
|
if (to.path == '/indexEquipment') {
|
||||||
|
next();
|
||||||
|
} else if (getToken()) {
|
||||||
to.meta.title && useSettingsStore().setTitle(to.meta.title);
|
to.meta.title && useSettingsStore().setTitle(to.meta.title);
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
|
@ -99,6 +99,11 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
component: () => import('@/views/gisHome/index.vue'),
|
component: () => import('@/views/gisHome/index.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/indexEquipment',
|
||||||
|
component: () => import('@/views/materials/orderEquipment/indexEquipment.vue'),
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/drone',
|
path: '/drone',
|
||||||
component: () => import('@/views/drone/index.vue'),
|
component: () => import('@/views/drone/index.vue'),
|
||||||
|
@ -36,7 +36,9 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="Check" @click="submitForm" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">保存</el-button>
|
<el-button type="success" plain icon="Check" @click="submitForm" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">保存</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Share" @click="onShare" v-hasPermi="['cailiaoshebei:cailiaoshebei:delete']">分享</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -330,7 +332,16 @@ const handleAdd = () => {
|
|||||||
// dialog.visible = true;
|
// dialog.visible = true;
|
||||||
// dialog.title = '修改物资-材料设备';
|
// dialog.title = '修改物资-材料设备';
|
||||||
// };
|
// };
|
||||||
|
const onShare = () => {
|
||||||
|
const TokenKey = 'Admin-Token';
|
||||||
|
const tokenStorage = useStorage<null | string>(TokenKey, null);
|
||||||
|
const getToken = () => tokenStorage.value;
|
||||||
|
console.log(getToken());
|
||||||
|
|
||||||
|
// 跳转新的地址 传token
|
||||||
|
let url = `http://192.168.110.151:7788/indexEquipment?projectId=${encodeURIComponent(currentProject.value.id)}&token=${encodeURIComponent(getToken())}&batchNumber=${encodeURIComponent(form.value.batchNumber)}`;
|
||||||
|
window.open(url, '_blank');
|
||||||
|
};
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
|
217
src/views/materials/orderEquipment/indexEquipment.vue
Normal file
217
src/views/materials/orderEquipment/indexEquipment.vue
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Check" @click="submitForm">保存</el-button>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="单据号">
|
||||||
|
<el-input v-model="form.batchNumbers" placeholder="请输入单据号" @input="getList" prefix-icon="Search" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="采购人">
|
||||||
|
<el-input v-model="form.purchasingAgent" placeholder="请输入采购人" @input="getList" prefix-icon="Search" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="采购时间">
|
||||||
|
<el-date-picker v-model="form.purchasingPeriod" type="date" value-format="YYYY-MM-DD" placeholder="选择采购时间" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="供应商">
|
||||||
|
<el-input v-model="form.supplier" placeholder="请输入供应商" @input="getList" prefix-icon="Search" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="合同号">
|
||||||
|
<el-input v-model="form.contractNumber" placeholder="请输入合同号" @input="getList" prefix-icon="Search" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.dhRemark" placeholder="请输入备注" @input="getList" prefix-icon="Search" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="cailiaoshebeiList">
|
||||||
|
<el-table-column label="设备材料名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="规格型号" align="center" prop="specification" />
|
||||||
|
<el-table-column label="物料编码" align="center" prop="materialCode" width="200" />
|
||||||
|
<el-table-column label="需求数量" align="center" prop="demandQuantity" width="80" />
|
||||||
|
<el-table-column label="验收数量" align="center" prop="acceptanceQuantity" />
|
||||||
|
<el-table-column label="订货量" align="center" prop="orderQuantity">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.orderQuantity" type="number" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="预计到货时间" align="center" prop="expectedArrival" width="250">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="flex justify-center w100%">
|
||||||
|
<el-date-picker v-model="scope.row.expectedArrival" type="date" value-format="YYYY-MM-DD" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="预计生产完成时间" align="center" prop="productionTime" width="250">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="flex justify-center w100%">
|
||||||
|
<el-date-picker v-model="scope.row.productionTime" type="date" value-format="YYYY-MM-DD" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="Cailiaoshebei" lang="ts">
|
||||||
|
import { CailiaoshebeiVO, CailiaoshebeiForm } from '@/api/materials/orderEquipment/types';
|
||||||
|
import axios from 'axios';
|
||||||
|
const cailiaoshebeiList = ref<CailiaoshebeiVO[]>([]);
|
||||||
|
const loading = ref(false);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const cailiaoshebeiFormRef = ref<ElFormInstance>();
|
||||||
|
var token = '';
|
||||||
|
const initFormData: CailiaoshebeiForm = {
|
||||||
|
id: undefined,
|
||||||
|
batchNumber: undefined,
|
||||||
|
supplierId: undefined,
|
||||||
|
addDataList: [],
|
||||||
|
supplier: undefined,
|
||||||
|
name: undefined,
|
||||||
|
supply: undefined,
|
||||||
|
specification: undefined,
|
||||||
|
signalment: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
arrivalTime: undefined,
|
||||||
|
finishTime: undefined,
|
||||||
|
unit: undefined,
|
||||||
|
plan: undefined,
|
||||||
|
realQuantity: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
const data = reactive<PageData<any, any>>({
|
||||||
|
form: { ...initFormData },
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
batchNumber: undefined,
|
||||||
|
supplierId: undefined,
|
||||||
|
supplier: undefined,
|
||||||
|
name: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
supply: undefined,
|
||||||
|
specification: undefined,
|
||||||
|
signalment: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
arrivalTime: undefined,
|
||||||
|
finishTime: undefined,
|
||||||
|
unit: undefined,
|
||||||
|
plan: undefined,
|
||||||
|
realQuantity: undefined,
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
/** 查询物资-材料设备列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
// 请求数据
|
||||||
|
axios
|
||||||
|
.get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/trackPcPlanList', {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
projectId: initFormData.projectId,
|
||||||
|
batchNumber: initFormData.batchNumber
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
form.value = response.data.rows[0];
|
||||||
|
console.log(form.value);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('请求失败:', error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 获取列表
|
||||||
|
const getListAll = () => {
|
||||||
|
loading.value = true;
|
||||||
|
axios
|
||||||
|
.get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/listGYS', {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
projectId: initFormData.projectId,
|
||||||
|
batchNumber: initFormData.batchNumber
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
console.log('请求成功:', response.data);
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('请求失败:', error);
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/** 提交按钮 */
|
||||||
|
const submitForm = async () => {
|
||||||
|
axios
|
||||||
|
.get('http://192.168.110.159:8898/cailiaoshebei/materialsorder/modifyTheOrderFormGYS', {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
id: '',
|
||||||
|
materialstatus: '',
|
||||||
|
overdueType: '',
|
||||||
|
cause: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
console.log('请求成功:', response.data);
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('请求失败:', error);
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
const queryString = window.location.search;
|
||||||
|
// 解析查询字符串
|
||||||
|
const urlParams = new URLSearchParams(queryString);
|
||||||
|
// 获取参数值
|
||||||
|
// const token = urlParams.get('token');
|
||||||
|
token = urlParams.get('token');
|
||||||
|
// localStorage.setItem('Admin-Token', 'Bearer ' + token);
|
||||||
|
initFormData.projectId = urlParams.get('projectId');
|
||||||
|
initFormData.batchNumber = urlParams.get('batchNumber');
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
Reference in New Issue
Block a user